From ce4b99c54ba24a85075dd92eda29b4ee44c66096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Tue, 3 Nov 2026 13:08:02 +0200 Subject: [PATCH 1/2] feat: opt into the Themeisle SDK Support Hub Register feedzy_rss_feeds_support_hub_metadata with is_pro and Docs and Forum links, so Feedzy's screens get the Support Hub Help button and the Plugins screen gets the new deactivation window. It replaces the float widget. No setup_complete, so the setup nudge stays off. Require themeisle-sdk ^3.3.70, the first release with the Support Hub and the Pro add-on license lookup. --- composer.json | 2 +- composer.lock | 2 +- feedzy-rss-feed.php | 26 ++++++++++++++ tests/test-support-hub.php | 70 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 tests/test-support-hub.php diff --git a/composer.json b/composer.json index 5768571a..468147a3 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "source": "https://github.com/Codeinwp/feedzy-rss-feeds" }, "require": { - "codeinwp/themeisle-sdk": "^3.3.65" + "codeinwp/themeisle-sdk": "^3.3.70" }, "autoload": { "files": [ diff --git a/composer.lock b/composer.lock index 07ee913a..dbec8a71 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3499b8053e3d32bb448bbb23fe5994df", + "content-hash": "75b5e7799b2000c27ac293bc2d7b012b", "packages": [ { "name": "codeinwp/themeisle-sdk", diff --git a/feedzy-rss-feed.php b/feedzy-rss-feed.php index 21a17896..bb99fd2d 100644 --- a/feedzy-rss-feed.php +++ b/feedzy-rss-feed.php @@ -320,6 +320,32 @@ function () { } ); +/* + * Opts into the SDK Support Hub: one Help button on Feedzy's screens and the + * deactivation window. It replaces the float widget. Feedzy's screens already + * fire `themeisle_internal_page`, so no `pages` list is needed. + */ +add_filter( + 'feedzy_rss_feeds_support_hub_metadata', + function () { + return array( + 'is_pro' => feedzy_is_pro(), + 'links' => array( + array( + 'icon' => 'book-alt', + 'text' => __( 'Docs', 'feedzy-rss-feeds' ), + 'url' => 'https://docs.themeisle.com/collection/1569-feedzy-rss-feeds', + ), + array( + 'icon' => 'groups', + 'text' => __( 'Forum', 'feedzy-rss-feeds' ), + 'url' => 'https://wordpress.org/support/plugin/feedzy-rss-feeds/', + ), + ), + ); + } +); + add_filter( 'themeisle_sdk_labels', function ( $labels ) { diff --git a/tests/test-support-hub.php b/tests/test-support-hub.php new file mode 100644 index 00000000..6b98dc46 --- /dev/null +++ b/tests/test-support-hub.php @@ -0,0 +1,70 @@ +assertIsArray( $data ); + $this->assertSame( array( 'is_pro', 'links' ), array_keys( $data ) ); + $this->assertArrayNotHasKey( 'setup_complete', $data, 'The setup nudge stays off for now.' ); + } + + /** + * The footer links point to Feedzy's docs and wordpress.org forum. + */ + public function test_links_point_to_feedzy() { + $links = apply_filters( 'feedzy_rss_feeds_support_hub_metadata', array() )['links']; + + $this->assertSame( + array( + 'https://docs.themeisle.com/collection/1569-feedzy-rss-feeds', + 'https://wordpress.org/support/plugin/feedzy-rss-feeds/', + ), + wp_list_pluck( $links, 'url' ) + ); + foreach ( $links as $link ) { + $this->assertNotEmpty( $link['icon'] ); + $this->assertNotEmpty( $link['text'] ); + } + } + + /** + * Messages are tagged as Pro only while the Pro license is valid. + */ + public function test_is_pro_needs_a_valid_license() { + add_filter( 'product_feedzy_license_status', array( $this, 'expired_license' ) ); + $this->assertFalse( apply_filters( 'feedzy_rss_feeds_support_hub_metadata', array() )['is_pro'] ); + remove_filter( 'product_feedzy_license_status', array( $this, 'expired_license' ) ); + + add_filter( 'product_feedzy_license_status', array( $this, 'valid_license' ) ); + // test-import.php defines FEEDZY_PRO_ABSPATH for the rest of the run, so Pro may or may not be "installed" here. + $this->assertSame( defined( 'FEEDZY_PRO_ABSPATH' ), apply_filters( 'feedzy_rss_feeds_support_hub_metadata', array() )['is_pro'] ); + remove_filter( 'product_feedzy_license_status', array( $this, 'valid_license' ) ); + } + + /** + * Reports a valid license. + * + * @return string + */ + public function valid_license() { + return 'valid'; + } + + /** + * Reports an expired license. + * + * @return string + */ + public function expired_license() { + return 'expired'; + } +} From 6777bcc2a4111add23ad243c35e0621dfcfa923a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vytis=20Bulkevi=C4=8Dius?= Date: Tue, 3 Nov 2026 14:21:28 +0200 Subject: [PATCH 2/2] fix: reuse existing Documentation and Community Forum strings --- feedzy-rss-feed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/feedzy-rss-feed.php b/feedzy-rss-feed.php index bb99fd2d..78e7a7b4 100644 --- a/feedzy-rss-feed.php +++ b/feedzy-rss-feed.php @@ -333,12 +333,12 @@ function () { 'links' => array( array( 'icon' => 'book-alt', - 'text' => __( 'Docs', 'feedzy-rss-feeds' ), + 'text' => __( 'Documentation', 'feedzy-rss-feeds' ), 'url' => 'https://docs.themeisle.com/collection/1569-feedzy-rss-feeds', ), array( 'icon' => 'groups', - 'text' => __( 'Forum', 'feedzy-rss-feeds' ), + 'text' => __( 'Community Forum', 'feedzy-rss-feeds' ), 'url' => 'https://wordpress.org/support/plugin/feedzy-rss-feeds/', ), ),