Skip to content

Commit e4040cb

Browse files
committed
[static-analysis] Fix php errors from static analysis.
1 parent 37ed17d commit e4040cb

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
@@ -13953,15 +13953,15 @@ private function get_parent_and_addons_installs_info() {
1395313953
$this->get_parent_instance() :
1395413954
$this;
1395513955

13956-
$installed_addons_ids_map = array();
13956+
$installed_addons_ids = array();
1395713957

1395813958
$installed_addons_instances = $fs->get_installed_addons();
1395913959
foreach ( $installed_addons_instances as $instance ) {
13960-
$installed_addons_ids_map[] = $instance->get_id();
13960+
$installed_addons_ids[] = $instance->get_id();
1396113961
}
1396213962

1396313963
$addons_ids = array_unique( array_merge(
13964-
$installed_addons_ids_map,
13964+
$installed_addons_ids,
1396513965
$fs->get_updated_account_addons()
1396613966
) );
1396713967

@@ -13973,6 +13973,7 @@ private function get_parent_and_addons_installs_info() {
1397313973
)
1397413974
);
1397513975

13976+
$installed_addons_ids_map = array_flip( $installed_addons_ids );
1397613977
foreach ( $addons_ids as $addon_id ) {
1397713978
$is_installed = isset( $installed_addons_ids_map[ $addon_id ] );
1397813979

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)