kunalnagar / custom-404-pro

🔗 A WordPress Plugin to override the default 404 page with any page from the Admin Panel.
https://wordpress.org/plugins/custom-404-pro/
GNU General Public License v2.0
8 stars 6 forks source link

PHP Depriciated #88

Open Lokmeup opened 2 months ago

Lokmeup commented 2 months ago

Keep getting these errors: [18-Sep-2024 04:56:29 UTC] PHP Deprecated: Creation of dynamic property AdminClass::$helpers is deprecated in /home4/etexeate/public_html/wp-content/plugins/custom-404-pro/admin/AdminClass.php on line 6 [18-Sep-2024 04:56:29 UTC] PHP Deprecated: Creation of dynamic property Helpers::$table_options is deprecated in /home4/etexeate/public_html/wp-content/plugins/custom-404-pro/admin/Helpers.php on line 17 [18-Sep-2024 04:56:29 UTC] PHP Deprecated: Creation of dynamic property Helpers::$table_logs is deprecated in /home4/etexeate/public_html/wp-content/plugins/custom-404-pro/admin/Helpers.php on line 18 [18-Sep-2024 04:56:29 UTC] PHP Deprecated: Creation of dynamic property Helpers::$options_defaults is deprecated in /home4/etexeate/public_html/wp-content/plugins/custom-404-pro/admin/Helpers.php on line 19

timoutright commented 1 month ago

I'm seeing the same errors after updating PHP from 7.4 to 8.2. (which certainly makes sense). Is the plugin not compatible with PHP 8?

kunalnagar commented 1 month ago

Thanks for reporting this folks - I'll look into it

kunalnagar commented 1 month ago

@timoutright @Lokmeup - Can I get some more info about your setup? I'm using the latest version of the plugin on PHP 8.2, WordPress 6.6.2 i.e. wordpress:6.6.2-php8.2-apache and I don't seem to see any deprecated logs 🤔

timoutright commented 1 week ago

Hey @kunalnagar . I'm running all the same versions you listed, but Nginx instead of Apache. According to PHP3.2 docs, those properties need to be explicitly declared within the class. I'm no PHP dev though so don't take my word for it! I'm most easily able to see it running my site locally when I run 'wp plugin list' (or really any wp-cli command).

Is something like this needed in Helpers.php?

`class Helpers {

private $table_options;

private $table_logs;

private $options_defaults;

[etc]

`

https://php.watch/versions/8.2/dynamic-properties-deprecated