0

I've just created my first custom Wordpress plugin. Now I want to push a new version:

Recreation Steps:

  • Install v1.1.0
  • Activate v1.1.0
  • See that is doing stuff -> YEAH
  • Create new Zip with v1.1.2 and inside set "Version: 1.1.2"
  • Go to Wordpress -> Add New and pick that zip
  • Wordpress will install new plugin and not ask to overwrite...

Can someone explain to me what I'm doing wrong?

Kind Regards, Ben

2
  • 1
    which version of WordPress are you using? Uploading the zip again with a newer version only works on the newest versions of WordPress, assuming the zip file is structured correctly ( see Jacobs answer )
    – Tom J Nowell
    Mar 30, 2022 at 14:30
  • Version is 5.9.2. So should work, but Jacob answer was the solution :) Thanks for you help!
    – CasualBen
    Mar 31, 2022 at 12:22

1 Answer 1

5

A plugin is treated as the same as another plugin if it has the same directory name. That's it. If your zip file contains the plugin files then the zip filename will be used as the directory name. If your zip has a directory in it, containing the plugin files, then that will be used as the plugin directory.

So the solution is to structure your zips like this:

my-plugin-1.0.0.zip
    ∟ my-plugin/
        ∟ my-plugin.php

my-plugin-1.1.0.zip
    ∟ my-plugin/
        ∟ my-plugin.php

This way the directory will always be my-plugin/ and those two zips will be treated as the same plugin.

1
  • Interesting. My plugin.php was flat in the zip, so that's why! Thanks for helping out!
    – CasualBen
    Mar 31, 2022 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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