Codestar / codestar-framework

A Simple and Lightweight WordPress Option Framework for Themes and Plugins
http://codestarframework.com/
GNU General Public License v2.0
284 stars 98 forks source link

PHP 8.2 Support #171

Open arafatjamil01 opened 1 year ago

arafatjamil01 commented 1 year ago

I tried to use PHP 8.2, and many deprecation notices were shown. It'd be great if it updated.

optimocha commented 11 months ago

Yeah, it would be nice to have compatibility with PHP 8.2. One of our users got the following "deprecated" notices:

[15-Nov-2023 12:46:58 UTC] PHP Deprecated: Creation of dynamic property CSF_Field_code_editor::$field is deprecated in /kunden/XXXXXX_XXXX/wp/wp-content/plugins/speed-booster-pack/vendor/codestar-framework/classes/fields.class.php on line 14
[15-Nov-2023 12:46:58 UTC] PHP Deprecated: Creation of dynamic property CSF_Field_code_editor::$value is deprecated in /kunden/XXXXXX_XXXX/wp/wp-content/plugins/speed-booster-pack/vendor/codestar-framework/classes/fields.class.php on line 15
[15-Nov-2023 12:46:58 UTC] PHP Deprecated: Creation of dynamic property CSF_Field_code_editor::$unique is deprecated in /kunden/XXXXXX_XXXX/wp/wp-content/plugins/speed-booster-pack/vendor/codestar-framework/classes/fields.class.php on line 16
[15-Nov-2023 12:46:58 UTC] PHP Deprecated: Creation of dynamic property CSF_Field_code_editor::$where is deprecated in /kunden/XXXXXX_XXXX/wp/wp-content/plugins/speed-booster-pack/vendor/codestar-framework/classes/fields.class.php on line 17
[15-Nov-2023 12:46:58 UTC] PHP Deprecated: Creation of dynamic property CSF_Field_code_editor::$parent is deprecated in /kunden/XXXXXX_XXXX/wp/wp-content/plugins/speed-booster-pack/vendor/codestar-framework/classes/fields.class.php on line 18

https://wordpress.org/support/topic/debug-fehler/#post-17203731

Niloys7 commented 11 months ago

Hi @Codestar, can you please provide an update on the issue? We're currently encountering the same error that @optimocha mentioned, and it's affecting all of our plugins :(

arafatjamil01 commented 10 months ago

It's 8.3 now

STV11C commented 10 months ago

I'm experiencing the same issue. Looking forward to a fix. Does anyone have a temp fix that could work?

Niloys7 commented 10 months ago

@STV11C I added these properties to CSF_Abstract to resolve the error when wp_debug is enabled. Tested on PHP 8.2.8.

CleanShot 2023-12-14 at 23 39 51

public $field = array(); public $unique = ''; public $value = ''; public $parent = ''; public $where = '';

STV11C commented 10 months ago

@Niloys7 - THANK YOU SO MUCH!

I received two more as follows:

Deprecated: Creation of dynamic property CSF_Metabox::$post_formats is deprecated in .../codestar-framework/classes/metabox-options.class.php on line 46
Deprecated: Creation of dynamic property CSF_Metabox::$page_templates is deprecated in .../codestar-framework/classes/metabox-options.class.php on line 47

I followed the same approach by adding the following two lines in metabox-options.class.php file:

public $post_formats   = '';
public $page_templates = '';

Hopefully these additions do not break anything :)

cs-fix
Codestar commented 9 months ago

Hi Guys,

It's fixed. You can re-download and use it.

Regards.

arafatjamil01 commented 9 months ago

Thank you. ❤️