-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated #526
Comments
This error suggests that there is a stored update that has a Try installing the Debug Bar plugin and take a look at the "PUC (your-plugin-slug)" panel. What does it show for "Cached update"? Also, what are you using to provide updates: a JSON file, a GitHub repository, or something else? |
Interesting, Debug Bar shows 2 other plugins running PUC (1 via This is a public GitHub repository and |
|
Just to be clear, did you look at the full Debug Bar screen or just its dropdown menu? Due to some technical issues with how that plugin works, if there are multiple plugins using PUC, only some of them will appear in the dropdown. However, if you click one of those menu items, you should get a full-page screen that has more tabs on the left side, one of which should match your plugin. That serialized update looks fine at a glance. The stored version number is not Could it be that the error is actually being triggered by one of the other plugins? If multiple plugins use the same version of PUC, only one copy of that version will actually be loaded, so you can have a situation where code in one plugin is calling code that's technically part of another plugin. |
Oh geez, sorry. When I view the full page, I see it in the left sidebar, but the content is empty. All of the others work. I have a lot of plugins using PUC, and after clicking on them all in Debug Bar sidebar, all of the ones using v5 are empty. The ones using v4 show correctly. |
That sounds like an unusual problem. Maybe there are more PHP errors somewhere? Or one of the other plugins tries to hide its own panel and ends up hiding all of them? In any case, I tried installing your plugin on a local site (from the |
Thanks so much for checking. Can you also install one of the plugins that's running v4? This one is super simple: https://github.com/maithemewp/mai-display-taxonomy/. When I have only those running I see the blank screen in Debug Bar. |
All right, I tried that one as well, including the 1.2.1 update that you added just now. I'm not seeing any errors. When I click on the "PUC (mai-display-taxonomy)" tab in the left sidebar (not in the dropdown menu), it has the expected content. The "PUC (mai-analytics)" tab is also not empty. I've included a screenshot of one of them below. |
Okay, thanks for checking. I'll have to keep digging. |
Forcing an update check, then updating translations in WP (cause I noticed they were available) somehow cleared the error. |
Hmm, I'm still not sure why that's happening. Another idea: since you looked at the |
All right, so that didn't work out. Perhaps you could modify the |
Thanks. I'll try both of these things the next time I hit the issue. I wonder if the DB didn't show anything null because the error is gone now. |
Some more info: I deactivated Whoops debugger, then ran all of these via CLI, and nothing helped.
FWIW, none of my plugins had updates, it was only a few random plugins were updated. Then I went to Dashboard > Updates and hit "Check again" which refreshes via |
In the screenshot, the version number for I've read through the relevant PUC code again, and I see a possibility that Could it be that your site is intermittently hitting GitHub API rate limits? That would explain how PUC has some update information but not all of it. |
We could definitely be hitting rate limits. We hit it all the time since we use the updater for all of our plugins/themes, including our premium stuff that is on thousands of sites. Sidenote: That's still been a source of frustration for our users because it shows an error that looks like something is broken, instead of just saying, "rate limit reached, please try again later" or something. Another note is that we don't always use tags/releases for all of our stuff. Should we be? It's an extra step for our internal plugins that we test/update often. From the screenshot above, only mai-accordion uses tags/releases, the other 2 do not. |
It's not required to use tags/releases. PUC is supposed to also support branches, so I would consider this a bug. I'll need to add a sanity check to the VCS support code and reject updates that don't have a version number. |
Okay, thanks. Let me know if I can help in any way. A bit off-track, but is there a way I'm missing to limit how often update checks happen? If we can limit to every hour or every few hours instead of every 5-10min (or whatever the default is) we can probably prolong the time before we hit rate limits. |
…mber. This can happen when PUC is configured to use a branch (as opposed to tags or releases) and it fails to retrieve the main plugin file from the repository, e.g. due to API rate limits. Then it can't get the "Version" header from the main plugin file. See #526
The default check period is 12 hours, but there are exceptions for specific admin pages. For example, it will check much more often if you're hitting the "Dashboard -> Updates" page. There are multiple ways to change how often PUC checks for updates.
|
Just a note that I hit this issue on 5.3 as well. I have to deactivate my debugger in order to hit "Check again" to clear the error. |
The |
Hmmm. I actually hit it while on 5.2, then updated to 5.3 and it was still there when I refreshed the page. I'll get more details if/when I hit it again. I have a bunch of plugins still on 5.2 but updating them as I get to them. |
Using PUC 5.0 in my plugin, LocalWP, and PHP 8.1.9, I get the following error:
on
which is inside the
getUpdate()
method.This doesn't happen on PHP 8.0.22.
I'm not sure what other info you need, or how to fix/test anything, but let me know how I can help :) Thanks.
The text was updated successfully, but these errors were encountered: