Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boost: Remove URL override from image guide #39874

Merged
merged 6 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading