From bfd1c8db02ac554d246be9f6c86a89157bd0f5fb Mon Sep 17 00:00:00 2001 From: Laurence Bahiirwa Date: Tue, 16 Apr 2024 19:01:50 +0300 Subject: [PATCH] static-analysis] Fix php errors from static analysis. --- includes/class-fs-plugin-updater.php | 2 +- includes/fs-plugin-info-dialog.php | 2 +- templates/account.php | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/class-fs-plugin-updater.php b/includes/class-fs-plugin-updater.php index 2d112cda..4e14c6b7 100755 --- a/includes/class-fs-plugin-updater.php +++ b/includes/class-fs-plugin-updater.php @@ -1049,7 +1049,7 @@ function plugins_api_filter( $data, $action = '', $args = null ) { false ); - if ( is_array( $addon_plugin_data ) && $addon_plugin_data['Version'] ) { + if ( is_array( $addon_plugin_data ) && isset( $addon_plugin_data['Version'] ) ) { $addon_version = $addon_plugin_data['Version']; } } diff --git a/includes/fs-plugin-info-dialog.php b/includes/fs-plugin-info-dialog.php index 7183a71c..a57d348a 100755 --- a/includes/fs-plugin-info-dialog.php +++ b/includes/fs-plugin-info-dialog.php @@ -229,7 +229,7 @@ function _get_addon_info_filter( $data, $action = '', $args = null ) { false ); - if ( is_array( $addon_plugin_data ) && $addon_plugin_data['Version'] ) { + if ( is_array( $addon_plugin_data ) && isset( $addon_plugin_data['Version'] ) ) { $current_addon_version = $addon_plugin_data['Version']; } } diff --git a/templates/account.php b/templates/account.php index 1df94461..bc6f83e1 100755 --- a/templates/account.php +++ b/templates/account.php @@ -157,7 +157,7 @@ $site_view_params[] = $view_params; - if ( null === $install ) { + if ( is_object( $install ) ) { continue; } @@ -186,6 +186,7 @@ $bundle_subscription = null; $is_bundle_first_payment_pending = false; + $bundle_plan_title = ''; if ( $show_plan_row && @@ -468,11 +469,10 @@ class="dashicons dashicons-image-rotate"> get_module_type() ) : '' ); if ( $show_plan_row ) { $profile[] = array( 'id' => 'plan', - 'title' => $bundle_title . ' ' . $plan_text, + 'title' => ( $has_bundle_license ? ucfirst( $fs->get_module_type() ) . ' ' : '' ) . $plan_text, 'value' => strtoupper( is_string( $plan->name ) ? $plan->title : strtoupper( $free_text ) @@ -483,7 +483,7 @@ class="dashicons dashicons-image-rotate"> 'bundle_plan', 'title' => $bundle_plan_text, - 'value' => $bundle_title + 'value' => $bundle_plan_title ); } }