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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP 8.2 Compatibility - Deprecation Notice

ddur opened this issue · comments

commented

Deprecated: Creation of dynamic property YahnisElsts\PluginUpdateChecker\v5p1\Plugin\PluginInfo::$request_time_elapsed is deprecated in plugin-update-checker-5.1/Puc/v5p1/Metadata.php on line 55

PHP 8.2.6

I found a quick and dirty hack for myself. I don't know if this is production-ready, so use at your own risk and please don't beat me up!

Insert into
...\lib\plugin-update-checker\Puc\v5p1\Metadata.php this line of code #[\AllowDynamicProperties] above class definition:

[...]
#[\AllowDynamicProperties]
abstract class Metadata {
[...]

Works for me on 8.2.4
ym2c

commented

Thanks, @mbsouth

I was testing something else on PHP 8.2.7 with WP_DEBUG on and got it.

When WP_DEBUG is off, warning is gone, but in next major php release (9?) Puc library/plugin may crash.

This is actually not issue to me, but warning that I guess, may help to the author to fix it on time, before becomes the real issue.