Automattic / vip-go-mu-plugins

The development repo for mu-plugins used on the WordPress VIP Platform.
https://docs.wpvip.com/
GNU General Public License v2.0
197 stars 101 forks source link

Backport PHP 8.2 changes for Object Cache Dropin #4747

Closed BrookeDot closed 9 months ago

BrookeDot commented 1 year ago

Desired Behavior

When PHP 8.2 is enabled our object-cache drop-in will present deprication errors. There is an upstream issue reported here: https://github.com/Automattic/wp-memcached/issues/146

With an Upstream PR to fix the problem here: https://github.com/Automattic/wp-memcached/pull/149/files

The desired behavior is to backport (or modify the proposed fix) to remove these notices so they do not appear in the application logs allowing customers to use PHP 8.2 successfully on WPVIP.

Actual Behavior

Deprecated notices are presented (note that the ones below are copied from the upstream ticket so line numbers may be off as we maintain a fork of the upstream plugin: https://github.com/Automattic/vip-go-mu-plugins/tree/develop/drop-ins/object-cache

Deprecated: Creation of dynamic property Memcache::$connection is deprecated in /var/www/html/wp-content/object-cache.php on line 1094

Deprecated: Creation of dynamic property Memcache::$_failureCallback is deprecated in /var/www/html/wp-content/object-cache.php on line 1094

Deprecated: Creation of dynamic property Memcache::$connection is deprecated in /var/www/html/wp-content/object-cache.php on line 1100

Deprecated: Creation of dynamic property Memcache::$_failureCallback is deprecated in /var/www/html/wp-content/object-cache.php on line 1100

Deprecated: Creation of dynamic property WP_Object_Cache::$global_prefix is deprecated in /var/www/html/wp-content/object-cache.php on line 1107

Deprecated: Creation of dynamic property WP_Object_Cache::$blog_prefix is deprecated in /var/www/html/wp-content/object-cache.php on line 1108

Deprecated: Creation of dynamic property WP_Object_Cache::$key_salt is deprecated in /var/www/html/wp-content/object-cache.php on line 1039

Deprecated: Creation of dynamic property WP_Object_Cache::$cache_hits is deprecated in /var/www/html/wp-content/object-cache.php on line 1117

Deprecated: Creation of dynamic property WP_Object_Cache::$cache_misses is deprecated in /var/www/html/wp-content/object-cache.php on line 1118

Deprecated: Creation of dynamic property WP_Object_Cache::$time_start is deprecated in /var/www/html/wp-content/object-cache.php on line 1184

Steps to Reproduce the Problem

  1. Enable PHP 8.2 in a non-production environment.
  2. View the logs
  3. See a bunch of depreciation notices

(Optional) Additional notes

Reported in 171581-zd-wordpressvip props to @jakewrfoster for the original report. Assigned to @WPprodigy as you have done some recent work on Object Cache, feel free to re-assign if needed.

WPprodigy commented 1 year ago

Hmm, we actually don't use these drop-ins anymore, and I don't believe the issue will exist in the new one we have.

It's only loaded in local dev envs if ! extension_loaded( 'memcached' ): https://github.com/Automattic/vip-go-mu-plugins/blob/develop/drop-ins/object-cache.php#L31, which will soon be removed anyway once we can ensure our supported dev-envs are all updated.

BrookeDot commented 1 year ago

It's only loaded in local dev envs

That makes sense, the report was when testing PHP 8.2 locally. Do you think it makes sense to fix the classes allowing the local environment to continue to function, or will we be dropping these soon?

WPprodigy commented 1 year ago

Hoping to drop the legacy dropin soon. Any local dev-env environment that gets the errors triggered should update their dev-env to have the latest images w/ PHP Memcached extension, as then the new drop-in can load.

jakewrfoster commented 1 year ago

Howdy @WPprodigy & @BrookeDot! I am checking in on this in case there was an update that I missed elsewhere 🙏

Given that it's been almost two months since this was reported, is there any reservation against merging https://github.com/Automattic/wp-memcached/pull/149, which would effectively resolve both this issue and https://github.com/Automattic/wp-memcached/issues/146?

My apologies if I am still working off of old information on my side! Thanks!

github-actions[bot] commented 1 year ago

This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed.

This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched.

WPprodigy commented 1 year ago

Hey @jakewrfoster, sorry I didn't reply earlier!

On any local development environments, make sure to have the memcached PHP extension so that the newer object cache plugin is loaded in, ensuring that your local environments mirror production better.

github-actions[bot] commented 10 months ago

This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed.

This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched.