| @@ -1,12 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | -defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); | |
| 3 | 2 | |
| 3 | +defined( 'ABSPATH' ) || exit; | |
| 4 | + | |
| 4 | 5 | if ( defined( 'IMAGIFY_HIDDEN_ACCOUNT' ) && IMAGIFY_HIDDEN_ACCOUNT ) { |
| 5 | 6 | if ( ! defined( 'IMAGIFY_API_KEY' ) || ! IMAGIFY_API_KEY ) { |
| 6 | 7 | $options = Imagify_Options::get_instance(); |
| 7 | 8 | ?> |
| 8 | - <input type="hidden" value="<?php echo esc_attr( $options->get( 'api_key' ) ); ?>" name="<?php echo $options->get_option_name(); ?>[api_key]"> | |
| 9 | + <input type="hidden" value="<?php echo esc_attr( $options->get( 'api_key' ) ); ?>" name="<?php echo esc_attr( $options->get_option_name() ); ?>[api_key]"> | |
| 9 | 10 | <?php |
| 10 | 11 | } |
| 11 | 12 | return; |
| 12 | 13 | } |
| @@ -11,66 +12,32 @@ | ||
| 11 | 12 | return; |
| 12 | 13 | } |
| 13 | 14 | |
| 14 | 15 | if ( Imagify_Requirements::is_api_key_valid() ) { |
| 15 | - $user = imagify_get_cached_user(); | |
| 16 | - $unconsumed_quota = $user ? $user->get_percent_unconsumed_quota : false; | |
| 17 | - $hidden_class = ''; | |
| 16 | + $user = imagify_get_cached_user(); | |
| 18 | 17 | |
| 19 | 18 | if ( ! $user ) { |
| 20 | 19 | // Lazyload user. |
| 21 | - Imagify_Assets::get_instance()->localize_script( 'options', 'imagifyUser', array( | |
| 22 | - 'action' => 'imagify_get_user_data', | |
| 23 | - '_wpnonce' => wp_create_nonce( 'imagify_get_user_data' ), | |
| 24 | - ) ); | |
| 20 | + Imagify_Assets::get_instance()->localize_script( | |
| 21 | + 'options', | |
| 22 | + 'imagifyUser', | |
| 23 | + [ | |
| 24 | + 'action' => 'imagify_get_user_data', | |
| 25 | + '_wpnonce' => wp_create_nonce( 'imagify_get_user_data' ), | |
| 26 | + ] | |
| 27 | + ); | |
| 25 | 28 | } |
| 26 | -} else { | |
| 27 | - $hidden_class = ' hidden'; | |
| 28 | 29 | } |
| 29 | 30 | ?> |
| 30 | 31 | <div class="imagify-settings-section"> |
| 32 | +<?php $this->print_template( 'part-upsell' ); ?> | |
| 31 | 33 | |
| 32 | 34 | <?php |
| 33 | - if ( Imagify_Requirements::is_api_key_valid() ) { | |
| 34 | - ?> | |
| 35 | - <div class="imagify-col-content imagify-block-secondary imagify-mt2"> | |
| 36 | - <?php | |
| 37 | - /** | |
| 38 | - * Best plan. | |
| 39 | - */ | |
| 40 | - ?> | |
| 41 | - <div class="best-plan<?php echo $hidden_class; ?>"> | |
| 42 | - <h3 class="imagify-user-best-plan-title"> | |
| 43 | - <?php | |
| 44 | - if ( $user && ! $unconsumed_quota ) { | |
| 45 | - esc_html_e( 'Oops, It\'s Over!', 'imagify' ); | |
| 46 | - } elseif ( $user && $unconsumed_quota <= 20 ) { | |
| 47 | - esc_html_e( 'Oops, It\'s almost over!', 'imagify' ); | |
| 48 | - } else { | |
| 49 | - esc_html_e( 'You\'re new to Imagify?', 'imagify' ); | |
| 50 | - } | |
| 51 | - ?> | |
| 52 | - </h3> | |
| 53 | - | |
| 54 | - <p><?php esc_html_e( 'Let us help you by analyzing your existing images and determine the best plan for you.', 'imagify' ); ?></p> | |
| 55 | - | |
| 56 | - <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"> | |
| 57 | - <i class="dashicons dashicons-dashboard" aria-hidden="true"></i> | |
| 58 | - <span class="button-text"><?php esc_html_e( 'What plan do I need?', 'imagify' ); ?></span> | |
| 59 | - </button> | |
| 60 | - </div> | |
| 61 | - </div><!-- .imagify-col-content --> | |
| 62 | - <?php | |
| 63 | - } | |
| 64 | - ?> | |
| 65 | - | |
| 66 | - <?php | |
| 67 | 35 | if ( ! defined( 'IMAGIFY_API_KEY' ) || ! IMAGIFY_API_KEY ) { |
| 68 | 36 | if ( Imagify_Requirements::is_api_key_valid() ) { |
| 69 | 37 | ?> |
| 70 | 38 | <h2 class="imagify-options-title"> |
| 71 | - <?php esc_html_e( 'Account Type', 'imagify' ); ?> | |
| 72 | - <strong class="imagify-user-plan-label"><?php echo $user ? esc_html( $user->plan_label ) : ''; ?></strong> | |
| 39 | + <?php esc_html_e( 'API Key', 'imagify' ); ?> | |
| 73 | 40 | </h2> |
| 74 | 41 | <?php |
| 75 | 42 | } else { |
| 76 | 43 | ?> |
| @@ -95,10 +62,10 @@ | ||
| 95 | 62 | } |
| 96 | 63 | ?> |
| 97 | 64 | |
| 98 | 65 | <div class="imagify-api-line"> |
| 99 | - <label for="api_key"><?php echo $options->get( 'api_key' ) ? esc_html__( 'API Key', 'imagify' ) : esc_html__( 'Enter Your API Key Below', 'imagify' ); ?></label> | |
| 100 | - <input type="text" size="35" value="<?php echo esc_attr( $options->get( 'api_key' ) ); ?>" name="<?php echo $options->get_option_name(); ?>[api_key]" id="api_key"> | |
| 66 | + <label for="api_key" class="screen-reader-text"><?php echo $options->get( 'api_key' ) ? esc_html__( 'API Key', 'imagify' ) : esc_html__( 'Enter Your API Key Below', 'imagify' ); ?></label> | |
| 67 | + <input type="text" size="35" value="<?php echo esc_attr( $options->get( 'api_key' ) ); ?>" name="<?php echo esc_attr( $options->get_option_name() ); ?>[api_key]" id="api_key"> | |
| 101 | 68 | <?php |
| 102 | 69 | if ( Imagify_Requirements::is_api_key_valid() ) { |
| 103 | 70 | ?> |
| 104 | 71 | |
| @@ -122,5 +89,5 @@ | ||
| 122 | 89 | <?php |
| 123 | 90 | } |
| 124 | 91 | ?> |
| 125 | 92 | </div> |
| 126 | -<?php | |
| 93 | + | |