Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/wp-rocket/inc/ThirdParty/Plugins/SEO/SEOPress.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + namespace WP_Rocket\ThirdParty\Plugins\SEO;
4 +
5 + use WP_Rocket\Admin\Options_Data;
6 + use WP_Rocket\Event_Management\Subscriber_Interface;
7 +
8 + class SEOPress implements Subscriber_Interface {
9 +
10 + /**
11 + * Option instance.
12 + *
13 + * @var Options_Data
14 + */
15 + protected $option;
16 +
17 + /**
18 + * Instantiate class.
19 + *
20 + * @param Options_Data $option Option instance.
21 + */
22 + public function __construct( Options_Data $option ) {
23 + $this->option = $option;
24 + }
25 +
26 + /**
27 + * Subscribed events.
28 + */
29 + public static function get_subscribed_events() {
30 + if ( ! function_exists( 'seopress_get_toggle_option' ) || 1 !== (int) seopress_get_toggle_option( 'xml-sitemap' ) ) {
31 + return [];
32 + }
33 +
34 + if ( ! method_exists( seopress_get_service( 'SitemapOption' ), 'isEnabled' ) || 1 !== (int) seopress_get_service( 'SitemapOption' )->isEnabled() ) {
35 + return [];
36 + }
37 +
38 + return [
39 + 'rocket_sitemap_preload_list' => [ 'add_seopress_sitemap', 15 ],
40 + ];
41 + }
42 +
43 + /**
44 + * Add SEOPress sitemap URL to the sitemaps to preload
45 + *
46 + * @param array $sitemaps Sitemaps to preload.
47 + * @return array Updated Sitemaps to preload
48 + */
49 + public function add_seopress_sitemap( $sitemaps ) {
50 + $sitemaps[] = get_home_url() . '/sitemaps.xml';
51 +
52 + return $sitemaps;
53 + }
54 + }
55 +