From e23ea7bf9f003815ab1c750380550b0d97a37be4 Mon Sep 17 00:00:00 2001 From: Maciej Brencz Date: Wed, 6 Aug 2025 14:05:26 +0200 Subject: [PATCH 1/2] PHP 8.2 support: Add AllowDynamicProperties attribute Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0. Reference: [https://wiki.php.net/rfc/deprecate_dynamic_properties PHP RFC: Deprecate dynamic properties]. This resolves the following deprecation warnings: Deprecated: Creation of dynamic property hyperdb::$callback_result is deprecated Deprecated: Creation of dynamic property hyperdb::$current_host is deprecated Deprecated: Creation of dynamic property hyperdb::$dataset is deprecated Deprecated: Creation of dynamic property hyperdb::$dbhname is deprecated Deprecated: Creation of dynamic property hyperdb::$lag is deprecated Deprecated: Creation of dynamic property hyperdb::$lag_cache_key is deprecated Deprecated: Creation of dynamic property hyperdb::$lag_threshold is deprecated Deprecated: Creation of dynamic property hyperdb::$last_connection is deprecated Deprecated: Creation of dynamic property hyperdb::$last_errno is deprecated Deprecated: Creation of dynamic property hyperdb::$table is deprecated --- db.php | 1 + 1 file changed, 1 insertion(+) diff --git a/db.php b/db.php index 24e1d34..3a931c8 100644 --- a/db.php +++ b/db.php @@ -70,6 +70,7 @@ define( 'HYPERDB_SERVER_GONE_ERROR', 2006 ); // MySQL server has gone away // phpcs:ignore PEAR.NamingConventions.ValidClassName.StartWithCapital +#[AllowDynamicProperties] class hyperdb extends wpdb { /** * The last table that was queried From e27093bcdd23e9384a1e982b529bb370ff1f2e33 Mon Sep 17 00:00:00 2001 From: Maciej Brencz Date: Wed, 6 Aug 2025 14:10:49 +0200 Subject: [PATCH 2/2] Update db.php --- db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.php b/db.php index 3a931c8..6643331 100644 --- a/db.php +++ b/db.php @@ -69,8 +69,8 @@ define( 'HYPERDB_CONN_HOST_ERROR', 2003 ); // Can't connect to MySQL server on '%s' (%d) define( 'HYPERDB_SERVER_GONE_ERROR', 2006 ); // MySQL server has gone away -// phpcs:ignore PEAR.NamingConventions.ValidClassName.StartWithCapital #[AllowDynamicProperties] +// phpcs:ignore PEAR.NamingConventions.ValidClassName.StartWithCapital class hyperdb extends wpdb { /** * The last table that was queried