Skip to content

Commit 0149621

Browse files
committed
Add missing private access tags to Embed Optimizer
1 parent 9aec886 commit 0149621

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

plugins/embed-optimizer/helper.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Add hooks.
1717
*
1818
* @since 0.2.0
19+
* @access private
1920
*/
2021
function embed_optimizer_add_hooks(): void {
2122
add_action( 'wp_head', 'embed_optimizer_render_generator' );
@@ -28,6 +29,7 @@ function embed_optimizer_add_hooks(): void {
2829
* Adds hooks for when the Optimization Detective logic is not running.
2930
*
3031
* @since 0.3.0
32+
* @access private
3133
*/
3234
function embed_optimizer_add_non_optimization_detective_hooks(): void {
3335
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 {
3941
* Initializes Embed Optimizer when Optimization Detective has loaded.
4042
*
4143
* @since 0.3.0
44+
* @access private
4245
*
4346
* @param string $optimization_detective_version Current version of the optimization detective plugin.
4447
*/
@@ -70,6 +73,7 @@ static function (): void {
7073
* Registers the tag visitor for embeds.
7174
*
7275
* @since 0.2.0
76+
* @access private
7377
*
7478
* @param OD_Tag_Visitor_Registry $registry Tag visitor registry.
7579
*/
@@ -83,6 +87,7 @@ function embed_optimizer_register_tag_visitors( OD_Tag_Visitor_Registry $registr
8387
* Filters additional properties for the element item schema for Optimization Detective.
8488
*
8589
* @since 0.3.0
90+
* @access private
8691
*
8792
* @param array<string, array{type: string}> $additional_properties Additional properties.
8893
* @return array<string, array{type: string}> Additional properties.
@@ -114,6 +119,7 @@ function embed_optimizer_add_element_item_schema_properties( array $additional_p
114119
* Filters the list of Optimization Detective extension module URLs to include the extension for Embed Optimizer.
115120
*
116121
* @since 0.3.0
122+
* @access private
117123
*
118124
* @param string[]|mixed $extension_module_urls Extension module URLs.
119125
* @return string[] Extension module URLs.
@@ -132,6 +138,7 @@ function embed_optimizer_filter_extension_module_urls( $extension_module_urls ):
132138
* This ensures that the module for handling embeds is only loaded when there is an embed on the page.
133139
*
134140
* @since 0.3.0
141+
* @access private
135142
*
136143
* @param string|mixed $html The oEmbed HTML.
137144
* @return string Unchanged oEmbed HTML.
@@ -151,6 +158,7 @@ function embed_optimizer_filter_oembed_html_to_detect_embed_presence( $html ): s
151158
* Lazy load any script tags.
152159
*
153160
* @since 0.1.0
161+
* @access private
154162
*
155163
* @param string|mixed $html The oEmbed HTML.
156164
* @return string Filtered oEmbed HTML.
@@ -170,6 +178,7 @@ function embed_optimizer_filter_oembed_html_to_lazy_load( $html ): string {
170178
* Applies changes to HTML in the supplied tag processor to lazy-load the embed.
171179
*
172180
* @since 0.2.0
181+
* @access private
173182
*
174183
* phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.Missing -- The exception is caught.
175184
*
@@ -319,6 +328,7 @@ function embed_optimizer_update_markup( WP_HTML_Tag_Processor $html_processor, b
319328
* Load an embed's scripts when it approaches the viewport using an IntersectionObserver.
320329
*
321330
* @since 0.1.0
331+
* @access private
322332
*/
323333
function embed_optimizer_lazy_load_scripts(): void {
324334
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 {
330340
* Load an embed's scripts when it approaches the viewport using an IntersectionObserver.
331341
*
332342
* @since 0.2.0
343+
* @access private
333344
*/
334345
function embed_optimizer_get_lazy_load_script(): string {
335346
$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 {
345356
* Prints the Optimization Detective installation notices.
346357
*
347358
* @since 0.2.0
359+
* @access private
348360
*
349361
* @param string $plugin_file Plugin file.
350362
*/
@@ -424,6 +436,7 @@ function embed_optimizer_print_row_meta_install_notice( string $plugin_file ): v
424436
* See {@see 'wp_head'}.
425437
*
426438
* @since 0.1.0
439+
* @access private
427440
*/
428441
function embed_optimizer_render_generator(): void {
429442
// Use the plugin slug as it is immutable.
@@ -434,6 +447,7 @@ function embed_optimizer_render_generator(): void {
434447
* Gets the path to a script or stylesheet.
435448
*
436449
* @since 0.4.0
450+
* @access private
437451
*
438452
* @param string $src_path Source path, relative to plugin root.
439453
* @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

Comments
 (0)