| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' ); |
| 3 |
|
| 4 |
/* |
| 5 |
* Get the optimization data list for a specific attachment. |
| 6 |
* |
| 7 |
* @since 1.0 |
| 8 |
* @author Jonathan Buttigieg |
| 9 |
* |
| 10 |
* @param object $attachment The attachment object. |
| 11 |
* @return string The output to print. |
| 12 |
*/ |
| 13 |
function get_imagify_attachment_optimization_text( $attachment, $context = 'wp' ) { |
| 14 |
global $pagenow; |
| 15 |
|
| 16 |
$attachment_id = $attachment->id; |
| 17 |
$data = $attachment->get_data(); |
| 18 |
$output = ( 'post.php' != $pagenow ) ? '<ul class="imagify-datas-list">' : ''; |
| 19 |
$output_before = ( 'post.php' != $pagenow ) ? '<li class="imagify-data-item">' : '<div class="misc-pub-section misc-pub-imagify imagify-data-item">'; |
| 20 |
$output_after = ( 'post.php' != $pagenow ) ? '</li>' : '</div>'; |
| 21 |
$reoptimize_output = ''; |
| 22 |
|
| 23 |
if ( $error = get_imagify_attachment_error_text( $attachment, $context ) ) { |
| 24 |
$error = ( 'post.php' === $pagenow ) ? $output_before . $error . $output_after : $error; |
| 25 |
return $error; |
| 26 |
} |
| 27 |
|
| 28 |
$optimization_level = $attachment->get_optimization_level_label(); |
| 29 |
|
| 30 |
if ( imagify_valid_key() && $attachment->has_backup() ) { |
| 31 |
$reoptimize_link = get_imagify_attachment_reoptimize_link( $attachment, $context ); |
| 32 |
$reoptimize_output = ( $reoptimize_link ) ? $reoptimize_link : ''; |
| 33 |
} |
| 34 |
|
| 35 |
if ( 'post.php' !== $pagenow ) { |
| 36 |
$output .= $output_before . '<span class="data">' . __( 'New Filesize:', 'imagify' ) . '</span> <strong class="big">' . size_format( $data['sizes']['full']['optimized_size'], 2 ) . '</strong>' . $output_after; |
| 37 |
} |
| 38 |
|
| 39 |
$chart = '<span class="imagify-chart"> |
| 40 |
<span class="imagify-chart-container"> |
| 41 |
<canvas id="imagify-consumption-chart" width="15" height="15"></canvas> |
| 42 |
</span> |
| 43 |
</span>'; |
| 44 |
|
| 45 |
$output .= $output_before . '<span class="data">' . __( 'Original Saving:', 'imagify' ) . '</span> <strong> |
| 46 |
' . ( ( 'post.php' != $pagenow ) ? $chart : '' ) . '<span class="imagify-chart-value">' . $data['sizes']['full']['percent'] . '</span>%</strong>' . $output_after; |
| 47 |
|
| 48 |
// more details section |
| 49 |
if ( 'post.php' != $pagenow ) { |
| 50 |
// new list |
| 51 |
$output .= '</ul>'; |
| 52 |
$output .= '<p class="imagify-datas-more-action"><a href="#imagify-view-details-' . $attachment_id . '" data-close="' . __( 'Close details', 'imagify' ) . '" data-open="' . __( 'View details', 'imagify' ) . '"><span class="the-text">' . __( 'View details', 'imagify' ) . '</span><span class="dashicons dashicons-arrow-down-alt2"></span></a></p>'; |
| 53 |
$output .= '<ul id="imagify-view-details-' . $attachment_id . '" class="imagify-datas-list imagify-datas-details">'; |
| 54 |
|
| 55 |
// not in metabox |
| 56 |
$output .= $output_before . '<span class="data">' . __( 'Original Filesize:', 'imagify' ) . '</span> <strong class="original">' . $attachment->get_original_size() . '</strong>' . $output_after; |
| 57 |
} |
| 58 |
|
| 59 |
$output .= $output_before . '<span class="data">' . __( 'Level:', 'imagify' ) . '</span> <strong>' . $optimization_level . '</strong>' . $output_after; |
| 60 |
|
| 61 |
if ( $total_optimized_thumbnails = $attachment->get_optimized_sizes_count() ) { |
| 62 |
$output .= $output_before . '<span class="data">' . __( 'Thumbnails Optimized:', 'imagify' ) . '</span> <strong>' . $total_optimized_thumbnails . '</strong>' . $output_after; |
| 63 |
$output .= $output_before . '<span class="data">' . __( 'Overall Saving:', 'imagify' ) . '</span> <strong>' . $data['stats']['percent'] . '%</strong>' . $output_after; |
| 64 |
} |
| 65 |
|
| 66 |
// end of list |
| 67 |
$output .= ( 'post.php' != $pagenow ) ? '</ul>' : ''; |
| 68 |
|
| 69 |
// actions section |
| 70 |
$output .= ( 'post.php' != $pagenow ) ? '' : $output_before; |
| 71 |
$output .= '<div class="imagify-datas-actions-links">'; |
| 72 |
$output .= $reoptimize_output; |
| 73 |
|
| 74 |
if ( $attachment->has_backup() ) { |
| 75 |
$args = array( |
| 76 |
'attachment_id' => $attachment_id, |
| 77 |
'context' => $context |
| 78 |
); |
| 79 |
$class = ( 'post.php' !== $pagenow ) ? 'button-imagify-restore' : ''; |
| 80 |
$output .= '<a id="imagify-restore-' . $attachment_id . '" href="' . get_imagify_admin_url( 'restore-upload', $args ) . '" class="' . $class . '" data-waiting-label="' . esc_attr__( 'Restoring...', 'imagify' ) . '"><span class="dashicons dashicons-image-rotate"></span>' . __( 'Restore Original', 'imagify' ) . '</a>'; |
| 81 |
|
| 82 |
if ( 'upload.php' != $pagenow ) { |
| 83 |
$image = wp_get_attachment_image_src( $attachment_id, 'full' ); |
| 84 |
|
| 85 |
$output .= '<input id="imagify-original-src" type="hidden" value="' . $attachment->get_backup_url() . '">'; |
| 86 |
$output .= '<input id="imagify-original-size" type="hidden" value="' . $attachment->get_original_size() . '">'; |
| 87 |
$output .= '<input id="imagify-full-src" type="hidden" value="' . $image[0] . '">'; |
| 88 |
$output .= '<input id="imagify-full-width" type="hidden" value="' . $image[1] . '">'; |
| 89 |
$output .= '<input id="imagify-full-height" type="hidden" value="' . $image[2] . '">'; |
| 90 |
} |
| 91 |
} |
| 92 |
|
| 93 |
$output .= '</div><!-- .imagify-datas-actions-links -->'; |
| 94 |
$output .= ( 'post.php' != $pagenow ) ? '' : $output_after; |
| 95 |
|
| 96 |
return $output; |
| 97 |
} |
| 98 |
|
| 99 |
/* |
| 100 |
* Get the error message for a specific attachment. |
| 101 |
* |
| 102 |
* @since 1.0 |
| 103 |
* @author Jonathan Buttigieg |
| 104 |
* |
| 105 |
* @param object $attachment The attachement object. |
| 106 |
* @return string The output to print. |
| 107 |
*/ |
| 108 |
function get_imagify_attachment_error_text( $attachment, $context = 'wp' ) { |
| 109 |
global $pagenow; |
| 110 |
|
| 111 |
$attachment_id = $attachment->id; |
| 112 |
$data = $attachment->get_data(); |
| 113 |
$output = ''; |
| 114 |
$args = array( |
| 115 |
'attachment_id' => $attachment_id, |
| 116 |
'context' => $context |
| 117 |
); |
| 118 |
|
| 119 |
if ( isset( $data['sizes']['full']['success'] ) && ! $data['sizes']['full']['success'] ) { |
| 120 |
$class = ( 'post.php' !== $pagenow ) ? 'button-imagify-manual-upload' : ''; |
| 121 |
$output .= '<strong>' . $data['sizes']['full']['error'] . '</strong><br/><a id="imagify-upload-' . $attachment_id . '" class="button ' . $class . '" href="' . get_imagify_admin_url( 'manual-upload', $args ) . '" data-waiting-label="' . esc_attr__( 'Optimizing...', 'imagify' ) . '">' . __( 'Try again', 'imagify' ) . '</a>'; |
| 122 |
} |
| 123 |
|
| 124 |
return $output; |
| 125 |
} |
| 126 |
|
| 127 |
/* |
| 128 |
* Get the re-optimize link for a specific attachment. |
| 129 |
* |
| 130 |
* @since 1.0 |
| 131 |
* @author Jonathan Buttigieg |
| 132 |
* |
| 133 |
* @param int $attachment_id The attachement ID. |
| 134 |
* @return string The output to print. |
| 135 |
*/ |
| 136 |
function get_imagify_attachment_reoptimize_link( $attachment, $context = 'wp' ) { |
| 137 |
global $pagenow; |
| 138 |
|
| 139 |
$attachment_id = $attachment->id; |
| 140 |
$level = (int) $attachment->get_optimization_level(); |
| 141 |
$args = array( |
| 142 |
'attachment_id' => $attachment_id, |
| 143 |
'context' => $context |
| 144 |
); |
| 145 |
$output = ''; |
| 146 |
|
| 147 |
if ( $attachment->has_backup() ) { |
| 148 |
$class = ( 'post.php' !== $pagenow ) ? 'button-imagify-manual-override-upload' : ''; |
| 149 |
|
| 150 |
// Re-optimize to Ultra |
| 151 |
if ( 1 === $level || 0 === $level ) { |
| 152 |
$args['optimization_level'] = 2; |
| 153 |
$output .= '<a href="' . get_imagify_admin_url( 'manual-override-upload', $args ) . '" class="' . $class . '" data-waiting-label="' . esc_attr__( 'Optimizing...', 'imagify' ) . '"><span class="dashicons dashicons-admin-generic"></span>' . sprintf( __( 'Re-Optimize to %s', 'imagify' ), __( 'Ultra', 'imagify' ) ) . '</a>'; |
| 154 |
} |
| 155 |
|
| 156 |
// Re-optimize to Aggressive |
| 157 |
if ( 2 === $level || 0 === $level ) { |
| 158 |
$args['optimization_level'] = 1; |
| 159 |
$output .= '<a href="' . get_imagify_admin_url( 'manual-override-upload', $args ) . '" class="' . $class . '" data-waiting-label="' . esc_attr__( 'Optimizing...', 'imagify' ) . '"><span class="dashicons dashicons-admin-generic"></span>' . sprintf( __( 'Re-Optimize to %s', 'imagify' ), __( 'Aggressive', 'imagify' ) ) . '</a>'; |
| 160 |
} |
| 161 |
|
| 162 |
// Re-optimize to Normal |
| 163 |
if ( 2 === $level || 1 === $level ) { |
| 164 |
$args['optimization_level'] = 0; |
| 165 |
$output .= '<a href="' . get_imagify_admin_url( 'manual-override-upload', $args ) . '" class="' . $class . '" data-waiting-label="' . esc_attr__( 'Optimizing...', 'imagify' ) . '"><span class="dashicons dashicons-admin-generic"></span>' . sprintf( __( 'Re-Optimize to %s', 'imagify' ), __( 'Normal', 'imagify' ) ) . '</a>'; |
| 166 |
} |
| 167 |
|
| 168 |
} |
| 169 |
|
| 170 |
return $output; |
| 171 |
} |
| 172 |
|
| 173 |
/* |
| 174 |
* Get all data to diplay for a specific attachment. |
| 175 |
* |
| 176 |
* @since 1.2 |
| 177 |
* @author Jonathan Buttigieg |
| 178 |
* |
| 179 |
* @param object $attachment The attachement object. |
| 180 |
* @return string The output to print. |
| 181 |
*/ |
| 182 |
function get_imagify_media_column_content( $attachment, $context = 'wp' ) { |
| 183 |
$attachment_id = $attachment->id; |
| 184 |
$attachment_ext = $attachment->get_extension(); |
| 185 |
$output = ''; |
| 186 |
|
| 187 |
// Check if the attachment extension is allowed |
| 188 |
if ( 'wp' === $context && ! wp_attachment_is_image( $attachment_id ) ) { |
| 189 |
$output = sprintf( __( '%s can\'t be optimized', 'imagify' ), strtoupper( $attachment_ext ) ); |
| 190 |
return $output; |
| 191 |
} |
| 192 |
|
| 193 |
// Check if the API key is valid |
| 194 |
if ( ! imagify_valid_key() && ! $attachment->is_optimized() ) { |
| 195 |
$output .= __( 'Invalid API key', 'imagify' ); |
| 196 |
$output .= '<br/>'; |
| 197 |
$output .= '<a href="' . get_imagify_admin_url( 'options-general' ) . '">' . __( 'Check your Settings', 'imagify' ) . '</a>'; |
| 198 |
return $output; |
| 199 |
} |
| 200 |
|
| 201 |
$transient_context = ( 'wp' !== $context ) ? strtolower( $context ) . '-' : ''; |
| 202 |
$transient_name = 'imagify-' . $transient_context . 'async-in-progress-' . $attachment_id; |
| 203 |
|
| 204 |
if ( false !== get_transient( $transient_name ) ) { |
| 205 |
$output = '<div class="button"><span class="imagify-spinner"></span>' . __( 'Optimizing...', 'imagify' ) . '</div>'; |
| 206 |
return $output; |
| 207 |
} |
| 208 |
|
| 209 |
// Check if the image was optimized |
| 210 |
if ( ! $attachment->is_optimized() && ! $attachment->has_error() ) { |
| 211 |
$args = array( |
| 212 |
'attachment_id' => $attachment_id, |
| 213 |
'context' => $context |
| 214 |
); |
| 215 |
$output .= '<a id="imagify-upload-' . $attachment_id . '" href="' . get_imagify_admin_url( 'manual-upload', $args ) . '" class="button-primary button-imagify-manual-upload" data-waiting-label="' . esc_attr__( 'Optimizing...', 'imagify' ) . '">' . __( 'Optimize', 'imagify' ) . '</a>'; |
| 216 |
return $output; |
| 217 |
} |
| 218 |
|
| 219 |
$output .= get_imagify_attachment_optimization_text( $attachment, $context ); |
| 220 |
return $output; |
| 221 |
} |
| 222 |
|
| 223 |
/** |
| 224 |
* Add a small section with button |
| 225 |
* |
| 226 |
* @return string HTML |
| 227 |
* |
| 228 |
* @since 1.5 |
| 229 |
* @author Geoffrey |
| 230 |
* |
| 231 |
* @todo add only for no-payable users? |
| 232 |
*/ |
| 233 |
function get_imagify_new_to_imagify() { |
| 234 |
if ( apply_filters( 'imagify_show_new_to_imagify', true ) ) { |
| 235 |
return ' |
| 236 |
<div class="imagify-section imagify-section-positive"> |
| 237 |
<div class="imagify-start imagify-mr2"> |
| 238 |
<button id="imagify-get-pricing-modal" data-nonce="' . 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-button-big"> |
| 239 |
<i class="dashicons dashicons-dashboard" aria-hidden="true"></i> |
| 240 |
<span class="button-text">' . esc_html__( 'What plan do I need?', 'imagify' ) . '</span> |
| 241 |
</button> |
| 242 |
</div> |
| 243 |
<div class="imagify-oh"> |
| 244 |
<p class="imagify-section-title">' . esc_html__( 'You\'re new to Imagify?', 'imagify' ) . '</p> |
| 245 |
<p>' . esc_html__( 'Let us help you by analyzing your existing images and determinate the best plan for you', 'imagify' ) . '</p> |
| 246 |
</div> |
| 247 |
</div> |
| 248 |
'; |
| 249 |
} |
| 250 |
} |
| 251 |
|
| 252 |
/** |
| 253 |
* Return the formatted price present in pricing tables |
| 254 |
* |
| 255 |
* @param float $value the price value |
| 256 |
* @return string the markuped price |
| 257 |
* |
| 258 |
* @since 1.5 |
| 259 |
* @author Geoffrey |
| 260 |
*/ |
| 261 |
function get_imagify_price_table_format( $value ) { |
| 262 |
$v = explode( '.', (string) $value ); |
| 263 |
|
| 264 |
return '<span class="imagify-price-big">' . $v[0] . '</span> <span class="imagify-price-mini">.' . ( strlen( $v[1] ) === 1 ? $v[1] . '0' : $v[1] ) . '</span>'; |
| 265 |
} |
| 266 |
|
| 267 |
/** |
| 268 |
* Return the payment modal HTML |
| 269 |
* @return string HTML code for payement modal |
| 270 |
* |
| 271 |
* @since 1.5 |
| 272 |
* @author Geoffrey |
| 273 |
*/ |
| 274 |
function imagify_payment_modal() { |
| 275 |
?> |
| 276 |
<div id="imagify-pricing-modal" class="imagify-modal imagify-payment-modal" aria-hidden="false" role="dialog" aria-labelledby="imagify-pricing-step-1"> |
| 277 |
<div class="imagify-modal-content"> |
| 278 |
<div class="imagify-modal-main"> |
| 279 |
<ol class="imagify-payment-steps"> |
| 280 |
<li id="imagify-pricing-step-1" class="active"><?php esc_html_e( 'Choose Plan', 'imagify' ); ?></li> |
| 281 |
<li id="imagify-pricing-step-2"><?php esc_html_e( 'Payment Info', 'imagify' ); ?></li> |
| 282 |
</ol> |
| 283 |
|
| 284 |
<div class="imagify-modal-views imagify-pre-checkout-view" id="imagify-pre-checkout-view" aria-hidden="false"> |
| 285 |
<div class="imagify-modal-section section-gray"> |
| 286 |
<p class="imagify-modal-title"><?php esc_html_e( 'We analysed your images', 'imagify' ); ?></p> |
| 287 |
|
| 288 |
<div class="imagify-modal-cols"> |
| 289 |
<div class="imagify-col"> |
| 290 |
<p> |
| 291 |
<span class="imagify-border-styled"><?php |
| 292 |
printf( esc_html__( 'You have %s images', 'imagify' ), '</span><span class="imagify-big-number">58000</span><span class="imagify-border-styled">' ); ?></span> |
| 293 |
</p> |
| 294 |
</div> |
| 295 |
<div class="imagify-col"> |
| 296 |
<p class="imagify-iconed"> |
| 297 |
<i class="dashicons dashicons-images-alt2" aria-hidden="true"></i> |
| 298 |
<?php printf( esc_html__( 'You actually have %s of images in your library.', 'imagify' ), '<strong class="imagify-dark">3 GB</strong>' ); ?> |
| 299 |
</p> |
| 300 |
<p class="imagify-iconed"> |
| 301 |
<i class="dashicons dashicons-cloud" aria-hidden="true"></i> |
| 302 |
<?php printf( esc_html__( 'You upload around %s of images per month.', 'imagify' ), '<strong class="imagify-dark">353 MB</strong>' ); ?> |
| 303 |
</p> |
| 304 |
</div> |
| 305 |
</div> |
| 306 |
</div> |
| 307 |
|
| 308 |
<div class="imagify-modal-section"> |
| 309 |
<p class="imagify-modal-title"><?php esc_html_e( 'We recommend you this plan', 'imagify' ); ?></p> |
| 310 |
|
| 311 |
<div class="imagify-offer-line imagify-offer-monthly imagify-offer-selected imagify-month-selected" data-offer='{"lite":{"id":3,"name":"Lite","data":1073741824,"dataf":"1 GB","imgs":5000,"prices":{"monthly":4.99,"yearly":4.16,"add":4}}}'> |
| 312 |
<div class="imagify-offer-header"> |
| 313 |
<p class="imagify-offer-title imagify-switch-my"> |
| 314 |
<span aria-hidden="false" class="imagify-monthly"><?php esc_html_e( 'Subscribe a monthly plan', 'imagify' ); ?></span> |
| 315 |
<span aria-hidden="true" class="imagify-yearly"><?php esc_html_e( 'Subscribe a yearly plan', 'imagify' ); ?></span> |
| 316 |
</p> |
| 317 |
<div class="imagify-inline-options imagify-radio-line"> |
| 318 |
<input id="imagify-subscription-monthly" type="radio" value="monthly" name="plan-subscription" checked="checked"> |
| 319 |
<label for="imagify-subscription-monthly"><?php esc_html_e( 'Monthly' , 'imagify' ); ?></label> |
| 320 |
|
| 321 |
<input id="imagify-subscription-yearly" type="radio" value="yearly" name="plan-subscription"> |
| 322 |
<label for="imagify-subscription-yearly"><?php esc_html_e( 'Yearly' , 'imagify' ); ?><span class="imagify-2-free"><?php esc_html_e( '2 months free', 'imagify' ) ?></span></label> |
| 323 |
</div><!-- .imagify-radio-line --> |
| 324 |
</div><!-- .imagify-offer-header --> |
| 325 |
|
| 326 |
<div class="imagify-offer-content imagify-flex-table"> |
| 327 |
|
| 328 |
<div class="imagify-col-checkbox"> |
| 329 |
<input type="checkbox" name="imagify-offer" id="imagify-offer-1gb" value="1Gb" checked="checked" class="imagify-checkbox medium"> |
| 330 |
<label for="imagify-offer-1gb"> |
| 331 |
<span class="imagify-the-offer"> |
| 332 |
<span class="imagify-offer-size">1 GB</span> |
| 333 |
<span class="imagify-offer-by"><?php esc_html_e( '/month', 'imagify' ); ?></span> |
| 334 |
</span> |
| 335 |
<span class="imagify-approx"><?php printf( esc_html__( 'approx: %s images', 'imagify' ), '<span class="imagify-approx-nb">5 000</span>' ); ?></span> |
| 336 |
</label> |
| 337 |
</div> |
| 338 |
<div class="imagify-col-price imagify-flex-table"> |
| 339 |
<span class="imagify-price-block"> |
| 340 |
<span class="imagify-dollars">$</span> |
| 341 |
<span class="imagify-number-block"> |
| 342 |
<span class="imagify-switch-my"> |
| 343 |
<span class="imagify-monthly" aria-hidden="false"> |
| 344 |
<span class="imagify-price-big">3</span> |
| 345 |
<span class="imagify-price-mini">.99</span> |
| 346 |
</span> |
| 347 |
<span class="imagify-yearly" aria-hidden="true"> |
| 348 |
<span class="imagify-price-big">3</span> |
| 349 |
<span class="imagify-price-mini">.16</span> |
| 350 |
</span> |
| 351 |
</span> |
| 352 |
<span class="imagify-price-by"><?php esc_html_e( '/month', 'imagify' ); ?></span> |
| 353 |
</span> |
| 354 |
</span> |
| 355 |
|
| 356 |
<p class="imagify-price-complement"><?php printf( __( '%s per<br> |
| 357 |
additionnal Gb', 'imagify' ), '<span class="imagify-price-add-data"></span>' ); ?></p> |
| 358 |
|
| 359 |
</div> |
| 360 |
<div class="imagify-col-other-actions"> |
| 361 |
<a href="#imagify-plans-selection-view" class="imagify-choose-another-plan" data-imagify-choose="plan"><?php esc_html_e( 'Choose another plan', 'imagify' ); ?></a> |
| 362 |
</div> |
| 363 |
|
| 364 |
</div><!-- .imagify-offer-content --> |
| 365 |
|
| 366 |
</div><!-- .imagify-offer-line --> |
| 367 |
|
| 368 |
<div class="imagify-offer-line imagify-offer-onetime" data-offer='{"recommended":{"id":999,"name":"Customized","data":3000001337,"dataf":"3 GB","imgs":54634,"price":28.98}}'> |
| 369 |
<div class="imagify-offer-header"> |
| 370 |
<p class="imagify-offer-title"> |
| 371 |
<?php esc_html_e( 'Optimize the images you already have, buy a one-time plan', 'imagify' ); ?> |
| 372 |
</p> |
| 373 |
</div><!-- .imagify-offer-header --> |
| 374 |
|
| 375 |
<div class="imagify-offer-content imagify-flex-table"> |
| 376 |
|
| 377 |
<div class="imagify-col-checkbox"> |
| 378 |
<input type="checkbox" name="imagify-offer" id="imagify-offer-custom" value="1Gb" class="imagify-checkbox medium"> |
| 379 |
<label for="imagify-offer-custom"> |
| 380 |
<span class="imagify-the-offer"> |
| 381 |
<span class="imagify-offer-size">3 GB</span> |
| 382 |
</span> |
| 383 |
<span class="imagify-approx"><?php printf( esc_html__( 'approx: %s images', 'imagify' ), '<span class="imagify-approx-nb">54000</span>' ); ?></span> |
| 384 |
</label> |
| 385 |
</div> |
| 386 |
<div class="imagify-col-price imagify-flex-table"> |
| 387 |
<span class="imagify-price-block"> |
| 388 |
<span class="imagify-dollars">$</span> |
| 389 |
<span class="imagify-number-block"> |
| 390 |
<span class="imagify-price-big">60</span> |
| 391 |
<span class="imagify-price-mini">.99</span> |
| 392 |
</span> |
| 393 |
</span> |
| 394 |
</div> |
| 395 |
<div class="imagify-col-other-actions"> |
| 396 |
<a href="#imagify-plans-selection-view" class="imagify-choose-another-plan" data-imagify-choose="onetime"><?php esc_html_e( 'Choose another plan', 'imagify' ); ?></a> |
| 397 |
</div> |
| 398 |
|
| 399 |
</div><!-- .imagify-offer-content --> |
| 400 |
|
| 401 |
</div><!-- .imagify-offer-line --> |
| 402 |
|
| 403 |
|
| 404 |
<p class="imagify-submit-line"> |
| 405 |
<button type="button" class="button button-secondary imagify-button-secondary" id="imagify-modal-checkout-btn"> |
| 406 |
<i class="dashicons dashicons-cart" aria-hidden="true"></i> |
| 407 |
<?php esc_html_e( 'Checkout', 'imagify' ); ?> |
| 408 |
</button> |
| 409 |
</p> |
| 410 |
|
| 411 |
<p class="imagify-footer-lines"><?php esc_html_e( 'Monthly plans comes with credits which is renewed every months. The billing happens automatically each month or year depending the billing period you choose.', 'imagify' ); ?></p> |
| 412 |
</div> |
| 413 |
</div><!-- .imagify-pre-checkout-view --> |
| 414 |
|
| 415 |
<?php |
| 416 |
|
| 417 |
|
| 418 |
|
| 419 |
/** |
| 420 |
* |
| 421 |
* |
| 422 |
* SECOND MODAL VIEW |
| 423 |
* |
| 424 |
* |
| 425 |
*/ |
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
?> |
| 430 |
|
| 431 |
<div class="imagify-modal-views imagify-plans-selection-view" id="imagify-plans-selection-view" aria-hidden="true"> |
| 432 |
<ul class="imagify-tabs" role="tablist"> |
| 433 |
<li class="imagify-tab imagify-current"> |
| 434 |
<a href="#imagify-pricing-tab-monthly" role="tab" aria-controls="imagify-pricing-tab-monthly" aria-selected="true"> |
| 435 |
<?php esc_html_e( 'Monthly Plans', 'imagify' ); ?> |
| 436 |
</a> |
| 437 |
</li> |
| 438 |
<li class="imagify-tab"> |
| 439 |
<a href="#imagify-pricing-tab-onetime" role="tab" aria-controls="imagify-pricing-tab-onetime" aria-selected="false"> |
| 440 |
<?php esc_html_e( 'One Time Plans', 'imagify' ); ?> |
| 441 |
</a> |
| 442 |
</li> |
| 443 |
</ul><!-- .imagify-tabs --> |
| 444 |
|
| 445 |
<div class="imagify-tabs-contents"> |
| 446 |
|
| 447 |
<div class="imagify-tab-content imagify-current" id="imagify-pricing-tab-monthly" role="tabpanel"> |
| 448 |
|
| 449 |
<div class="imagify-modal-section section-gray"> |
| 450 |
<p><?php esc_html_e( 'Monthly plans come with credits which is renewed every months. The billing happens automatically each month or year depending the billing period you choose.', 'imagify' ); ?></p> |
| 451 |
</div> |
| 452 |
|
| 453 |
<div class="imagify-inline-options imagify-small-options imagify-radio-line"> |
| 454 |
<input id="imagify-pricing-montly" type="radio" value="monthly" name="plan-pricing" checked="checked"> |
| 455 |
<label for="imagify-pricing-montly"><?php esc_html_e( 'Monthly' , 'imagify' ); ?></label> |
| 456 |
|
| 457 |
<input id="imagify-pricing-yearly" type="radio" value="yearly" name="plan-pricing"> |
| 458 |
<label for="imagify-pricing-yearly"><?php esc_html_e( 'Yearly' , 'imagify' ); ?><span class="imagify-2-free imagify-b-right"><?php esc_html_e( '2 months free', 'imagify' ) ?></span></label> |
| 459 |
</div><!-- .imagify-radio-line --> |
| 460 |
|
| 461 |
<div class="imagify-pricing-table imagify-month-selected"> |
| 462 |
|
| 463 |
<script type="text/template" id="imagify-offer-monthly-template"><div class="imagify-offer-line imagify-offer-monthlies imagify-flex-table"> |
| 464 |
<div class="imagify-col-details"> |
| 465 |
<p class="imagify-label"> |
| 466 |
<span class="imagify-the-offer"> |
| 467 |
<span class="imagify-offer-size"></span> |
| 468 |
<span class="imagify-offer-by"><?php esc_html_e( '/month', 'imagify' ); ?></span> |
| 469 |
</span> |
| 470 |
<span class="imagify-approx"><?php printf( __( 'approx: %s images', 'imagify' ), '<span class="imagify-approx-nb"></span>' ); ?></span> |
| 471 |
</p> |
| 472 |
</div> |
| 473 |
<div class="imagify-col-price imagify-flex-table"> |
| 474 |
<span class="imagify-price-block"> |
| 475 |
<span class="imagify-dollars">$</span> |
| 476 |
<span class="imagify-number-block"> |
| 477 |
<span class="imagify-switch-my"></span> |
| 478 |
<span class="imagify-price-by"><?php esc_html_e( '/month', 'imagify' ); ?></span> |
| 479 |
</span> |
| 480 |
</span> |
| 481 |
|
| 482 |
<span class="imagify-recommend" aria-hidden="true"><?php esc_html_e( 'we recommend for you', 'imagify' ); ?></span> |
| 483 |
|
| 484 |
<p class="imagify-price-complement"><?php printf( __( '%s per<br> |
| 485 |
additionnal Gb', 'imagify' ), '<span class="imagify-price-add-data"></span>' ); ?></p> |
| 486 |
|
| 487 |
</div><!-- .imagify-col-price --> |
| 488 |
|
| 489 |
<div class="imagify-col-other-actions"> |
| 490 |
<button type="button" class="button imagify-button-secondary mini imagify-payment-btn-select-plan"><?php esc_html_e( 'Choose plan', 'imagify' ); ?></button> |
| 491 |
</div> |
| 492 |
</div><!-- .imagify-offer-line --></script> |
| 493 |
</div><!-- .imagify-pricing-table --> |
| 494 |
|
| 495 |
<div class="imagify-cols"> |
| 496 |
<div class="imagify-col imagify-txt-start"> |
| 497 |
<p class="imagify-special-needs"> |
| 498 |
<strong><?php esc_html_e( 'Need more?', 'imagify' ); ?></strong> |
| 499 |
<span><?php esc_html_e( 'for special needs', 'imagify' ); ?></span> |
| 500 |
</p> |
| 501 |
</div> |
| 502 |
<div class="imagify-col imagify-txt-end"> |
| 503 |
<p><a class="button imagify-button-ghost imagify-button-medium imagify-mt1 imagify-mb1 imagify-mr1" href="https://imagify.io/<?php echo ( get_locale() === 'fr_FR' ? 'fr/' : '' ) ?>contact" target="_blank"><i class="dashicons dashicons-email" aria-hidden="true"></i> <?php esc_html_e( 'Contact Us', 'imagify' ); ?></a></p> |
| 504 |
</div> |
| 505 |
</div> |
| 506 |
|
| 507 |
</div><!-- .imagify-tab-content --> |
| 508 |
<div class="imagify-tab-content" id="imagify-pricing-tab-onetime" role="tabpanel"> |
| 509 |
<div class="imagify-modal-section section-gray"> |
| 510 |
<p><?php esc_html_e( 'One time plans are useful if you have a lots of existing images which need to be optimized. You can use it for bulk optimizing all your past images. You will pay only once.', 'imagify' ); ?></p> |
| 511 |
</div> |
| 512 |
|
| 513 |
|
| 514 |
<div class="imagify-pricing-table imagify-month-selected"> |
| 515 |
<script type="text/template" id="imagify-offer-onetime-template"><div class="imagify-offer-line imagify-flex-table imagify-offer-onetimes"> |
| 516 |
<div class="imagify-col-details"> |
| 517 |
<p class="imagify-label"> |
| 518 |
<span class="imagify-the-offer"> |
| 519 |
<span class="imagify-offer-size"></span> |
| 520 |
</span> |
| 521 |
<span class="imagify-approx"><?php printf( __( 'approx: %s images', 'imagify' ), '<span class="imagify-approx-nb"></span>' ); ?></span> |
| 522 |
</p> |
| 523 |
</div> |
| 524 |
<div class="imagify-col-price"> |
| 525 |
<span class="imagify-price-block"> |
| 526 |
<span class="imagify-dollars">$</span> |
| 527 |
<span class="imagify-number-block"></span> |
| 528 |
</span> |
| 529 |
<span class="imagify-recommend"><?php esc_html__( 'we recommend for you', 'imagify' ); ?></span> |
| 530 |
</div><!-- .imagify-col-price --> |
| 531 |
|
| 532 |
<div class="imagify-col-other-actions"> |
| 533 |
<button type="button" class="button imagify-button-secondary mini imagify-payment-btn-select-plan"><?php esc_html_e( 'Choose plan', 'imagify' ); ?></button> |
| 534 |
</div> |
| 535 |
</div><!-- .imagify-offer-line --></script> |
| 536 |
</div><!-- .imagify-pricing-table --> |
| 537 |
|
| 538 |
</div><!-- .imagify-tab-content --> |
| 539 |
|
| 540 |
</div><!-- .imagify-tabs-contents --> |
| 541 |
</div><!-- .imagify-plans-selection-view --> |
| 542 |
|
| 543 |
|
| 544 |
<?php |
| 545 |
|
| 546 |
|
| 547 |
|
| 548 |
/** |
| 549 |
* |
| 550 |
* |
| 551 |
* THIRD MODAL VIEW |
| 552 |
* |
| 553 |
* |
| 554 |
*/ |
| 555 |
|
| 556 |
|
| 557 |
|
| 558 |
?> |
| 559 |
|
| 560 |
<div class="imagify-modal-views imagify-payment-process-view" id="imagify-payment-process-view" aria-hidden="true"> |
| 561 |
<div class="imagify-modal-section section-gray"> |
| 562 |
<div class="imagify-cart imagify-month-selected"> |
| 563 |
<p class="imagify-cart-label"><?php esc_html_e( 'Your order', 'imagify' ); ?></p> |
| 564 |
|
| 565 |
<div class="imagify-cart-list"> |
| 566 |
<?php |
| 567 |
$emptied_item = '<div class="imagify-cart-emptied-item"> |
| 568 |
<p>' . sprintf( esc_html__( '%scancel%sYou just removed %s', 'imagify' ), '<a href="#cancel" class="imagify-cancel-removing">', '</a>', '<span class="imagify-removed-name"></span>' ) . '</p> |
| 569 |
</div>'; |
| 570 |
?> |
| 571 |
|
| 572 |
<!-- JS stuff will complete the datas of list item --> |
| 573 |
|
| 574 |
<div class="imagify-cart-item imagify-cart-item-monthly imagify-flex-table imagify-align-top" data-offer=""> |
| 575 |
<div class="imagify-cl-remove"> |
| 576 |
<button type="button" class="imagify-remove-from-cart" title="<?php esc_html_e( 'Remove this item', 'imagify' ); ?>"><i class="dashicons dashicons-no-alt" aria-hidden="true"></i></button> |
| 577 |
</div> |
| 578 |
<div class="imagify-cl-name"> |
| 579 |
<p class="imagify-cart-product-name"><span class="imagify-the-product-name"></span> Monthly plan</p> |
| 580 |
<p class="imagify-cart-suggestion"><a href="#step1" class="imagify-back-to-plans"><?php esc_html_e( 'Choose another plan', 'imagify' ); ?></a></p> |
| 581 |
</div> |
| 582 |
<div class="imagify-cl-description"> |
| 583 |
<p><?php printf( esc_html__( '%s per month', 'imagify' ), '<span class="imagify-cart-offer-data"></span>') ?></p> |
| 584 |
</div> |
| 585 |
<div class="imagify-cl-price imagify-price-block"> |
| 586 |
<span class="imagify-dollars">$</span> |
| 587 |
<span class="imagify-number-block"> |
| 588 |
<span class="imagify-switch-my"> |
| 589 |
</span> |
| 590 |
</span> |
| 591 |
</div> |
| 592 |
</div><!-- .imagify-cart-item --> |
| 593 |
<?php echo $emptied_item; ?> |
| 594 |
|
| 595 |
<div class="imagify-cart-item imagify-cart-item-onetime imagify-flex-table imagify-align-top" data-offer=""> |
| 596 |
<div class="imagify-cl-remove"> |
| 597 |
<button type="button" class="imagify-remove-from-cart" title="<?php esc_html_e( 'Remove this item', 'imagify' ); ?>"><i class="dashicons dashicons-no-alt" aria-hidden="true"></i></button> |
| 598 |
</div> |
| 599 |
<div class="imagify-cl-name"> |
| 600 |
<p class="imagify-cart-product-name"><span class="imagify-the-product-name"></span> One Time Plan</p> |
| 601 |
<p class="imagify-cart-suggestion"><a href="#step1" class="imagify-back-to-plans"><?php esc_html_e( 'Choose another plan', 'imagify' ); ?></a></p> |
| 602 |
</div> |
| 603 |
<div class="imagify-cl-description"> |
| 604 |
<p><?php printf( esc_html__( 'one time %s', 'imagify' ), '<span class="imagify-cart-offer-data"></span>') ?></p> |
| 605 |
</div> |
| 606 |
<div class="imagify-cl-price imagify-price-block"> |
| 607 |
<span class="imagify-dollars">$</span> |
| 608 |
<span class="imagify-number-block"> |
| 609 |
</span> |
| 610 |
</div> |
| 611 |
</div><!-- .imagify-cart-item --> |
| 612 |
<?php echo $emptied_item; ?> |
| 613 |
</div><!-- .imagify-cart-list --> |
| 614 |
|
| 615 |
<div class="imagify-cols imagify-cart-list-my-choice"> |
| 616 |
<div class="imagify-col imagify-switch-my imagify-pr1"> |
| 617 |
<p class="imagify-monthly"><?php printf( __( 'Switch to yearly subscription and <br><strong class="imagify-dark">save %s per year!</strong>', 'imagify' ), '<span class="imagify-nb-save-per-year"></span>' ); ?></p> |
| 618 |
<p class="imagify-yearly"><?php printf( __( 'Perfect!<br>You\'re <strong class="imagify-dark">saving %s per year!</strong>', 'imagify' ), '<span class="imagify-nb-save-per-year"></span>' ); ?></p> |
| 619 |
</div> |
| 620 |
<div class="imagify-col"> |
| 621 |
<div class="imagify-inline-options imagify-small-options imagify-radio-line imagify-cart-list-switcher"> |
| 622 |
<input type="radio" checked="checked" name="plan-checkout" value="monthly" id="imagify-checkout-monthly"> |
| 623 |
<label for="imagify-checkout-monthly"><?php esc_html_e('Monthly', 'imagify' ); ?></label> |
| 624 |
|
| 625 |
<input type="radio" name="plan-checkout" value="yearly" id="imagify-checkout-yearly"> |
| 626 |
<label for="imagify-checkout-yearly"><?php esc_html_e('Yearly', 'imagify' ); ?><span class="imagify-2-free imagify-b-bottom"><?php esc_html_e('2 months free', 'imagify' ); ?></span></label> |
| 627 |
</div> |
| 628 |
</div> |
| 629 |
</div> |
| 630 |
|
| 631 |
</div><!-- .imagify-cart.imagify-month-selected --> |
| 632 |
</div><!-- .imagify-section-gray --> |
| 633 |
|
| 634 |
<?php $imagify_api_key = get_imagify_option( 'api_key', false ); ?> |
| 635 |
|
| 636 |
<iframe data-imagify-api="<?php echo $imagify_api_key; ?>" id="imagify-payment-iframe" src="" frameborder="0"></iframe> |
| 637 |
|
| 638 |
</div><!-- .imagify-modal-views --> |
| 639 |
|
| 640 |
|
| 641 |
<?php |
| 642 |
|
| 643 |
|
| 644 |
/** |
| 645 |
* |
| 646 |
* |
| 647 |
* Succes view |
| 648 |
* |
| 649 |
* |
| 650 |
*/ |
| 651 |
|
| 652 |
|
| 653 |
?> |
| 654 |
|
| 655 |
<div class="imagify-modal-views imagify-success-view" id="imagify-success-view" aria-hidden="true"> |
| 656 |
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>big-blue-check.png" width="113" height="109" alt=""> |
| 657 |
<p><?php esc_html_e( 'Thank you for being awesome!', 'imagify' ); ?></p> |
| 658 |
</div><!-- .imagify-modal-views --> |
| 659 |
|
| 660 |
<button class="close-btn" type="button"> |
| 661 |
<i aria-hidden="true" class="dashicons dashicons-no-alt"></i> |
| 662 |
<span class="screen-reader-text"><?php esc_html_e( 'Close', 'imagify' ); ?></span> |
| 663 |
</button> |
| 664 |
</div><!-- .imagify-modal-main --> |
| 665 |
|
| 666 |
<div class="imagify-modal-sidebar"> |
| 667 |
<div class="imagify-modal-sidebar-content imagify-txt-start"> |
| 668 |
<p class="imagify-modal-sidebar-title"><?php esc_html_e( 'What do our user think about Imagify', 'imagify' ) ?></p> |
| 669 |
|
| 670 |
<div class="imagify-modal-testimony"> |
| 671 |
<div class="imagify-modal-testimony-person"> |
| 672 |
<span class="imagify-modal-avatar"> |
| 673 |
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>pic-srhdesign.jpg" alt=""> |
| 674 |
</span> |
| 675 |
<p class="imagify-modal-identity"> |
| 676 |
<a href="https://twitter.com/SRHDesign" target="_blank">@SRHDesign</a> |
| 677 |
<a href="https://twitter.com/SRHDesign/status/686486119249260544" target="_blank"><time datetime="2016-01-11">11 jan. 2016 @ 17:40</time></a> |
| 678 |
</p> |
| 679 |
</div> |
| 680 |
<div class="imagify-modal-testimony-content"> |
| 681 |
<p>@imagify is an awesome tool that is powerful & easy to use. It's fast, rivals and surpasses other established plugins/software. Awesome!</p> |
| 682 |
</div> |
| 683 |
</div> |
| 684 |
|
| 685 |
<div class="imagify-modal-testimony"> |
| 686 |
<div class="imagify-modal-testimony-person"> |
| 687 |
<span class="imagify-modal-avatar"> |
| 688 |
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>pic-ericwaltr.jpg" alt=""> |
| 689 |
</span> |
| 690 |
<p class="imagify-modal-identity"> |
| 691 |
<a href="https://twitter.com/EricWaltr" target="_blank">@EricWaltr</a> |
| 692 |
<a href="https://twitter.com/EricWaltR/status/679053496382038016" target="_blank"><time datetime="2016-01-11">21 dec. 2015 @ 22:39</time></a> |
| 693 |
</p> |
| 694 |
</div> |
| 695 |
<div class="imagify-modal-testimony-content"> |
| 696 |
<p>Clearly @imagify is the most awesome tool to compress images on your website! A must try</p> |
| 697 |
</div> |
| 698 |
</div> |
| 699 |
|
| 700 |
<div class="imagify-modal-sidebar-trust imagify-txt-center"> |
| 701 |
<p class="imagify-secondary"> |
| 702 |
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>icon-lock.png" srcset="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>icon-lock.svg 2x" width="16" height="19" alt=""> <?php esc_html_e( 'Secure Credit Card Payment', 'imagify' ); ?></p> |
| 703 |
<p><?php esc_html_e( 'This is secure 128-bits SSL encrypted payment', 'imagify' ); ?></p> |
| 704 |
</div> |
| 705 |
</div> |
| 706 |
</div> |
| 707 |
|
| 708 |
<div class="imagify-modal-loader"></div> |
| 709 |
</div><!-- .imagify-modal-content--> |
| 710 |
</div><!-- .imagify-payment-modal --> |
| 711 |
<?php |
| 712 |
} |