From df78061c6591874c2e5e4c6fc0e04d67807cfb42 Mon Sep 17 00:00:00 2001 From: Laurence Bahiirwa Date: Mon, 15 Jan 2024 21:31:20 +0300 Subject: [PATCH] [static-analysis] Fix undeclared variables errors. --- templates/account.php | 9 +++--- templates/account/partials/addon.php | 4 +-- templates/account/partials/site.php | 6 ++-- templates/debug.php | 23 ++++++++------- templates/forms/affiliation.php | 43 ++++++++++++++-------------- 5 files changed, 45 insertions(+), 40 deletions(-) diff --git a/templates/account.php b/templates/account.php index af1ceb38..9e64bb4a 100755 --- a/templates/account.php +++ b/templates/account.php @@ -468,10 +468,11 @@ class="dashicons dashicons-image-rotate"> get_module_type() ) : '' ); if ( $show_plan_row ) { $profile[] = array( 'id' => 'plan', - 'title' => ( $has_bundle_license ? ucfirst( $fs->get_module_type() ) . ' ' : '' ) . $plan_text, + 'title' => $bundle_title . ' ' . $plan_text, 'value' => strtoupper( is_string( $plan->name ) ? $plan->title : strtoupper( $free_text ) @@ -482,7 +483,7 @@ class="dashicons dashicons-image-rotate"> 'bundle_plan', 'title' => $bundle_plan_text, - 'value' => $bundle_plan_title + 'value' => $bundle_title ); } } @@ -870,8 +871,8 @@ class="fs-tag fs-can_use_premium_code() ? 'success' : 'warn' ?>" $VARS['id'], 'payments' => $payments ); - fs_require_once_template( 'account/billing.php', $view_params ); + $view_params = array( 'id' => $VARS['id'], 'payments' => $payments ); // @phpstan-ignore-line + fs_require_once_template( 'account/billing.php', $view_params ); fs_require_once_template( 'account/payments.php', $view_params ); } ?> diff --git a/templates/account/partials/addon.php b/templates/account/partials/addon.php index 9f3fd122..f53d2c0a 100644 --- a/templates/account/partials/addon.php +++ b/templates/account/partials/addon.php @@ -158,11 +158,11 @@ - + - + diff --git a/templates/account/partials/site.php b/templates/account/partials/site.php index 0be1440a..5e90522d 100644 --- a/templates/account/partials/site.php +++ b/templates/account/partials/site.php @@ -323,13 +323,13 @@ class="dashicons dashicons-arrow-right-alt2"> $downgrade_confirmation_message = sprintf( $downgrade_x_confirm_text, ( $fs->is_only_premium() ? $cancelling_subscription_text : $downgrading_plan_text ), - $plan->title, + $plan_title, $human_readable_license_expiration ); $after_downgrade_message = ! $license->is_block_features ? - sprintf( $after_downgrade_non_blocking_text, $plan->title, $fs->get_module_label( true ) ) : - sprintf( $after_downgrade_blocking_text, $plan->title ); + sprintf( $after_downgrade_non_blocking_text, $plan_title, $fs->get_module_label( true ) ) : + sprintf( $after_downgrade_blocking_text, $plan_title ); ?>
diff --git a/templates/debug.php b/templates/debug.php index 4e386e1d..4623d935 100644 --- a/templates/debug.php +++ b/templates/debug.php @@ -296,22 +296,25 @@ } ?> id ); + $fs = freemius( $data->id ); + $has_api_connectivity = $fs->has_api_connectivity(); $active_modules_by_id[ $data->id ] = true; } ?> - has_api_connectivity(); - - if ( true === $has_api_connectivity && $fs->is_on() ) { - echo ' style="background: #E6FFE6; font-weight: bold"'; - } else { - echo ' style="background: #ffd0d0; font-weight: bold"'; + is_on() ) { + echo 'style="background: #E6FFE6; font-weight: bold"'; + } else { + echo 'style="background: #ffd0d0; font-weight: bold"'; + } } - } ?>> + ?>> id ?> version ?> diff --git a/templates/forms/affiliation.php b/templates/forms/affiliation.php index a053d2d1..c09ea2d9 100644 --- a/templates/forms/affiliation.php +++ b/templates/forms/affiliation.php @@ -121,28 +121,29 @@ ?>

- is_suspended() ) { - $message_text = fs_text_inline( 'Your affiliation account was temporarily suspended.', 'affiliate-account-suspended', $slug ); - $message_container_class = 'notice notice-warning'; - } else if ( $affiliate->is_rejected() ) { - $message_text = fs_text_inline( "Thank you for applying for our affiliate program, unfortunately, we've decided at this point to reject your application. Please try again in 30 days.", 'affiliate-application-rejected', $slug ); - $message_container_class = 'error'; - } else if ( $affiliate->is_blocked() ) { - $message_text = fs_text_inline( 'Due to violation of our affiliation terms, we decided to temporarily block your affiliation account. If you have any questions, please contact support.', 'affiliate-account-blocked', $slug ); - $message_container_class = 'error'; - } - ?> -
-

-
- + is_suspended() ) { + $message_text = fs_text_inline( 'Your affiliation account was temporarily suspended.', 'affiliate-account-suspended', $slug ); + $message_container_class = 'notice notice-warning'; + } else if ( $affiliate->is_rejected() ) { + $message_text = fs_text_inline( "Thank you for applying for our affiliate program, unfortunately, we've decided at this point to reject your application. Please try again in 30 days.", 'affiliate-application-rejected', $slug ); + $message_container_class = 'error'; + } else if ( $affiliate->is_blocked() ) { + $message_text = fs_text_inline( 'Due to violation of our affiliation terms, we decided to temporarily block your affiliation account. If you have any questions, please contact support.', 'affiliate-account-blocked', $slug ); + $message_container_class = 'error'; + } + ?> +
+

+
+