1

I'm working on a plugin that's in the WordPress plugin repository. I've made some changes to the plugin's code. The changes I made were to move code from a large admin.php file into an /admin directory. The code has no errors that I can see in the logs. It passes the php codesniffer using the WordPress standard. I have no other plugins installed on my testing site.

With the old version of the plugin active, when updating the plugin through the plugin repository, it seems that the new version of the plugin is not being activated, but initially it's menu item is showing up on the dashboard. If I click on the dashboard menu item I get the error 'Sorry, you are not allowed to access this page.'

When I navigate back to admin/plugins.php the plugin is deactivated. After reactivating the plugin it works as it's supposed to.

If I update to the new version, and instead of clicking on the menu item, navigate to another admin page, when I return to admin/plugins.php I get the error notice The plugin my-plugin-1.2.3/my-plugin.php has been deactivated due to an error: Plugin file does not exist. The new version of the plugin is deactivated and listed in the plugin list. If I then activate it, it works as expected, without errors.

If I deactivate the old version of the plugin, update to the new version, and then activate the new version, everything works as expected.

Does anyone have an idea what could be going on with this?

0

Problem solved. I was doing something dumb when I was testing the update process - uploading a zipped version of an earlier tagged release of the plugin, so that the tag '1.2.3' was being appended to the file name. When I remove the tag from the file name, everything works like it should.

Programming is hard sometimes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.