Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/lightbox-trigger-button-visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
SohamPatel46 authored Jan 22, 2025
2 parents 0c57433 + 6803bc9 commit d1cc1f5
Show file tree
Hide file tree
Showing 79 changed files with 1,024 additions and 98 deletions.
5 changes: 3 additions & 2 deletions plugins/auto-sizes/auto-sizes.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* @package auto-sizes
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

// Define the constant.
if ( defined( 'IMAGE_AUTO_SIZES_VERSION' ) ) {
Expand Down
2 changes: 2 additions & 0 deletions plugins/auto-sizes/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* @since 1.0.0
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Displays the HTML generator tag for the plugin.
Expand Down
2 changes: 2 additions & 0 deletions plugins/dominant-color-images/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
* @since 1.0.0
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Add the dominant color metadata to the attachment.
Expand Down
5 changes: 3 additions & 2 deletions plugins/dominant-color-images/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* @package dominant-color-images
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

// Define required constants.
if ( defined( 'DOMINANT_COLOR_IMAGES_VERSION' ) ) {
Expand Down
5 changes: 3 additions & 2 deletions plugins/embed-optimizer/class-embed-optimizer-tag-visitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.2.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Tag visitor that optimizes embeds.
Expand Down
2 changes: 2 additions & 0 deletions plugins/embed-optimizer/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* @package embed-optimizer
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Add hooks.
Expand Down
5 changes: 3 additions & 2 deletions plugins/embed-optimizer/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* @package embed-optimizer
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.1.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Tag visitor that optimizes elements with background-image styles.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.1.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Tag visitor that optimizes IMG tags.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.1.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Tag visitor that optimizes image tags.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
* @since 0.2.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Image Prioritizer: Image_Prioritizer_Video_Tag_Visitor class
Expand Down
2 changes: 2 additions & 0 deletions plugins/image-prioritizer/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* @since 0.1.0
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Initializes Image Prioritizer when Optimization Detective has loaded.
Expand Down
2 changes: 2 additions & 0 deletions plugins/image-prioritizer/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
* @since 0.1.0
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

add_action( 'od_init', 'image_prioritizer_init' );
5 changes: 3 additions & 2 deletions plugins/image-prioritizer/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
* @package image-prioritizer
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.1.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Exception thrown when failing to validate URL Metrics data.
Expand Down
5 changes: 3 additions & 2 deletions plugins/optimization-detective/class-od-element.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.7.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Data for a single element in a URL Metric.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.1.1
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Extension to WP_HTML_Tag_Processor that supports injecting HTML and obtaining XPath for the current tag.
Expand Down
5 changes: 3 additions & 2 deletions plugins/optimization-detective/class-od-link-collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.3.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Collection for links added to the document.
Expand Down
5 changes: 3 additions & 2 deletions plugins/optimization-detective/class-od-strict-url-metric.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.6.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Representation of the measurements taken from a single client's visit to a specific URL without additionalProperties allowed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.4.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Context for tag visitors invoked for each tag while walking over a document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.3.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Registry for tag visitors invoked for each tag while walking over a document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.1.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Collection of URL groups according to the breakpoints.
Expand Down
5 changes: 3 additions & 2 deletions plugins/optimization-detective/class-od-url-metric-group.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.1.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* URL Metrics grouped by viewport according to breakpoints.
Expand Down
5 changes: 3 additions & 2 deletions plugins/optimization-detective/class-od-url-metric.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* @since 0.1.0
*/

// Exit if accessed directly.
// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit;
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Representation of the measurements taken from a single client's visit to a specific URL.
Expand Down
2 changes: 2 additions & 0 deletions plugins/optimization-detective/detection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
* @since 0.1.0
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Obtains the ID for a post related to this response so that page caches can be told to invalidate their cache.
Expand Down
17 changes: 16 additions & 1 deletion plugins/optimization-detective/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
* @since 0.1.0
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Initializes extensions for Optimization Detective.
*
* @since 0.7.0
* @access private
*/
function od_initialize_extensions(): void {
/**
Expand All @@ -29,6 +32,9 @@ function od_initialize_extensions(): void {
/**
* Generates a media query for the provided minimum and maximum viewport widths.
*
* This helper function is available for extensions to leverage when manually printing STYLE rules via
* {@see OD_HTML_Tag_Processor::append_head_html()} or {@see OD_HTML_Tag_Processor::append_body_html()}
*
* @since 0.7.0
*
* @param int|null $minimum_viewport_width Minimum viewport width.
Expand Down Expand Up @@ -59,16 +65,25 @@ function od_generate_media_query( ?int $minimum_viewport_width, ?int $maximum_vi
* See {@see 'wp_head'}.
*
* @since 0.1.0
* @access private
*/
function od_render_generator_meta_tag(): void {
// Use the plugin slug as it is immutable.
echo '<meta name="generator" content="optimization-detective ' . esc_attr( OPTIMIZATION_DETECTIVE_VERSION ) . '">' . "\n";
$content = 'optimization-detective ' . OPTIMIZATION_DETECTIVE_VERSION;

// Indicate that the plugin will not be doing anything because the REST API is unavailable.
if ( od_is_rest_api_unavailable() ) {
$content .= '; rest_api_unavailable';
}

echo '<meta name="generator" content="' . esc_attr( $content ) . '">' . "\n";
}

/**
* Gets the path to a script or stylesheet.
*
* @since 0.9.0
* @access private
*
* @param string $src_path Source path, relative to plugin root.
* @param string|null $min_path Minified path. If not supplied, then '.min' is injected before the file extension in the source path.
Expand Down
Loading

0 comments on commit d1cc1f5

Please sign in to comment.