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.22k stars 403 forks source link

Updater no longer sees new version, Debug Bar does #429

Closed haulrich closed 3 years ago

haulrich commented 3 years ago

I've successfully used the implementation (v4p9) over almost a year now, but today suddenly it didn't mention new theme updates.

So I updated your plugin version to v4p11 and manually copied it to a staging site so any new functionality could do its work.

I'm at a loss, since I'm about to release something to my customer. I can update manually by editing the files, but for 3 similar sites in total, that's waiting for bad luck to happen.

Below a screenshot of one of the currently live sites that do spot the update, but do not seem to find it to differ... Sudden elementary school math problems? (Note: this one still has the v4p9, I know). image

YahnisElsts commented 3 years ago

It sounds like you might be expecting the update checker to treat version 2.8.4 as greater than 2.8.22. However, it actually treats each part of a version string as an integer, not as a decimal number or a plain sequence of digits. 4 is less than 22, so version 2.8.4 is lower than version 2.8.22, and it will not be shown as a update. Maybe you could change the version to 2.8.40?

For reference, the update checker uses the version_compare() function to compare version numbers.

haulrich commented 3 years ago

Hi Yahnis,

You are far out the quickest and most engaged developer in your responses; my compliments. I updated to version 2.8.5 first, for I would say 2+2 is 4, and 5 is more than 4. That's how you do it, right? That brought no luck. Once I updated to version 2.8.40 like you said, the update popped up instantly. Saved!

I still have to wrap my head around this, but I'm glad there is a logical solution. Thanks again.

haulrich commented 3 years ago

In case you wanted to get back on the versioning system. The semantic versioning article puzzled me a bit - but only a bit... in general I'm following it quite right. My awesome friend @schizoduck explained me the rest of your calculation and now I totally get it.

YahnisElsts commented 3 years ago

I wasn't sure what that "2+2 is 4" part was about (perhaps a joke that I missed?), but if you've figured out the versioning system, I think this issue can be closed.

haulrich commented 3 years ago

Hi Yahnis, I was serious. In an attempt to understand the possible ways of comparison (before reading the docs) I assumed the function would simply explode all pairs of digits, and add them up per pair. It would make no sense, of course. But considering all possibilities, even the stupid ones, sometimes brings you closer to the solution, than sticking to only the logical ones :)

I'll close it here!