PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 27.7
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v27.7
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / plugins-tab / user-interface / plugins-tab-integration.php

plugins-tab-integration.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 27.7, at src/plugins-tab/user-interface/plugins-tab-integration.php

60 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4 namespace Yoast\WP\SEO\Plugins_Tab\User_Interface;
5
6 use Yoast\WP\SEO\Conditionals\Admin_Conditional;
7 use Yoast\WP\SEO\Integrations\Integration_Interface;
8 use Yoast\WP\SEO\Plugins_Tab\Application\Plugins_List_Handler;
9
10 /**
11 * Registers the Yoast tab on the WordPress Plugins screen.
12 *
13 * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
14 */
15 class Plugins_Tab_Integration implements Integration_Interface {
16
17 /**
18 * The plugins list handler.
19 *
20 * @var Plugins_List_Handler
21 */
22 private $handler;
23
24 /**
25 * Constructs the integration.
26 *
27 * @param Plugins_List_Handler $handler The plugins list handler.
28 */
29 public function __construct( Plugins_List_Handler $handler ) {
30 $this->handler = $handler;
31 }
32
33 /**
34 * Returns the conditionals based on which this loadable should be active.
35 *
36 * @return array<string> The conditionals.
37 */
38 public static function get_conditionals(): array {
39 return [
40 Admin_Conditional::class,
41 ];
42 }
43
44 /**
45 * Registers the hooks for the Yoast plugins tab.
46 *
47 * @return void
48 */
49 public function register_hooks(): void {
50 global $wp_version;
51
52 if ( \version_compare( $wp_version, '7.0-alpha0', '<' ) ) {
53 return;
54 }
55
56 \add_filter( 'plugins_list', [ $this->handler, 'filter_plugins_list' ] );
57 \add_filter( 'plugins_list_status_text', [ $this->handler, 'get_status_text' ], 10, 3 );
58 }
59 }
60