WordPress plugin for Yoast Meta

We are going to create a plugin that adds the Yoast metadata to the REST API.

It will be both a separate plugin and part of the main Frontity plugin.


Name of the solo plugin: REST API Yoast Meta by Frontity.
Name in the Frontity plugin: Yoast Meta.
Class name: Frontity_Yoast_Meta.
Activation function: frontity_yoast_meta_activation.
Deactivation function: frontity_yoast_meta_deactivation.
Uninstall function: frontity_yoast_meta_uninstall.
Settings name in MySQL: frontity_yoast_meta.
Settings name in JavaScript: window.frontity.settings.yoast => state.yoast.

We can take the code from https://github.com/maru3l/wp-api-yoast-meta but output it in an array instead of separate fields. Maintain the authors name in the license.

It will have a setting to activate or deactivate it. If it is activated, the yoast_meta endpoint will always be shown. If it is deactivated, the yoast_meta endpoint can be shown using the query.

It should include one query:

  • ?yoast_meta=true/false: this query should override the setting.

In the future, @frontity/yoast can add params: { yoast: true } to the settings of @frontity/wp-source to make sure it always gets the yoast meta.

If Yoast plugin is not active (class WPSEO_Frontend) it should warn the user that the plugin is active but not working. Something like Plugin not working because Yoast SEO plugin is not active.

Settings:

  • active: boolean (default: true)

Activation:

  • create frontity_yoast_meta settings if they don’t exist.

Deactivation:

  • nothing

Uninstall:

  • delete frontity_yoast_meta settings.
1 Like