jakobbouchard / hestia-nginx-cache

Hestia Nginx Cache Integration for WordPress.
https://wordpress.org/plugins/hestia-nginx-cache/
GNU General Public License v3.0
11 stars 4 forks source link

Frontend admin bar button not showing #14

Closed chriscapisce closed 1 year ago

chriscapisce commented 2 years ago

The frontend admin bar button is not showing in any of my installations. Would you be able to implement it? Thanks in advance.

jakobbouchard commented 1 year ago

Sorry I completely forgot about this issue since I started university 😅 is it still a problem? By default it is disabled, but you can enable it by going into Settings > Hestia Nginx Cache and checking the box labeled Show button in the admin bar. If that doesn't work, let me know!

chriscapisce commented 1 year ago

Unfortunately, that doesn't work for me on the front-end.. No clue why because all of my other Admin bar items appear as expected.

jakobbouchard commented 1 year ago

If you "inspect element" on the admin bar, I assume there's no element with the ID wp-admin-bar-hestia-nginx-cache-manual-purge? Also, would it be possible for you to verify in the database that the value is correctly being set? In the wp_options table, there should be a row with the option_name set to hestia-nginx-cache. It contains a serialized array, which you can unserialize here. The show_adminbar_button value should be set to 1.

chriscapisce commented 1 year ago

Indeed, there is no ID with wp-admin-bar-hestia-nginx-cache-manual-purge. Also, I checked the show_adminbar_button and it's set to 1, [show_adminbar_button] => 1. Any other thoughts on this? I'm using HestiaCP v1.6.10, Wordpress 6.0.3 with the latest version of your plugin, 2.1.4.

jakobbouchard commented 1 year ago

in theory, the only other reason it shouldn't show is if the plugin isn't configured, aka the access_key and secret_key values aren't set. I doubt it's a Hestia issue though honestly, it's more than likely that it's the plugin or something else in WordPress.

This part checks if the plugin is configured, while this one adds the action to show the button.

chriscapisce commented 1 year ago

Yes, it's strange since the plugin works perfectly fine. Incl. the Clear Cache button in the Admin bar on the backend. I'm positive that I filled out the access_key and secret_key correctly. I cleared out all caches and disabled all other plugins. Still no success..

jakobbouchard commented 1 year ago

Hmmm, I actually just noticed that I don't see it in the frontend either. I think I might need to specify that it should appear in the frontend too... I'll look into the WordPress developer reference!

chriscapisce commented 1 year ago

Thanks for the solution.