From 5a403f9e54d79d77acc4852f96c4d73b28abe60d Mon Sep 17 00:00:00 2001 From: datorik Date: Tue, 14 Apr 2026 16:23:44 +0300 Subject: [PATCH 1/4] https://app.doboard.com/1/task/46614 --- inc/cleantalk-admin.php | 35 ---------------------------- templates/apbct_settings__footer.php | 1 - 2 files changed, 36 deletions(-) diff --git a/inc/cleantalk-admin.php b/inc/cleantalk-admin.php index 8ac6e95f4..e7b251e3e 100644 --- a/inc/cleantalk-admin.php +++ b/inc/cleantalk-admin.php @@ -756,11 +756,6 @@ function apbct_admin__admin_bar__add_structure($wp_admin_bar) $gf2db_title_node = apbct__admin_bar__add_gf2db_title(); if ($gf2db_title_node) { $wp_admin_bar->add_node($gf2db_title_node); - } else { - $gf2db_invite_to_install_title = apbct__admin_bar__get_title_for_gf2db_invite_to_install(); - if ($gf2db_invite_to_install_title) { - $wp_admin_bar->add_node($gf2db_invite_to_install_title); - } } } @@ -823,36 +818,6 @@ function apbct__admin_bar__add_gf2db_title() ); } -/** - * Gets the title for the "Gravity Forms to doBoard" Add-On invite to install admin bar node. - * - * This function constructs the title for the "Gravity Forms to doBoard" Add-On invite to install admin bar node based on various conditions. - * The title includes a link to the "Gravity Forms to doBoard" Add-On invite to install. - * - * @return array|false The node data for the "Gravity Forms to doBoard" Add-On invite to install admin bar node, or false if the "Gravity Forms to doBoard" Add-On invite to install admin bar node is not enabled. - */ -function apbct__admin_bar__get_title_for_gf2db_invite_to_install() -{ - if (is_plugin_active('cleantalk-doboard-add-on-for-gravity-forms/cleantalk-doboard-add-on-for-gravity-forms.php')) { - return false; - } - - $title = sprintf( - '%s', - admin_url('plugin-install.php?s=GF2DB&tab=search&type=term'), - esc_html__( - 'Organize and track all messages from your site. Gravity Forms, upgraded with project management.', - 'cleantalk-spam-protect' - ), - esc_html__('Install "Gravity Forms to doBoard" Add-On', 'cleantalk-spam-protect') - ); - - return array( - 'parent' => 'project_manager__parent_node', - 'id' => 'gf2db_invite_to_install_title', - 'title' => $title, - ); -} /** * Gets the title for the APBCT admin bar node. diff --git a/templates/apbct_settings__footer.php b/templates/apbct_settings__footer.php index 92e109469..b68583b3a 100644 --- a/templates/apbct_settings__footer.php +++ b/templates/apbct_settings__footer.php @@ -43,7 +43,6 @@ function apbct_settings__footer() ]; $block2_links = [ ['text' => 'Security plugin by CleanTalk', 'url' => admin_url('plugin-install.php') . '?s=spbct&tab=search&type=term'], - ['text' => esc_html__('Forms to CRM / Gravity Add-On'), 'url' => admin_url('plugin-install.php') . '?s=cleantalk-doboard-add-on-for-gravity-forms&tab=search&type=term'], ]; ?> From 8362c295aa3f4f087419a7b9e93abc4953fb20fe Mon Sep 17 00:00:00 2001 From: datorik Date: Wed, 15 Apr 2026 15:44:03 +0300 Subject: [PATCH 2/4] Removing the link to install "Gravity Forms to doBoard" --- inc/cleantalk-admin.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/inc/cleantalk-admin.php b/inc/cleantalk-admin.php index e7b251e3e..9d623214c 100644 --- a/inc/cleantalk-admin.php +++ b/inc/cleantalk-admin.php @@ -751,12 +751,10 @@ function apbct_admin__admin_bar__add_structure($wp_admin_bar) * Link to project manager */ $project_manager_title_node = apbct__admin_bar__get_title_for_project_manager(); - if ( $project_manager_title_node ) { + $gf2db_title_node = apbct__admin_bar__add_gf2db_title(); + if ( $project_manager_title_node && $gf2db_title_node) { $wp_admin_bar->add_node($project_manager_title_node); - $gf2db_title_node = apbct__admin_bar__add_gf2db_title(); - if ($gf2db_title_node) { - $wp_admin_bar->add_node($gf2db_title_node); - } + $wp_admin_bar->add_node($gf2db_title_node); } /** From ffb6a5d2fd89dc86575d642aa6fdb2a828ba41b4 Mon Sep 17 00:00:00 2001 From: datorik Date: Wed, 15 Apr 2026 22:52:38 +0300 Subject: [PATCH 3/4] Fix. UnitTests Gravity install link --- tests/StandaloneFunctions/TestSettingsFooterLinks.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/StandaloneFunctions/TestSettingsFooterLinks.php b/tests/StandaloneFunctions/TestSettingsFooterLinks.php index 883565ed3..737ff0906 100644 --- a/tests/StandaloneFunctions/TestSettingsFooterLinks.php +++ b/tests/StandaloneFunctions/TestSettingsFooterLinks.php @@ -28,10 +28,6 @@ public function testBlock2LinksJsonStructureIsValid(): void $this->assertArrayHasKey('text', $decoded[0]); $this->assertArrayHasKey('url', $decoded[0]); $this->assertEquals('Security plugin by CleanTalk', $decoded[0]['text']); - - $this->assertArrayHasKey('text', $decoded[1]); - $this->assertArrayHasKey('url', $decoded[1]); - $this->assertStringContainsString('Gravity Add-On', $decoded[1]['text']); } else { $this->fail('JSON for Recommended plugins not found'); } From b38e7b5ea5d408f33e8f0d2e29b54de54b40689d Mon Sep 17 00:00:00 2001 From: datorik Date: Thu, 16 Apr 2026 14:44:22 +0300 Subject: [PATCH 4/4] Fix. UnitTests Gravity install link --- .../TestWPAdminBarTitleNodes.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/StandaloneFunctions/TestWPAdminBarTitleNodes.php b/tests/StandaloneFunctions/TestWPAdminBarTitleNodes.php index 849284a03..d5e1d54c5 100644 --- a/tests/StandaloneFunctions/TestWPAdminBarTitleNodes.php +++ b/tests/StandaloneFunctions/TestWPAdminBarTitleNodes.php @@ -161,4 +161,20 @@ function testArrayContentSPBC($array, $test) $this->assertStringContainsString('product_id=4', $title); $this->assertStringNotContainsString('apbct-icon-attention-alt', $title); } + + public function testProjectManagerNodeIndependentOfGf2dbNode() + { + + $project_manager_node = apbct__admin_bar__get_title_for_project_manager(); + $gf2db_node = apbct__admin_bar__add_gf2db_title(); + + $this->assertFalse($project_manager_node ); + $this->assertFalse($gf2db_node); + + $shouldAddParentNode = (bool) $project_manager_node; + $shouldAddChildNode = (bool) $gf2db_node; + + $this->assertFalse($shouldAddParentNode); + $this->assertFalse($shouldAddChildNode); + } }