0

If a user has a version of my plugin installed and activated, let's say version 1.1 And I send the user version 1.2 and he tries to upload and activate the new version, what will happen is that they will get an error: "Failed to redeclare activate_function()"

I'm struggling to see how I can prevent this. If I use class_exists or function_exists to check, that's still not working, the newer version will run first, and then the older version will error out.

I just want to do it nice and smoothly without errors. Thoughts?

  • Have you seen that error in practice? I didn't think you could upload a new plugin with the same name as an existing plugin; I've wanted to do this to update a plugin in the past and I've had to deactivate and delete the old one before I can upload the new version. – Rup May 19 at 13:56
  • Both can be uploaded and the plugin basically shows up as duplicate with different versions. Deleting the old one is of course a solution. I was just hoping to make things smoother for users, especially those without much experience with WP – Stefan S May 19 at 14:06

Your Answer

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

Browse other questions tagged or ask your own question.