Skip to content

Commit

Permalink
Closes #3001 Infinite Plan - Price (#935)
Browse files Browse the repository at this point in the history
Co-authored-by: E2E Environment <[email protected]>
  • Loading branch information
Khadreal and E2E Environment authored Dec 18, 2024
1 parent 7e076a5 commit b634182
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 25 deletions.
6 changes: 3 additions & 3 deletions assets/css/admin-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@
#wp-admin-bar-imagify-profile .imagify-upsell-admin-bar {
position:relative ;
background: #c51161;
margin: 10px -13px -10px -13px;
padding: 20px;
margin: 10px -15px -13px -15px;
padding: 16px;
}

#wp-admin-bar-imagify-profile .imagify-upsell-admin-bar p {
color: #fff;
color: #ebebeb;
}

#wp-admin-bar-imagify-profile a.imagify-upsell-admin-bar-button {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin-bar.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions assets/css/pricing-modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ div.imagify-col-price {
.imagify-offer-monthly .imagify-flex-table .imagify-price-block,
.imagify-offer-monthlies .imagify-price-block {
padding-top: 0;
max-width: 39%;
}
.imagify-flex-table .imagify-price-complement {
padding-right: 0;
Expand Down Expand Up @@ -1502,6 +1503,6 @@ input:checked ~ .imagify-badge-container .imagify-badge {
background-color: #97c45e;
color: white;
border-color: #97c45e;
opacity: 1;
opacity: 1;
}
/** End Toggle Switch **/
/** End Toggle Switch **/
2 changes: 1 addition & 1 deletion assets/css/pricing-modal.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/notices.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/**
* Close an Imagify notice.
*/
$( '.imagify-notice-dismiss' ).on( 'click.imagify', function( e ) {
$(document).on('click', '.imagify-notice-dismiss', function ( e ) {
var $this = $( this ),
$parent = $this.parents( '.imagify-welcome, .imagify-notice, .imagify-rkt-notice, .imagify-upsell, .imagify-upsell-admin-bar' ),
href = $this.attr( 'href' );
Expand Down
2 changes: 1 addition & 1 deletion assets/js/notices.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions classes/Admin/AdminBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,22 @@ public function get_admin_bar_profile_callback() {
$upgrade_link = '';

if ( $this->user->is_free() ) {
$text = esc_html__( 'Upgrade your plan now for more!', 'rocket' ) . '<br>' .
esc_html__( 'From $5.99/month only, keep going with image optimization!', 'rocket' );
$button_text = esc_html__( 'Upgrade My Plan', 'rocket' );
$text = esc_html__( 'Upgrade your plan now for more!', 'imagify' ) . '<br>' .
esc_html__( 'From $5.99/month only, keep going with image optimization!', 'imagify' );
$button_text = esc_html__( 'Upgrade My Plan', 'imagify' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/?utm_source=plugin&utm_medium=notification';
} elseif ( $this->user->is_growth() ) {
$text = esc_html__( 'Switch to Infinite plan for unlimited optimization:', 'rocket' ) . '<br>';
$text = esc_html__( 'Switch to Infinite plan for unlimited optimization:', 'imagify' ) . '<br>';

if ( $this->user->is_monthly ) {
$text .= esc_html__( 'For $9.99/month, optimize as many images as you like!', 'rocket' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/plan_switch/?label=infinite&payment_plan=1&utm_source=plugin&utm_medium=notification ';
$text .= esc_html__( 'For $11.99/month, optimize as many images as you like!', 'imagify' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/plan_switch/?label=infinite_3&payment_plan=1&utm_source=plugin&utm_medium=notification ';
} else {
$text .= esc_html__( 'For $99.9/year, optimize as many images as you like!', 'rocket' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/plan_switch/?label=infinite&payment_plan=2&utm_source=plugin&utm_medium=notification ';
$text .= esc_html__( 'For $9.99/month, optimize as many images as you like!', 'imagify' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/plan_switch/?label=infinite_3&payment_plan=2&utm_source=plugin&utm_medium=notification ';
}

$button_text = esc_html__( 'Switch To Infinite Plan', 'rocket' );
$button_text = esc_html__( 'Switch To Infinite Plan', 'imagify' );
}

$data = [
Expand Down
6 changes: 4 additions & 2 deletions inc/classes/class-imagify-files-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ public static function get_overall_original_size() {
}

$table_name = $files_db->get_table_name();
$size = round( $wpdb->get_var( "SELECT SUM( original_size ) FROM $table_name" ) ); // WPCS: unprepared SQL ok.
$sql = $wpdb->get_var( "SELECT SUM( original_size ) FROM $table_name" ); // WPCS: unprepared SQL ok.
$size = is_null( $sql ) ? 0 : round( $sql );

return $size;
}
Expand Down Expand Up @@ -435,7 +436,8 @@ public static function calculate_average_size_per_month() {
}

$table_name = $files_db->get_table_name();
$average = round( $wpdb->get_var( "SELECT AVG( size ) AS average_size_per_month FROM ( SELECT SUM( original_size ) AS size FROM $table_name GROUP BY YEAR( file_date ), MONTH( file_date ) ) AS size_per_month" ) ); // WPCS: unprepared SQL ok.
$sql = $wpdb->get_var( "SELECT AVG( size ) AS average_size_per_month FROM ( SELECT SUM( original_size ) AS size FROM $table_name GROUP BY YEAR( file_date ), MONTH( file_date ) ) AS size_per_month" ); // WPCS: unprepared SQL ok.
$average = is_null( $sql ) ? 0 : round( $sql );

return $average;
}
Expand Down
5 changes: 4 additions & 1 deletion views/admin/admin-bar-status.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );

$pos = strpos( $data['plan_label'], '_' );
$plan_label = false !== $pos ? substr( $data['plan_label'], 0, $pos ) : $data['plan_label'];
?>
<div class="imagify-admin-bar-quota">
<div class="imagify-abq-row">
Expand All @@ -8,7 +11,7 @@
<?php endif; ?>
<div class="imagify-account">
<p class="imagify-meteo-title"><?php esc_html_e( 'Account status', 'imagify' ); ?></p>
<p class="imagify-meteo-subs"><?php esc_html_e( 'Your subscription:', 'imagify' ); ?> &nbsp;<strong class="imagify-user-plan"><?php echo $data['plan_label']; ?></strong></p>
<p class="imagify-meteo-subs"><?php esc_html_e( 'Your subscription:', 'imagify' ); ?> &nbsp;<strong class="imagify-user-plan"><?php echo $plan_label; ?></strong></p>
</div>
</div>
<?php if ( $data['plan_with_quota'] ) : ?>
Expand Down
8 changes: 4 additions & 4 deletions views/part-upsell.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
$upgrade = esc_html__( 'Upgrade your plan now to keep optimizing your images.', 'imagify' );

if ( $imagify_user->is_monthly ) {
$price = esc_html__( 'For $9.99/month only, choose unlimited image optimization!', 'imagify' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/plan_switch/?label=infinite&payment_plan=1&utm_source=plugin&utm_medium=upsell_banner';
$price = esc_html__( 'For $11.99/month only, choose unlimited image optimization!', 'imagify' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/plan_switch/?label=infinite_3&payment_plan=1&utm_source=plugin&utm_medium=upsell_banner';
} else {
$price = esc_html__( 'For $99.9/year only, choose unlimited image optimization!', 'imagify' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/plan_switch/?label=infinite&payment_plan=2&utm_source=plugin&utm_medium=upsell_banner';
$price = esc_html__( 'For $9.99/month only, choose unlimited image optimization!', 'imagify' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/plan_switch/?label=infinite_3&payment_plan=2&utm_source=plugin&utm_medium=upsell_banner';
}
}
?>
Expand Down

0 comments on commit b634182

Please sign in to comment.