Skip to content

Commit 06f4127

Browse files
georgeolaruclaude
andcommitted
PHP 8.x compatibility and updated requirements
- Add null/type safety guards for get_option() and apply_filters() results - Guard preg_split() return before array_map() in to_kebab_case() - Update minimum PHP requirement from 5.6.40 to 7.4 - Update minimum WordPress requirement from 4.9.14 to 5.9.0 - Update tested up to WordPress 6.9 - Update internal minimalRequiredPhpVersion from 5.4 to 7.4 Fixes #253 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2bd4622 commit 06f4127

6 files changed

Lines changed: 19 additions & 10 deletions

File tree

customify.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* License: GPL-2.0+
1212
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
1313
* Domain Path: /languages/
14-
* Requires at least: 4.9.14
15-
* Tested up to: 5.9.5
16-
* Requires PHP: 5.6.40
14+
* Requires at least: 5.9.0
15+
* Tested up to: 6.9
16+
* Requires PHP: 7.4
1717
*/
1818

1919
// If this file is called directly, abort.

includes/class-customify-block-editor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,11 @@ public function editor_color_palettes_css_classes() {
517517
}
518518

519519
public static function to_kebab_case( $string ) {
520-
return implode( '-', array_map( '\strtolower', preg_split( "/[\n\r\t -_]+/", preg_replace( "/['\x{2019}]/u", '', $string ), - 1, PREG_SPLIT_NO_EMPTY ) ) );
520+
$parts = preg_split( "/[\n\r\t -_]+/", preg_replace( "/['\x{2019}]/u", '', $string ), - 1, PREG_SPLIT_NO_EMPTY );
521+
if ( ! is_array( $parts ) ) {
522+
return '';
523+
}
524+
return implode( '-', array_map( '\strtolower', $parts ) );
521525
}
522526

523527
/**

includes/class-customify-color-palettes.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ public function add_current_palette_control( $config ) {
509509

510510
$current_palette .= '<div class="sm-color-palette__colors">';
511511
$color_classes = apply_filters( 'customify_style_manager_color_palettes_colors_classes', array( 'sm-color-palette__color' ) );
512+
if ( ! is_array( $color_classes ) ) {
513+
$color_classes = array( 'sm-color-palette__color' );
514+
}
512515
foreach ( $master_color_controls_ids as $setting_id ) {
513516
$current_palette .=
514517
'<div class="' . esc_attr( join( ' ', $color_classes ) ) . ' ' . esc_attr( $setting_id ) . '" data-setting="' . esc_attr( $setting_id ) . '">' . "\n" .

includes/class-pixcustomify.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class PixCustomifyPlugin {
114114
* @access private
115115
* @since 1.5.0
116116
*/
117-
private $minimalRequiredPhpVersion = '5.4';
117+
private $minimalRequiredPhpVersion = '7.4';
118118

119119
protected function __construct( $file, $version = '1.0.0' ) {
120120
// The main plugin file (the one that loads all this).

includes/extras.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,10 @@ function customify_migrate_customizations_from_parent_to_child_theme() {
454454
'pixcare_new_theme_version',
455455
'pixcare_install_notice_dismissed',
456456
];
457-
foreach ( $excluded as $exclude ) {
458-
unset( $parent_theme_mods[ $exclude ] );
457+
if ( is_array( $parent_theme_mods ) ) {
458+
foreach ( $excluded as $exclude ) {
459+
unset( $parent_theme_mods[ $exclude ] );
460+
}
459461
}
460462
// Finally, write the new theme mods for the active child theme.
461463
if ( ! update_option( "theme_mods_" . get_option( 'stylesheet' ), $parent_theme_mods ) ) {

readme.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
=== Customify - Intuitive Website Styling ===
22
Contributors: pixelgrade, vlad.olaru, babbardel, razvanonofrei, gorby31
33
Tags: design, customizer, fonts, colors, gutenberg, font palettes, color palettes
4-
Requires at least: 4.9.14
5-
Tested up to: 5.9.5
4+
Requires at least: 5.9.0
5+
Tested up to: 6.9
66
Stable tag: 2.10.6
7-
Requires PHP: 5.6.40
7+
Requires PHP: 7.4
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

0 commit comments

Comments
 (0)