Skip to content

Commit

Permalink
Boost: Remove URL override from image guide (#39874)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Petrov <peter.petrov89@gmail.com>
  • Loading branch information
haqadn and dilirity authored Oct 23, 2024
1 parent 2599f56 commit c3e2ec5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions projects/plugins/boost/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
// PhanImpossibleTypeComparison : 1 occurrence
// PhanImpossibleTypeComparisonInGlobalScope : 1 occurrence
// PhanPluginNeverReturnFunction : 1 occurrence
// PhanPluginSimplifyExpressionBool : 1 occurrence
// PhanRedefineFunction : 1 occurrence
// PhanTypeComparisonToArray : 1 occurrence
// PhanTypeInvalidUnaryOperandIncOrDec : 1 occurrence
Expand Down Expand Up @@ -62,7 +61,6 @@
'app/lib/minify/functions-helpers.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchDefault', 'PhanUndeclaredClassMethod', 'PhanUndeclaredClassReference', 'PhanUndeclaredConstant'],
'app/lib/minify/functions-service.php' => ['PhanImpossibleTypeComparison', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginNeverReturnFunction', 'PhanPluginUseReturnValueInternalKnown', 'PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition', 'PhanTypeMismatchArgumentInternal', 'PhanTypeMismatchArgumentNullableInternal'],
'app/modules/Modules_Setup.php' => ['PhanTypeMismatchPropertyDefault'],
'app/modules/image-guide/Image_Guide.php' => ['PhanPluginSimplifyExpressionBool'],
'app/modules/image-guide/Image_Guide_Proxy.php' => ['PhanPluginDuplicateConditionalNullCoalescing'],
'app/modules/image-size-analysis/data-sync/Image_Size_Analysis_Action_Fix.php' => ['PhanPossiblyUndeclaredVariable', 'PhanRedundantCondition'],
'app/modules/optimizations/critical-css/CSS_Proxy.php' => ['PhanPluginDuplicateConditionalNullCoalescing'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
class Image_Guide implements Pluggable {

public function setup() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$override = isset( $_GET['jb-debug-ig'] );

if ( is_admin() || is_user_logged_in() || current_user_can( 'manage_options' ) ) {
if ( is_user_logged_in() && current_user_can( 'manage_options' ) ) {
Image_Guide_Proxy::init();
}

// Show the UI only when the user is logged in, with sufficient permissions and isn't looking at the dashboard.
if ( true !== $override && ( is_admin() || ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) ) {
if ( is_admin() || ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
return;
}

Expand Down
4 changes: 4 additions & 0 deletions projects/plugins/boost/changelog/remove-image-guide-override
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: removed

Image Guide: Remove URL parameter based override.

0 comments on commit c3e2ec5

Please sign in to comment.