jazzsequence / book-review-library

A book cataloguing and review system designed with bookophiles and librarians in mind.
GNU General Public License v3.0
16 stars 7 forks source link

WP 5.0.4 Control buttons of BookReviewLibrary disappeared from WP panel #63

Closed Denisvt closed 5 years ago

Denisvt commented 5 years ago

WP theme: TwentyFourteen The Control buttons of BookReview disappeared from WP panel. The Plugin is still working but it's impossible to manage it. The only option left - to switch it on or off in the list of plugin installed. github-1 github-2

jazzsequence commented 5 years ago

Hey @Denisvt So it looks to me the thing that is causing this issue is menu overload-- you have so many menus in your dashboard that the Book Review Library menu is being pushed offscreen. I don't think this is because of a WordPress update -- I've updated my local test box to the latest WordPress and activated Twentyfourteen and the plugin menu appears normally.

Screenshot 2019-05-24 15 52 23

If possible, I would like you to test something for me. Currently, Book Review Library is set to menu_position 20, that is, just below Pages. (Documentation), which is where I want it. Interestingly, I don't see anything conflicting with that specific position in your screenshot. However, if you can, I'd like you to open up class-book-reviews.php in a text editor and search for menu_position in the file. You should find this line: https://github.com/jazzsequence/book-review-library/blob/master/class-book-reviews.php#L410

Once you've found it, try changing 20 to 24 -- that shouldn't change where it's positioned in relation to the Pages and Comments menus, but it will place it directly above Comments rather than directly below Pages. Then re-upload the file.

If that solves your problem, I can make a quick change in the code base to a more specific position.

The other possibility that could be happening is a conflict in the order in which various custom post types that you have via plugins are being loaded. Sometimes they crowd out other post types if they all have the same priority -- so if changing the position doesn't fix the issue, let me know and we can try that.

If you aren't comfortable or aren't able to change that file for whatever reason, let me know, and I can create a fork of the repository with just that change and give you a link to download that to test.

Denisvt commented 5 years ago

Dear Chris! I've made the modification you asked for, but nothing changed!

jazzsequence commented 5 years ago

Hey @Denisvt Okay, next thing to try: Open views/actions.php. Search for register_post_type_book_review. You should find this line: https://github.com/jazzsequence/book-review-library/blob/master/views/actions.php#L18

Change that line to: add_action( 'init', array( $this, 'register_post_type_book_review' ), 4 );

This will change the priority order of the book review post type registration from the default (which is 10). If that does not make the menu show up, try different values. Less than 4 might not work because it may be too early, but you could try increasing the number up to 20, testing each time. If after 20 you still don't see it, you can try lowering the priority until you get to 1.

If changing the value works, let me know which one worked for you. If changing the value doesn't work at all we may need to take a different approach.

Denisvt commented 5 years ago

I carefully tested each value in /wp-content/plugins/book-review-library/views/actions.php from 4 to 21 and from 20 back to 1. Unfortunately they don't work.

jazzsequence commented 5 years ago

Hmm...that's unfortunate. As I said, testing locally with the latest version of WordPress and TwentyFourteen theme, I get the menu listed in the admin. So it's not an issue with the plugin or with the WordPress update -- it's a result of a plugin conflict with one or more of the other plugins you have installed.

There are only really two options left that I can think of. The first one is to change the menu position to something else. The reason I didn't have you test anything other than 24 is because if I was going to make a change in the plugin, I wouldn't want to reposition the menu for the Book Review plugin -- it should be where it is because that's where it makes the most sense for most people. But if that position is a problem on your specific install, it might make sense for you to change it to something else. Again, I would refer you to the documentation on menu positioning to understand where in the menu it would go and warn that any change to the plugin would get overridden by a plugin update and would need to be re-applied.

The other option is to deactivate the last plugin(s) you installed/activated to see if you can find the one that is conflicting. Typically this is the first step in plugin troubleshooting particularly when it's shown that the problem doesn't actually exist in the plugin itself. However, I tend to assume that people install their plugins for a reason and would personally prefer making every effort to maintain compatibility with other plugins if possible. Unfortunately, based on the screenshot you provided, it looks to me like you have a lot of plugins and, while having a lot of plugins isn't inherently a problem, it can lead to odd problems like this where another plugin is obviously working (book reviews still exist on the site) but the menu doesn't show up because it's being pushed out by so many other menus. This issue can't have been happening forever (and, in fact, you said as much) and rather than it being triggered by a WordPress update, it may have been triggered by a plugin update, or a plugin install. If you haven't installed or activated plugins recently, I would just start deactivating plugins, starting with the ones that you could most live without if you needed to until the menu shows up again. If, for some strange reason, you deactivate everything and you're still not seeing the menu, it may be possible that you're using a modified theme or a child theme, or that there's some other code running on your site that is, for some reason, clashing with the plugin.

Denisvt commented 5 years ago

Dear Chris! Everything works now! Thank you very much for your help. I turned off all of my plugins and should restarted the Book Review plugin - after that the problem disappeared. I greatly appreciate you for care and was glad to know, that you continue to support your great plugin.

jazzsequence commented 5 years ago

Awesome! So glad to hear you got it working again. 😁