Closed light-source closed 2 years ago
Does 'x\Puc_v4p11_Plugin_Update' imply that you added a custom namespace to the library? My guess would that this is what indirectly triggered the error. Unfortunately, the part of the code that decides which class to use to load a stored update is not namespace-aware. This means that it would not have been able to determine the base class (Pugin_update
) and would try to use the version-specific class Puc_v4p11_Plugin_Update
which no longer exists in 4.12.
I'll see if I can fix StateStore
to support namespaces for the next release.
Yes, I've added a namespace via Scoper. Please have a look, because your package is a critical part of any WP plugin (that uses it), it means there is no way even to add a temporary fix down the line if the updater's logic is broken.
This should be fixed by the last two commits, but I don't have much personal experience with PHP Scoper and I haven't tested this patch.
Do you perhaps have an opportunity to test this fix? If it works, I'll make a new release.
I've tested with the master branch, and it has no warning anymore. Thank you. Firstly I thought that the wrong data in site options leads to a case, when new versions are unavailable constantly, but then I read your comment to the fixing commit and got that it had had auto fixing with the first checking for updates, so the issue wasn't so big as I thought and was relating to the PHP warning only. But anyway I'm glad it's fixed.
I've made a new release that includes this fix.
Thank you kindly.
Hello. I've updated your package via composer from v4.11 to v4.12 and it have been giving me a warning,
call_user_func() expects parameter 1 to be a valid callback, class 'x\Puc_v4p11_Plugin_Update' not found
(in the StateStore.php, 'load' method). After a small research I got that for some reasons this class had been written in site options, so became invalid after the update. I fixed it manually with a calldelete_site_option($this->optionName)
once and it's gone. But I think it's an issue and should be fixed, so nobody gets it during next updates. Thank you in advance for looking into it.