Skip to content

Commit

Permalink
fix hidden class
Browse files Browse the repository at this point in the history
  • Loading branch information
remyperona committed Nov 14, 2023
1 parent 913fe2a commit 621d648
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 1 addition & 4 deletions views/part-settings-account.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
}

if ( Imagify_Requirements::is_api_key_valid() ) {
$user = imagify_get_cached_user();
$hidden_class = '';
$user = imagify_get_cached_user();

if ( ! $user ) {
// Lazyload user.
Expand All @@ -25,8 +24,6 @@
'_wpnonce' => wp_create_nonce( 'imagify_get_user_data' ),
) );
}
} else {
$hidden_class = ' hidden';
}
?>
<div class="imagify-settings-section">
Expand Down
7 changes: 4 additions & 3 deletions views/part-upsell.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
$user_id = get_current_user_id();
$notices = get_user_meta( $user_id, '_imagify_ignore_notices', true );
$notices = $notices && is_array( $notices ) ? array_flip( $notices ) : [];
$api_key_valid = Imagify_Requirements::is_api_key_valid();

if (
$imagify_user->is_free()
&&
Imagify_Requirements::is_api_key_valid()
$api_key_valid
&&
$unconsumed_quota > 20
) {
?>
<div class="imagify-col-content imagify-block-secondary imagify-mt2">
<div class="best-plan<?php echo $hidden_class; ?>">
<div class="best-plan<?php echo $api_key_valid ? '': ' hidden'; ?>">
<h3 class="imagify-user-best-plan-title">
<?php esc_html_e( 'You\'re new to Imagify?', 'imagify' ); ?>
<?php esc_html_e( 'You\'re new to Imagify?', 'imagify' ); ?>
</h3>
<p><?php esc_html_e( 'Let us help you by analyzing your existing images and determine the best plan for you.', 'imagify' ); ?></p>
<button id="imagify-get-pricing-modal" data-nonce="<?php echo wp_create_nonce( 'imagify_get_pricing_' . get_current_user_id() ); ?>" data-target="#imagify-pricing-modal" type="button" class="imagify-modal-trigger imagify-button imagify-button-light imagify-full-width">
Expand Down

0 comments on commit 621d648

Please sign in to comment.