From 66c8f25346749007d8b1b326f2e31e8719b4e1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Mon, 12 Jan 2026 14:49:43 -0500 Subject: [PATCH 1/9] remove test --- .../ImagifySavePartnerHideOurPluginsTest.php | 11 ------ .../ImagifySavePartnerHideOurPluginsTest.php | 35 ------------------- 2 files changed, 46 deletions(-) delete mode 100644 Tests/Fixtures/inc/functions/Partners/ImagifySavePartnerHideOurPluginsTest.php delete mode 100644 Tests/Unit/inc/functions/Partners/ImagifySavePartnerHideOurPluginsTest.php diff --git a/Tests/Fixtures/inc/functions/Partners/ImagifySavePartnerHideOurPluginsTest.php b/Tests/Fixtures/inc/functions/Partners/ImagifySavePartnerHideOurPluginsTest.php deleted file mode 100644 index 00f2c12c..00000000 --- a/Tests/Fixtures/inc/functions/Partners/ImagifySavePartnerHideOurPluginsTest.php +++ /dev/null @@ -1,11 +0,0 @@ - [ - 'partner' => 'unknown_partner', - 'expected' => false, - ], - 'testShouldSaveWhenPartnerIsInList' => [ - 'partner' => 'extendify', - 'expected' => 'extendify', - ], -]; diff --git a/Tests/Unit/inc/functions/Partners/ImagifySavePartnerHideOurPluginsTest.php b/Tests/Unit/inc/functions/Partners/ImagifySavePartnerHideOurPluginsTest.php deleted file mode 100644 index 9c060db9..00000000 --- a/Tests/Unit/inc/functions/Partners/ImagifySavePartnerHideOurPluginsTest.php +++ /dev/null @@ -1,35 +0,0 @@ -never(); - } else { - Functions\expect( 'update_option' ) - ->once() - ->with( 'imagify_partner_hide_our_plugins', $expected ); - } - - imagify_save_partner_hide_our_plugins( $partner ); - } -} From 739bff1549d0c5e5aa0603bef3b5e69a6ff54267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Mon, 12 Jan 2026 14:49:52 -0500 Subject: [PATCH 2/9] remove function --- inc/functions/partners.php | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/inc/functions/partners.php b/inc/functions/partners.php index 884194f1..da3ac1c4 100755 --- a/inc/functions/partners.php +++ b/inc/functions/partners.php @@ -34,24 +34,3 @@ function imagify_delete_partner() { delete_option( 'imagifyp_id' ); } } - -/** - * Save the partner ID to hide our other plugins if needed - * - * @since 2.2.7 - * - * @param string|bool $partner Partner ID. - * - * @return void - */ -function imagify_save_partner_hide_our_plugins( $partner ) { - $partners = [ - 'extendify', - ]; - - if ( ! in_array( $partner, $partners, true ) ) { - return; - } - - update_option( 'imagify_partner_hide_our_plugins', $partner ); -} From 716d04d265ff632e13d4d97932c53fb9fe332868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Mon, 12 Jan 2026 14:50:01 -0500 Subject: [PATCH 3/9] remove unused section --- inc/common/partners.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/inc/common/partners.php b/inc/common/partners.php index 5c8646f2..7c17a16e 100755 --- a/inc/common/partners.php +++ b/inc/common/partners.php @@ -13,14 +13,6 @@ */ function imagify_maybe_delete_partner_on_option_update( $old_value, $new_value ) { if ( empty( $old_value['api_key'] ) && ! empty( $new_value['api_key'] ) ) { - $partner = imagify_get_partner(); - - if ( false === $partner ) { - return; - } - - imagify_save_partner_hide_our_plugins( $partner ); - imagify_delete_partner(); } } From 4b39853b5259bbbd736d3c822c7e6a8b0abca40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Mon, 12 Jan 2026 14:50:09 -0500 Subject: [PATCH 4/9] remove option --- uninstall.php | 1 - 1 file changed, 1 deletion(-) diff --git a/uninstall.php b/uninstall.php index b53be1d8..d5942541 100755 --- a/uninstall.php +++ b/uninstall.php @@ -11,7 +11,6 @@ delete_option( 'imagify_data' ); delete_option( 'ngg_imagify_data_db_version' ); delete_option( $wpdb->prefix . 'ngg_imagify_data_db_version' ); -delete_option( 'imagify_partner_hide_our_plugins' ); // Delete all transients. delete_site_transient( 'imagify_activation' ); From c545c45caddec571b2dc1296b831444b77efac7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Mon, 12 Jan 2026 14:50:20 -0500 Subject: [PATCH 5/9] use filter instead of option --- inc/classes/class-imagify-views.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/classes/class-imagify-views.php b/inc/classes/class-imagify-views.php index d83d6781..c47d0b89 100644 --- a/inc/classes/class-imagify-views.php +++ b/inc/classes/class-imagify-views.php @@ -204,7 +204,7 @@ public function display_settings_page() { $plugins_array = $plugin_family->get_filtered_plugins( 'imagify/imagify' ); $data = [ - 'hide_plugin_family' => (bool) get_option( 'imagify_partner_hide_our_plugins' ), + 'hide_plugin_family' => wpm_apply_filters_typed( 'boolean', 'imagify_hide_plugin_family', false ), 'plugin_family' => $plugins_array['uncategorized'], ]; From 0f9cb7f3cf1e281149629078813c5cb5257f7a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Mon, 12 Jan 2026 14:50:26 -0500 Subject: [PATCH 6/9] remove unused function --- inc/classes/class-imagify.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/inc/classes/class-imagify.php b/inc/classes/class-imagify.php index cf3a5cc3..3bab7a6f 100644 --- a/inc/classes/class-imagify.php +++ b/inc/classes/class-imagify.php @@ -158,8 +158,6 @@ public function create_user( $data ) { ); if ( ! is_wp_error( $response ) && isset( $data['partner'] ) ) { - imagify_save_partner_hide_our_plugins( $data['partner'] ); - imagify_delete_partner(); } From 143654459e4b3c887eedcc96e47f7c1c1d9b020c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Mon, 12 Jan 2026 14:50:37 -0500 Subject: [PATCH 7/9] add Extendify compatibility --- classes/ThirdParty/Hostings/Extendify.php | 36 +++++++++++++++++++++++ classes/ThirdParty/ServiceProvider.php | 4 +++ 2 files changed, 40 insertions(+) create mode 100644 classes/ThirdParty/Hostings/Extendify.php diff --git a/classes/ThirdParty/Hostings/Extendify.php b/classes/ThirdParty/Hostings/Extendify.php new file mode 100644 index 00000000..25459558 --- /dev/null +++ b/classes/ThirdParty/Hostings/Extendify.php @@ -0,0 +1,36 @@ + 'hide_plugin_family', + ]; + } + + /** + * Hide the plugin family if the Extendify site ID option is present. + * + * @param bool $hide Current value. + * + * @return bool + */ + public function hide_plugin_family( $hide ) { + $option = get_option( 'extendify_site_id', false ); + + if ( false === $option ) { + return $hide; + } + + return true; + } +} diff --git a/classes/ThirdParty/ServiceProvider.php b/classes/ThirdParty/ServiceProvider.php index bbd22496..5aed2b16 100644 --- a/classes/ThirdParty/ServiceProvider.php +++ b/classes/ThirdParty/ServiceProvider.php @@ -4,6 +4,7 @@ namespace Imagify\ThirdParty; use Imagify\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider; +use Imagify\ThirdParty\Hostings\Extendify; use Imagify\ThirdParty\Plugins\GravityForms; /** @@ -17,6 +18,7 @@ class ServiceProvider extends AbstractServiceProvider { */ protected $provides = [ 'gravity_from_subscriber', + Extendify::class, ]; /** @@ -26,6 +28,7 @@ class ServiceProvider extends AbstractServiceProvider { */ public $subscribers = [ 'gravity_from_subscriber', + Extendify::class, ]; /** @@ -55,5 +58,6 @@ public function get_subscribers() { */ public function register(): void { $this->getContainer()->addShared( 'gravity_from_subscriber', GravityForms::class ); + $this->getContainer()->addShared( Extendify::class ); } } From f8afbd7264b8500a543dca7ea5f52d91cb0d341b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Mon, 12 Jan 2026 14:50:43 -0500 Subject: [PATCH 8/9] add tests --- .../Extendify/HidePluginFamilyTest.php | 13 ++++++++++ .../Extendify/HidePluginFamilyTest.php | 25 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 Tests/Fixtures/classes/ThirdParty/Hostings/Extendify/HidePluginFamilyTest.php create mode 100644 Tests/Unit/classes/ThirdParty/Hostings/Extendify/HidePluginFamilyTest.php diff --git a/Tests/Fixtures/classes/ThirdParty/Hostings/Extendify/HidePluginFamilyTest.php b/Tests/Fixtures/classes/ThirdParty/Hostings/Extendify/HidePluginFamilyTest.php new file mode 100644 index 00000000..4c2036fe --- /dev/null +++ b/Tests/Fixtures/classes/ThirdParty/Hostings/Extendify/HidePluginFamilyTest.php @@ -0,0 +1,13 @@ + [ + 'value' => false, + 'option' => false, + 'expected' => false, + ], + 'testShouldReturnTrueWhenOptionPresent' => [ + 'value' => false, + 'option' => 'some_site_id', + 'expected' => true, + ], +]; diff --git a/Tests/Unit/classes/ThirdParty/Hostings/Extendify/HidePluginFamilyTest.php b/Tests/Unit/classes/ThirdParty/Hostings/Extendify/HidePluginFamilyTest.php new file mode 100644 index 00000000..82a92f7d --- /dev/null +++ b/Tests/Unit/classes/ThirdParty/Hostings/Extendify/HidePluginFamilyTest.php @@ -0,0 +1,25 @@ +justReturn( $option ); + + $this->assertSame( + $expected, + $extendify->hide_plugin_family( $value ) + ); + } +} From bd83e80ddd63ba0cdcc8dd6a962bbb9f0e025326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Perona?= Date: Mon, 12 Jan 2026 15:11:03 -0500 Subject: [PATCH 9/9] add missing doc comment --- classes/ThirdParty/Hostings/Extendify.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/ThirdParty/Hostings/Extendify.php b/classes/ThirdParty/Hostings/Extendify.php index 25459558..18929135 100644 --- a/classes/ThirdParty/Hostings/Extendify.php +++ b/classes/ThirdParty/Hostings/Extendify.php @@ -5,6 +5,9 @@ use Imagify\EventManagement\SubscriberInterface; +/** + * Extendify compatibility class + */ class Extendify implements SubscriberInterface { /** * Returns an array of events that this subscriber wants to listen to.