Skip to content

Add prepare route for MyYoast connection #12131

@herregroen

Description

@herregroen

We want to have a new admin route to initiate the connection to MyYoast.

This route will be called from our onboarding wizard our premium plugin page and should do the following:

  • Ensure the current user has sufficient privileges to make the connection ( can manage_options ).
  • Generate a UUID ( wp_generate_uuid4() ).
  • Store the UUID ( see Create OAuth Client Class #12093 ).
  • Redirect the user to https://my.yoast.com/connect with the following parameters:
    • url: the home_url or network_home_url as is currently used for licensing.
    • client_id: the generated UUID.
    • extensions: an array of the active Yoast extensions by slug ( premium, local etc. ).
    • redirect_url: The url of the route implemented in ( Add callback route for MyYoast connection #12135 ).

Test instructions:
Free & single:

  • Have only free enabled on a non-network site.
  • Visit the prepare route.
  • The redirect should have your home_url as the url and an empty extensions array.

Free & multi:

  • Have only free enabled on a single site on a network.
  • Visit the prepare route.
  • The redirect should have your home_url as the url and an empty extensions array.

Free & multi network:

  • Have only free enabled network-enabled.
  • Visit the prepare route.
  • The redirect should have your home_url as the url and an empty extensions array.

Premium & multi:

  • Have only premium enabled on a single site on a network.
  • Visit the prepare route.
  • The redirect should have your home_url as the url and the extensions array should contain a single element which is the slug of premium.

Premium, addon & multi:

  • Have premium and one of the addons enabled on a single site on a network.
  • Visit the prepare route.
  • The redirect should have your home_url as the url and the extensions array should contain two elements which are the slug of premium and the slug of your chosen addon.

parent #12136
Needs #12093

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions