Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/wp-rocket/inc/ThirdParty/ServiceProvider.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
declare(strict_types=1);
3
+
4
+
namespace WP_Rocket\ThirdParty;
5
+
6
+
use WP_Rocket\Dependencies\League\Container\Argument\Literal\StringArgument;
7
+
use WP_Rocket\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
8
+
use WP_Rocket\Subscriber\Third_Party\Plugins\Images\Webp\EWWW_Subscriber;
9
+
use WP_Rocket\Subscriber\Third_Party\Plugins\Images\Webp\Imagify_Subscriber;
10
+
use WP_Rocket\Subscriber\Third_Party\Plugins\Images\Webp\Optimus_Subscriber;
11
+
use WP_Rocket\Subscriber\Third_Party\Plugins\Images\Webp\ShortPixel_Subscriber;
12
+
use WP_Rocket\Subscriber\Third_Party\Plugins\Mobile_Subscriber;
13
+
use WP_Rocket\Subscriber\Third_Party\Plugins\NGG_Subscriber;
14
+
use WP_Rocket\Subscriber\Third_Party\Plugins\SyntaxHighlighter_Subscriber;
15
+
use WP_Rocket\ThirdParty\Plugins\Ads\Adthrive;
16
+
use WP_Rocket\ThirdParty\Plugins\ConvertPlug;
17
+
use WP_Rocket\ThirdParty\Plugins\Cookie\Termly;
18
+
use WP_Rocket\ThirdParty\Plugins\Ecommerce\BigCommerce;
19
+
use WP_Rocket\ThirdParty\Plugins\Ecommerce\WooCommerceSubscriber;
20
+
use WP_Rocket\ThirdParty\Plugins\I18n\TranslatePress;
21
+
use WP_Rocket\ThirdParty\Plugins\I18n\WPML;
22
+
use WP_Rocket\ThirdParty\Plugins\InlineRelatedPosts;
23
+
use WP_Rocket\ThirdParty\Plugins\ModPagespeed;
24
+
use WP_Rocket\ThirdParty\Plugins\Optimization\AMP;
25
+
use WP_Rocket\ThirdParty\Plugins\Optimization\Autoptimize;
26
+
use WP_Rocket\ThirdParty\Plugins\Optimization\Ezoic;
27
+
use WP_Rocket\ThirdParty\Plugins\Optimization\WPMeteor;
28
+
use WP_Rocket\ThirdParty\Plugins\PageBuilder\BeaverBuilder;
29
+
use WP_Rocket\ThirdParty\Plugins\PageBuilder\Elementor;
30
+
use WP_Rocket\ThirdParty\Plugins\PDFEmbedder;
31
+
use WP_Rocket\ThirdParty\Plugins\PWA;
32
+
use WP_Rocket\ThirdParty\Plugins\RevolutionSlider;
33
+
use WP_Rocket\ThirdParty\Plugins\Security\WordFenceCompatibility;
34
+
use WP_Rocket\ThirdParty\Plugins\SEO\Yoast;
35
+
use WP_Rocket\ThirdParty\Plugins\SimpleCustomCss;
36
+
use WP_Rocket\ThirdParty\Plugins\Smush;
37
+
use WP_Rocket\ThirdParty\Plugins\TheEventsCalendar;
38
+
use WP_Rocket\ThirdParty\Plugins\ThirstyAffiliates;
39
+
use WP_Rocket\ThirdParty\Plugins\UnlimitedElements;
40
+
use WP_Rocket\ThirdParty\Plugins\CDN\{Cloudflare, CloudflareFacade};
41
+
use WP_Rocket\ThirdParty\Plugins\Jetpack;
42
+
use WP_Rocket\ThirdParty\Plugins\WPGeotargeting;
43
+
use WP_Rocket\ThirdParty\Plugins\ContactForm7;
44
+
use WP_Rocket\ThirdParty\Plugins\SEO\RankMathSEO;
45
+
use WP_Rocket\ThirdParty\Plugins\SEO\AllInOneSEOPack;
46
+
use WP_Rocket\ThirdParty\Plugins\SEO\SEOPress;
47
+
use WP_Rocket\ThirdParty\Plugins\SEO\TheSEOFramework;
48
+
use WP_Rocket\ThirdParty\Plugins\Optimization\RocketLazyLoad;
49
+
use WP_Rocket\ThirdParty\Plugins\Optimization\Perfmatters;
50
+
use WP_Rocket\ThirdParty\Plugins\Optimization\RapidLoad;
51
+
use WP_Rocket\ThirdParty\Plugins\I18n\Weglot;
52
+
53
+
/**
54
+
* Service provider for WP Rocket third party compatibility
55
+
*/
56
+
class ServiceProvider extends AbstractServiceProvider {
57
+
/**
58
+
* Array of services provided by this service provider
59
+
*
60
+
* @var array
61
+
*/
62
+
protected $provides = [
63
+
'mobile_subscriber',
64
+
'woocommerce_subscriber',
65
+
'syntaxhighlighter_subscriber',
66
+
'elementor_subscriber',
67
+
'ngg_subscriber',
68
+
'smush_subscriber',
69
+
'imagify_webp_subscriber',
70
+
'shortpixel_webp_subscriber',
71
+
'ewww_webp_subscriber',
72
+
'optimus_webp_subscriber',
73
+
'bigcommerce_subscriber',
74
+
'beaverbuilder_subscriber',
75
+
'amp_subscriber',
76
+
'simple_custom_css',
77
+
'pdfembedder',
78
+
'mod_pagespeed',
79
+
'adthrive',
80
+
'autoptimize',
81
+
'wp-meteor',
82
+
'revolution_slider_subscriber',
83
+
'wordfence_subscriber',
84
+
'ezoic',
85
+
'pwa',
86
+
'convertplug',
87
+
'unlimited_elements',
88
+
'inline_related_posts',
89
+
'jetpack',
90
+
'rank_math_seo',
91
+
'all_in_one_seo_pack',
92
+
'seopress',
93
+
'the_seo_framework',
94
+
'wpml',
95
+
'cloudflare_plugin_facade',
96
+
'cloudflare_plugin_subscriber',
97
+
'rocket_lazy_load',
98
+
'the_events_calendar',
99
+
'perfmatters',
100
+
'rapidload',
101
+
'translatepress',
102
+
'wpgeotargeting',
103
+
'weglot',
104
+
'contactform7',
105
+
'termly_subscriber',
106
+
];
107
+
108
+
/**
109
+
* Check if the service provider provides a specific service.
110
+
*
111
+
* @param string $id The id of the service.
112
+
*
113
+
* @return bool
114
+
*/
115
+
public function provides( string $id ): bool {
116
+
return in_array( $id, $this->provides, true );
117
+
}
118
+
119
+
/**
120
+
* Registers the subscribers in the container
121
+
*
122
+
* @since 3.3
123
+
*
124
+
* @return void
125
+
*/
126
+
public function register(): void {
127
+
$this->getContainer()->addShared( 'mobile_subscriber', Mobile_Subscriber::class );
128
+
$this->getContainer()->addShared( 'elementor_subscriber', Elementor::class )
129
+
->addArguments(
130
+
[
131
+
'options',
132
+
rocket_direct_filesystem(),
133
+
'delay_js_html',
134
+
]
135
+
);
136
+
$this->getContainer()->addShared( 'woocommerce_subscriber', WooCommerceSubscriber::class )
137
+
->addArgument( 'delay_js_html' );
138
+
$this->getContainer()->addShared( 'syntaxhighlighter_subscriber', SyntaxHighlighter_Subscriber::class );
139
+
$this->getContainer()->addShared( 'ngg_subscriber', NGG_Subscriber::class );
140
+
$this->getContainer()->addShared( 'smush_subscriber', Smush::class )
141
+
->addArguments(
142
+
[
143
+
'options_api',
144
+
'options',
145
+
]
146
+
);
147
+
$this->getContainer()->addShared( 'imagify_webp_subscriber', Imagify_Subscriber::class )
148
+
->addArgument( 'options' );
149
+
$this->getContainer()->addShared( 'shortpixel_webp_subscriber', ShortPixel_Subscriber::class )
150
+
->addArgument( 'options' );
151
+
$this->getContainer()->addShared( 'ewww_webp_subscriber', EWWW_Subscriber::class )
152
+
->addArgument( 'options' );
153
+
$this->getContainer()->addShared( 'optimus_webp_subscriber', Optimus_Subscriber::class );
154
+
$this->getContainer()->addShared( 'bigcommerce_subscriber', BigCommerce::class );
155
+
$this->getContainer()->addShared( 'beaverbuilder_subscriber', BeaverBuilder::class );
156
+
$this->getContainer()->addShared( 'amp_subscriber', AMP::class )
157
+
->addArgument( 'cdn_subscriber' );
158
+
$this->getContainer()->addShared( 'simple_custom_css', SimpleCustomCss::class )
159
+
->addArguments(
160
+
[
161
+
new StringArgument( rocket_get_constant( 'WP_ROCKET_CACHE_BUSTING_PATH', '' ) ),
162
+
new StringArgument( rocket_get_constant( 'WP_ROCKET_CACHE_BUSTING_URL', '' ) ),
163
+
]
164
+
);
165
+
$this->getContainer()->addShared( 'pdfembedder', PDFEmbedder::class );
166
+
$this->getContainer()->addShared( 'mod_pagespeed', ModPagespeed::class );
167
+
$this->getContainer()->addShared( 'adthrive', Adthrive::class );
168
+
$this->getContainer()->addShared( 'autoptimize', Autoptimize::class )
169
+
->addArgument( 'options' );
170
+
$this->getContainer()->addShared( 'wp-meteor', WPMeteor::class );
171
+
$this->getContainer()->addShared( 'revolution_slider_subscriber', RevolutionSlider::class );
172
+
$this->getContainer()->addShared( 'wordfence_subscriber', WordFenceCompatibility::class );
173
+
$this->getContainer()->addShared( 'ezoic', Ezoic::class );
174
+
$this->getContainer()->addShared( 'thirstyaffiliates', ThirstyAffiliates::class );
175
+
$this->getContainer()->addShared( 'pwa', PWA::class );
176
+
$this->getContainer()->addShared( 'yoast_seo', Yoast::class );
177
+
$this->getContainer()->addShared( 'convertplug', ConvertPlug::class );
178
+
$this->getContainer()->addShared( 'unlimited_elements', UnlimitedElements::class );
179
+
$this->getContainer()->addShared( 'inline_related_posts', InlineRelatedPosts::class );
180
+
$this->getContainer()->addShared( 'wpml', WPML::class );
181
+
$this->getContainer()->add( 'cloudflare_plugin_facade', CloudflareFacade::class );
182
+
$this->getContainer()->addShared( 'cloudflare_plugin_subscriber', Cloudflare::class )
183
+
->addArguments(
184
+
[
185
+
'options',
186
+
'options_api',
187
+
'beacon',
188
+
'cloudflare_plugin_facade',
189
+
]
190
+
);
191
+
$this->getContainer()->addShared( 'jetpack', Jetpack::class )
192
+
->addArgument( 'options' );
193
+
$this->getContainer()->addShared( 'convertplug', ConvertPlug::class );
194
+
$this->getContainer()->addShared( 'rank_math_seo', RankMathSEO::class );
195
+
$this->getContainer()->addShared( 'all_in_one_seo_pack', AllInOneSEOPack::class )
196
+
->addArgument( 'options' );
197
+
$this->getContainer()->addShared( 'seopress', SEOPress::class )
198
+
->addArgument( 'options' );
199
+
$this->getContainer()->addShared( 'the_seo_framework', TheSEOFramework::class )
200
+
->addArgument( 'options' );
201
+
$this->getContainer()->addShared( 'rocket_lazy_load', RocketLazyLoad::class );
202
+
$this->getContainer()->addShared( 'the_events_calendar', TheEventsCalendar::class );
203
+
$this->getContainer()->addShared( 'perfmatters', Perfmatters::class );
204
+
$this->getContainer()->addShared( 'rapidload', RapidLoad::class );
205
+
$this->getContainer()->addShared( 'weglot', Weglot::class );
206
+
$this->getContainer()->addShared( 'translatepress', TranslatePress::class );
207
+
$this->getContainer()->addShared( 'wpgeotargeting', WPGeotargeting::class );
208
+
$this->getContainer()->addShared( 'contactform7', ContactForm7::class );
209
+
$this->getContainer()->addShared( 'termly_subscriber', Termly::class );
210
+
}
211
+
}
212
+