• Resolved wpbcd

    (@wpbcd)


    Hello,

    Issue:
    PHP Deprecated: Creation of dynamic property WP_Object_Cache::$cache_enabled is deprecated in /var/www/html/wp-activate.php on line 68

    Environment:
    WordPress Version: 6.8.2
    Plugin Version: 2.6.3
    PHP Version: 8.2
    Multisite: Enabled

    Description:
    The plugin is creating dynamic properties on the WP_Object_Cache class, which triggers deprecation warnings in PHP 8.2+. This occurs during multisite activation processes.

    Thank you for your attention to this matter and for maintaining this great plugin!

    Best regards,
    Dzmitry

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    This would be a bug in WP core actually. Can you open a trac ticket and link it here?

    Thread Starter wpbcd

    (@wpbcd)

    Thank you for your response.

    As the analysis showed:

    1. With the plugin disabled, wp-activate.php works with an instance of the original WP_Object_Cache class from wp-includes/cache.php, which has the #[AllowDynamicProperties] attribute. Therefore, PHP does not generate a Deprecated warning.
    2. With the plugin enabled, wp-activate.php works with an instance of the WP_Object_Cache class from the redis-cache/includes/object-cache.php file.

    My proposed solution (I think this will be better than filing a trac ticket, as it will likely be rejected): Add the #[AllowDynamicProperties] attribute to the WP_Object_Cache class in the redis-cache/includes/object-cache.php file:

    #[AllowDynamicProperties]
    class WP_Object_Cache {
    ...
    }
    Plugin Author Till Krüss

    (@tillkruess)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Deprecated Dynamic Property WP_Object_Cache::$cache_enabled’ is closed to new replies.