Skip to content

Commit 48aaba0

Browse files
committed
[static-analysis] Fix php errors from static analysis.
1 parent 9d67cdd commit 48aaba0

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
@@ -14300,15 +14300,15 @@ private function get_parent_and_addons_installs_info() {
1430014300
$this->get_parent_instance() :
1430114301
$this;
1430214302

14303-
$installed_addons_ids_map = array();
14303+
$installed_addons_ids = array();
1430414304

1430514305
$installed_addons_instances = $fs->get_installed_addons();
1430614306
foreach ( $installed_addons_instances as $instance ) {
14307-
$installed_addons_ids_map[] = $instance->get_id();
14307+
$installed_addons_ids[] = $instance->get_id();
1430814308
}
1430914309

1431014310
$addons_ids = array_unique( array_merge(
14311-
$installed_addons_ids_map,
14311+
$installed_addons_ids,
1431214312
$fs->get_updated_account_addons()
1431314313
) );
1431414314

@@ -14320,6 +14320,7 @@ private function get_parent_and_addons_installs_info() {
1432014320
)
1432114321
);
1432214322

14323+
$installed_addons_ids_map = array_flip( $installed_addons_ids );
1432314324
foreach ( $addons_ids as $addon_id ) {
1432414325
$is_installed = isset( $installed_addons_ids_map[ $addon_id ] );
1432514326

includes/class-fs-plugin-updater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ function plugins_api_filter( $data, $action = '', $args = null ) {
10491049
false
10501050
);
10511051

1052-
if ( is_array( $addon_plugin_data ) && $addon_plugin_data['Version'] ) {
1052+
if ( is_array( $addon_plugin_data ) && isset( $addon_plugin_data['Version'] ) ) {
10531053
$addon_version = $addon_plugin_data['Version'];
10541054
}
10551055
}

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)