Skip to content
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
4 changes: 0 additions & 4 deletions projects/packages/analyzer/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@
// # Issue statistics:
// PhanUndeclaredProperty : 25+ occurrences
// PhanTypeMismatchArgument : 8 occurrences
// PhanPossiblyUndeclaredVariable : 7 occurrences
// PhanParamSignatureMismatch : 6 occurrences
// PhanPluginDuplicateConditionalNullCoalescing : 6 occurrences
// PhanTypeMismatchReturnProbablyReal : 6 occurrences
// PhanUndeclaredClassMethod : 6 occurrences
// PhanUndeclaredMethod : 6 occurrences
// PhanTypeArraySuspiciousNullable : 5 occurrences
// PhanTypeMismatchArgumentNullable : 5 occurrences
// PhanUndeclaredTypeParameter : 4 occurrences
// PhanNonClassMethodCall : 2 occurrences
// PhanPluginDuplicateCatchStatementBody : 2 occurrences
// PhanTypeMismatchDeclaredParam : 2 occurrences
// PhanUndeclaredClassStaticProperty : 2 occurrences
Expand Down Expand Up @@ -49,7 +46,6 @@
'src/api/class-model.php' => ['PhanTypeArraySuspiciousNullable'],
'src/api/class-plugin-downloader.php' => ['PhanPluginDuplicateExpressionAssignmentOperation'],
'src/class-declarations.php' => ['PhanPluginDuplicateCatchStatementBody'],
'src/class-differences.php' => ['PhanNonClassMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullable'],
'src/class-invocations.php' => ['PhanPluginDuplicateCatchStatementBody'],
'src/class-utils.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredMethod', 'PhanUndeclaredProperty', 'PhanUndeclaredTypeParameter'],
'src/class-warnings.php' => ['PhanUndeclaredMethod'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Phan: Address PhanPossiblyUndeclaredVariable violations.
5 changes: 3 additions & 2 deletions projects/packages/analyzer/src/class-differences.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function find( $new_declarations, $prev_declarations, $new_root = null, $
$moved = false;
$moved_with_empty_file = false;
$deprecated = false;
$new_declaration = false;
foreach ( $new_declarations->get() as $new_declaration ) {

if ( $prev_declaration->match( $new_declaration ) ) {
Expand All @@ -56,7 +57,7 @@ public function find( $new_declarations, $prev_declarations, $new_root = null, $
$moved = true;
}
}
$matched = true;
$matched = $new_declaration;
break;
} elseif ( $prev_declaration->partial_match( $new_declaration ) ) {
// TODO this is to catch things like function args changed, method the same
Expand All @@ -69,7 +70,7 @@ public function find( $new_declarations, $prev_declarations, $new_root = null, $
}

// Add differences for any detected deprecations.
if ( $deprecated ) {
if ( $deprecated && $matched ) {
switch ( $new_declaration->type() ) {
case 'method':
$this->add( new Differences\Class_Method_Deprecated( $prev_declaration ) );
Expand Down
3 changes: 1 addition & 2 deletions projects/packages/backup/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
// PhanTypeMismatchReturnProbablyReal : 15+ occurrences
// PhanTypeMismatchReturn : 6 occurrences
// PhanUndeclaredStaticMethod : 2 occurrences
// PhanPossiblyUndeclaredVariable : 1 occurrence

// Currently, file_suppressions and directory_suppressions are the only supported suppressions
'file_suppressions' => [
'src/class-jetpack-backup.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredStaticMethod'],
'src/class-jetpack-backup.php' => ['PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanUndeclaredStaticMethod'],
'src/class-rest-controller.php' => ['PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal'],
],
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Phan: Address PhanPossiblyUndeclaredVariable violations.
5 changes: 1 addition & 4 deletions projects/packages/backup/src/class-jetpack-backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,17 +717,14 @@ public static function get_storage_addon_upsell_slug( $bytes_used, $bytes_availa
return $upsell_products[ $bytes_1tb ];
}

$matched_bytes = $bytes_10gb;
foreach ( $upsell_products as $bytes => $product ) {
if ( $bytes > $additional_bytes_needed ) {
$matched_bytes = $bytes;
break;
}
}

if ( ! $matched_bytes ) {
$matched_bytes = $bytes_10gb;
}

return $upsell_products[ $matched_bytes ];
}

Expand Down
4 changes: 1 addition & 3 deletions projects/packages/connection/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
// PhanDeprecatedFunction : 2 occurrences
// PhanNonClassMethodCall : 2 occurrences
// PhanPluginUnreachableCode : 2 occurrences
// PhanPossiblyUndeclaredVariable : 2 occurrences
// PhanTypeMismatchPropertyDefault : 2 occurrences
// PhanTypeMismatchReturnNullable : 2 occurrences
// PhanTypePossiblyInvalidDimOffset : 2 occurrences
// PhanPluginDuplicateAdjacentStatement : 1 occurrence
// PhanPluginSimplifyExpressionBool : 1 occurrence
// PhanTypeMismatchArgumentNullable : 1 occurrence
// PhanTypeMismatchDeclaredParamNullable : 1 occurrence
// PhanTypeMismatchReturnNullable : 1 occurrence
// PhanUndeclaredClassMethod : 1 occurrence

// Currently, file_suppressions and directory_suppressions are the only supported suppressions
Expand All @@ -40,7 +39,6 @@
'src/class-error-handler.php' => ['PhanTypeMismatchReturnProbablyReal'],
'src/class-heartbeat.php' => ['PhanTypeMismatchPropertyDefault'],
'src/class-manager.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeMismatchArgument', 'PhanTypeMismatchDeclaredParamNullable', 'PhanTypeMismatchDefault', 'PhanTypeMismatchPropertyProbablyReal', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnNullable', 'PhanTypeMismatchReturnProbablyReal'],
'src/class-nonce-handler.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchReturnNullable'],
'src/class-partner-coupon.php' => ['PhanPluginDuplicateConditionalNullCoalescing'],
'src/class-partner.php' => ['PhanTypeMismatchPropertyProbablyReal'],
'src/class-rest-authentication.php' => ['PhanTypeMismatchPropertyDefault', 'PhanTypeMismatchPropertyProbablyReal'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Phan: Address PhanPossiblyUndeclaredVariable violations.
4 changes: 2 additions & 2 deletions projects/packages/connection/src/class-nonce-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public function add( $timestamp, $nonce ) {
// Raw query so we can avoid races: add_option will also update.
$show_errors = $this->db->hide_errors();

$return = false;

// Running `try...finally` to make sure that we re-enable errors in case of an exception.
try {
$old_nonce = $this->db->get_row(
Expand All @@ -105,8 +107,6 @@ public function add( $timestamp, $nonce ) {
'no'
)
);
} else {
$return = false;
}
} finally {
$this->db->show_errors( $show_errors );
Expand Down
6 changes: 2 additions & 4 deletions projects/packages/image-cdn/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
// PhanPluginSimplifyExpressionBool : 6 occurrences
// PhanPluginDuplicateConditionalNullCoalescing : 4 occurrences
// PhanTypeMismatchArgumentProbablyReal : 4 occurrences
// PhanPossiblyUndeclaredVariable : 2 occurrences
// PhanTypeMismatchPropertyProbablyReal : 2 occurrences
// PhanNonClassMethodCall : 1 occurrence
// PhanTypeArraySuspicious : 1 occurrence
// PhanTypeMismatchArgumentNullable : 1 occurrence
// PhanTypeMismatchArgumentNullableInternal : 1 occurrence
// PhanTypeMismatchReturn : 1 occurrence
// PhanTypeMismatchReturnProbablyReal : 1 occurrence
Expand All @@ -28,10 +26,10 @@
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
'file_suppressions' => [
'src/class-image-cdn-image-sizes.php' => ['PhanPluginSimplifyExpressionBool'],
'src/class-image-cdn.php' => ['PhanNonClassMethodCall', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginSimplifyExpressionBool', 'PhanPossiblyUndeclaredVariable', 'PhanTypeArraySuspicious', 'PhanTypeMismatchPropertyProbablyReal', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypePossiblyInvalidDimOffset'],
'src/class-image-cdn.php' => ['PhanNonClassMethodCall', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginSimplifyExpressionBool', 'PhanTypeArraySuspicious', 'PhanTypeMismatchPropertyProbablyReal', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal', 'PhanTypePossiblyInvalidDimOffset'],
'src/compatibility/photon.php' => ['PhanTypeMismatchArgumentNullableInternal'],
'tests/php/Image_CDN_Core_Test.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeObjectUnsetDeclaredProperty'],
'tests/php/Image_CDN_Test.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchPropertyProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredStaticMethod'],
'tests/php/Image_CDN_Test.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeMismatchPropertyProbablyReal', 'PhanUndeclaredMethod', 'PhanUndeclaredStaticMethod'],
],
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.
// (directory_suppressions will currently be ignored by subsequent calls to --save-baseline, but may be preserved in future Phan releases)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Phan: Address PhanPossiblyUndeclaredVariable violations.
10 changes: 5 additions & 5 deletions projects/packages/image-cdn/src/class-image-cdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,10 @@ public static function filter_the_content( $content ) {
}

// Identify image source.
$src_orig = $processor->get_attribute( 'src' );
$src = $src_orig;
$src_orig = $processor->get_attribute( 'src' );
$src = $src_orig;
$placeholder_src = null;
$placeholder_src_orig = null;

/*
* Only examine tags that are considered an image,
Expand Down Expand Up @@ -648,14 +650,12 @@ public static function filter_the_content( $content ) {
$processor->set_attribute( 'src', $photon_url );

// If Lazy Load is in use, pass placeholder image through Photon.
if ( isset( $placeholder_src ) && self::validate_image_url( $placeholder_src ) ) {
if ( $placeholder_src !== null && self::validate_image_url( $placeholder_src ) ) {
$placeholder_src = Image_CDN_Core::cdn_url( $placeholder_src );

if ( $placeholder_src !== $placeholder_src_orig ) {
$processor->set_attribute( $source_type, $placeholder_src );
}

unset( $placeholder_src );
}

// If we are not transforming the image with resize, fit, or letterbox (lb), then we should remove
Expand Down
6 changes: 3 additions & 3 deletions projects/packages/image-cdn/tests/php/Image_CDN_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ protected function helper_get_query( $data ) {
* @return int Post ID (attachment) of the image.
*/
protected function helper_get_image( $size = 'large', $meta = true ) {
if ( 'large' === $size ) { // 1600x1200
$filename = __DIR__ . '/sample-content/test-image-large.png';
} elseif ( 'medium' === $size ) { // 1024x768
if ( 'medium' === $size ) { // 1024x768
$filename = __DIR__ . '/sample-content/test-image-medium.png';
} else { // 1600x1200 - default to 'large'
$filename = __DIR__ . '/sample-content/test-image-large.png';
}
// Add sizes that exist before uploading the file.
add_image_size( 'jetpack_soft_defined', 700, 500, false ); // Intentionally not a 1.33333 ratio.
Expand Down
3 changes: 1 addition & 2 deletions projects/packages/publicize/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// PhanPluginUnreachableCode : 4 occurrences
// PhanTypeMismatchArgument : 3 occurrences
// PhanUndeclaredClassMethod : 3 occurrences
// PhanPossiblyUndeclaredVariable : 2 occurrences
// PhanTypeMismatchArgumentNullable : 2 occurrences
// PhanTypeMismatchReturnProbablyReal : 2 occurrences
// PhanTypeMissingReturn : 2 occurrences
Expand All @@ -35,7 +34,7 @@
'src/class-keyring-helper.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchDefault'],
'src/class-publicize-base.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginSimplifyExpressionBool', 'PhanSuspiciousMagicConstant', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchDimFetch'],
'src/class-publicize-ui.php' => ['PhanPluginDuplicateExpressionAssignmentOperation', 'PhanTypeMismatchReturnProbablyReal'],
'src/class-publicize.php' => ['PhanParamSignatureMismatch', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgument', 'PhanTypeMissingReturn'],
'src/class-publicize.php' => ['PhanParamSignatureMismatch', 'PhanTypeMismatchArgument', 'PhanTypeMissingReturn'],
'src/class-rest-controller.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeMismatchReturnProbablyReal'],
'src/rest-api/class-connections-controller.php' => ['PhanPluginMixedKeyNoKey', 'PhanTypeSuspiciousNonTraversableForeach'],
'src/rest-api/class-connections-post-field.php' => ['PhanPluginDuplicateConditionalNullCoalescing'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Phan: Address PhanPossiblyUndeclaredVariable violations.
4 changes: 2 additions & 2 deletions projects/packages/publicize/src/class-publicize.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,8 +653,8 @@ public function test_connection( $service_name, $connection ) {

$error_data = array(
'user_can_refresh' => $user_can_refresh,
'refresh_text' => $refresh_text,
'refresh_url' => $refresh_url,
'refresh_text' => $refresh_text ?? null,
'refresh_url' => $refresh_url ?? null,
);

$this->test_connection_results[ $id ] = new WP_Error( $connection_error_code, $connection_test_message, $error_data );
Expand Down
3 changes: 1 addition & 2 deletions projects/packages/search/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// PhanImpossibleCondition : 2 occurrences
// PhanDeprecatedPartiallySupportedCallable : 1 occurrence
// PhanPluginSimplifyExpressionBool : 1 occurrence
// PhanPossiblyUndeclaredVariable : 1 occurrence
// PhanTypeInvalidDimOffset : 1 occurrence
// PhanTypeMismatchDeclaredParamNullable : 1 occurrence
// PhanTypeMismatchDefault : 1 occurrence
Expand All @@ -38,7 +37,7 @@
'src/classic-search/class-classic-search.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchDeclaredParamNullable', 'PhanTypeMismatchProperty', 'PhanTypeMismatchReturn', 'PhanTypePossiblyInvalidDimOffset'],
'src/customizer/customize-controls/class-excluded-post-types-control.php' => ['PhanTypeMismatchReturnProbablyReal'],
'src/instant-search/class-instant-search.php' => ['PhanTypeMismatchProperty', 'PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal'],
'src/widgets/class-search-widget.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgument'],
'src/widgets/class-search-widget.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeMismatchArgument'],
'src/wpes/class-query-builder.php' => ['PhanImpossibleCondition', 'PhanTypeMismatchDimAssignment', 'PhanTypeMismatchReturnProbablyReal'],
'tests/php/Helpers_Test.php' => ['PhanPluginMixedKeyNoKey', 'PhanTypeMismatchArgument'],
'tests/php/Plan_Test.php' => ['PhanDeprecatedFunction', 'PhanTypeMismatchArgumentProbablyReal'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Phan: Address PhanPossiblyUndeclaredVariable violations.
14 changes: 4 additions & 10 deletions projects/packages/search/src/widgets/class-search-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public function widget( $args, $instance ) {
* @since 8.3.0
*/
public function widget_non_instant( $args, $instance ) {
$display_filters = false;
$filters = array();

// Search instance must have been initialized before widget render.
if ( is_search() ) {
Expand All @@ -339,13 +339,9 @@ public function widget_non_instant( $args, $instance ) {
if ( ! Helper::are_filters_by_widget_disabled() && ! $this->should_display_sitewide_filters() ) {
$filters = array_filter( $filters, array( $this, 'is_for_current_widget' ) );
}

if ( ! empty( $filters ) ) {
$display_filters = true;
}
}

if ( ! $display_filters && empty( $instance['search_box_enabled'] ) && empty( $instance['user_sort_enabled'] ) ) {
if ( ! $filters && empty( $instance['search_box_enabled'] ) && empty( $instance['user_sort_enabled'] ) ) {
return;
}

Expand Down Expand Up @@ -400,7 +396,7 @@ public function widget_non_instant( $args, $instance ) {
<?php
endif;

if ( $display_filters ) {
if ( $filters ) {
/**
* Responsible for rendering filters to narrow down search results.
*
Expand Down Expand Up @@ -445,8 +441,6 @@ public function widget_instant( $args, $instance ) {
$filters = array_filter( $filters, array( $this, 'is_for_current_widget' ) );
}

$display_filters = ! empty( $filters );

$title = ! empty( $instance['title'] ) ? $instance['title'] : '';

/** This filter is documented in core/src/wp-includes/default-widgets.php */
Expand All @@ -473,7 +467,7 @@ public function widget_instant( $args, $instance ) {

Template_Tags::render_widget_search_form( array(), '', '' );

if ( $display_filters ) {
if ( $filters ) {
/**
* Responsible for rendering filters to narrow down search results.
*
Expand Down
7 changes: 3 additions & 4 deletions projects/packages/sync/.phan/baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
// # Issue statistics:
// PhanTypeMismatchArgument : 40+ occurrences
// PhanPluginDuplicateConditionalNullCoalescing : 30+ occurrences
// PhanTypeMismatchReturnProbablyReal : 30+ occurrences
// PhanTypeMismatchReturnProbablyReal : 25+ occurrences
// PhanTypeMismatchReturn : 20+ occurrences
// PhanParamSignatureMismatch : 10+ occurrences
// PhanTypeMismatchArgumentProbablyReal : 10+ occurrences
// PhanPluginSimplifyExpressionBool : 9 occurrences
// PhanPluginDuplicateSwitchCaseLooseEquality : 6 occurrences
// PhanPossiblyUndeclaredVariable : 4 occurrences
// PhanTypeExpectedObjectPropAccess : 4 occurrences
// PhanNonClassMethodCall : 3 occurrences
// PhanTypeArraySuspiciousNullable : 3 occurrences
Expand Down Expand Up @@ -50,13 +49,13 @@
'src/class-rest-sender.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeMismatchArgumentProbablyReal'],
'src/class-sender.php' => ['PhanNonClassMethodCall', 'PhanPluginDuplicateConditionalNullCoalescing', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanTypeMismatchProperty', 'PhanTypeMismatchReturnProbablyReal'],
'src/class-server.php' => ['PhanTypeMismatchDeclaredParam', 'PhanTypeMismatchReturnProbablyReal'],
'src/class-settings.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
'src/class-settings.php' => ['PhanTypeMismatchArgumentProbablyReal'],
'src/class-utils.php' => ['PhanTypeExpectedObjectPropAccess'],
'src/modules/class-callables.php' => ['PhanParamSignatureMismatch', 'PhanTypeArraySuspicious', 'PhanTypeMismatchArgument'],
'src/modules/class-comments.php' => ['PhanTypeMismatchReturn', 'PhanTypeMismatchReturnProbablyReal'],
'src/modules/class-constants.php' => ['PhanParamSignatureMismatch'],
'src/modules/class-full-sync-immediately.php' => ['PhanPluginSimplifyExpressionBool', 'PhanTypeMismatchReturn'],
'src/modules/class-full-sync.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginSimplifyExpressionBool', 'PhanPossiblyUndeclaredVariable'],
'src/modules/class-full-sync.php' => ['PhanPluginDuplicateConditionalNullCoalescing', 'PhanPluginSimplifyExpressionBool'],
'src/modules/class-module.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchReturnProbablyReal'],
'src/modules/class-network-options.php' => ['PhanParamSignatureMismatch'],
'src/modules/class-options.php' => ['PhanParamSignatureMismatch', 'PhanTypeMismatchReturnProbablyReal'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Phan: Address PhanPossiblyUndeclaredVariable violations.
1 change: 1 addition & 0 deletions projects/packages/sync/src/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ public static function update_settings( $new_settings ) {
/**
* Regular option update and handling
*/
$updated = false;
if ( self::is_network_setting( $setting ) ) {
if ( is_multisite() && is_main_site() ) {
$updated = update_site_option( self::SETTINGS_OPTION_PREFIX . $setting, $value );
Expand Down
4 changes: 4 additions & 0 deletions projects/packages/sync/src/modules/class-full-sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ public function get_range( $type ) {
$id = 'comment_ID';
$where_sql = Settings::get_comments_filter_sql();
break;
default:
// This should never be reached due to the guard condition above,
// but Phan complains so let's make it happy.
return array();
}

// TODO: Call $wpdb->prepare on the following query.
Expand Down
Loading
Loading