YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.27k stars 411 forks source link

New version not detected #577

Closed herbie4 closed 1 month ago

herbie4 commented 1 month ago

Hi Yahnis, I have a new version released (1.4.3) and using 1.4.2 shows that there are no updates. ?! The new release has correct higher version header. You can checkout the setup here around line 84: https://github.com/herbie4/mainwp-check-plugins-vulnerability-extension/blob/master/hhdev-mwpcpv.php Kind regards, hrbrt

YahnisElsts commented 1 month ago

I think this is probably what's happening: PUC treats the "master" branch as a special case, and it will look at releases first. The latest release has the tag 1.4.3, but the Version header in that release is 1.4.2, so it's not considered to be an update.

If you want PUC to ignore releases and tags and to actually use the branch instead, take a look at this comment: https://github.com/YahnisElsts/plugin-update-checker/issues/567#issuecomment-1991336970

herbie4 commented 1 month ago

Thank you. It might be easier just to change the branch name to 'main'.

YahnisElsts commented 1 month ago

Unfortunately, since main is the other default branch name, it's also treated as a special case with the same catch: PUC will check for releases first. To avoid that, you would have to use a custom branch or the strategy filter I linked above.

herbie4 commented 1 month ago

Okay so now I am puzzled. I have another plugin (private) repo with master branch and running the v5 version of updatechecker. Here the updates notification do work without the filter. How is that possible?

herbie4 commented 1 month ago

Unfortunately, since main is the other default branch name, it's also treated as a special case with the same catch: PUC will check for releases first. To avoid that, you would have to use a custom branch or the strategy filter I linked above.

So if I understand correct it will check first if there is a release? But I have made a release 1.4.3, so it should work already without the filter?!

YahnisElsts commented 1 month ago

As I mentioned above, the release has a mismatched version number. The release is tagged as 1.4.3, but the plugin file in the release actually has the header Version: 1.4.2. So the real version number is 1.4.2, which is the same as the installed version, and doesn't count as an update.

herbie4 commented 1 month ago

As I mentioned above, the release has a mismatched version number. The release is tagged as 1.4.3, but the plugin file in the release actually has the header Version: 1.4.2. So the real version number is 1.4.2, which is the same as the installed version, and doesn't count as an update.

Thanks! I can see it now, but how can that happen? Master version header is set to 1.4.3 so if I make a release it should be too, right?

herbie4 commented 1 month ago

Hello Yahnis, Okay, it seems fixed now. Still dont know why it occurs. Now I deleted the release 1.4.3 made new release 1.4.3 from master, still wrong version in header. Then I deleted the release again and removed the version tag 1.4.3, made new tag (1.4.3) and release and now it is correct and the update shows up again. So not a pluginupdater issue. Thank you for the pointers and advice. Kind regards, hrbrt