Introductions
Is for showing introductions to a user, on Yoast admin pages. Based on plugin version, page, user capabilities and whether the user has seen it already.
Introduction_Interfacedefines what data is neededidas unique identifierpluginandversionto determine if the introduction is new (version > plugin version)pagesto be able to only show on certain Yoast admin pagescapabilitiesto be able to only show for certain users
Introductions_Collectoruses that data to determine whether an introduction should be "shown" to a user- uses the
wpseo_introductionsfilter to be extendable from our other plugins - uses
Introductions_Seen_Repositoryto get the data to determine if the user saw an introduction already
- uses the
Introductions_Seen_Repositoryis the doorway whether a user has seen an introduction or not- uses the
_yoast_introductionsuser metadata
- uses the
Introduction_BucketandIntroduction_Itemare used by the collector to get an arrayIntroductions_Integrationruns on the Yoast Admin pages and loads the assets- only loads on our Yoast admin pages, but never on our installation success pages as to not disturb onboarding
- only loads assets if there is an introduction to show
js/src/introductionsholds the JSwpseoIntroductionsis the localized script to transfer data from PHP to JScss/src/ai-generator.cssholds the CSS
Inside JS, register the modal content via window.YoastSEO._registerIntroductionComponent, which takes a
id and a Component. The id needs to be the same as the id in the Introduction_Interface.
The action yoast.introductions.ready can be used to know whether the registration function is available and ready for
use.