Skip to content

Commit

Permalink
[static-analysis] Fix undeclared variables errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
bahiirwa committed Jan 15, 2024
1 parent 0c85dd0 commit df78061
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 40 deletions.
9 changes: 5 additions & 4 deletions templates/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,11 @@ class="dashicons dashicons-image-rotate"></i> <?php fs_esc_html_echo_x_inline( '
);
}
} else {
$bundle_title = ( $has_bundle_license ? ucfirst( $fs->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 )
Expand All @@ -482,7 +483,7 @@ class="dashicons dashicons-image-rotate"></i> <?php fs_esc_html_echo_x_inline( '
$profile[] = array(
'id' => 'bundle_plan',
'title' => $bundle_plan_text,
'value' => $bundle_plan_title
'value' => $bundle_title
);
}
}
Expand Down Expand Up @@ -870,8 +871,8 @@ class="fs-tag fs-<?php echo $fs->can_use_premium_code() ? 'success' : 'warn' ?>"

<?php
if ( $show_billing ) {
$view_params = array( 'id' => $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 );
}
?>
Expand Down
4 changes: 2 additions & 2 deletions templates/account/partials/addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@
<!--/ ID -->

<!-- Version -->
<td><?php echo $version ?></td>
<td><?php echo $version; // @phpstan-ignore-line ?></td>
<!--/ Version -->

<!-- Plan Title -->
<td><?php echo strtoupper( is_string( $plan_name ) ? $plan_title : $free_text ) ?></td>
<td><?php echo strtoupper( is_string( $plan_name ) ? $plan_title : $free_text ); // @phpstan-ignore-line ?></td>
<!--/ Plan Title -->

<!-- Expiration -->
Expand Down
6 changes: 3 additions & 3 deletions templates/account/partials/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,13 @@ class="dashicons dashicons-arrow-right-alt2"></i>
$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 );
?>
<?php $action = 'downgrade_account' ?>
<form id="fs_downgrade" action="<?php echo $fs->_get_admin_page_url( 'account' ) ?>" method="POST">
Expand Down
23 changes: 13 additions & 10 deletions templates/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,22 +296,25 @@
}
?>
<?php
$fs = null;
$fs = null;
$has_api_connectivity = false;

if ( $is_active ) {
$fs = freemius( $data->id );
$fs = freemius( $data->id );
$has_api_connectivity = $fs->has_api_connectivity();

$active_modules_by_id[ $data->id ] = true;
}
?>
<tr<?php if ( $is_active ) {
$has_api_connectivity = $fs->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"';
<tr <?php
if ( $is_active ) {
if ( true === $has_api_connectivity && $fs->is_on() ) {
echo 'style="background: #E6FFE6; font-weight: bold"';
} else {
echo 'style="background: #ffd0d0; font-weight: bold"';
}
}
} ?>>
?>>
<td><?php echo $data->id ?></td>
<td><?php echo $slug ?></td>
<td><?php echo $data->version ?></td>
Expand Down
43 changes: 22 additions & 21 deletions templates/forms/affiliation.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,28 +121,29 @@
?></strong></p>
</div>
<?php else : ?>
<?php
$message_text = '';

if ( $is_pending_affiliate ) {
$message_text = fs_text_inline( "Thank you for applying for our affiliate program, we'll review your details during the next 14 days and will get back to you with further information.", 'affiliate-application-thank-you', $slug );
$message_container_class = 'updated';
} else if ( $affiliate->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';
}
?>
<div class="<?php echo $message_container_class ?>">
<p><strong><?php echo esc_html( $message_text ) ?></strong></p>
</div>
<?php endif ?>
<?php
$message_text = '';
$message_container_class = '';

if ( $is_pending_affiliate ) {
$message_text = fs_text_inline( "Thank you for applying for our affiliate program, we'll review your details during the next 14 days and will get back to you with further information.", 'affiliate-application-thank-you', $slug );
$message_container_class = 'updated';
} else if ( $affiliate->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';
}
?>
<div class="<?php echo $message_container_class ?>">
<p><strong><?php echo esc_html( $message_text ) ?></strong></p>
</div>
<?php endif ?>
<?php endif ?>
</div>
<div class="entry-content">
<?php if ( ! $is_affiliate ) : ?>
Expand Down

0 comments on commit df78061

Please sign in to comment.