Skip to content

Commit 3c5a82a

Browse files
committed
[static-analysis] Fix php errors from static analysis.
1 parent 6df9830 commit 3c5a82a

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

includes/class-freemius.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13942,15 +13942,15 @@ private function get_parent_and_addons_installs_info() {
1394213942
$this->get_parent_instance() :
1394313943
$this;
1394413944

13945-
$installed_addons_ids_map = array();
13945+
$installed_addons_ids = array();
1394613946

1394713947
$installed_addons_instances = $fs->get_installed_addons();
1394813948
foreach ( $installed_addons_instances as $instance ) {
13949-
$installed_addons_ids_map[] = $instance->get_id();
13949+
$installed_addons_ids[] = $instance->get_id();
1395013950
}
1395113951

1395213952
$addons_ids = array_unique( array_merge(
13953-
$installed_addons_ids_map,
13953+
$installed_addons_ids,
1395413954
$fs->get_updated_account_addons()
1395513955
) );
1395613956

@@ -13962,6 +13962,7 @@ private function get_parent_and_addons_installs_info() {
1396213962
)
1396313963
);
1396413964

13965+
$installed_addons_ids_map = array_flip( $installed_addons_ids );
1396513966
foreach ( $addons_ids as $addon_id ) {
1396613967
$is_installed = isset( $installed_addons_ids_map[ $addon_id ] );
1396713968

includes/class-fs-plugin-updater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ function plugins_api_filter( $data, $action = '', $args = null ) {
10941094
false
10951095
);
10961096

1097-
if ( is_array( $addon_plugin_data ) && $addon_plugin_data['Version'] ) {
1097+
if ( is_array( $addon_plugin_data ) && isset( $addon_plugin_data['Version'] ) ) {
10981098
$addon_version = $addon_plugin_data['Version'];
10991099
}
11001100
}

includes/fs-plugin-info-dialog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ function _get_addon_info_filter( $data, $action = '', $args = null ) {
229229
false
230230
);
231231

232-
if ( is_array( $addon_plugin_data ) && $addon_plugin_data['Version'] ) {
232+
if ( is_array( $addon_plugin_data ) && isset( $addon_plugin_data['Version'] ) ) {
233233
$current_addon_version = $addon_plugin_data['Version'];
234234
}
235235
}

templates/account.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157

158158
$site_view_params[] = $view_params;
159159

160-
if ( null === $install ) {
160+
if ( is_object( $install ) ) {
161161
continue;
162162
}
163163

@@ -186,6 +186,7 @@
186186

187187
$bundle_subscription = null;
188188
$is_bundle_first_payment_pending = false;
189+
$bundle_plan_title = '';
189190

190191
if (
191192
$show_plan_row &&
@@ -468,11 +469,10 @@ class="dashicons dashicons-image-rotate"></i> <?php fs_esc_html_echo_x_inline( '
468469
);
469470
}
470471
} else {
471-
$bundle_title = ( $has_bundle_license ? ucfirst( $fs->get_module_type() ) : '' );
472472
if ( $show_plan_row ) {
473473
$profile[] = array(
474474
'id' => 'plan',
475-
'title' => $bundle_title . ' ' . $plan_text,
475+
'title' => ( $has_bundle_license ? ucfirst( $fs->get_module_type() ) . ' ' : '' ) . $plan_text,
476476
'value' => strtoupper( is_string( $plan->name ) ?
477477
$plan->title :
478478
strtoupper( $free_text )
@@ -483,7 +483,7 @@ class="dashicons dashicons-image-rotate"></i> <?php fs_esc_html_echo_x_inline( '
483483
$profile[] = array(
484484
'id' => 'bundle_plan',
485485
'title' => $bundle_plan_text,
486-
'value' => $bundle_title
486+
'value' => $bundle_plan_title
487487
);
488488
}
489489
}

0 commit comments

Comments
 (0)