-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DGR-964: Bump Tested up to version to 6.6 #73
DGR-964: Bump Tested up to version to 6.6 #73
Conversation
- php: '7.0' | ||
composer: 1 | ||
wordpress: '5.9' | ||
wordpress: '6.2' | ||
- php: '7.1' | ||
composer: 1 | ||
wordpress: '5.9' | ||
- php: '7.2' | ||
composer: 2 | ||
wordpress: '5.9' | ||
- php: '7.3' | ||
composer: 2 | ||
wordpress: '5.9' | ||
wordpress: '6.5' | ||
- php: '7.4' | ||
composer: 2 | ||
wordpress: '5.9' | ||
wordpress: '6.6' | ||
- php: '8.2' | ||
composer: 2 | ||
wordpress: '6.6' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating the CI setup to test the current major WP version 6
with possible PHP versions.
c.f.
c046f8b
to
97b2e94
Compare
d40057e
to
b079544
Compare
b079544
to
590fd9c
Compare
… in function call phpcs errors
git clone -b main https://github.com/WordPress/WordPress-Coding-Standards.git vendor/wp-coding-standards/wpcs | ||
composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true | ||
composer global require wp-coding-standards/wpcs | ||
composer global require phpcompatibility/phpcompatibility-paragonie | ||
composer global require phpcompatibility/phpcompatibility-wp | ||
sudo vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs,vendor/phpcompatibility/php-compatibility,vendor/phpcompatibility/phpcompatibility-paragonie,vendor/phpcompatibility/phpcompatibility-wp | ||
composer global require phpcsstandards/phpcsutils | ||
composer global require phpcsstandards/phpcsextra | ||
sudo vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs,vendor/phpcompatibility/php-compatibility,vendor/phpcompatibility/phpcompatibility-paragonie,vendor/phpcompatibility/phpcompatibility-wp,vendor/phpcsstandards/phpcsutils,vendor/phpcsstandards/phpcsextra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix the PHPCS setup for CI.
git clone -b main https://github.com/WordPress/WordPress-Coding-Standards.git $wpcs_path | ||
phpcsutils_path="${PLUGIN_DIR}/vendor/phpcsstandards/phpcsutils" | ||
phpcompatibility_path="${PLUGIN_DIR}/vendor/phpcompatibility/phpcompatibility-wp" | ||
phpcs_extra_path="${PLUGIN_DIR}/vendor/phpcsstandards/phpcsextra" | ||
vendor/bin/phpcs --config-set installed_paths $wpcs_path, $phpcsutils_path, $phpcompatibility_path, $phpcs_extra_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix the PHPCS setup for development.
"phpcompatibility/phpcompatibility-wp": "*", | ||
"phpcsstandards/phpcsutils": "^1.0", | ||
"phpcsstandards/phpcsextra": "^1.2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix the PHPCS setup for development.
@@ -23,7 +23,7 @@ public static function add() { | |||
add_menu_page( | |||
'Accredible LearnDash Add-on', | |||
'Accredible LearnDash Add-on', | |||
'administrator', | |||
'manage_options', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -21,7 +21,7 @@ class Accredible_Learndash_Admin_Form_Helper { | |||
public static function value_attr( $obj, $key ) { | |||
$obj = (array) $obj; | |||
if ( ! empty( $obj ) && isset( $obj[ $key ] ) ) { | |||
echo sprintf( | |||
printf( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-correction by PHPCBF: bbcfe99
@@ -93,7 +93,7 @@ public function build_table_rows( $table_data ) { | |||
} | |||
$row_cells .= '</tr>'; | |||
|
|||
$index ++; | |||
++$index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-correction by PHPCBF: bbcfe99
@@ -157,10 +157,8 @@ public static function validate( $data, $id = null ) { | |||
if ( ! isset( $data[ $field ] ) || '' === trim( $data[ $field ] ) ) { | |||
throw new Exception( esc_attr( $field ) . ' is a required field.' ); | |||
} | |||
} else { | |||
if ( array_key_exists( $field, $data ) && ( null === $data[ $field ] || '' === trim( $data[ $field ] ) ) ) { | |||
} elseif ( array_key_exists( $field, $data ) && ( null === $data[ $field ] || '' === trim( $data[ $field ] ) ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-correction by PHPCBF: bbcfe99
* @param mixed $default_value default value. | ||
*/ | ||
public static function html( $value, $default = 'N/A' ) { | ||
public static function html( $value, $default_value = 'N/A' ) { | ||
if ( empty( $value ) ) { | ||
$value = $default; | ||
$value = $default_value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My php foo is definitely rusted but changes look reasonable also CI & manual testing gives confidence, off to you go sailer 🚢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love PHP 🫠
This PR updates the tested WP version up to 6.6. As commented, it also fixes the development and CI setup for PHPCS and corrects PHPCS violations.
I've also conducted manual testing from the UI to make sure everything works as expected.