Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes admin bar rendering #589

Merged
merged 5 commits into from
Aug 22, 2018

Conversation

stodorovic
Copy link

  • Action dashmenu is pretty deprecated. Adds deprecation notice for function delete_cache_dashboard.
  • Fixes logic in function supercache_admin_bar_render. It isn't perfect but it's enough for first iteration.
  • Uses the method add_menu in $wp_admin_bar to render menu into admin dashboard.

Fixes: Automattic/wp-super-cache#489, Automattic/jetpack#25556, Automattic/jetpack#25594, Automattic/jetpack#25596

@stodorovic
Copy link
Author

I've found issues related to multisite and subdirectory installations. Function wpsc_admin_bar_render removes from path parameter (function get_supercache_dir already includes this path and it improves security) and this change fixes these issues.

I've removed $wp_cache_not_logged_in from this condition. I'm not sure why it was here, but I've tested and I don't see issues (cllick on button removes cache files for all users, but it's expected behavior).

I've removed deprecated action dashmenu and filter favorite_actions (also I've added deprecation notices for associated functions). I've moved code to new function wpsc_admin_bar_render (which replaces supercache_admin_bar_render). I'm not sure that works in WP 3.1 and 3.2 (admin dashboard only) because there are few changes. It should work (WP 3.1 and 3.2) on frontend pages. I've seen in WP 3.3 changelog:

Toolbar in the dashboard, combining the Admin Bar and admin header

I've tested this code on WP 3.3 and PHP 5.2.4 and buttons work (dashboard and frontend). I think that works correctly since WP 3.3 (I'll test on different WP versions).

@stodorovic
Copy link
Author

stodorovic commented Aug 21, 2018

I've tested it on few installations:

  • WP 3.1 (PHP 5.2.4) doesn't show admin bar (frontend and backend), but it seems everything else works as should (I don't see PHP errors/warnings). I think that's acceptable because it's pretty outdated version.
  • WP 3.2 (PHP 5.2.4) shows button in admin bar ( both backend, and frontend after enabling options in user profile - when viewing site and in dashboard )
  • WP 3.3 single site and multise works.
  • WP 4.6 works.
  • Latest WP - subdirectory installation works.
  • Latest WP with WPML - works. It removes only current language (frontend), but it's expected behavior.
  • Latest WP - multisite. It seems that works for all sites correctly.

@donnchawp
Copy link
Contributor

Thanks for tackling this and all the testing!

@donnchawp donnchawp merged commit 886b050 into Automattic:master Aug 22, 2018
@stodorovic stodorovic deleted the fixes-admin-bar-render branch August 22, 2018 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Top "delete cache" button is not working
2 participants