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

PHP 8.2 Compatibility - Deprecation Notice #536

Closed ddur closed 1 year ago

ddur commented 1 year ago

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

mbsouth commented 1 year ago

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

ddur commented 1 year ago

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.

mbsouth commented 1 year ago

@YahnisElsts

Thanks!