Skip to content

321 highlight google docs and duplicate post on plans#22704

Merged
leonidasmi merged 36 commits intotrunkfrom
321-highlight-google-docs-and-duplicate-post-on-plans
Nov 20, 2025
Merged

321 highlight google docs and duplicate post on plans#22704
leonidasmi merged 36 commits intotrunkfrom
321-highlight-google-docs-and-duplicate-post-on-plans

Conversation

@mykola
Copy link
Copy Markdown
Contributor

@mykola mykola commented Nov 7, 2025

Context

  • Highlight the Google docs & Yoast Duplicate post add-on on the Plans page.

Summary

This PR can be summarized in the following changelog entry:

  • Highlights the Google Docs & Yoast Duplicate post add-ons on the Plans page.

Relevant technical choices:

  • A new php class added to detect Duplicate Post plugin. Also shared-admin storage to manage Plugins links is added.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

Duplicate Post

Duplicate post is not installed/activated

User has permissions to install and activate plugins.
  • Check that Duplicate Post plugin is not installed and activated. Deactivate is if it's active and remove.
  • Open the Yoast Seo -> Plans page and check the Duplicate Post card
  • It should fit the design of the install state.
  • Check that Learn more directs to the https://yoa.st/plans-duplicate-post-learn-more page
  • Click Install Plugin Button
  • Install process should be started in separate tab.
  • Don't activate the plugin during installation.
  • Open the Plans Page again
  • Click Install Plugin button again
  • Duplicate post plugin should be activated.
  • Return to Plans Page
  • Now Install Plugin button should be disabled.
  • The Duplicate Post card should now fit the design of the detected state.
  • Make sure that green Active is present on top of the card.
  • Make sure that green highlight is present around the card.
User doesn't has permissions to install plugins but has permissions to activate
  • Use Members plugin or similar - copy SEO Manager role and allow only activate plugins.
  • Check that Duplicate Post plugin is not installed and activated. Deactivate is if it's active and remove.
  • Open the Yoast Seo -> Plans page
  • Install Plugin button on Duplicate Post card should be disabled
  • Login under admin user and install Duplicate Post plugin but not activate it.
  • Relogin under previous user
  • Go to Plans again and check the Install Plugin button on Duplicate Post card - it should be enabled
  • Click Install Plugin button
  • Duplicate Post plugin should be activated
  • Return to Plans Page
  • Now Install Plugin button should be disabled.
User doesn't has permissions to install and activate plugins (SEO Manager)
  • Check that Duplicate Post plugin is not installed and activated. Deactivate is if it's active and remove.
  • Install Plugin should be disabled for Duplicate Post card.
  • Login under admin user and install plugin but not activate it.
  • Relogin under original previous user
  • Check that Install Plugin is still disabled for Duplicate Post card.

Duplicate post is installed and activated

  • Install the Duplicate Post plugin and activate it
  • Open the Yoast Seo -> Plans page and check the Duplicate Post card
  • Check that Install Plugin button is disabled

Google docs add-on

Premium is not installed and not active

Premium is installed and activated

Do smoke test of other Plan page cards

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

  • Can impact other plans cards and their buttons

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #321

@mykola mykola added the changelog: other Needs to be included in the 'Other' category in the changelog label Nov 7, 2025
@mykola mykola changed the base branch from trunk to release/26.4 November 10, 2025 07:04
@mykola mykola marked this pull request as ready for review November 10, 2025 07:30
@coveralls
Copy link
Copy Markdown

coveralls commented Nov 10, 2025

Pull Request Test Coverage Report for Build fc0d7497f52cb4528d285f93aa634c36240c5ce4

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 29 of 74 (39.19%) changed or added relevant lines in 12 files are covered.
  • 283 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-0.07%) to 53.269%

Changes Missing Coverage Covered Lines Changed/Added Lines %
admin/class-admin-utils.php 0 1 0.0%
packages/js/src/plans/components/cards/base-card.js 2 3 66.67%
packages/js/src/plans/components/images/duplicate-post-svg.js 0 2 0.0%
packages/js/src/plans/components/images/google-docs-addon-svg.js 0 2 0.0%
src/plans/application/duplicate-post-manager.php 7 11 63.64%
packages/js/src/plans/components/cards/google-docs-addon-card.js 0 5 0.0%
packages/js/src/plans/store/duplicate-post.js 0 7 0.0%
packages/js/src/plans/store/user-can.js 0 7 0.0%
packages/js/src/plans/components/cards/duplicate-post-card.js 0 16 0.0%
Files with Coverage Reduction New Missed Lines %
src/integrations/settings-integration.php 6 26.25%
packages/js/src/ai-optimizer/components/ai-optimize-button.js 7 84.14%
packages/js/src/elementor/initializers/render-sidebar.js 9 0.0%
packages/js/src/elementor/initialize.js 13 0.0%
packages/js/src/elementor/initializers/introduction-editor-v2.js 28 0.0%
admin/class-admin-asset-manager.php 51 15.79%
src/integrations/third-party/elementor.php 169 0.0%
Totals Coverage Status
Change from base Build a27514f8e0b862c6290d808bd633e53641b366ef: -0.07%
Covered Lines: 32232
Relevant Lines: 60699

💛 - Coveralls

@leonidasmi
Copy link
Copy Markdown
Contributor

Not a full-fledge review but something I noticed while skimming the PR:

  • When duplicate post is active, the Install plugin button is not properly disabled and points to /wp-content/plugins which is not a thing.

@leonidasmi
Copy link
Copy Markdown
Contributor

Hm, actually that Install plugin button is also not working properly when duplicate post is not there as well. It points to the wp-content/plugins directory and that doesnt make any sense, from what I can tell 🤔

@leonidasmi
Copy link
Copy Markdown
Contributor

Maybe this is not review-ready and was move to Needs Review by accident @manuelaugustin ?

@enricobattocchi enricobattocchi changed the base branch from release/26.4 to trunk November 13, 2025 08:33
@mykola
Copy link
Copy Markdown
Contributor Author

mykola commented Nov 13, 2025

Hm, actually that Install plugin button is also not working properly when duplicate post is not there as well. It points to the wp-content/plugins directory and that doesnt make any sense, from what I can tell 🤔

@leonidas I directed to plugins page intentionally it’s reflected in the tests. I'll double check this behaviour

@leonidasmi
Copy link
Copy Markdown
Contributor

But:

  1. it just points to /wp-content/plugins which is not a page, it's a directory
  2. even if it was the plugins page, the designs say that it "goes to the WordPress installation screen" instead

Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the things I left inline, a couple more remarks that can be useful:

  • The install plugin for the duplicate post should also be disabled when the user can't install plugins (eg. when they are an SEO manager).
  • We need to differentiate whether the duplicate post plugin is installed and whether it's active and point users to install/activate accordingly. This again should be covered by the change of approach and having the duplicate post class not be an implementation of the Add_On_Interface
    • that way we know whether to point users to the action=install-plugin URL I've mentioned inline, or to the action=activate-plugin one

Comment thread src/plans/domain/add-ons/duplicate-post.php Outdated
Comment thread inc/class-addon-manager.php
Comment thread src/plans/user-interface/plans-page-integration.php Outdated
Comment thread src/plans/domain/add-ons/duplicate-post.php Outdated
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: 🏗️

Comment thread inc/class-addon-manager.php Outdated
Comment thread inc/class-addon-manager.php Outdated
Comment thread inc/class-addon-manager.php Outdated
Comment thread packages/js/src/plans/components/actions/card-link.js
Comment thread packages/js/src/plans/components/cards/base-card.js Outdated
Comment thread packages/js/src/plans/components/cards/base-card.js Outdated
Comment thread packages/js/src/plans/components/cards/google-docs-addon-card.js
Comment thread packages/js/src/plans/components/images/duplicate-post-svg.js
Comment thread src/plans/application/duplicate-post-manager.php Outdated
@leonidasmi leonidasmi added this to the 26.6 milestone Nov 20, 2025
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR + Acceptance test is ✅

@leonidasmi leonidasmi merged commit 530e8fc into trunk Nov 20, 2025
41 checks passed
@leonidasmi leonidasmi deleted the 321-highlight-google-docs-and-duplicate-post-on-plans branch November 20, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: other Needs to be included in the 'Other' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants