Yoast\WP\SEO\MyYoast_Client\User_Interface
MyYoast_Cleanup_Integration{}└─ Integration_Interface
Handles cleanup of all MyYoast client data on plugin uninstall or through Yoast Test Helper.
Хуков нет.
Использование
$MyYoast_Cleanup_Integration = new MyYoast_Cleanup_Integration(); // use class methods
Методы
- public __construct( MyYoast_Client_Cleanup $cleanup )
- public cleanup()
- public static get_conditionals()
- public register_hooks()
Код MyYoast_Cleanup_Integration{} MyYoast Cleanup Integration{} Yoast 27.7
class MyYoast_Cleanup_Integration implements Integration_Interface {
/**
* The cleanup service.
*
* @var MyYoast_Client_Cleanup
*/
private $cleanup;
/**
* MyYoast_Cleanup_Integration constructor.
*
* @param MyYoast_Client_Cleanup $cleanup The cleanup service.
*/
public function __construct( MyYoast_Client_Cleanup $cleanup ) {
$this->cleanup = $cleanup;
}
/**
* Returns the conditionals based on which this integration should be loaded.
*
* @return array<string> The array of conditionals.
*/
public static function get_conditionals() {
return [ MyYoast_Connection_Conditional::class ];
}
/**
* Registers hooks.
*
* @return void
*/
public function register_hooks(): void {
\add_action( 'uninstall_' . \WPSEO_BASENAME, [ $this, 'cleanup' ] );
/**
* Public action that wipes all local MyYoast OAuth client state
* (registered client, site/user tokens, key pairs, OIDC/JWKS/DPoP caches).
*
* Intended for development tooling that needs to reset state without
* uninstalling the plugin. The handler is the same one that runs on
* uninstall, so the effect is identical.
*
* @internal
*/
\add_action( 'wpseo_myyoast_clear_client_state', [ $this, 'cleanup' ] );
}
/**
* Cleans up all MyYoast client data.
*
* @return void
*/
public function cleanup(): void {
$this->cleanup->execute();
}
}