From 01e0adb3fb943c527843108fc58538f584cb2e8b Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Sun, 30 Oct 2022 20:35:54 +0530 Subject: [PATCH 01/21] add PHPUnit tests --- phpunit.xml | 2 +- tests/phpunit/test-tools/Utils_Tests.php | 84 ++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index 2e1d5405..b52920e8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@ bootstrap="tests/bootstrap.php" backupGlobals="false" processIsolation="false" - colors="false"> + colors="true"> ./tests/phpunit diff --git a/tests/phpunit/test-tools/Utils_Tests.php b/tests/phpunit/test-tools/Utils_Tests.php index d55145bd..f1342b80 100644 --- a/tests/phpunit/test-tools/Utils_Tests.php +++ b/tests/phpunit/test-tools/Utils_Tests.php @@ -45,4 +45,88 @@ public function data_provider_embedded_images() { ), ); } + + public function test_get_primary_category__default_category__yoast_deactivated() { + $term_array = array( + (object) array( + 'term_id' => 10, + 'name' => 'Uncategorized', + ) + ); + + \WP_Mock::userFunction( 'wp_get_post_terms', array( + 'times' => 1, + 'args' => array( null, 'category' ), + 'return' => $term_array, + ) ); + + $term_name = get_primary_category(); + + $this->assertEquals( $term_name, 'Uncategorized' ); + } + + public function test_get_primary_category__multiple_categories__yoast_deactivated() { + $term_array = array( + (object) array( + 'term_id' => 10, + 'name' => 'Science', + ), + (object) array( + 'term_id' => 10, + 'name' => 'Uncategorized', + ) + ); + + \WP_Mock::userFunction( 'wp_get_post_terms', array( + 'times' => 1, + 'args' => array( null, 'category' ), + 'return' => $term_array, + ) ); + + $term_name = get_primary_category(); + + $this->assertEquals( $term_name, 'Science' ); + } + + public function test_get_primary_category__default_category__yoast_activated() { + \WP_Mock::userFunction( 'yoast_get_primary_term_id', array( + 'times' => 1, + 'args' => array( 'category', null ), + 'return' => 123, + ) ); + + \WP_Mock::userFunction( 'get_term', array( + 'times' => 1, + 'args' => array( 123 ), + 'return' => (object) array( + 'term_id' => 123, + 'name' => 'Uncategorized', + ), + ) ); + + $term_name = get_primary_category(); + + $this->assertEquals( $term_name, 'Uncategorized' ); + } + + public function test_get_primary_category__custom_category__yoast_activated() { + \WP_Mock::userFunction( 'yoast_get_primary_term_id', array( + 'times' => 1, + 'args' => array( 'category', null ), + 'return' => 123, + ) ); + + \WP_Mock::userFunction( 'get_term', array( + 'times' => 1, + 'args' => array( 123 ), + 'return' => (object) array( + 'term_id' => 123, + 'name' => 'Art', + ), + ) ); + + $term_name = get_primary_category(); + + $this->assertEquals( $term_name, 'Art' ); + } } From a89b50ba825bbed10b1becd53230ba7a03fa0b6d Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Sun, 30 Oct 2022 20:36:10 +0530 Subject: [PATCH 02/21] add util to fetch primary category --- includes/functions/content-sync.php | 2 +- includes/functions/utils.php | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/includes/functions/content-sync.php b/includes/functions/content-sync.php index 9920d103..999ab1af 100644 --- a/includes/functions/content-sync.php +++ b/includes/functions/content-sync.php @@ -276,7 +276,7 @@ function get_post_data( $post ) { 'plainText' => wp_strip_all_tags( $content ), 'size' => str_word_count( wp_strip_all_tags( $content ) ), 'allSections' => Utils\get_post_categories_paths( $post->ID ), - 'sectionNames' => Utils\get_post_categories( $post->ID ), + 'sectionNames' => Utils\get_primary_category( $post->ID ), 'modifiedAt' => gmdate( \DateTime::RFC3339, strtotime( $post->post_modified_gmt ) ), 'tags' => Utils\get_post_tags( $post ), 'url' => $permalink, diff --git a/includes/functions/utils.php b/includes/functions/utils.php index 375954ee..86b43851 100644 --- a/includes/functions/utils.php +++ b/includes/functions/utils.php @@ -545,3 +545,28 @@ function get_post_categories( $post_id ) { function get_wp_sophi_versions() { return 'wp-' . get_bloginfo( 'version' ) . ':plugin-' . SOPHI_WP_VERSION; } + +/** + * Get the primary term name. + * + * @param string $taxonomy Optional. The taxonomy to get the primary term ID for. Defaults to category. + * @param int $post_id Optional. Post to get the primary term ID for. + * + * @return string + */ +function get_primary_category( $post_id = 0, $taxonomy = 'category' ) { + if ( ! function_exists( 'yoast_get_primary_term_id' ) ) { + $post_terms = wp_get_post_terms( $post_id, $taxonomy ); + + if ( is_array( $post_terms ) && count( $post_terms ) > 0 ) { + return $post_terms[0]->name; + } else { + return ''; + } + } + + $primary_term_id = yoast_get_primary_term_id( $taxonomy, $post_id ); + $primary_category = get_term( $primary_term_id ); + + return $primary_category->name; +} From 20522d3ecea761c6baa854fa63b8d5aec02e4e07 Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Mon, 31 Oct 2022 11:28:50 +0530 Subject: [PATCH 03/21] replace string with array --- includes/functions/content-sync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/functions/content-sync.php b/includes/functions/content-sync.php index 999ab1af..9a3442c3 100644 --- a/includes/functions/content-sync.php +++ b/includes/functions/content-sync.php @@ -276,7 +276,7 @@ function get_post_data( $post ) { 'plainText' => wp_strip_all_tags( $content ), 'size' => str_word_count( wp_strip_all_tags( $content ) ), 'allSections' => Utils\get_post_categories_paths( $post->ID ), - 'sectionNames' => Utils\get_primary_category( $post->ID ), + 'sectionNames' => array( Utils\get_primary_category( $post->ID ) ), 'modifiedAt' => gmdate( \DateTime::RFC3339, strtotime( $post->post_modified_gmt ) ), 'tags' => Utils\get_post_tags( $post ), 'url' => $permalink, From d3032f635a74a862bb5543dabb5c1fd8f18736af Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Tue, 1 Nov 2022 01:30:29 +0530 Subject: [PATCH 04/21] fix test --- tests/phpunit/test-tools/Utils_Tests.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/tests/phpunit/test-tools/Utils_Tests.php b/tests/phpunit/test-tools/Utils_Tests.php index f1342b80..fc606f77 100644 --- a/tests/phpunit/test-tools/Utils_Tests.php +++ b/tests/phpunit/test-tools/Utils_Tests.php @@ -108,25 +108,4 @@ public function test_get_primary_category__default_category__yoast_activated() { $this->assertEquals( $term_name, 'Uncategorized' ); } - - public function test_get_primary_category__custom_category__yoast_activated() { - \WP_Mock::userFunction( 'yoast_get_primary_term_id', array( - 'times' => 1, - 'args' => array( 'category', null ), - 'return' => 123, - ) ); - - \WP_Mock::userFunction( 'get_term', array( - 'times' => 1, - 'args' => array( 123 ), - 'return' => (object) array( - 'term_id' => 123, - 'name' => 'Art', - ), - ) ); - - $term_name = get_primary_category(); - - $this->assertEquals( $term_name, 'Art' ); - } } From 67c339e99455f286e873b48ecfc450aaf508d922 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 3 Nov 2022 10:07:59 -0500 Subject: [PATCH 05/21] version bump (again) to 1.3.1-dev --- sophi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sophi.php b/sophi.php index 161173b2..d8a2d7b3 100644 --- a/sophi.php +++ b/sophi.php @@ -3,7 +3,7 @@ * Plugin Name: Sophi * Plugin URI: https://github.com/globeandmail/sophi-for-wordpress * Description: WordPress VIP-compatible plugin for the Sophi.io Site Automation service. - * Version: 1.3.0 + * Version: 1.3.1-dev * Requires at least: 6.0 * Requires PHP: 7.4 * Author: 10up From 4ca6ee44cfc6ddcc2ab74229b4a55e7621cf9f82 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 9 Nov 2022 09:24:30 -0600 Subject: [PATCH 06/21] version bump to 1.3.1 --- package-lock.json | 4 ++-- package.json | 2 +- sophi.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3e25aca7..4be0bfbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@globeandmail/sophi-for-wordpress", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@globeandmail/sophi-for-wordpress", - "version": "1.2.1", + "version": "1.3.1", "license": "GPL-2.0-or-later", "dependencies": { "@10up/block-components": "^1.13.0", diff --git a/package.json b/package.json index 0e887de5..d818b966 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@globeandmail/sophi-for-wordpress", - "version": "1.3.0", + "version": "1.3.1", "description": "WordPress VIP-compatible plugin for the Sophi.io Site Automation service.", "homepage": "https://github.com/globeandmail/sophi-for-wordpress", "bugs": { diff --git a/sophi.php b/sophi.php index 161173b2..2b898f81 100644 --- a/sophi.php +++ b/sophi.php @@ -3,7 +3,7 @@ * Plugin Name: Sophi * Plugin URI: https://github.com/globeandmail/sophi-for-wordpress * Description: WordPress VIP-compatible plugin for the Sophi.io Site Automation service. - * Version: 1.3.0 + * Version: 1.3.0=1 * Requires at least: 6.0 * Requires PHP: 7.4 * Author: 10up @@ -16,7 +16,7 @@ */ // Useful global constants. -define( 'SOPHI_WP_VERSION', '1.3.0' ); +define( 'SOPHI_WP_VERSION', '1.3.1' ); define( 'SOPHI_WP_URL', plugin_dir_url( __FILE__ ) ); define( 'SOPHI_WP_PATH', plugin_dir_path( __FILE__ ) ); define( 'SOPHI_WP_INC', SOPHI_WP_PATH . 'includes/' ); From dfad7f7aa19ba8c89e3b1e5e957e0c6d2ed63008 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 9 Nov 2022 09:26:32 -0600 Subject: [PATCH 07/21] header field updates --- readme.txt | 4 +++- sophi.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 9d0f5b9d..311a310b 100644 --- a/readme.txt +++ b/readme.txt @@ -1,8 +1,10 @@ === Sophi === Contributors: 10up, sophidev Tags: Sophi, Site Automation, Curator, Collector, AI, Artifical Intelligence, ML, Machine Learning, Content Curation +Requires at least: 6.0 Tested up to: 6.0 -Stable tag: 1.3.0 +Stable tag: 1.3.1 +Requires PHP: 7.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html diff --git a/sophi.php b/sophi.php index 2b898f81..3edd336d 100644 --- a/sophi.php +++ b/sophi.php @@ -3,7 +3,7 @@ * Plugin Name: Sophi * Plugin URI: https://github.com/globeandmail/sophi-for-wordpress * Description: WordPress VIP-compatible plugin for the Sophi.io Site Automation service. - * Version: 1.3.0=1 + * Version: 1.3.1 * Requires at least: 6.0 * Requires PHP: 7.4 * Author: 10up From 32b7a22abad73935e6b0d9bf6bf925001218ab5e Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 9 Nov 2022 09:27:57 -0600 Subject: [PATCH 08/21] Update CREDITS.md --- CREDITS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CREDITS.md b/CREDITS.md index b0f290aa..41b869f1 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -6,7 +6,7 @@ The following acknowledges the Maintainers for this repository, those who have C The following individuals are responsible for curating the list of issues, responding to pull requests, and ensuring regular releases happen. -[Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Felipe Elia (@felipeelia)](https://github.com/felipeelia). +[Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Darin Kotter (@dkotter)](https://github.com/dkotter). ## Contributors From a49be123c4091be3e53ff1ec5b9b9336c0a636ef Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 9 Nov 2022 09:34:30 -0600 Subject: [PATCH 09/21] add 1.3.1 to changelogs --- CHANGELOG.md | 5 +++++ readme.txt | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31b786c9..1785944f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] - TBD +## [1.3.1] - 2022-11-10 +### Changed +- Mapping for `sectionNames` field to reflect Primary Category or first Category (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90) via [#350](https://github.com/globeandmail/sophi-for-wordpress/pull/350)). + ## [1.3.0] - 2022-10-28 **Note that this version bumps the minimum WordPress version from 5.6 to 6.0 and adds an integration with the Sophi Override feature.** @@ -268,6 +272,7 @@ All notable changes to this project will be documented in this file, per [the Ke - Initial public release! 🎉 [Unreleased]: https://github.com/globeandmail/sophi-for-wordpress/compare/trunk...develop +[1.3.1]: https://github.com/globeandmail/sophi-for-wordpress/compare/1.3.0...1.3.1 [1.3.0]: https://github.com/globeandmail/sophi-for-wordpress/compare/1.2.1...1.3.0 [1.2.1]: https://github.com/globeandmail/sophi-for-wordpress/compare/1.2.0...1.2.1 [1.2.0]: https://github.com/globeandmail/sophi-for-wordpress/compare/1.1.3...1.2.0 diff --git a/readme.txt b/readme.txt index 311a310b..8d10db31 100644 --- a/readme.txt +++ b/readme.txt @@ -151,6 +151,9 @@ The same [Privacy & Terms that govern The Globe and Mail](https://www.theglobean == Changelog == += 1.3.1 - 2022-11-10 = +* **Changed:** Mapping for `sectionNames` field to reflect Primary Category or first Category (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90) via [#350](https://github.com/globeandmail/sophi-for-wordpress/pull/350)). + = 1.3.0 - 2022-10-28 = **Note that this version bumps the minimum WordPress version from 5.6 to 6.0 and adds an integration with the Sophi Override feature.** From 6ead52546c210886f4071eb6a0c355fd11be7f57 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 9 Nov 2022 10:04:15 -0700 Subject: [PATCH 10/21] Modify our configured check to look at each section of settings individually instead of checking for them all. Use this to more accurately load functionality --- includes/functions/settings.php | 10 +++---- includes/functions/utils.php | 51 ++++++++++++++++++++++++++------- sophi.php | 27 ++++++++++------- 3 files changed, 62 insertions(+), 26 deletions(-) diff --git a/includes/functions/settings.php b/includes/functions/settings.php index ac726545..7df7a0fb 100644 --- a/includes/functions/settings.php +++ b/includes/functions/settings.php @@ -506,15 +506,15 @@ function render_select( $args ) { * * @return array */ -function add_action_links ( $actions ) { - if ( ! is_configured() ) { - $action_label = __('Set up your Sophi.io account', 'sophi-wp'); +function add_action_links( $actions ) { + if ( ! is_configured( 'collector' ) || ! is_configured( 'automation' ) ) { + $action_label = __( 'Set up your Sophi.io account', 'sophi-wp' ); } else { - $action_label = __('Settings', 'sophi-wp'); + $action_label = __( 'Settings', 'sophi-wp' ); } return array_merge( [ - '' . $action_label . '', + '' . $action_label . '', ], $actions ); diff --git a/includes/functions/utils.php b/includes/functions/utils.php index 86b43851..7a64b54f 100644 --- a/includes/functions/utils.php +++ b/includes/functions/utils.php @@ -254,20 +254,51 @@ function get_supported_post_types() { /** * Check if Sophi is configured or not. * + * @param string $section Settings section to check for. Default 'all'. * @return bool */ -function is_configured() { +function is_configured( $section = 'all' ) { $settings = get_sophi_settings(); - unset( $settings['environment'] ); - unset( $settings['query_integration'] ); - - $settings = array_filter( - $settings, - function( $item ) { - return empty( $item ); - } - ); + switch ( $section ) { + case 'collector': + $settings = array_filter( + $settings, + function( $item, $key ) { + return in_array( $key, [ 'collector_url', 'tracker_address', 'tracker_client_id' ], true ) && empty( $item ); + }, + ARRAY_FILTER_USE_BOTH + ); + break; + case 'automation': + $settings = array_filter( + $settings, + function( $item, $key ) { + return in_array( $key, [ 'host', 'tenant_id', 'site_automation_url' ], true ) && empty( $item ); + }, + ARRAY_FILTER_USE_BOTH + ); + break; + case 'override': + $settings = array_filter( + $settings, + function( $item, $key ) { + return in_array( $key, [ 'sophi_override_url', 'sophi_override_client_id', 'sophi_override_client_secret' ], true ) && empty( $item ); + }, + ARRAY_FILTER_USE_BOTH + ); + break; + case 'all': + default: + $settings = array_filter( + $settings, + function( $item, $key ) { + return ! in_array( $key, [ 'environment', 'query_integration' ], true ) && empty( $item ); + }, + ARRAY_FILTER_USE_BOTH + ); + break; + } if ( count( $settings ) > 0 ) { return false; diff --git a/sophi.php b/sophi.php index d8a2d7b3..1924584e 100644 --- a/sophi.php +++ b/sophi.php @@ -63,23 +63,28 @@ function() { SophiWP\Settings\setup(); SophiWP\PostType\setup(); - if ( ! SophiWP\Utils\is_configured() ) { - return add_action( 'admin_notices', 'sophi_setup_notice' ); + if ( ! SophiWP\Utils\is_configured( 'collector' ) || ! SophiWP\Utils\is_configured( 'automation' ) ) { + add_action( 'admin_notices', 'sophi_setup_notice' ); } - SophiWP\ContentSync\setup(); - SophiWP\Tracking\setup(); - SophiWP\Blocks\setup(); - ( new SophiWP\SiteAutomation\Services() )->register(); + if ( SophiWP\Utils\is_configured( 'collector' ) ) { + SophiWP\ContentSync\setup(); + SophiWP\Tracking\setup(); - if ( defined( 'WP_CLI' ) && WP_CLI ) { - try { - \WP_CLI::add_command( 'sophi', 'SophiWP\Command' ); - } catch ( \Exception $e ) { - error_log( $e->getMessage() ); // phpcs:ignore + if ( defined( 'WP_CLI' ) && WP_CLI ) { + try { + \WP_CLI::add_command( 'sophi', 'SophiWP\Command' ); + } catch ( \Exception $e ) { + error_log( $e->getMessage() ); // phpcs:ignore + } } } + if ( SophiWP\Utils\is_configured( 'automation' ) ) { + SophiWP\Blocks\setup(); + ( new SophiWP\SiteAutomation\Services() )->register(); + } + /** * Fires after Sophi has been loaded. * From 0aff9277653be311691423902d7f993e4c57420f Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 9 Nov 2022 11:38:13 -0700 Subject: [PATCH 11/21] Comment out override settings that aren't needed yet. Fix an issue where we try and iterate over a non-array --- includes/classes/SiteAutomation/EndPoints.php | 12 ++++--- includes/functions/settings.php | 31 +++++++++++++------ 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/includes/classes/SiteAutomation/EndPoints.php b/includes/classes/SiteAutomation/EndPoints.php index c275e3ac..dc7a1671 100644 --- a/includes/classes/SiteAutomation/EndPoints.php +++ b/includes/classes/SiteAutomation/EndPoints.php @@ -118,8 +118,10 @@ public function site_automation( $request ) { } $curated_posts_new = []; - foreach ( $curated_posts as $index => $curated_post ) { - $curated_posts_new[ $index ] = $this->get_post_details( $curated_post, $rules ); + if ( is_array( $curated_posts ) ) { + foreach ( $curated_posts as $index => $curated_post ) { + $curated_posts_new[ $index ] = $this->get_post_details( $curated_post, $rules ); + } } $curated_posts = $curated_posts_new; @@ -209,8 +211,8 @@ public function site_automation_params() { */ public function site_automation_permission(){ $current_user = wp_get_current_user(); - - if ( ! $current_user->exists() ) { + + if ( ! $current_user->exists() ) { return new \WP_Error(401, __( 'Unauthorised user, please log in.', 'sophi-wp' ) ); } @@ -366,4 +368,4 @@ public function site_automation_override_params() { */ return apply_filters( 'site_automation_override_params', $params ); } -} \ No newline at end of file +} diff --git a/includes/functions/settings.php b/includes/functions/settings.php index ac726545..2844d82f 100644 --- a/includes/functions/settings.php +++ b/includes/functions/settings.php @@ -131,7 +131,7 @@ function fields_setup() { SETTINGS_GROUP, 'collector_settings', [ - 'label_for' => 'collector_url', + 'label_for' => 'collector_url', 'description' => __( 'Please use URL without http(s) scheme.', 'sophi-wp' ), ] ); @@ -200,6 +200,9 @@ function fields_setup() { ] ); + /* // phpcs:ignore + Commenting out the Sophi Override settings for now. + // Add Auth settings section. add_settings_section( 'sophi_api_auth', @@ -241,6 +244,7 @@ function fields_setup() { 'description' => __( 'For example, https://xyz.sophi.io/v1/, please add a slash (/) in the end.', 'sophi-wp' ), ] ); + */ // Add Advanced settings section. add_settings_section( @@ -325,13 +329,13 @@ function sanitize_settings( $settings ) { $settings['query_integration'] = 0; } - if ( empty( $settings['site_automation_url']) ) { + if ( empty( $settings['site_automation_url'] ) ) { add_settings_error( SETTINGS_GROUP, SETTINGS_GROUP, __( 'Site Automation URL is required for Site Automation integration.', 'sophi-wp' ) ); - } else if ( ! filter_var( $settings['site_automation_url'], FILTER_VALIDATE_URL ) ) { + } elseif ( ! filter_var( $settings['site_automation_url'], FILTER_VALIDATE_URL ) ) { add_settings_error( SETTINGS_GROUP, SETTINGS_GROUP, @@ -343,26 +347,30 @@ function sanitize_settings( $settings ) { add_settings_error( SETTINGS_GROUP, SETTINGS_GROUP, + /* translators: %s is replaced with the tracker URL */ sprintf( __( 'Tracker Address URL is invalid: %s', 'sophi-wp' ), $settings['tracker_address'] ) ); unset( $settings['tracker_address'] ); } - if ( empty( $settings['sophi_override_url']) ) { + /* // phpcs:ignore + Commenting out the Sophi Override settings for now. + if ( empty( $settings['sophi_override_url'] ) ) { add_settings_error( SETTINGS_GROUP, SETTINGS_GROUP, __( 'Sophi Override URL is required for Override actions.', 'sophi-wp' ) ); - } else if ( ! filter_var( $settings['sophi_override_url'], FILTER_VALIDATE_URL ) ) { + } elseif ( ! filter_var( $settings['sophi_override_url'], FILTER_VALIDATE_URL ) ) { add_settings_error( SETTINGS_GROUP, SETTINGS_GROUP, __( 'Sophi Override URL is invalid.', 'sophi-wp' ) ); } + */ - if ( empty( $settings['collector_url']) ) { + if ( empty( $settings['collector_url'] ) ) { add_settings_error( SETTINGS_GROUP, SETTINGS_GROUP, @@ -383,6 +391,8 @@ function sanitize_settings( $settings ) { ); } + /* // phpcs:ignore + Commenting out the Sophi Override settings for now. if ( empty( $settings['sophi_override_client_id'] ) || empty( $settings['sophi_override_client_secret'] ) ) { add_settings_error( SETTINGS_GROUP, @@ -390,6 +400,7 @@ function sanitize_settings( $settings ) { __( 'Both Client ID and Client Secret are required to generate a token for API.', 'sophi-wp' ) ); } + */ if ( isset( $settings['client_id'] ) ) { unset( $settings['client_id'] ); @@ -506,15 +517,15 @@ function render_select( $args ) { * * @return array */ -function add_action_links ( $actions ) { +function add_action_links( $actions ) { if ( ! is_configured() ) { - $action_label = __('Set up your Sophi.io account', 'sophi-wp'); + $action_label = __( 'Set up your Sophi.io account', 'sophi-wp' ); } else { - $action_label = __('Settings', 'sophi-wp'); + $action_label = __( 'Settings', 'sophi-wp' ); } return array_merge( [ - '' . $action_label . '', + '' . $action_label . '', ], $actions ); From 8f29b79cf1a845ca09de6c2572817b76911b0a82 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Wed, 9 Nov 2022 14:21:02 -0600 Subject: [PATCH 12/21] update 1.3.1 changelogs --- CHANGELOG.md | 7 +++++++ readme.txt | 3 +++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1785944f..41605b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ All notable changes to this project will be documented in this file, per [the Ke ## [1.3.1] - 2022-11-10 ### Changed - Mapping for `sectionNames` field to reflect Primary Category or first Category (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90) via [#350](https://github.com/globeandmail/sophi-for-wordpress/pull/350)). +- Update our configured check to be smarter (props [@dkotter](https://github.com/dkotter), [@vjayaseelan90](https://github.com/vjayaseelan90), [@jeffpaul](https://github.com/jeffpaul) via [#361](https://github.com/globeandmail/sophi-for-wordpress/pull/361)). + +### Removed +- Comment out the override settings _for now_ (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#362](https://github.com/globeandmail/sophi-for-wordpress/pull/362)). + +### Fixed +- Ensure we have an array of items before iterating over them (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#362](https://github.com/globeandmail/sophi-for-wordpress/pull/362)). ## [1.3.0] - 2022-10-28 **Note that this version bumps the minimum WordPress version from 5.6 to 6.0 and adds an integration with the Sophi Override feature.** diff --git a/readme.txt b/readme.txt index 8d10db31..f8fb5156 100644 --- a/readme.txt +++ b/readme.txt @@ -153,6 +153,9 @@ The same [Privacy & Terms that govern The Globe and Mail](https://www.theglobean = 1.3.1 - 2022-11-10 = * **Changed:** Mapping for `sectionNames` field to reflect Primary Category or first Category (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90) via [#350](https://github.com/globeandmail/sophi-for-wordpress/pull/350)). +* **Changed:** Update our configured check to be smarter (props [@dkotter](https://github.com/dkotter), [@vjayaseelan90](https://github.com/vjayaseelan90), [@jeffpaul](https://github.com/jeffpaul) via [#361](https://github.com/globeandmail/sophi-for-wordpress/pull/361)). +* **Removed:** Comment out the override settings _for now_ (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#362](https://github.com/globeandmail/sophi-for-wordpress/pull/362)). +* **Fixed:** Ensure we have an array of items before iterating over them (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#362](https://github.com/globeandmail/sophi-for-wordpress/pull/362)). = 1.3.0 - 2022-10-28 = **Note that this version bumps the minimum WordPress version from 5.6 to 6.0 and adds an integration with the Sophi Override feature.** From a9851719378220e43fb3e3363a594030cd6e073c Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Thu, 10 Nov 2022 09:47:30 -0700 Subject: [PATCH 13/21] Modify our get_primary_category function to have better validation on if a primary term is set and ensuring it exists --- includes/functions/utils.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/includes/functions/utils.php b/includes/functions/utils.php index 7a64b54f..6776e66b 100644 --- a/includes/functions/utils.php +++ b/includes/functions/utils.php @@ -583,21 +583,28 @@ function get_wp_sophi_versions() { * @param string $taxonomy Optional. The taxonomy to get the primary term ID for. Defaults to category. * @param int $post_id Optional. Post to get the primary term ID for. * - * @return string + * @return string|boolean */ function get_primary_category( $post_id = 0, $taxonomy = 'category' ) { - if ( ! function_exists( 'yoast_get_primary_term_id' ) ) { + if ( + ! function_exists( 'yoast_get_primary_term_id' ) || + ! yoast_get_primary_term_id( $taxonomy, $post_id ) + ) { $post_terms = wp_get_post_terms( $post_id, $taxonomy ); if ( is_array( $post_terms ) && count( $post_terms ) > 0 ) { return $post_terms[0]->name; } else { - return ''; + return false; } } $primary_term_id = yoast_get_primary_term_id( $taxonomy, $post_id ); $primary_category = get_term( $primary_term_id ); - return $primary_category->name; + if ( ! is_wp_error( $primary_category ) && ! empty( $primary_category ) ) { + return $primary_category->name; + } + + return false; } From d21e80b8dbf4654f0773a82b172d597981e1480c Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Thu, 10 Nov 2022 09:47:58 -0700 Subject: [PATCH 14/21] Ensure that if we don't have a primary category set, we output an empty array --- includes/functions/content-sync.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/functions/content-sync.php b/includes/functions/content-sync.php index 9a3442c3..71eaebb2 100644 --- a/includes/functions/content-sync.php +++ b/includes/functions/content-sync.php @@ -142,7 +142,7 @@ function send_track_event( $tracker, $post, $action ) { * @param {Tracker} $tracker Tracker being used. * @param {string} $post Post object. * @param {string} $action Publishing action. - * + * * @return {array} Tracking data to send. */ $data = apply_filters_ref_array( 'sophi_cms_tracking_request_data', array( $data, &$tracker, $post, $action ) ); @@ -224,7 +224,7 @@ function init_tracker() { * @hook sophi_tracker_emitter_debug * * @param {bool} $debug Debug is active. - * + * * @return {bool} Whether to turn on emitter debug. */ $debug = apply_filters( 'sophi_tracker_emitter_debug', false ); @@ -276,7 +276,7 @@ function get_post_data( $post ) { 'plainText' => wp_strip_all_tags( $content ), 'size' => str_word_count( wp_strip_all_tags( $content ) ), 'allSections' => Utils\get_post_categories_paths( $post->ID ), - 'sectionNames' => array( Utils\get_primary_category( $post->ID ) ), + 'sectionNames' => Utils\get_primary_category( $post->ID ) ? [ Utils\get_primary_category( $post->ID ) ] : [], 'modifiedAt' => gmdate( \DateTime::RFC3339, strtotime( $post->post_modified_gmt ) ), 'tags' => Utils\get_post_tags( $post ), 'url' => $permalink, @@ -367,7 +367,7 @@ function maybe_skip_track_event( $data ) { * * @param {boolean} $skip Whether to skip tracking. * @param {array} $data Data to track. - * + * * @return {boolean} */ return apply_filters( 'sophi_skip_track_event', $skip, $data ); From 1d3da6a847109bec3aa58f23d58f4a4c9ff32882 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Thu, 10 Nov 2022 10:07:59 -0700 Subject: [PATCH 15/21] Fix unit tests and simplify code a bit --- includes/functions/utils.php | 18 +++++------------- tests/phpunit/test-tools/Utils_Tests.php | 8 +++++++- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/includes/functions/utils.php b/includes/functions/utils.php index 6776e66b..83026ed6 100644 --- a/includes/functions/utils.php +++ b/includes/functions/utils.php @@ -583,28 +583,20 @@ function get_wp_sophi_versions() { * @param string $taxonomy Optional. The taxonomy to get the primary term ID for. Defaults to category. * @param int $post_id Optional. Post to get the primary term ID for. * - * @return string|boolean + * @return string */ function get_primary_category( $post_id = 0, $taxonomy = 'category' ) { - if ( - ! function_exists( 'yoast_get_primary_term_id' ) || - ! yoast_get_primary_term_id( $taxonomy, $post_id ) - ) { + if ( ! function_exists( 'yoast_get_primary_term' ) || ! yoast_get_primary_term( $taxonomy, $post_id ) ) { $post_terms = wp_get_post_terms( $post_id, $taxonomy ); if ( is_array( $post_terms ) && count( $post_terms ) > 0 ) { return $post_terms[0]->name; } else { - return false; + return ''; } } - $primary_term_id = yoast_get_primary_term_id( $taxonomy, $post_id ); - $primary_category = get_term( $primary_term_id ); + $primary_term = yoast_get_primary_term( $taxonomy, $post_id ); - if ( ! is_wp_error( $primary_category ) && ! empty( $primary_category ) ) { - return $primary_category->name; - } - - return false; + return $primary_term; } diff --git a/tests/phpunit/test-tools/Utils_Tests.php b/tests/phpunit/test-tools/Utils_Tests.php index fc606f77..46bf17ab 100644 --- a/tests/phpunit/test-tools/Utils_Tests.php +++ b/tests/phpunit/test-tools/Utils_Tests.php @@ -2,6 +2,7 @@ namespace SophiWP\Utils; use SophiWP as Base; +use stdClass; class Core_Tests extends Base\TestCase { @@ -90,7 +91,7 @@ public function test_get_primary_category__multiple_categories__yoast_deactivate public function test_get_primary_category__default_category__yoast_activated() { \WP_Mock::userFunction( 'yoast_get_primary_term_id', array( - 'times' => 1, + 'times' => 2, 'args' => array( 'category', null ), 'return' => 123, ) ); @@ -104,6 +105,11 @@ public function test_get_primary_category__default_category__yoast_activated() { ), ) ); + \WP_Mock::userFunction( 'is_wp_error', array( + 'times' => 1, + 'return' => false, + ) ); + $term_name = get_primary_category(); $this->assertEquals( $term_name, 'Uncategorized' ); From 8963dfe4d77f1026a4dee2ac22581fd39eacc352 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Thu, 10 Nov 2022 10:09:54 -0700 Subject: [PATCH 16/21] Remove unneeded test code --- tests/phpunit/test-tools/Utils_Tests.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/tests/phpunit/test-tools/Utils_Tests.php b/tests/phpunit/test-tools/Utils_Tests.php index 46bf17ab..04996b29 100644 --- a/tests/phpunit/test-tools/Utils_Tests.php +++ b/tests/phpunit/test-tools/Utils_Tests.php @@ -90,24 +90,10 @@ public function test_get_primary_category__multiple_categories__yoast_deactivate } public function test_get_primary_category__default_category__yoast_activated() { - \WP_Mock::userFunction( 'yoast_get_primary_term_id', array( + \WP_Mock::userFunction( 'yoast_get_primary_term', array( 'times' => 2, 'args' => array( 'category', null ), - 'return' => 123, - ) ); - - \WP_Mock::userFunction( 'get_term', array( - 'times' => 1, - 'args' => array( 123 ), - 'return' => (object) array( - 'term_id' => 123, - 'name' => 'Uncategorized', - ), - ) ); - - \WP_Mock::userFunction( 'is_wp_error', array( - 'times' => 1, - 'return' => false, + 'return' => 'Uncategorized', ) ); $term_name = get_primary_category(); From ae5cf982e0f5d588391279abb51b831f049474ee Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Thu, 10 Nov 2022 10:16:47 -0700 Subject: [PATCH 17/21] Simplify code a bit more --- includes/functions/utils.php | 4 +--- tests/phpunit/test-tools/Utils_Tests.php | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/includes/functions/utils.php b/includes/functions/utils.php index 83026ed6..f029768c 100644 --- a/includes/functions/utils.php +++ b/includes/functions/utils.php @@ -596,7 +596,5 @@ function get_primary_category( $post_id = 0, $taxonomy = 'category' ) { } } - $primary_term = yoast_get_primary_term( $taxonomy, $post_id ); - - return $primary_term; + return yoast_get_primary_term( $taxonomy, $post_id ); } diff --git a/tests/phpunit/test-tools/Utils_Tests.php b/tests/phpunit/test-tools/Utils_Tests.php index 04996b29..f4b1705d 100644 --- a/tests/phpunit/test-tools/Utils_Tests.php +++ b/tests/phpunit/test-tools/Utils_Tests.php @@ -2,7 +2,6 @@ namespace SophiWP\Utils; use SophiWP as Base; -use stdClass; class Core_Tests extends Base\TestCase { From 416b66f847fd558f3e78b94ea0e4f489d2cd148e Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 10 Nov 2022 12:56:26 -0600 Subject: [PATCH 18/21] update 1.3.1 changelogs --- CHANGELOG.md | 2 +- readme.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41605b07..2f5ea8b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file, per [the Ke ## [1.3.1] - 2022-11-10 ### Changed -- Mapping for `sectionNames` field to reflect Primary Category or first Category (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90) via [#350](https://github.com/globeandmail/sophi-for-wordpress/pull/350)). +- Mapping for `sectionNames` field to reflect Primary Category or first Category (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90), [@dkotter](https://github.com/dkotter) via [#350](https://github.com/globeandmail/sophi-for-wordpress/pull/350), [#363](https://github.com/globeandmail/sophi-for-wordpress/pull/363)). - Update our configured check to be smarter (props [@dkotter](https://github.com/dkotter), [@vjayaseelan90](https://github.com/vjayaseelan90), [@jeffpaul](https://github.com/jeffpaul) via [#361](https://github.com/globeandmail/sophi-for-wordpress/pull/361)). ### Removed diff --git a/readme.txt b/readme.txt index f8fb5156..dd961e66 100644 --- a/readme.txt +++ b/readme.txt @@ -152,7 +152,7 @@ The same [Privacy & Terms that govern The Globe and Mail](https://www.theglobean == Changelog == = 1.3.1 - 2022-11-10 = -* **Changed:** Mapping for `sectionNames` field to reflect Primary Category or first Category (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90) via [#350](https://github.com/globeandmail/sophi-for-wordpress/pull/350)). +* **Changed:** Mapping for `sectionNames` field to reflect Primary Category or first Category (props [@Sidsector9](https://github.com/Sidsector9), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@vjayaseelan90](https://github.com/vjayaseelan90), [@dkotter](https://github.com/dkotter) via [#350](https://github.com/globeandmail/sophi-for-wordpress/pull/350), [#363](https://github.com/globeandmail/sophi-for-wordpress/pull/363)). * **Changed:** Update our configured check to be smarter (props [@dkotter](https://github.com/dkotter), [@vjayaseelan90](https://github.com/vjayaseelan90), [@jeffpaul](https://github.com/jeffpaul) via [#361](https://github.com/globeandmail/sophi-for-wordpress/pull/361)). * **Removed:** Comment out the override settings _for now_ (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#362](https://github.com/globeandmail/sophi-for-wordpress/pull/362)). * **Fixed:** Ensure we have an array of items before iterating over them (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#362](https://github.com/globeandmail/sophi-for-wordpress/pull/362)). From 5ba15dc488de6e6d29efcb1cee188bf983362b64 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Thu, 10 Nov 2022 14:54:52 -0700 Subject: [PATCH 19/21] Instead of skipping tracking if the meta-box-loader is set, only skip if that is set and the Yoast primary category isn't --- includes/functions/content-sync.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/functions/content-sync.php b/includes/functions/content-sync.php index 71eaebb2..45e8ae05 100644 --- a/includes/functions/content-sync.php +++ b/includes/functions/content-sync.php @@ -333,8 +333,11 @@ function maybe_skip_track_event( $data ) { $transient_name = 'sophi_tracking_request_' . $transient_hash; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - if ( isset( $_GET['meta-box-loader'] ) && $_GET['meta-box-loader'] ) { - // Skip if metabox is reloading. + if ( + ( isset( $_GET['meta-box-loader'] ) && $_GET['meta-box-loader'] ) && + ! filter_input( INPUT_POST, 'yoast_wpseo_primary_category_term', FILTER_SANITIZE_NUMBER_INT ) + ) { + // Skip if metabox is reloading and we're not saving the primary category. $skip = true; } elseif ( get_transient( $transient_name ) === $data ) { // Skip duplicated track within last 10 seconds. From b7693ec38debe266034adcffa1a07d8b6665427d Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Thu, 10 Nov 2022 15:05:37 -0700 Subject: [PATCH 20/21] PHPCS fixes --- includes/functions/content-sync.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/functions/content-sync.php b/includes/functions/content-sync.php index 45e8ae05..434b600a 100644 --- a/includes/functions/content-sync.php +++ b/includes/functions/content-sync.php @@ -333,10 +333,8 @@ function maybe_skip_track_event( $data ) { $transient_name = 'sophi_tracking_request_' . $transient_hash; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - if ( - ( isset( $_GET['meta-box-loader'] ) && $_GET['meta-box-loader'] ) && - ! filter_input( INPUT_POST, 'yoast_wpseo_primary_category_term', FILTER_SANITIZE_NUMBER_INT ) - ) { + if ( ( isset( $_GET['meta-box-loader'] ) && $_GET['meta-box-loader'] ) && + ! filter_input( INPUT_POST, 'yoast_wpseo_primary_category_term', FILTER_SANITIZE_NUMBER_INT ) ) { // Skip if metabox is reloading and we're not saving the primary category. $skip = true; } elseif ( get_transient( $transient_name ) === $data ) { From bf7517f66477d5b2653a310f38f7fcad84288881 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Fri, 11 Nov 2022 11:17:08 -0600 Subject: [PATCH 21/21] update 1.3.1 changelogs --- CHANGELOG.md | 1 + readme.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f5ea8b2..8133bc55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file, per [the Ke ### Fixed - Ensure we have an array of items before iterating over them (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#362](https://github.com/globeandmail/sophi-for-wordpress/pull/362)). +- Ensure we send tracking events when the Yoast featured category data is saved (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#365](https://github.com/globeandmail/sophi-for-wordpress/pull/365)). ## [1.3.0] - 2022-10-28 **Note that this version bumps the minimum WordPress version from 5.6 to 6.0 and adds an integration with the Sophi Override feature.** diff --git a/readme.txt b/readme.txt index dd961e66..2465359f 100644 --- a/readme.txt +++ b/readme.txt @@ -156,6 +156,7 @@ The same [Privacy & Terms that govern The Globe and Mail](https://www.theglobean * **Changed:** Update our configured check to be smarter (props [@dkotter](https://github.com/dkotter), [@vjayaseelan90](https://github.com/vjayaseelan90), [@jeffpaul](https://github.com/jeffpaul) via [#361](https://github.com/globeandmail/sophi-for-wordpress/pull/361)). * **Removed:** Comment out the override settings _for now_ (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#362](https://github.com/globeandmail/sophi-for-wordpress/pull/362)). * **Fixed:** Ensure we have an array of items before iterating over them (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#362](https://github.com/globeandmail/sophi-for-wordpress/pull/362)). +* **Fixed:** Ensure we send tracking events when the Yoast featured category data is saved (props [@dkotter](https://github.com/dkotter), [@jeffpaul](https://github.com/jeffpaul) via [#365](https://github.com/globeandmail/sophi-for-wordpress/pull/365)). = 1.3.0 - 2022-10-28 = **Note that this version bumps the minimum WordPress version from 5.6 to 6.0 and adds an integration with the Sophi Override feature.**