Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install link of RankMath must change based on the plugin of origin #17

Open
MathieuLamiot opened this issue Nov 29, 2024 · 11 comments · May be fixed by #19
Open

Install link of RankMath must change based on the plugin of origin #17

MathieuLamiot opened this issue Nov 29, 2024 · 11 comments · May be fixed by #19
Assignees
Labels
effort: [XS] < 1 day of estimated development time

Comments

@MathieuLamiot
Copy link

MathieuLamiot commented Nov 29, 2024

Context
See #16
The validation of the end-to-end behavior depends on https://gitlab.group.one/rankmath/rankmath.com-website/-/issues/5
Currently, the "INSTALL" button for RankMath downloads & installs the plugin from the WP public repo.

Expected behavior
The Install button for RankMath must trigger the download & install of RankMath plugin from the following link: rankmath.com/downloads/plugin-family/_plugin_slug_ where _plugin_slug_ should be replaced by the plugin name of the plugin from which the advertisement is displayed:

  • imagify for Imagify
  • wp-rocket for WP Rocket

Acceptance Criteria

  1. Install Imagify (with this plugin-family version) on a website without RankMath. Check the RankMath download counter from Imagify. Click the "Install RankMath" button on Imagify plugin. RankMath must be installed and the download counter must increase.

Additional information
You can contact Uzair or Mladen from RankMath to access the download counter.
See more details on group.one Slack #saas-eng-plugin-family
Once this is implemented in plugin-family, both Imagify & WP Rocket must be updated accordingly.

@jeawhanlee
Copy link
Collaborator

jeawhanlee commented Dec 16, 2024

Scope a solution ✅

In WPMedia\PluginFamily\Controller

  • Create a new method that will hold plugins with custom download urls and accept plugin slug as argument, so the plugin slug would be the key and the custom urls as value, we will return the download url with the matching key passed as argument to the method.

    • To append the correct plugin slug to the end of the url, we will create a new trait that handles this logic so we can share it with WPMedia\PluginFamily\Model::PluginFamily since we currently pass this as an argument. This trait will have a method that returns the main plugin slug where the package is installed. For rank math the main plugin slug is appended to the end of the url, for another plugin it could be somewhere in the middle of the url, for this I suggest we use a generic placeholder in the links, so at the end we can just replace every occurrence of this placeholder with the main plugin slug.
  • Use this new method in WPMedia\PluginFamily\Controller::get_download_url to return early if there's a match for a plugin with custom download url.

Update tests.

Estimate the effort ✅

[XS]

Would this be limited to just Imagify & WP Rocket? @MathieuLamiot

@jeawhanlee jeawhanlee added the effort: [XS] < 1 day of estimated development time label Dec 16, 2024
@MathieuLamiot
Copy link
Author

@jeawhanlee Thanks!

Would this be limited to just Imagify & WP Rocket?

Those are the only use-cases we have currently, but this could be extended and there are no specific reasons to restrict. Ideally, plugin-family would just add the plugin slug in the link rankmath.com/download/plugin-family/_plugin_slug_ so that we have future compatibility with whichever plugin uses plugin-family

@Khadreal
Copy link
Contributor

LGTM

@jeawhanlee
Copy link
Collaborator

jeawhanlee commented Dec 16, 2024

@MathieuLamiot Do we need to trigger download, install and activate using the custom url with one-click?

@MathieuLamiot
Copy link
Author

Yes, the behavior of the button must be completely the same as currently, just using a different place to download the plugin.

@jeawhanlee
Copy link
Collaborator

Ok Thanks, the grooming above does not satisfy this, we'll need to update it.

@MathieuLamiot
Copy link
Author

Moving this back to Grooming in Progress then. Can you look into it? Thanks 🙏

@MathieuLamiot
Copy link
Author

MathieuLamiot commented Dec 17, 2024

Update from Mladen at RankMath: the links will be downloads/plugin-family instead of download/plugin-family.
I am updating the GH issue.

The links are already working.

@jeawhanlee
Copy link
Collaborator

Grooming has been updated to fit AC

@remyperona
Copy link

LGTM

@jeawhanlee jeawhanlee self-assigned this Dec 19, 2024
@MathieuLamiot
Copy link
Author

@jeawhanlee @piotrbak It woudl be great if this update is:

  • included in WP Rocket 3.17.4
  • NOT included in Imagify 2.2.4

I guess we can just avoid updating the plugin-family version in Imagify for now. Thanks 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: [XS] < 1 day of estimated development time
Projects
None yet
5 participants