16
16
* Add hooks.
17
17
*
18
18
* @since 0.2.0
19
+ * @access private
19
20
*/
20
21
function embed_optimizer_add_hooks (): void {
21
22
add_action ( 'wp_head ' , 'embed_optimizer_render_generator ' );
@@ -28,6 +29,7 @@ function embed_optimizer_add_hooks(): void {
28
29
* Adds hooks for when the Optimization Detective logic is not running.
29
30
*
30
31
* @since 0.3.0
32
+ * @access private
31
33
*/
32
34
function embed_optimizer_add_non_optimization_detective_hooks (): void {
33
35
if ( false === has_action ( 'od_register_tag_visitors ' , 'embed_optimizer_register_tag_visitors ' ) ) {
@@ -39,6 +41,7 @@ function embed_optimizer_add_non_optimization_detective_hooks(): void {
39
41
* Initializes Embed Optimizer when Optimization Detective has loaded.
40
42
*
41
43
* @since 0.3.0
44
+ * @access private
42
45
*
43
46
* @param string $optimization_detective_version Current version of the optimization detective plugin.
44
47
*/
@@ -70,6 +73,7 @@ static function (): void {
70
73
* Registers the tag visitor for embeds.
71
74
*
72
75
* @since 0.2.0
76
+ * @access private
73
77
*
74
78
* @param OD_Tag_Visitor_Registry $registry Tag visitor registry.
75
79
*/
@@ -83,6 +87,7 @@ function embed_optimizer_register_tag_visitors( OD_Tag_Visitor_Registry $registr
83
87
* Filters additional properties for the element item schema for Optimization Detective.
84
88
*
85
89
* @since 0.3.0
90
+ * @access private
86
91
*
87
92
* @param array<string, array{type: string}> $additional_properties Additional properties.
88
93
* @return array<string, array{type: string}> Additional properties.
@@ -114,6 +119,7 @@ function embed_optimizer_add_element_item_schema_properties( array $additional_p
114
119
* Filters the list of Optimization Detective extension module URLs to include the extension for Embed Optimizer.
115
120
*
116
121
* @since 0.3.0
122
+ * @access private
117
123
*
118
124
* @param string[]|mixed $extension_module_urls Extension module URLs.
119
125
* @return string[] Extension module URLs.
@@ -132,6 +138,7 @@ function embed_optimizer_filter_extension_module_urls( $extension_module_urls ):
132
138
* This ensures that the module for handling embeds is only loaded when there is an embed on the page.
133
139
*
134
140
* @since 0.3.0
141
+ * @access private
135
142
*
136
143
* @param string|mixed $html The oEmbed HTML.
137
144
* @return string Unchanged oEmbed HTML.
@@ -151,6 +158,7 @@ function embed_optimizer_filter_oembed_html_to_detect_embed_presence( $html ): s
151
158
* Lazy load any script tags.
152
159
*
153
160
* @since 0.1.0
161
+ * @access private
154
162
*
155
163
* @param string|mixed $html The oEmbed HTML.
156
164
* @return string Filtered oEmbed HTML.
@@ -170,6 +178,7 @@ function embed_optimizer_filter_oembed_html_to_lazy_load( $html ): string {
170
178
* Applies changes to HTML in the supplied tag processor to lazy-load the embed.
171
179
*
172
180
* @since 0.2.0
181
+ * @access private
173
182
*
174
183
* phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.Missing -- The exception is caught.
175
184
*
@@ -319,6 +328,7 @@ function embed_optimizer_update_markup( WP_HTML_Tag_Processor $html_processor, b
319
328
* Load an embed's scripts when it approaches the viewport using an IntersectionObserver.
320
329
*
321
330
* @since 0.1.0
331
+ * @access private
322
332
*/
323
333
function embed_optimizer_lazy_load_scripts (): void {
324
334
wp_print_inline_script_tag ( embed_optimizer_get_lazy_load_script (), array ( 'type ' => 'module ' ) );
@@ -330,6 +340,7 @@ function embed_optimizer_lazy_load_scripts(): void {
330
340
* Load an embed's scripts when it approaches the viewport using an IntersectionObserver.
331
341
*
332
342
* @since 0.2.0
343
+ * @access private
333
344
*/
334
345
function embed_optimizer_get_lazy_load_script (): string {
335
346
$ script = file_get_contents ( __DIR__ . '/ ' . embed_optimizer_get_asset_path ( 'lazy-load.js ' ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- It's a local filesystem path not a remote request.
@@ -345,6 +356,7 @@ function embed_optimizer_get_lazy_load_script(): string {
345
356
* Prints the Optimization Detective installation notices.
346
357
*
347
358
* @since 0.2.0
359
+ * @access private
348
360
*
349
361
* @param string $plugin_file Plugin file.
350
362
*/
@@ -424,6 +436,7 @@ function embed_optimizer_print_row_meta_install_notice( string $plugin_file ): v
424
436
* See {@see 'wp_head'}.
425
437
*
426
438
* @since 0.1.0
439
+ * @access private
427
440
*/
428
441
function embed_optimizer_render_generator (): void {
429
442
// Use the plugin slug as it is immutable.
@@ -434,6 +447,7 @@ function embed_optimizer_render_generator(): void {
434
447
* Gets the path to a script or stylesheet.
435
448
*
436
449
* @since 0.4.0
450
+ * @access private
437
451
*
438
452
* @param string $src_path Source path, relative to plugin root.
439
453
* @param string|null $min_path Minified path. If not supplied, then '.min' is injected before the file extension in the source path.
0 commit comments