Skip to content

Commit

Permalink
Only do file exists check if in admin or WP-CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Mar 22, 2024
1 parent 3aae425 commit ae07548
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/optimization-detective/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
return;
}

if ( ! file_exists( __DIR__ . '/detection/web-vitals.asset.php' ) ) {
if (
( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) &&
! file_exists( __DIR__ . '/detection/web-vitals.asset.php' )
) {
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
trigger_error(
esc_html(
Expand Down

0 comments on commit ae07548

Please sign in to comment.