Merged in feature/MAW-855-import-code-into-aws (pull request #2)
code import from pantheon * code import from pantheon
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Imagify\User\User;
|
||||
|
||||
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
|
||||
|
||||
if ( defined( 'IMAGIFY_HIDDEN_ACCOUNT' ) && IMAGIFY_HIDDEN_ACCOUNT ) {
|
||||
@@ -12,9 +15,7 @@ if ( defined( 'IMAGIFY_HIDDEN_ACCOUNT' ) && IMAGIFY_HIDDEN_ACCOUNT ) {
|
||||
}
|
||||
|
||||
if ( Imagify_Requirements::is_api_key_valid() ) {
|
||||
$user = imagify_get_cached_user();
|
||||
$unconsumed_quota = $user ? $user->get_percent_unconsumed_quota : false;
|
||||
$hidden_class = '';
|
||||
$user = imagify_get_cached_user();
|
||||
|
||||
if ( ! $user ) {
|
||||
// Lazyload user.
|
||||
@@ -23,51 +24,10 @@ if ( Imagify_Requirements::is_api_key_valid() ) {
|
||||
'_wpnonce' => wp_create_nonce( 'imagify_get_user_data' ),
|
||||
) );
|
||||
}
|
||||
} else {
|
||||
$hidden_class = ' hidden';
|
||||
}
|
||||
?>
|
||||
<div class="imagify-settings-section">
|
||||
|
||||
<?php
|
||||
$imagify_user = new Imagify_User();
|
||||
|
||||
if (
|
||||
$imagify_user->is_free()
|
||||
&&
|
||||
Imagify_Requirements::is_api_key_valid()
|
||||
) {
|
||||
?>
|
||||
<div class="imagify-col-content imagify-block-secondary imagify-mt2">
|
||||
<?php
|
||||
/**
|
||||
* Best plan.
|
||||
*/
|
||||
?>
|
||||
<div class="best-plan<?php echo $hidden_class; ?>">
|
||||
<h3 class="imagify-user-best-plan-title">
|
||||
<?php
|
||||
if ( $user && ! $unconsumed_quota ) {
|
||||
esc_html_e( 'Oops, It\'s Over!', 'imagify' );
|
||||
} elseif ( $user && $unconsumed_quota <= 20 ) {
|
||||
esc_html_e( 'Oops, It\'s almost over!', 'imagify' );
|
||||
} else {
|
||||
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">
|
||||
<i class="dashicons dashicons-dashboard" aria-hidden="true"></i>
|
||||
<span class="button-text"><?php esc_html_e( 'What plan do I need?', 'imagify' ); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</div><!-- .imagify-col-content -->
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php $this->print_template( 'part-upsell' ); ?>
|
||||
|
||||
<?php
|
||||
if ( ! defined( 'IMAGIFY_API_KEY' ) || ! IMAGIFY_API_KEY ) {
|
||||
|
||||
Reference in New Issue
Block a user