From 701015e6b188d00fa2398b7336fc3b9a3bbbb4b8 Mon Sep 17 00:00:00 2001 From: Enrico Battocchi Date: Sun, 5 Nov 2023 14:26:46 +0100 Subject: [PATCH 01/10] Set the WordPress tested up to version to 6.4 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index adb0498..cb5ad52 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: yoast, joostdevalk, omarreiss, jipmoors, herregroen Tags: Yoast, Yoast SEO, development Requires at least: 6.2 -Tested up to: 6.3 +Tested up to: 6.4 Stable tag: 1.18-RC5 Requires PHP: 7.2.5 License: GPLv2 or later From 7ccf9de1639619f894d7def416156e54cc5ca2e8 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 22 Sep 2023 13:41:59 +0200 Subject: [PATCH 02/10] Admin_Notifications::add_notification(): bug fix The `Admin_Notifications::add_notification()` method only expects one parameter, so no need to ask WP for 2. --- src/admin-notifications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/admin-notifications.php b/src/admin-notifications.php index db6c02c..4aaff16 100644 --- a/src/admin-notifications.php +++ b/src/admin-notifications.php @@ -20,7 +20,7 @@ class Admin_Notifications implements Integration { * @return void */ public function add_hooks() { - \add_action( 'Yoast\WP\Test_Helper\notification', [ $this, 'add_notification' ], 10, 2 ); + \add_action( 'Yoast\WP\Test_Helper\notification', [ $this, 'add_notification' ] ); \add_action( 'Yoast\WP\Test_Helper\notifications', [ $this, 'display_notifications' ] ); } From b4bea4c9a919acfa3d661a656360c391b8c897b1 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 22 Sep 2023 13:42:53 +0200 Subject: [PATCH 03/10] Downgrader::downgrade(): bug fix The `$adapter` property does not exist. The `$adapter` local variable does. --- src/downgrader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/downgrader.php b/src/downgrader.php index e65d9ea..cc849f8 100644 --- a/src/downgrader.php +++ b/src/downgrader.php @@ -151,7 +151,7 @@ protected function downgrade( $target_version ) { $adapter->remove_version( $version ); $adapter->commit_transaction(); } catch ( Exception $e ) { - $this->adapter->rollback_transaction(); + $adapter->rollback_transaction(); throw new Exception( \sprintf( From 6249daf47bc68ad4c95a9056443ed717f3b97ec0 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 22 Sep 2023 13:43:35 +0200 Subject: [PATCH 04/10] Feature_Toggler::add_hooks(): use the correct function The `wpseo_enable_feature` hook is a filter, not an action. --- src/feature-toggler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feature-toggler.php b/src/feature-toggler.php index 15fa9a4..3ad81d6 100644 --- a/src/feature-toggler.php +++ b/src/feature-toggler.php @@ -36,7 +36,7 @@ public function __construct( Option $option ) { * @return void */ public function add_hooks() { - \add_action( 'wpseo_enable_feature', [ $this, 'enable_features' ] ); + \add_filter( 'wpseo_enable_feature', [ $this, 'enable_features' ] ); \add_action( 'admin_post_yoast_seo_feature_toggler', From 75912ac6db5190cfdd9efe4f758e4ac2e8bb09d1 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 22 Sep 2023 13:44:42 +0200 Subject: [PATCH 05/10] Plugin_Toggler::verify_nonce(): consistent return type The return type is documented as `bool`, but the function contained a path which didn't return any value. Fixed now. --- src/plugin-toggler.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugin-toggler.php b/src/plugin-toggler.php index d5f268e..faa2377 100644 --- a/src/plugin-toggler.php +++ b/src/plugin-toggler.php @@ -431,6 +431,8 @@ private function verify_nonce() { if ( isset( $_GET['ajax_nonce'] ) && \wp_verify_nonce( $_GET['ajax_nonce'], 'yoast-plugin-toggle' ) ) { return true; } + + return false; } /** From 3b74fcd54e5de169ddc5cdd2583b566c147c3470 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 22 Sep 2023 13:49:59 +0200 Subject: [PATCH 06/10] Admin_Page::add_assets(): bug fix The third (`$deps`) parameter for `wp_enqueue_style()` expects an array of strings, not `null`. Ref: https://developer.wordpress.org/reference/functions/wp_enqueue_style/ --- src/admin-page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/admin-page.php b/src/admin-page.php index 12c486b..8087d53 100644 --- a/src/admin-page.php +++ b/src/admin-page.php @@ -44,7 +44,7 @@ public function add_assets() { \wp_enqueue_style( 'yoast-test-admin-style', \plugin_dir_url( \YOAST_TEST_HELPER_FILE ) . 'assets/css/admin.css', - null, + [], \YOAST_TEST_HELPER_VERSION ); \wp_enqueue_script( 'masonry' ); From 395d8bf1933fa142f5233ff231b63c51d2f5d914 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 22 Sep 2023 13:51:45 +0200 Subject: [PATCH 07/10] Plugin_Toggler::activate_plugin(): bug fix The second (`$redirect`) parameter for `activate_plugin()` expects a string, not `null`. Ref: https://developer.wordpress.org/reference/functions/activate_plugin/ --- src/plugin-toggler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin-toggler.php b/src/plugin-toggler.php index faa2377..08d199e 100644 --- a/src/plugin-toggler.php +++ b/src/plugin-toggler.php @@ -394,7 +394,7 @@ private function activate_plugin( $group, $plugin ) { } $plugin_path = $this->plugin_groups[ $group ][ $plugin ]; - \activate_plugin( \plugin_basename( $plugin_path ), null, false, true ); + \activate_plugin( \plugin_basename( $plugin_path ), '', false, true ); } /** From ac19de32de383f79490d073ffcd3c8c890a0cd4e Mon Sep 17 00:00:00 2001 From: Enrico Battocchi Date: Sat, 25 Nov 2023 18:34:35 +0100 Subject: [PATCH 08/10] Update changelog --- readme.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index cb5ad52..e16914c 100644 --- a/readme.txt +++ b/readme.txt @@ -46,11 +46,12 @@ Enhancements: Bugfixes: * Fixes a bug where the DB versions for Local SEO and News SEO would not be updated correctly. +* Fixes some small bugs that could result in PHP notices/warnings/errors. Other: * Removes the checkbox to enable the feature flag for the structured data blocks. -* Sets the WordPress tested up to version to 6.3. +* Sets the WordPress tested up to version to 6.4. * Sets minimum WordPress version to 6.2. * Drops compatibility with PHP 5.6, 7.0 and 7.1. From 2ebe2a44d95ecdd626e8face86b33817f1426dbd Mon Sep 17 00:00:00 2001 From: Enrico Battocchi Date: Sat, 25 Nov 2023 18:35:32 +0100 Subject: [PATCH 09/10] Bump RC number --- package.json | 2 +- readme.txt | 2 +- yoast-test-helper.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 6f0229e..a3a4d72 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,6 @@ }, "dependencies": {}, "yoast": { - "pluginVersion": "1.18-RC5" + "pluginVersion": "1.18-RC6" } } diff --git a/readme.txt b/readme.txt index e16914c..38c4b1b 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: yoast, joostdevalk, omarreiss, jipmoors, herregroen Tags: Yoast, Yoast SEO, development Requires at least: 6.2 Tested up to: 6.4 -Stable tag: 1.18-RC5 +Stable tag: 1.18-RC6 Requires PHP: 7.2.5 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html diff --git a/yoast-test-helper.php b/yoast-test-helper.php index 3966e6a..f23fb2e 100644 --- a/yoast-test-helper.php +++ b/yoast-test-helper.php @@ -8,7 +8,7 @@ * * @wordpress-plugin * Plugin Name: Yoast Test Helper - * Version: 1.18-RC5 + * Version: 1.18-RC6 * Plugin URI: https://github.com/yoast/yoast-test-helper * Description: Utility to provide testing features for Yoast plugins. * Author: Team Yoast @@ -35,7 +35,7 @@ define( 'YOAST_TEST_HELPER_FILE', __FILE__ ); define( 'YOAST_TEST_HELPER_DIR', dirname( YOAST_TEST_HELPER_FILE ) ); -define( 'YOAST_TEST_HELPER_VERSION', '1.18-RC5' ); +define( 'YOAST_TEST_HELPER_VERSION', '1.18-RC6' ); if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { require __DIR__ . '/vendor/autoload.php'; From dd57e4a0ac68cec07103fed60e4886583b310587 Mon Sep 17 00:00:00 2001 From: Enrico Battocchi Date: Sat, 25 Nov 2023 18:35:52 +0100 Subject: [PATCH 10/10] Update POT file --- languages/yoast-test-helper.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/languages/yoast-test-helper.pot b/languages/yoast-test-helper.pot index 3b6b555..81c8022 100644 --- a/languages/yoast-test-helper.pot +++ b/languages/yoast-test-helper.pot @@ -2,9 +2,9 @@ # This file is distributed under the GPL v3. msgid "" msgstr "" -"Project-Id-Version: Yoast Test Helper 1.18-RC5\n" +"Project-Id-Version: Yoast Test Helper 1.18-RC6\n" "Report-Msgid-Bugs-To: https://github.com/yoast/yoast-test-helper/issues\n" -"POT-Creation-Date: 2023-09-15 09:21:35+00:00\n" +"POT-Creation-Date: 2023-11-25 17:35:44+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n"