rebase from live enviornment

This commit is contained in:
Rachit Bhargava
2024-01-09 22:14:20 -05:00
parent ff0b49a046
commit 3a22fcaa4a
15968 changed files with 2344674 additions and 45234 deletions

View File

@@ -0,0 +1,41 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-admin-bar-quota">
<div class="imagify-abq-row">
<?php if ( $data['plan_with_quota'] ) : ?>
<div class="imagify-meteo-icon"><?php echo $data['quota_icon']; ?></div>
<?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>
</div>
</div>
<?php if ( $data['plan_with_quota'] ) : ?>
<div class="imagify-abq-row">
<div class="imagify-space-left">
<p><?php
printf(
// translators: %s = percentage.
__( 'You have %s space credit left', 'imagify' ), '<span class="imagify-unconsumed-percent">' . $data['unconsumed_quota'] . '%</span>' );
?></p>
<div class="<?php echo esc_attr( $data['quota_class'] ); ?>">
<div style="width: <?php echo esc_attr( $data['unconsumed_quota'] ); ?>%;" class="imagify-unconsumed-bar imagify-progress"></div>
</div>
</div>
</div>
<?php endif; ?>
<?php if ( $data['plan_with_quota'] && $data['unconsumed_quota'] <= 20 ) : ?>
<div class="imagify-upsell-admin-bar">
<?php if ( $data['unconsumed_quota'] <= 20 ) : ?>
<p><i class="dashicons dashicons-warning" aria-hidden="true"></i><strong><?php esc_html_e( 'Oops, It\'s almost over!', 'imagify' ); ?></strong></p>
<?php elseif ( 0 === $data['unconsumed_quota'] ) : ?>
<p><i class="dashicons dashicons-warning" aria-hidden="true"></i><strong><?php esc_html_e( 'Oops, It\'s Over!', 'imagify' ); ?></strong></p>
<?php endif; ?>
<p><?php echo $data['text']; ?></p>
<p class="center txt-center text-center"><a class="imagify-upsell-admin-bar-button" href="<?php echo esc_url( $data['upgrade_link'] ); ?>" target="_blank"><?php echo $data['button_text']; ?></a></p>
<a href="<?php echo esc_url( get_imagify_admin_url( 'dismiss-notice', 'upsell-admin-bar' ) ); ?>" class="imagify-notice-dismiss imagify-upsell-dismiss" title="<?php esc_attr_e( 'Dismiss this notice', 'imagify' ); ?>"><span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice', 'imagify' ); ?></span></a>
</div>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,13 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
printf(
'<a href="%1$s" data-id="%2$d" data-backup-src="%3$s" data-full-src="%4$s" data-full-width="%5$d" data-full-height="%6$d" data-target="#imagify-comparison-%2$d" class="imagify-compare-images imagify-modal-trigger hide-if-no-js">%7$s</a>',
esc_url( $data['url'] ),
$data['media_id'],
esc_url( $data['backup_url'] ),
esc_url( $data['original_url'] ),
$data['width'],
$data['height'],
esc_html__( 'Compare Original VS Optimized', 'imagify' )
);

View File

@@ -0,0 +1,31 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$html_atts = '';
if ( empty( $data['atts'] ) ) {
$data['atts'] = [];
}
if ( ! isset( $data['atts']['class'] ) ) {
// Class used for JS.
$data['atts']['class'] = 'button-imagify-delete-webp';
}
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
// Used for JS.
$data['atts']['data-processing-label'] = __( 'Deleting...', 'imagify' );
}
$html_atts = $this->build_attributes( $data['atts'] );
?>
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
<span class="dashicons dashicons-image-rotate"></span>
<?php esc_html_e( 'Delete WebP images', 'imagify' ); ?>
</a>
<?php
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
$this->print_js_template_in_footer( 'button/processing' );
}

View File

@@ -0,0 +1,33 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$html_atts = '';
if ( empty( $data['atts'] ) ) {
$data['atts'] = [];
}
if ( ! isset( $data['atts']['class'] ) ) {
// Class used for JS.
$data['atts']['class'] = 'button-imagify-generate-webp';
}
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
// Used for JS.
$data['atts']['data-processing-label'] = __( 'Generating...', 'imagify' );
}
$html_atts = $this->build_attributes( $data['atts'] );
?>
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
<span class="dashicons dashicons-admin-generic"></span>
<?php
esc_html_e( 'Generate WebP versions', 'imagify' );
?>
</a>
<?php
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
$this->print_js_template_in_footer( 'button/processing' );
}

View File

@@ -0,0 +1,39 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$html_atts = '';
if ( empty( $data['atts'] ) ) {
$data['atts'] = [];
}
if ( ! isset( $data['atts']['class'] ) ) {
// Class used for JS.
$data['atts']['class'] = 'optimize-missing-sizes';
}
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
// Used for JS.
$data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' );
}
$html_atts = $this->build_attributes( $data['atts'] );
?>
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
<span class="dashicons dashicons-admin-generic"></span>
<?php
printf(
/* translators: 1 is the number of thumbnails to optimize, 2 is the opening of a HTML tag that will be hidden on small screens, 3 is the closing tag. */
esc_html( _n( '%2$sOptimize %3$s%1$d missing thumbnail', '%2$sOptimize %3$s%1$d missing thumbnails', $data['count'], 'imagify' ) ),
number_format_i18n( $data['count'] ),
'<span class="imagify-hide-if-small">',
'</span>'
);
?>
</a>
<?php
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
$this->print_js_template_in_footer( 'button/processing' );
}

View File

@@ -0,0 +1,30 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$html_atts = '';
if ( empty( $data['atts'] ) ) {
$data['atts'] = [];
}
if ( ! isset( $data['atts']['class'] ) ) {
// Class used for JS.
$data['atts']['class'] = 'button-primary button-imagify-optimize';
}
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
// Used for JS.
$data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' );
}
$html_atts = $this->build_attributes( $data['atts'] );
?>
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
<?php esc_html_e( 'Optimize', 'imagify' ); ?>
</a>
<?php
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
$this->print_js_template_in_footer( 'button/processing' );
}

View File

@@ -0,0 +1,16 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
if ( empty( $data['label'] ) ) {
$data['label'] = '%s';
}
?>
<div class="button button-imagify-processing">
<span class="imagify-spinner"></span>
<?php echo esc_html( $data['label'] ); ?>
</div>
<?php
$this->print_js_template_in_footer( 'button/processing' );

View File

@@ -0,0 +1,46 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$html_atts = '';
if ( empty( $data['atts'] ) ) {
$data['atts'] = [];
}
if ( ! isset( $data['atts']['class'] ) ) {
// Class used for JS.
$data['atts']['class'] = 'button-imagify-manual-reoptimize';
}
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
// Used for JS.
$data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' );
}
$level_labels = [
0 => __( 'Lossless', 'imagify' ),
1 => __( 'Smart', 'imagify' ),
2 => __( 'Smart', 'imagify' ),
];
$level_label = $level_labels[ $data['optimization_level'] ];
$html_atts = $this->build_attributes( $data['atts'] );
?>
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
<span class="dashicons dashicons-admin-generic"></span>
<span class="imagify-hide-if-small">
<?php
printf(
/* translators: %s is an optimization level. */
esc_html__( 'Re-Optimize with %s compression', 'imagify' ),
'</span>' . esc_html( $level_label ) . '<span class="imagify-hide-if-small">'
);
?>
</span>
</a>
<?php
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
$this->print_js_template_in_footer( 'button/processing' );
}

View File

@@ -0,0 +1,31 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$html_atts = '';
if ( empty( $data['atts'] ) ) {
$data['atts'] = [];
}
if ( ! isset( $data['atts']['class'] ) ) {
// Class used for JS.
$data['atts']['class'] = 'button-imagify-refresh-status';
}
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
// Used for JS.
$data['atts']['data-processing-label'] = __( 'Refreshing status...', 'imagify' );
}
$html_atts = $this->build_attributes( $data['atts'] );
?>
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
<span class="dashicons dashicons-image-rotate"></span>
<?php esc_html_e( 'Refresh status', 'imagify' ); ?>
</a>
<?php
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
$this->print_js_template_in_footer( 'button/processing' );
}

View File

@@ -0,0 +1,31 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$html_atts = '';
if ( empty( $data['atts'] ) ) {
$data['atts'] = [];
}
if ( ! isset( $data['atts']['class'] ) ) {
// Class used for JS.
$data['atts']['class'] = 'button-imagify-restore attachment-has-backup';
}
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
// Used for JS.
$data['atts']['data-processing-label'] = __( 'Restoring...', 'imagify' );
}
$html_atts = $this->build_attributes( $data['atts'] );
?>
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
<span class="dashicons dashicons-image-rotate"></span>
<?php esc_html_e( 'Restore Original', 'imagify' ); ?>
</a>
<?php
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
$this->print_js_template_in_footer( 'button/processing' );
}

View File

@@ -0,0 +1,48 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$html_atts = '';
if ( empty( $data['atts'] ) ) {
$data['atts'] = [];
}
if ( ! isset( $data['atts']['class'] ) ) {
// Class used for JS.
$data['atts']['class'] = 'button button-imagify-optimize';
}
if ( ! isset( $data['atts']['data-processing-label'] ) ) {
// Used for JS.
$data['atts']['data-processing-label'] = __( 'Optimizing...', 'imagify' );
}
$html_atts = $this->build_attributes( $data['atts'] );
if ( ! empty( $data['error'] ) ) {
?>
<strong>
<?php
echo wp_kses(
imagify_translate_api_message( $data['error'] ),
[
'br' => true,
'code' => true,
'em' => true,
'strong' => true,
]
);
?>
</strong>
<br/>
<?php
}
?>
<a href="<?php echo esc_url( $data['url'] ); ?>"<?php echo $html_atts; ?>>
<?php esc_html_e( 'Try again', 'imagify' ); ?>
</a>
<?php
if ( ! empty( $data['atts']['data-processing-label'] ) ) {
$this->print_js_template_in_footer( 'button/processing' );
}

View File

@@ -0,0 +1,9 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-data-actions-container" data-id="<?php echo (int) $data['media_id']; ?>" data-context="<?php echo esc_attr( $data['context'] ); ?>">
<?php echo $data['content']; ?>
</div>
<?php

View File

@@ -0,0 +1,47 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
if ( empty( $data['values'] ) || empty( $data['name'] ) ) {
return;
}
if ( ! isset( $data['value'] ) ) {
$data['value'] = key( $data['values'] );
}
if ( empty( $data['current_label'] ) ) {
$data['current_label'] = __( 'Current value:', 'imagify' );
}
if ( ! isset( $data['values'][ $data['value'] ] ) ) {
return;
}
$list_id = str_replace( [ '[', ']' ], [ '-', '' ], $data['name'] );
$list_id = 'imagify-' . $list_id . '-selector-list';
?>
<div class="imagify-selector">
<span class="hide-if-js">
<?php echo esc_html( $data['current_label'] ); ?>
<span class="imagify-selector-current-value-info"><?php echo $data['values'][ $data['value'] ]; ?></span>
</span>
<button aria-controls="<?php echo esc_attr( $list_id ); ?>" type="button" class="button imagify-button-clean hide-if-no-js imagify-selector-button">
<span class="imagify-selector-current-value-info"><?php echo $data['values'][ $data['value'] ]; ?></span>
</button>
<ul id="<?php echo esc_attr( $list_id ); ?>" role="listbox" aria-orientation="vertical" aria-hidden="true" class="imagify-selector-list hide-if-no-js">
<?php
foreach ( $data['values'] as $val => $label ) {
$input_id = $list_id . '-' . sanitize_html_class( $val );
?>
<li class="imagify-selector-choice<?php echo $val === $data['value'] ? ' imagify-selector-current-value" aria-current="true' : ''; ?>" role="option">
<input type="radio" name="<?php echo esc_attr( $data['name'] ); ?>" value="<?php echo esc_attr( $val ); ?>" id="<?php echo esc_attr( $input_id ); ?>" <?php checked( $val, $data['value'] ); ?> class="screen-reader-text">
<label for="<?php echo esc_attr( $input_id ); ?>"><?php echo $label; ?></label>
</li>
<?php
}
?>
</ul>
</div>

View File

@@ -0,0 +1,433 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div id="imagify-pricing-modal" class="imagify-modal imagify-payment-modal hide-if-no-js" aria-hidden="false" role="dialog">
<div class="imagify-modal-content">
<div class="imagify-modal-main">
<?php
/**
* FIRST MODAL VIEW.
*/
?>
<div class="imagify-modal-views imagify-pre-checkout-view" id="imagify-pre-checkout-view" aria-hidden="false">
<div class="imagify-modal-section section-gray imagify-estimation-block imagify-analyzing">
<p class="imagify-modal-title">
<span class="imagify-numbers-calc"><?php esc_html_e( 'We analyzed your images', 'imagify' ); ?></span>
<span class="imagify-numbers-notcalc"><?php esc_html_e( 'We are analyzing your images', 'imagify' ); ?></span>
</p>
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>loader-balls.svg" width="77" height="48" alt="<?php esc_attr_e( 'Analyzing', 'imagify' ); ?>" class="imagify-loader">
<div class="imagify-modal-cols">
<div class="imagify-col">
<p>
<span class="imagify-border-styled">
<?php
$attachments_number = imagify_count_attachments() + Imagify_Files_Stats::count_all_files();
printf(
/* translators: %s is a formatted number (don't use %d). */
_n( 'You have %s original image', 'You have %s original images', $attachments_number, 'imagify' ),
'</span><span class="imagify-big-number">' . number_format_i18n( $attachments_number ) . '</span><span class="imagify-border-styled">'
);
?>
</span>
</p>
</div>
<div class="imagify-col">
<p class="imagify-iconed">
<i class="dashicons dashicons-images-alt2" aria-hidden="true"></i>
<?php
printf(
/* translators: %s is a formatted file size. */
esc_html__( 'You currently have %s of images in your library and folders.', 'imagify' ),
'<strong class="imagify-dark total-library-size">0</strong>'
);
?>
</p>
<p class="imagify-iconed">
<i class="dashicons dashicons-cloud" aria-hidden="true"></i>
<?php
printf(
/* translators: %s is a formatted file size. */
esc_html__( 'You upload around %s of images per month.', 'imagify' ),
'<strong class="imagify-dark average-month-size">0</strong>'
);
?>
</p>
</div>
</div>
</div><!-- .imagify-modal-section -->
<?php $this->print_template( 'part-discount-banner' ); ?>
<div class="imagify-modal-section imagify-pre-checkout-offers">
<p class="imagify-modal-title">
<span class="imagify-not-enough-title"><?php esc_html_e( 'Our recommendation for you', 'imagify' ); ?></span>
<span class="imagify-enough-title"><?php esc_html_e( 'The free plan is enough to optimize your images', 'imagify' ); ?></span>
<br/><span class="imagify-inner-sub-title"><?php esc_html_e( 'Based on your recent upload usage.', 'imagify' ); ?></span>
</p>
<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}}}'>
<div class="imagify-offer-header">
<p class="imagify-offer-title imagify-switch-my">
<span aria-hidden="false" class="imagify-monthly"><?php esc_html_e( 'Subscribe to a monthly plan', 'imagify' ); ?></span>
<span aria-hidden="true" class="imagify-yearly"><?php esc_html_e( 'Subscribe to a yearly plan', 'imagify' ); ?></span>
</p>
<div class="imagify-inline-options imagify-radio-line">
<input id="imagify-subscription-monthly" type="radio" value="monthly" name="plan-subscription" checked="checked">
<label for="imagify-subscription-monthly"><?php esc_html_e( 'Monthly', 'imagify' ); ?></label>
<input id="imagify-subscription-yearly" type="radio" value="yearly" name="plan-subscription">
<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>
</div><!-- .imagify-radio-line -->
</div><!-- .imagify-offer-header -->
<div class="imagify-offer-content imagify-flex-table">
<div class="imagify-col-checkbox">
<input type="checkbox" name="imagify-offer" id="imagify-offer-1gb" value="1Gb" checked="checked" class="imagify-checkbox medium">
<label for="imagify-offer-1gb">
<span class="imagify-the-offer">
<span class="imagify-offer-size">1 GB</span>
<span class="imagify-offer-by"><?php esc_html_e( '/month', 'imagify' ); ?></span>
</span>
<span class="imagify-approx">
<?php
printf(
/* translators: %s is a formatted number (don't use %d). */
esc_html__( 'approx: %s images', 'imagify' ),
'<span class="imagify-approx-nb">' . number_format_i18n( 5000 ) . '</span>'
);
?>
</span>
</label>
</div>
<div class="imagify-col-price imagify-flex-table">
<span class="imagify-price-block">
<span class="imagify-dollars">$</span>
<span class="imagify-number-block">
<span class="imagify-switch-my">
<span class="imagify-monthly" aria-hidden="false">
<span class="imagify-price-big">3</span>
<span class="imagify-price-mini">.99</span>
</span>
<span class="imagify-yearly" aria-hidden="true">
<span class="imagify-price-big">3</span>
<span class="imagify-price-mini">.16</span>
</span>
</span>
<span class="imagify-price-by"><?php esc_html_e( '/month', 'imagify' ); ?></span>
</span>
</span>
<p class="imagify-price-complement">
<?php
printf(
/* translators: %s is a formatted price. */
__( '%s per<br>additional Gb', 'imagify' ),
'<span class="imagify-price-add-data"></span>'
);
?>
</p>
</div>
<div class="imagify-col-other-actions">
<a href="#imagify-plans-selection-view" class="imagify-choose-another-plan" data-imagify-choose="plan"><?php esc_html_e( 'Choose another plan', 'imagify' ); ?></a>
</div>
</div><!-- .imagify-offer-content -->
</div><!-- .imagify-offer-line -->
<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}}'>
<div class="imagify-offer-header">
<p class="imagify-offer-title">
<?php esc_html_e( 'Optimize the images you already have with a One Time plan', 'imagify' ); ?>
</p>
</div><!-- .imagify-offer-header -->
<div class="imagify-offer-content imagify-flex-table">
<div class="imagify-col-checkbox">
<input type="checkbox" name="imagify-offer" id="imagify-offer-custom" value="1Gb" checked="checked" class="imagify-checkbox medium">
<label for="imagify-offer-custom">
<span class="imagify-the-offer">
<span class="imagify-offer-size">3 GB</span>
</span>
<span class="imagify-approx">
<?php
printf(
/* translators: %s is a formatted number (don't use %d). */
esc_html__( 'approx: %s images', 'imagify' ),
'<span class="imagify-approx-nb">' . number_format_i18n( 54000 ) . '</span>'
);
?>
</span>
</label>
</div>
<div class="imagify-col-price imagify-flex-table">
<span class="imagify-price-block">
<span class="imagify-dollars">$</span>
<span class="imagify-number-block">
<span class="imagify-price-big"></span>
<span class="imagify-price-mini"></span>
</span>
</span>
</div>
<div class="imagify-col-other-actions">
<a href="#imagify-plans-selection-view" class="imagify-choose-another-plan" data-imagify-choose="onetime"><?php esc_html_e( 'Choose another plan', 'imagify' ); ?></a>
</div>
</div><!-- .imagify-offer-content -->
</div><!-- .imagify-offer-line -->
<div class="imagify-submit-line">
<div class="imagify-coupon-section">
<p class="imagify-coupon-text">
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>loader-balls.svg" width="60" height="36" alt="<?php esc_attr_e( 'Checking Coupon', 'imagify' ); ?>" class="imagify-coupon-loader">
<label for="imagify-coupon-code"><?php _e( 'If you have a <strong>coupon code</strong><br> use it here:', 'imagify' ); ?></label>
</p>
<p class="imagify-coupon-input">
<input type="text" class="imagify-coupon-code" name="imagify-coupon-code" id="imagify-coupon-code" value="" placeholder="<?php _e( 'Coupon Code', 'imagify' ); ?>" autocomplete="off">
<button type="button" class="button button-secondary imagify-button-secondary" id="imagify-coupon-validate"><?php _e( 'OK' ); ?></button>
</p>
</div>
<div class="imagify-submit-section">
<button type="button" class="button button-secondary imagify-button-secondary" id="imagify-modal-checkout-btn">
<i class="dashicons dashicons-cart" aria-hidden="true"></i>
<?php _e( 'Checkout', 'imagify' ); ?>
</button>
</div>
</div>
<p class="imagify-footer-lines"><?php esc_html_e( 'Monthly plans come with credits which are renewed every month. The billing happens automatically each month or year, depending on which billing period you choose.', 'imagify' ); ?></p>
</div>
</div><!-- .imagify-pre-checkout-view -->
<?php
/**
* SECOND MODAL VIEW.
*/
?>
<div class="imagify-modal-views imagify-plans-selection-view" id="imagify-plans-selection-view" aria-hidden="true">
<p class="imagify-modal-title"><?php _e( 'Choose a plan', 'imagify' ); ?></p>
<ul class="imagify-tabs" role="tablist">
<li class="imagify-tab imagify-current">
<a href="#imagify-pricing-tab-monthly" role="tab" aria-controls="imagify-pricing-tab-monthly" aria-selected="true">
<?php esc_html_e( 'Monthly Plans', 'imagify' ); ?>
</a>
</li>
<li class="imagify-tab">
<a href="#imagify-pricing-tab-onetime" role="tab" aria-controls="imagify-pricing-tab-onetime" aria-selected="false">
<?php esc_html_e( 'One Time Plans', 'imagify' ); ?>
</a>
</li>
</ul><!-- .imagify-tabs -->
<div class="imagify-tabs-contents">
<div class="imagify-tab-content imagify-current" id="imagify-pricing-tab-monthly" role="tabpanel">
<div class="imagify-modal-section section-gray">
<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>
</div>
<?php $this->print_template( 'part-settings-discount-banner' ); ?>
<div class="imagify-inline-options imagify-small-options imagify-radio-line">
<input id="imagify-pricing-montly" type="radio" value="monthly" name="plan-pricing" checked="checked">
<label for="imagify-pricing-montly"><?php esc_html_e( 'Monthly', 'imagify' ); ?></label>
<input id="imagify-pricing-yearly" type="radio" value="yearly" name="plan-pricing">
<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>
</div><!-- .imagify-radio-line -->
<div class="imagify-pricing-table imagify-month-selected">
<script type="text/html" id="imagify-offer-monthly-template"><div class="imagify-offer-line imagify-offer-monthlies imagify-flex-table">
<div class="imagify-col-details">
<p class="imagify-label">
<span class="imagify-the-offer">
<span class="imagify-offer-size"></span>
<span class="imagify-offer-by"><?php esc_html_e( '/month', 'imagify' ); ?></span>
</span>
<span class="imagify-approx">
<?php
printf(
/* translators: %s is a formatted number (don't use %d). */
__( 'approx: %s images', 'imagify' ),
'<span class="imagify-approx-nb"></span>'
);
?>
</span>
</p>
</div>
<div class="imagify-col-price imagify-flex-table">
<span class="imagify-price-block">
<span class="imagify-dollars">$</span>
<span class="imagify-number-block">
<span class="imagify-switch-my"></span>
<span class="imagify-price-by"><?php esc_html_e( '/month', 'imagify' ); ?></span>
</span>
</span>
<span class="imagify-recommend" aria-hidden="true"><?php esc_html_e( 'We recommend for you', 'imagify' ); ?></span>
<p class="imagify-price-complement">
<?php
printf(
/* translators: %s is a formatted price. */
__( '%s per<br>additional Gb', 'imagify' ),
'<span class="imagify-price-add-data"></span>'
);
?>
</p>
</div><!-- .imagify-col-price -->
<div class="imagify-col-other-actions">
<button type="button" class="button imagify-button-secondary mini imagify-payment-btn-select-plan"><?php esc_html_e( 'Choose plan', 'imagify' ); ?></button>
</div>
</div><!-- .imagify-offer-line --></script>
</div><!-- .imagify-pricing-table -->
<div class="imagify-cols">
<div class="imagify-col imagify-txt-start">
<p class="imagify-special-needs">
<strong><?php esc_html_e( 'Need more?', 'imagify' ); ?></strong>
<span><?php esc_html_e( 'for special needs', 'imagify' ); ?></span>
</p>
</div>
<div class="imagify-col imagify-txt-end">
<p><a class="button imagify-button-ghost imagify-button-medium imagify-mt1 imagify-mb1 imagify-mr1" href="<?php echo esc_html( imagify_get_external_url( 'contact' ) ); ?>" target="_blank"><i class="dashicons dashicons-email" aria-hidden="true"></i>&nbsp;<?php esc_html_e( 'Contact Us', 'imagify' ); ?></a></p>
</div>
</div>
</div><!-- .imagify-tab-content -->
<div class="imagify-tab-content" id="imagify-pricing-tab-onetime" role="tabpanel">
<div class="imagify-modal-section section-gray">
<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>
</div>
<div class="imagify-pricing-table imagify-month-selected">
<script type="text/html" id="imagify-offer-onetime-template"><div class="imagify-offer-line imagify-flex-table imagify-offer-onetimes">
<div class="imagify-col-details">
<p class="imagify-label">
<span class="imagify-the-offer">
<span class="imagify-offer-size"></span>
</span>
<span class="imagify-approx">
<?php
printf(
/* translators: %s is a formatted number (don't use %d). */
__( 'approx: %s images', 'imagify' ),
'<span class="imagify-approx-nb"></span>'
);
?>
</span>
</p>
</div>
<div class="imagify-col-price">
<span class="imagify-price-block">
<span class="imagify-dollars">$</span>
<span class="imagify-number-block"></span>
</span>
<span class="imagify-recommend"><?php esc_html_e( 'We recommend for you', 'imagify' ); ?></span>
</div><!-- .imagify-col-price -->
<div class="imagify-col-other-actions">
<button type="button" class="button imagify-button-secondary mini imagify-payment-btn-select-plan"><?php esc_html_e( 'Choose plan', 'imagify' ); ?></button>
</div>
</div><!-- .imagify-offer-line --></script>
</div><!-- .imagify-pricing-table -->
</div><!-- .imagify-tab-content -->
</div><!-- .imagify-tabs-contents -->
</div><!-- .imagify-plans-selection-view -->
<?php
/**
* THIRD MODAL VIEW.
*/
?>
<div class="imagify-modal-views imagify-payment-process-view" id="imagify-payment-process-view" aria-hidden="true">
<iframe data-imagify-api="<?php echo esc_attr( get_imagify_option( 'api_key' ) ); ?>" id="imagify-payment-iframe" data-src="<?php echo esc_url( imagify_get_external_url( 'payment' ) ); ?>" name="imagify-payment-iframe"></iframe>
</div><!-- .imagify-modal-views -->
<?php
/**
* SUCCESS VIEW.
*/
?>
<div class="imagify-modal-views imagify-success-view" id="imagify-success-view" aria-hidden="true">
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>big-blue-check.png" width="113" height="109" alt="">
<p><?php esc_html_e( 'Thank you for being awesome!', 'imagify' ); ?></p>
</div><!-- .imagify-modal-views -->
<button class="close-btn" type="button">
<i aria-hidden="true" class="dashicons dashicons-no-alt"></i>
<span class="screen-reader-text"><?php esc_html_e( 'Close', 'imagify' ); ?></span>
</button>
</div><!-- .imagify-modal-main -->
<div class="imagify-modal-sidebar">
<div class="imagify-modal-sidebar-content imagify-txt-start">
<p class="imagify-modal-sidebar-title"><?php esc_html_e( 'What do our users think about Imagify', 'imagify' ); ?></p>
<div class="imagify-modal-testimony">
<div class="imagify-modal-testimony-person">
<span class="imagify-modal-avatar">
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>pic-srhdesign.jpg" alt="">
</span>
<p class="imagify-modal-identity">
<a href="https://twitter.com/SRHDesign/status/686486119249260544" target="_blank">@SRHDesign</a>
</p>
</div>
<div class="imagify-modal-testimony-content">
<p>@imagify is an awesome tool that is powerful &amp; easy to use. It's fast, rivals and surpasses other established plugins/software. Awesome!</p>
</div>
</div>
<div class="imagify-modal-testimony">
<div class="imagify-modal-testimony-person">
<span class="imagify-modal-avatar">
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>pic-ericwaltr.jpg" alt="">
</span>
<p class="imagify-modal-identity">
<a href="https://twitter.com/EricWaltR/status/679053496382038016" target="_blank">@EricWaltr</a>
</p>
</div>
<div class="imagify-modal-testimony-content">
<p>Clearly @imagify is the most awesome tool to compress images on your website! A must try</p>
</div>
</div>
<div class="imagify-modal-sidebar-trust imagify-txt-center">
<p class="imagify-secondary">
<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="">&nbsp;<?php esc_html_e( 'Secure Credit Card Payment', 'imagify' ); ?></p>
<p><?php esc_html_e( 'This is secure 128-bits SSL encrypted payment', 'imagify' ); ?></p>
</div>
</div>
</div><!-- .imagify-modal-sidebar -->
<div class="imagify-modal-loader"></div>
</div><!-- .imagify-modal-content-->
</div><!-- .imagify-payment-modal -->
<?php

View File

@@ -0,0 +1,57 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-modal" id="imagify-more-info">
<div class="imagify-modal-content">
<p class="h2"><?php _e( 'You can choose three levels of compression', 'imagify' ); ?></p>
<div class="imagify-columns">
<div class="col-1-3">
<p class="h3"><?php _e( 'Normal', 'imagify' ); ?></p>
<p>
<?php _e( 'This mode provides lossless optimization, your images will be optimized without any visible change.', 'imagify' ); ?>
</p>
<p>
<?php _e( 'If you want the perfect quality for your images, we recommend you that mode.', 'imagify' ); ?>
</p>
<p>
<em><?php _e( 'Note: the file size reduction will be less, compared to aggressive mode.', 'imagify' ); ?></em>
</p>
</div>
<div class="col-1-3">
<p class="h3"><?php _e( 'Aggressive', 'imagify' ); ?></p>
<p>
<?php _e( 'This mode provides perfect optimization of your images without any significant quality loss.', 'imagify' ); ?>
</p>
<p>
<?php _e( 'This will provide a drastic savings on the initial weight, with a small reduction in image quality. Most of the time it\'s not even noticeable.', 'imagify' ); ?>
</p>
<p>
<?php _e( 'If you want the maximum weight reduction, we recommend using this mode.', 'imagify' ); ?>
</p>
</div>
<div class="col-1-3">
<p class="h3"><?php _e( 'Ultra', 'imagify' ); ?></p>
<p>
<?php _e( 'This mode will apply all available optimizations for maximum image compression.', 'imagify' ); ?>
</p>
<p>
<?php _e( 'This will provide a huge savings on the initial weight. Sometimes the image quality could be degraded a little.', 'imagify' ); ?>
</p>
<p>
<?php _e( 'If you want the maximum weight reduction, and you agree to lose some quality on the images we recommend using this mode.', 'imagify' ); ?>
</p>
</div>
</div>
<button type="button" class="close-btn">
<i class="dashicons dashicons-no-alt" aria-hidden="true"></i>
<span class="screen-reader-text"><?php _e( 'Close' ); ?></span>
</button>
</div>
</div>
<?php

View File

@@ -0,0 +1,18 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-modal" id="imagify-partners-info">
<div class="imagify-modal-content">
<p>
<?php esc_html_e( 'Partner links are links to products we trust which might be displayed in the Imagify plugin or the plugin modal page. We may earn an affiliate commission if you make a purchase via these links.', 'imagify' ); ?>
</p>
<button type="button" class="close-btn">
<i class="dashicons dashicons-no-alt" aria-hidden="true"></i>
<span class="screen-reader-text"><?php esc_html_e( 'Close' ); ?></span>
</button>
</div>
</div>
<?php

View File

@@ -0,0 +1,140 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-modal" id="imagify-visual-comparison">
<div class="imagify-modal-content">
<p class="imagify-comparison-title">
<?php
printf(
/* translators: 1 and 2 are optimization levels: "Original", "Normal", "Aggressive", or "Ultra". */
__( 'I want to compare %1$s and %2$s', 'imagify' ),
'<span class="twentytwenty-left-buttons"></span>',
'<span class="twentytwenty-right-buttons"></span>'
);
?>
</p>
<div class="twentytwenty-container"
data-loader="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>loader-balls.svg"
data-label-original="<?php esc_attr_e( 'Original', 'imagify' ); ?>"
data-label-normal="<?php esc_attr_e( 'Normal', 'imagify' ); ?>"
data-label-aggressive="<?php esc_attr_e( 'Aggressive', 'imagify' ); ?>"
data-label-ultra="<?php esc_attr_e( 'Ultra', 'imagify' ); ?>"
data-original-label="<?php esc_attr_e( 'Original', 'imagify' ); ?>"
data-original-img="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>mushrooms-original.jpg"
data-original-dim="1220x350"
data-original-alt="<?php
/* translators: %s is a formatted file size. */
printf( esc_attr__( 'Original photography about %s', 'imagify' ), imagify_size_format( 343040 ) );
?>"
data-normal-label="<?php esc_attr_e( 'Normal', 'imagify' ); ?>"
data-normal-img="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>mushrooms-normal.jpg"
data-normal-dim="1220x350"
data-normal-alt="<?php
/* translators: %s is a formatted file size. */
printf( esc_attr__( 'Optimized photography about %s', 'imagify' ), imagify_size_format( 301056 ) );
?>"
data-aggressive-label="<?php esc_attr_e( 'Aggressive', 'imagify' ); ?>"
data-aggressive-img="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>mushrooms-aggressive.jpg"
data-aggressive-dim="1220x350"
data-aggressive-alt="<?php
/* translators: %s is a formatted file size. */
printf( esc_attr__( 'Optimized photography about %s', 'imagify' ), imagify_size_format( 108544 ) );
?>"
data-ultra-label="<?php esc_attr_e( 'Ultra', 'imagify' ); ?>"
data-ultra-img="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>mushrooms-ultra.jpg"
data-ultra-dim="1220x350"
data-ultra-alt="<?php
/* translators: %s is a formatted file size. */
printf( esc_attr__( 'Optimized photography about %s', 'imagify' ), imagify_size_format( 46080 ) );
?>"></div>
<div class="imagify-comparison-levels">
<div class="imagify-c-level imagify-level-original go-left">
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'Level:', 'imagify' ); ?></span>
<span class="value level"><?php _e( 'Original', 'imagify' ); ?></span>
</p>
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'File Size:', 'imagify' ); ?></span>
<span class="value"><?php echo imagify_size_format( 343040 ); ?></span>
</p>
</div>
<div class="imagify-c-level imagify-level-optimized imagify-level-normal" aria-hidden="true">
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'Level:', 'imagify' ); ?></span>
<span class="value level"><?php _e( 'Normal', 'imagify' ); ?></span>
</p>
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'File Size:', 'imagify' ); ?></span>
<span class="value size"><?php echo imagify_size_format( 301056 ); ?></span>
</p>
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'Original Saving:', 'imagify' ); ?></span>
<span class="value">
<span class="imagify-chart">
<span class="imagify-chart-container">
<canvas id="imagify-consumption-chart-normal" width="15" height="15"></canvas>
</span>
</span><span class="imagify-chart-value">12.24</span>%
</span>
</p>
</div>
<div class="imagify-c-level imagify-level-aggressive">
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'Level:', 'imagify' ); ?></span>
<span class="value level"><?php _e( 'Aggressive', 'imagify' ); ?></span>
</p>
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'File Size:', 'imagify' ); ?></span>
<span class="value size"><?php echo imagify_size_format( 108544 ); ?></span>
</p>
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'Original Saving:', 'imagify' ); ?></span>
<span class="value">
<span class="imagify-chart">
<span class="imagify-chart-container">
<canvas id="imagify-consumption-chart-aggressive" width="15" height="15"></canvas>
</span>
</span><span class="imagify-chart-value">68.36</span>%
</span>
</p>
</div>
<div class="imagify-c-level imagify-level-ultra go-right">
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'Level:', 'imagify' ); ?></span>
<span class="value level"><?php _e( 'Ultra', 'imagify' ); ?></span>
</p>
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'File Size:', 'imagify' ); ?></span>
<span class="value size"><?php echo imagify_size_format( 46080 ); ?></span>
</p>
<p class="imagify-c-level-row">
<span class="label"><?php _e( 'Original Saving:', 'imagify' ); ?></span>
<span class="value">
<span class="imagify-chart">
<span class="imagify-chart-container">
<canvas id="imagify-consumption-chart-ultra" width="15" height="15"></canvas>
</span>
</span><span class="imagify-chart-value">86.57</span>%
</span>
</p>
</div>
</div>
<button type="button" class="close-btn">
<i class="dashicons dashicons-no-alt" aria-hidden="true"></i>
<span class="screen-reader-text"><?php _e( 'Close' ); ?></span>
</button>
</div>
</div>
<?php

View File

@@ -0,0 +1,20 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$this->print_template( 'notice-header', array(
'classes' => array( 'error' ),
) );
$backup_path = $this->filesystem->make_path_relative( get_imagify_backup_dir_path( true ) );
if ( $this->filesystem->exists( get_imagify_backup_dir_path() ) ) {
/* translators: %s is a file path. */
$message = __( 'The backup folder %s is not writable by the server, original images cannot be saved!', 'imagify' );
} else {
/* translators: %s is a file path. */
$message = __( 'The backup folder %s cannot be created. Is its parent directory writable by the server? Original images cannot be saved!', 'imagify' );
}
echo '<p>' . sprintf( $message, "<code>$backup_path</code>" ) . '</p>';
$this->print_template( 'notice-footer' );

View File

@@ -0,0 +1,29 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
delete_transient( 'imagify_bulk_optimization_complete' );
delete_transient( 'imagify_bulk_optimization_result' );
?>
<div class="notice notice-success is-dismissible">
<div class="imagify-notice-bulk-complete">
<div class="imagify-notice-bulk-complete-logo">
<img src="<?php echo esc_url( IMAGIFY_ASSETS_IMG_URL . 'imagify.svg' ); ?>" width="96" height="96" alt="Imagify" />
</div>
<div>
<p><strong><?php esc_html_e( 'Well done!', 'imagify' ); ?></strong></p>
<p><?php esc_html_e( 'The bulk optimization is now complete.', 'imagify' ); ?></p>
<p><?php
printf(
// translators: %1$s = number of images optimized, %2$s = size saved, %3$s = total size, %4$s = opening link tag, %5$s = closing link tag.
__( 'We have optimized %1$s images and you have just saved %2$s out of %3$s. %4$sCheck your stats%5$s' ),
$data['total'],
$data['optimized_size'],
$data['original_size'],
'<a href="' . esc_url( $data['bulk_page_url'] ) . '">',
'</a>'
);
?>
</p>
</div>
<?php $this->print_template( 'notice-footer', [ 'dismissible' => 'bulk-optimization-complete' ] ); ?>

View File

@@ -0,0 +1,19 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="notice notice-success is-dismissible">
<div>
<p>
<?php
printf(
// translators: %1$s = opening strong tag, %2$s = closing strong tag, %3$s = opening link tag, %4$s = closing link tag.
'%1$sImagify%2$s: the bulk optimization is currently running. Check status %3$shere%4$s.',
'<strong>',
'</strong>',
'<a href="' . esc_url( $data['bulk_page_url'] ) . '">',
'</a>'
);
?>
</p>
<?php $this->print_template( 'notice-footer', [ 'dismissible' => 'bulk-optimization-complete' ] ); ?>

View File

@@ -0,0 +1,8 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
</div>
<?php if ( ! empty( $data['dismissible'] ) ) : ?>
<a href="<?php echo esc_url( get_imagify_admin_url( 'dismiss-notice', $data['dismissible'] ) ); ?>" class="imagify-notice-dismiss notice-dismiss" title="<?php esc_attr_e( 'Dismiss this notice', 'imagify' ); ?>"><span class="screen-reader-text"><?php _e( 'Dismiss this notice', 'imagify' ); ?></span></a>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,13 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$this->print_template( 'notice-header', array(
'title' => __( 'You\'re missing out!', 'imagify' ),
) );
?>
<p><?php _e( 'Use the List view to optimize images with Imagify.', 'imagify' ); ?></p>
<p><a href="<?php echo esc_url( admin_url( 'upload.php?mode=list' ) ); ?>"><?php _e( 'Switch to the List View', 'imagify' ); ?></a></p>
<?php
$this->print_template( 'notice-footer', array(
'dismissible' => 'grid-view',
) );

View File

@@ -0,0 +1,12 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="clear"></div>
<div class="imagify-notice below-h2<?php echo ( ! empty( $data['classes'] ) ? ' ' . implode( ' ', $data['classes'] ) : '' ); ?>">
<div class="imagify-notice-logo">
<img class="imagify-logo" src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>imagify-logo.png" width="138" height="16" alt="Imagify" />
</div>
<div class="imagify-notice-content">
<?php if ( ! empty( $data['title'] ) ) : ?>
<p class="imagify-notice-title"><strong><?php echo $data['title']; ?></strong></p>
<?php endif; ?>

View File

@@ -0,0 +1,22 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$this->print_template( 'notice-header', array(
'title' => __( 'The external HTTP requests are blocked!', 'imagify' ),
'classes' => array( 'error' ),
) );
?>
<p>
<?php _e( 'You defined the <code>WP_HTTP_BLOCK_EXTERNAL</code> constant in the <code>wp-config.php</code> to block all external HTTP requests.', 'imagify' ); ?>
</p>
<p>
<?php _e( 'To optimize your images, you have to put the following code in your <code>wp-config.php</code> file so that it works correctly.', 'imagify' ); ?><br/>
<?php _e( 'Click on the field and press Ctrl-A to select all.', 'imagify' ); ?>
</p>
<p>
<textarea readonly="readonly" class="large-text readonly" rows="1">define( 'WP_ACCESSIBLE_HOSTS', '*.imagify.io' );</textarea>
</p>
<?php
$this->print_template( 'notice-footer', array(
'dismissible' => 'http-block-external',
) );

View File

@@ -0,0 +1,22 @@
<?php
use Imagify\Notices\Notices;
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$this->print_template( 'notice-header', array(
'classes' => array( 'error' ),
) );
?>
<p><?php echo _n( 'The following plugin is not compatible with this plugin and may cause unexpected results:', 'The following plugins are not compatible with this plugin and may cause unexpected results:', count( $data ), 'imagify' ); ?></p>
<ul class="imagify-plugins-error">
<?php
foreach ( $data as $plugin ) {
$plugin_data = get_plugin_data( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin );
$deactivate_url = esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=imagify_deactivate_plugin&plugin=' . rawurlencode( $plugin ) ), Notices::DEACTIVATE_PLUGIN_NONCE_ACTION ) );
echo '<li>' . $plugin_data['Name'] . '</span> <a href="' . $deactivate_url . '" class="button button-mini alignright">' . __( 'Deactivate', 'imagify' ) . '</a></li>';
}
?>
</ul>
<?php
$this->print_template( 'notice-footer' );

View File

@@ -0,0 +1,36 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$this->print_template( 'notice-header', array(
'classes' => array( 'updated' ),
) );
?>
<p>
<?php
printf(
/* translators: 1 is a "bold" tag start, 2 is the "bold" tag end, 3 is a formatted number (don't use %3$d). */
__( '%1$sCongratulations%2$s, you have optimized %1$s%3$s images%2$s and improved your website\'s speed by reducing your images size.', 'imagify' ),
'<strong>',
'</strong>',
number_format_i18n( $data )
);
?>
</p>
<p class="imagify-rate-us">
<?php
printf(
/* translators: 1 is a "bold" tag start, 2 is the "bold" tag end + a line break tag, 3 is a link tag start, 4 is the link tag end. */
__( '%1$sDo you like this plugin?%2$s Please take a few seconds to %3$srate it on WordPress.org%4$s!', 'imagify' ),
'<strong>',
'</strong><br />',
'<a target="_blank" href="' . esc_url( imagify_get_external_url( 'rate' ) ) . '">',
'</a>'
);
?>
<br>
<a class="stars" target="_blank" href="<?php echo esc_url( imagify_get_external_url( 'rate' ) ); ?>">☆☆☆☆☆</a>
</p>
<?php
$this->print_template( 'notice-footer', array(
'dismissible' => 'rating',
) );

View File

@@ -0,0 +1,22 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$notices = array();
foreach ( $data as $notice_data ) {
if ( empty( $notices[ $notice_data['type'] ] ) ) {
$notices[ $notice_data['type'] ] = array();
}
$notices[ $notice_data['type'] ][] = $notice_data;
}
foreach ( $notices as $type => $type_notices ) {
?>
<div class="<?php echo $type; ?> settings-error notice is-dismissible">
<?php foreach ( $type_notices as $details ) { ?>
<p><strong><?php echo wp_kses( $details['message'], [ 'code' => [] ] ); ?></strong></p>
<?php } ?>
</div>
<?php
}

View File

@@ -0,0 +1,55 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-welcome">
<div class="imagify-title">
<img class="imagify-logo" src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>imagify-logo.png" width="225" height="26" alt="Imagify" />
<span class="baseline">
<?php _e( 'Welcome to Imagify, the best way to easily optimize your images!', 'imagify' ); ?>
</span>
<a href="<?php echo esc_url( get_imagify_admin_url( 'dismiss-notice', 'welcome-steps' ) ); ?>" class="imagify-notice-dismiss imagify-welcome-remove" title="<?php esc_attr_e( 'Dismiss this notice', 'imagify' ); ?>"><span class="dashicons dashicons-dismiss"></span><span class="screen-reader-text"><?php _e( 'Dismiss this notice', 'imagify' ); ?></span></a>
</div>
<div class="imagify-settings-section">
<div class="imagify-columns counter">
<div class="col-1-3">
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>user.svg" width="48" height="48" alt="">
<div class="imagify-col-content">
<p class="imagify-col-title"><?php _e( 'Create an Account', 'imagify' ); ?></p>
<p class="imagify-col-desc"><?php _e( 'Don\'t have an Imagify account yet? Optimize your images by creating an account in a few seconds!', 'imagify' ); ?></p>
<p>
<?php wp_nonce_field( 'imagify-signup', 'imagifysignupnonce', false ); ?>
<a id="imagify-signup" target="_blank" href="<?php echo esc_url( imagify_get_external_url( 'register' ) ); ?>" class="button button-primary"><?php _e( 'Sign up, It\'s FREE!', 'imagify' ); ?></a>
</p>
</div>
</div>
<div class="col-1-3">
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>key.svg" width="48" height="48" alt="">
<div class="imagify-col-content">
<p class="imagify-col-title"><?php _e( 'Enter your API Key', 'imagify' ); ?></p>
<p class="imagify-col-desc">
<?php
printf(
/* translators: 1 is a link tag start, 2 is the link tag end. */
__( 'Save your API Key you have received by email or you can get it on your %1$sImagify account page%2$s.', 'imagify' ),
'<a target="_blank" href="' . esc_url( imagify_get_external_url( 'get-api-key' ) ) . '">',
'</a>'
);
?>
</p>
<p>
<?php wp_nonce_field( 'imagify-check-api-key', 'imagifycheckapikeynonce', false ); ?>
<a id="imagify-save-api-key" href="<?php echo esc_url( get_imagify_admin_url() ); ?>" class="button button-primary"><?php _e( 'I have my API key', 'imagify' ); ?></a>
</p>
</div>
</div>
<div class="col-1-3">
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>gear.svg" width="48" height="48" alt="">
<div class="imagify-col-content">
<p class="imagify-col-title"><?php _e( 'Configure it', 'imagify' ); ?></p>
<p class="imagify-col-desc"><?php _e( 'Its almost done! You have just to configure your optimization settings.', 'imagify' ); ?></p>
<p><a href="<?php echo esc_url( get_imagify_admin_url() ); ?>" class="button button-primary"><?php _e( 'Go to Settings', 'imagify' ); ?></a></p>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,21 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$dismiss_url = get_imagify_admin_url( 'dismiss-notice', 'wp-rocket' );
$wprocket_url = imagify_get_wp_rocket_url();
?>
<div class="updated imagify-rkt-notice">
<a href="<?php echo esc_url( $dismiss_url ); ?>" class="imagify-notice-dismiss imagify-cross"><span class="dashicons dashicons-no"></span></a>
<p class="imagify-rkt-logo">
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>logo-wprocket.png" srcset="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>logo-wprocket.svg 1x, <?php echo IMAGIFY_ASSETS_IMG_URL; ?>logo-wprocket.svg 2x" alt="WP Rocket" width="118" height="32">
</p>
<p class="imagify-rkt-msg">
<?php
esc_html_e( 'Discover the best caching plugin to speed up your website.', 'imagify' );
?>
</p>
<p class="imagify-rkt-cta">
<a target="_blank" href="<?php echo esc_url( $wprocket_url ); ?>" class="button button-primary tgm-plugin-update-modal"><?php esc_html_e( 'Get WP Rocket now', 'imagify' ); ?></a>
</p>
</div>

View File

@@ -0,0 +1,24 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$this->print_template( 'notice-header', array(
'title' => __( 'Your API key isn\'t valid!', 'imagify' ),
'classes' => array( 'error' ),
) );
?>
<p>
<?php wp_nonce_field( 'imagify-signup', 'imagifysignupnonce', false ); ?>
<?php
printf(
/* translators: 1 and 2 are link tag starts, 3 is a link tag end. */
__( 'Go to your Imagify account page to get your API Key and specify it on %1$syour settings%3$s or %2$screate an account for free%3$s if you don\'t have one yet.', 'imagify' ),
'<a href="' . esc_url( get_imagify_admin_url() ) . '">',
'<a id="imagify-signup" target="_blank" href="' . esc_url( imagify_get_external_url( 'register' ) ) . '">',
'</a>'
);
?>
</p>
<?php
$this->print_template( 'notice-footer', array(
'dismissible' => 'wrong-api-key',
) );

View File

@@ -0,0 +1,190 @@
<?php
use Imagify\User\User;
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="wrap imagify-settings imagify-bulk">
<?php $this->print_template( 'part-bulk-optimization-header' ); ?>
<div class="imagify-settings-section">
<div class="imagify-columns">
<div class="imagify-col col-overview">
<h2 class="imagify-h2-like">
<span class="dashicons dashicons-chart-line"></span>
<?php esc_html_e( 'Overview', 'imagify' ); ?>
</h2>
<div class="imagify-columns">
<div class="imagify-col col-statistics">
<h3 class="screen-reader-text"><?php esc_html_e( 'Statistics', 'imagify' ); ?></h3>
<div class="imagify-number-you-optimized">
<p>
<span id="imagify-total-optimized-attachments" class="number"><?php echo esc_html( $data['already_optimized_attachments'] ); ?></span>
<span class="text">
<?php
printf(
/* translators: you can use %s to include a line break. */
esc_html__( 'that\'s the number of original images%s you optimized with Imagify', 'imagify' ),
'<br>'
);
?>
</span>
</p>
</div>
<div class="imagify-bars">
<p><?php esc_html_e( 'Original size', 'imagify' ); ?></p>
<div class="imagify-bar-negative base-transparent right-outside-number">
<div id="imagify-original-bar" class="imagify-progress" style="width: 100%"><span class="imagify-barnb"><?php echo esc_html( $data['original_human'] ); ?></span></div>
</div>
<p><?php esc_html_e( 'Optimized size', 'imagify' ); ?></p>
<div class="imagify-bar-primary base-transparent right-outside-number">
<div id="imagify-optimized-bar" class="imagify-progress" style="width: <?php echo max( 100 - $data['optimized_percent'], 0 ); ?>%"><span class="imagify-barnb"><?php echo esc_html( $data['optimized_human'] ); ?></span></div>
</div>
</div>
<div class="imagify-number-you-optimized">
<p>
<span id="imagify-total-optimized-attachments-pct" class="number"><?php echo esc_html( number_format_i18n( $data['optimized_percent'] ) ); ?>%</span>
<span class="text">
<?php
printf(
/* translators: %s is a line break. */
esc_html__( 'that\'s the size you saved %sby using Imagify', 'imagify' ),
'<br>'
);
?>
</span>
</p>
</div>
</div><!-- .imagify-col.col-statistics -->
<div class="imagify-col col-chart">
<div class="imagify-chart-container imagify-overview-chart-container">
<canvas id="imagify-overview-chart" width="180" height="180" data-unoptimized="<?php echo esc_attr( $data['unoptimized_attachments'] ); ?>" data-optimized="<?php echo esc_attr( $data['optimized_attachments'] ); ?>" data-errors="<?php echo esc_attr( $data['errors_attachments'] ); ?>"></canvas>
<div id="imagify-overview-chart-percent" class="imagify-chart-percent"><?php echo esc_html( min( $data['optimized_attachments_percent'], 100 ) ); ?><span>%</span></div>
</div>
<div id="imagify-overview-chart-legend"></div>
<p class="imagify-global-optim-phrase imagify-clear">
<?php
printf(
/* translators: %s is a percentage. */
esc_html__( 'You optimized %s of your website\'s images', 'imagify' ),
'<span class="imagify-total-percent">' . esc_html( min( $data['optimized_attachments_percent'], 100 ) ) . '%</span>'
);
?>
</p>
</div><!-- .imagify-col -->
</div>
</div><!-- .imagify-col.col-overview -->
<div class="imagify-col imagify-account-info-col">
<?php
if (
( ! defined( 'IMAGIFY_HIDDEN_ACCOUNT' ) || ! IMAGIFY_HIDDEN_ACCOUNT )
&&
Imagify_Requirements::is_api_key_valid()
) {
?>
<div class="imagify-options-title">
<div class="imagify-th-titles imagify-flex imagify-vcenter">
<span class="dashicons dashicons-admin-users"></span>
<p class="imagify-meteo-title">
<?php esc_html_e( 'Your Account', 'imagify' ); ?>
</p>
</div>
<a href="<?php echo esc_url( imagify_get_external_url( 'subscription' ) ); ?>" target="_blank"><?php _e( 'View your profile', 'imagify' ); ?></a>
</div>
<?php $this->print_template( 'part-upsell' ); ?>
<?php } // End if(). ?>
</div><!-- .imagify-account-info-col -->
</div><!-- .imagify-columns -->
<?php
$this->print_template( 'part-bulk-optimization-success' );
$this->print_template( 'part-bulk-optimization-table', $data );
// New Feature!
if ( ! empty( $data['no-custom-folders'] ) ) {
$this->print_template( 'part-bulk-optimization-newbie' );
}
?>
<div class="imagify-bulk-submit imagify-flex imagify-vcenter">
<div class="imagify-pr2">
<p>
<?php wp_nonce_field( 'imagify-bulk-optimize', 'imagifybulkuploadnonce' ); ?>
<?php
$disabled = '';
$class = '';
if (
false !== get_transient( 'imagify_wp_optimize_running' )
||
false !== get_transient( 'imagify_custom-folders_optimize_running' )
) {
$disabled = 'disabled="disabled"';
$class = 'rotate';
}
?>
<button id="imagify-bulk-action" type="button" class="button button-primary" <?php echo $disabled; ?>>
<span class="dashicons dashicons-admin-generic <?php echo $class; ?>"></span>
<span class="button-text"><?php _e( 'Imagifem all', 'imagify' ); ?></span>
</button>
</p>
</div>
<?php if ( ! is_wp_error( get_imagify_max_image_size() ) ) { ?>
<p>
<?php
printf(
/* translators: %s is a file size. */
esc_html__( 'All images greater than %s (after resizing, if any) will be optimized when using a paid plan.', 'imagify' ),
esc_html( imagify_size_format( get_imagify_max_image_size() ) )
);
?>
</p>
<?php } ?>
</div><!-- .imagify-bulk-submit -->
</div><!-- .imagify-settings-section -->
<?php
$this->print_template( 'modal-payment' );
if ( Imagify_Requirements::is_api_key_valid() ) {
$display_infos = get_transient( 'imagify_bulk_optimization_infos' );
?>
<script type="text/html" id="tmpl-imagify-overquota-alert">
<?php $this->print_template( 'part-bulk-optimization-overquota-alert' ); ?>
</script>
<?php
if ( ! $display_infos ) {
?>
<script type="text/html" id="tmpl-imagify-bulk-infos">
<?php
$this->print_template( 'part-bulk-optimization-infos', array(
'quota' => $data['unconsumed_quota'],
'quota_class' => $data['quota_class'],
'library' => ! empty( $data['groups']['library'] ),
) );
?>
</script>
<?php
}
}
?>
</div>
<?php

View File

@@ -0,0 +1,15 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="wrap imagify-files-list">
<?php $this->print_template( 'part-files-list-header' ); ?>
<form id="imagify-files-list-form" method="get">
<input type="hidden" name="page" value="<?php echo esc_attr( Imagify_Views::get_instance()->get_files_page_slug() ); ?>"/>
<?php $this->list_table->views(); ?>
<?php $this->list_table->display(); ?>
</form>
</div>
<?php

View File

@@ -0,0 +1,184 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$settings = Imagify_Settings::get_instance();
$options = Imagify_Options::get_instance();
$option_name = $options->get_option_name();
$hidden_class = Imagify_Requirements::is_api_key_valid() ? '' : ' hidden';
$lang = imagify_get_current_lang_in( array( 'de', 'es', 'fr', 'it' ) );
/* Ads notice */
$plugins = get_plugins();
$notice = 'wp-rocket';
$user_id = get_current_user_id();
$notices = get_user_meta( $user_id, '_imagify_ignore_ads', true );
$notices = $notices && is_array( $notices ) ? array_flip( $notices ) : array();
$wrapper_class = isset( $notices[ $notice ] ) || isset( $plugins['wp-rocket/wp-rocket.php'] ) ? 'imagify-have-rocket' : 'imagify-dont-have-rocket';
?>
<div class="wrap imagify-settings <?php echo $wrapper_class; ?> imagify-clearfix">
<div class="imagify-col imagify-main">
<?php $this->print_template( 'part-settings-header' ); ?>
<div class="imagify-main-content">
<form action="<?php echo esc_url( $settings->get_form_action() ); ?>" id="imagify-settings" method="post">
<div class="imagify-settings-main-content<?php echo Imagify_Requirements::is_api_key_valid() ? '' : ' imagify-no-api-key'; ?>">
<?php settings_fields( $settings->get_settings_group() ); ?>
<?php wp_nonce_field( 'imagify-signup', 'imagifysignupnonce', false ); ?>
<?php wp_nonce_field( 'imagify-check-api-key', 'imagifycheckapikeynonce', false ); ?>
<?php
if ( ! Imagify_Requirements::is_api_key_valid() ) {
$this->print_template( 'part-settings-account' );
$this->print_template( 'part-settings-footer' );
}
?>
<div class="imagify-col imagify-shared-with-account-col<?php echo $hidden_class; ?>">
<div class="imagify-settings-section">
<h2 class="imagify-options-title"><?php _e( 'General Settings', 'imagify' ); ?></h2>
<p class="imagify-setting-line">
<?php
$settings->field_checkbox( array(
'option_name' => 'auto_optimize',
'label' => __( 'Auto-Optimize images on upload', 'imagify' ),
'info' => __( 'Automatically optimize every image you upload to WordPress.', 'imagify' ),
) );
?>
</p>
<p class="imagify-setting-line">
<?php
$settings->field_checkbox( array(
'option_name' => 'backup',
'label' => __( 'Backup original images', 'imagify' ),
'info' => __( 'Keep your original images in a separate folder before optimization process.', 'imagify' ),
) );
$backup_error_class = $options->get( 'backup' ) && ! Imagify_Requirements::attachments_backup_dir_is_writable() ? '' : ' hidden';
?>
<br/><strong id="backup-dir-is-writable" class="imagify-error<?php echo $backup_error_class; ?>" data-nonce="<?php echo esc_attr( wp_create_nonce( 'imagify_check_backup_dir_is_writable' ) ); ?>">
<?php
$backup_path = $this->filesystem->make_path_relative( get_imagify_backup_dir_path( true ) );
/* translators: %s is a file path. */
printf( __( 'The backup folder %s cannot be created or is not writable by the server, original images cannot be saved!', 'imagify' ), "<code>$backup_path</code>" );
?>
</strong>
</p>
<p class="imagify-setting-line">
<?php
$settings->field_checkbox( array(
'option_name' => 'lossless',
'label' => __( 'Lossless compression', 'imagify' ),
'info' => __( 'By default, Imagify optimizes your images by using a smart compression to get the best compression rate with an optimal quality.', 'imagify' ) . '<br><br>' . __( 'If you are a photographer or focus on the quality of your images rather than the performance, you may be interested in this option to make sure not a single pixel looks different in the optimized image compared with the original.', 'imagify' ),
) );
?>
</p>
</div>
</div>
<?php if ( Imagify_Requirements::is_api_key_valid() ) { ?>
<div class="imagify-col imagify-account-info-col">
<?php $this->print_template( 'part-settings-account' ); ?>
</div>
<?php } ?>
</div>
<div class="imagify-settings-main-content<?php echo $hidden_class; ?>">
<div class="imagify-settings-section imagify-clear">
<h2 class="imagify-options-title"><?php _e( 'Optimization', 'imagify' ); ?></h2>
<?php
$this->print_template( 'part-settings-webp' );
$this->print_template( 'part-settings-library' );
$this->print_template( 'part-settings-custom-folders' );
?>
</div>
</div>
<div class="imagify-settings-main-content imagify-pb0<?php echo $hidden_class; ?>">
<div class="imagify-settings-section imagify-clear">
<div>
<h2 class="imagify-options-title"><?php _e( 'Display Options', 'imagify' ); ?></h2>
<p class="imagify-options-subtitle"><?php _e( 'Show Toolbar Menu', 'imagify' ); ?></p>
<div class="imagify-col">
<p>
<?php
$settings->field_checkbox( array(
'option_name' => 'admin_bar_menu',
'label' => __( 'I want this awesome quick access menu on my Toolbar.', 'imagify' ),
) );
?>
</p>
</div>
<div class="imagify-col">
<p>
<img class="imagify-menu-bar-img" src="<?php echo esc_url( IMAGIFY_ASSETS_IMG_URL . 'imagify-menu-bar-' . $lang . '.jpg' ); ?>" width="273" height="239" alt="">
</p>
</div>
<?php
/**
* List of partners affected by this option.
* For internal use only.
*
* @since 1.8.2
* @author Grégory Viguier
*
* @param array $partners An array of partner names.
* @return array
*/
$partners = apply_filters( 'imagify_deactivatable_partners', array() );
if ( $partners ) {
?>
<p class="imagify-options-subtitle" id="imagify-partners-label">
<?php esc_html_e( 'Partners', 'imagify' ); ?>
<span class="imagify-info">
<span class="dashicons dashicons-info"></span>
<a href="#imagify-partners-info" class="imagify-modal-trigger"><?php _e( 'More info?', 'imagify' ); ?></a>
</span>
</p>
<p>
<?php
$settings->field_checkbox( array(
'option_name' => 'partner_links',
'label' => __( 'Display Partner Links', 'imagify' ),
) );
?>
</p>
<?php
}
?>
</div>
</div>
<?php
if ( Imagify_Requirements::is_api_key_valid() ) {
$this->print_template( 'part-settings-footer' );
}
?>
</div>
</form>
</div>
</div>
<?php
$this->print_template( 'part-rocket-ad' );
$this->print_template( 'modal-settings-infos' );
$this->print_template( 'modal-settings-partners-infos' );
$this->print_template( 'modal-settings-visual-comparison' );
$this->print_template( 'modal-payment' );
?>
</div>
<?php

View File

@@ -0,0 +1,19 @@
<?php defined( 'ABSPATH' ) || die( 'Cheatin uh?' ); ?>
<h1 class="screen-reader-text"><?php _e( 'Bulk Optimization', 'imagify' ); ?> Imagify <?php echo IMAGIFY_VERSION; ?></h1>
<div class="imagify-title">
<p class="imagify-logo-block">
<span class="imagify-lb-icon">
<svg class="icon icon-bulk" viewBox="0 0 38 36" width="38" height="36" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m233.09 177.21l-5.52 10.248c-.08.145-.018.272-.023.388-.074.193-.033.4-.033.619v21.615c0 .952.601 1.429 1.552 1.429h33.897c.952 0 1.962-.478 1.962-1.429v-21.615c0-.487-.323-.925-.649-1.24l-5.623-9.976c-.405-.726-1.202-1.179-2.034-1.182l-21.486-.068c-.849 0-1.64.464-2.043 1.211m30.424 32.869c0 .173-.378.018-.551.018h-33.897c-.172 0-.14.155-.14-.018v-21.576l33.961-.281c.066.008.186.09.263.128.054.027.205.049.258.073.002.014.106.027.106.041v21.615m-6.153-32.11l4.91 8.835h-14.992v-9.354l9.306.045c.322.001.619.192.776.474m-11.494-.523v9.358h-16.306l4.773-8.892c.155-.289.456-.484.787-.484l10.746.018m7.06 17.12c0 .39-.316.706-.706.706h-12.706c-.39 0-.706-.316-.706-.706 0-.39.316-.706.706-.706h12.706c.39 0 .706.316.706.706" transform="translate(-227-176)" fill="#40B1D0"/></g></svg>
</span>
<span class="imagify-lb-text">
<img width="139" height="16" alt="Imagify" src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>imagify-logo.png" class="imagify-logo" />
<?php _e( 'Bulk Optimization', 'imagify' ); ?>
</span>
</p>
<?php $this->print_template( 'part-documentation-link' ); ?>
</div>
<?php

View File

@@ -0,0 +1,47 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-swal-subtitle"><?php esc_html_e( 'Some information to know before launching the optimization.', 'imagify' ); ?></div>
<div class="imagify-swal-quota">
<div class="imagify-space-left">
<p>
<?php
printf(
/* translators: %s is a data quota. */
esc_html__( 'You have %s space credit left', 'imagify' ),
'<span class="imagify-unconsumed-percent">' . esc_html( $data['quota'] ) . '%</span>'
);
?>
</p>
<div class="<?php echo sanitize_html_class( $data['quota_class'] ); ?>">
<div class="imagify-unconsumed-bar imagify-progress" style="width: <?php echo esc_attr( $data['quota'] ) . '%'; ?>;"></div>
</div>
</div>
</div>
<div class="imagify-swal-content">
<ul class="imagify-list-infos">
<li>
<span class="imagify-info-icon"><svg width="36" height="36" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg"><g fill="#40b1d0" fill-rule="nonzero"><path d="m18 36c-9.925 0-18-8.07-18-18 0-9.925 8.07-18 18-18 9.925 0 18 8.07 18 18 0 9.925-8.07 18-18 18m0-34.435c-9.06 0-16.435 7.372-16.435 16.435 0 9.06 7.372 16.435 16.435 16.435 9.06 0 16.435-7.372 16.435-16.435 0-9.06-7.372-16.435-16.435-16.435"/><path d="m27.391 18.783l-9.391 0c-.432 0-.783-.351-.783-.783l0-12.522c0-.432.351-.783.783-.783.432 0 .783.351.783.783l0 11.739 8.609 0c.432 0 .783.351.783.783 0 .432-.351.783-.783.783"/></g></svg></span>
<span><?php
esc_html_e( 'Please be aware that optimizing a large number of images can take a while depending on your server and network speed.', 'imagify' );
if ( ! empty( $data['library'] ) && get_transient( 'imagify_large_library' ) ) {
printf(
/* translators: %s is a formatted number. Don't use %d. */
__( 'If you have more than %s images, you will need to launch the bulk optimization several times.', 'imagify' ),
number_format_i18n( imagify_get_unoptimized_attachment_limit() )
);
}
?></span>
</li>
<li>
<span class="imagify-info-icon"><svg width="36" height="47" viewBox="0 0 36 47" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="translate(-594-569)"><path d="m13.304 31.3l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0-4.696l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0 9.391l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0 4.696l-7.826 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l7.826 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m-8.609-22.696c0 .432.351.783.783.783l25.04 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783l-25.04 0c-.432 0-.783.351-.783.783m30.522-18l-21.913 0c-.105 0-.207.022-.302.061-.045.019-.08.053-.121.08-.044.03-.094.05-.131.088l-12.522 12.522c-.036.036-.056.085-.085.127-.028.042-.064.078-.083.125-.039.095-.061.197-.061.302l0 32.87c0 .432.351.783.783.783l34.435 0c.432 0 .783-.351.783-.783l0-45.39c0-.432-.351-.783-.783-.783m-22.696 2.672l0 9.85-9.85 0 9.85-9.85m21.913 42.719l-32.87 0 0-31.3 11.739 0c.432 0 .783-.351.783-.783l0-11.739 20.348 0 0 43.826m-3.913-23.478l-25.04 0c-.432 0-.783.351-.783.783 0 .432.351.783.783.783l25.04 0c.432 0 .783-.351.783-.783 0-.432-.351-.783-.783-.783m0 4.696l-14.09 0c-.432 0-.783.351-.783.783l0 14.09c0 .011.006.019.006.03.003.063.019.121.036.182.011.039.017.08.034.116.022.047.056.086.086.128.03.041.056.083.094.117.009.009.014.02.023.03.03.025.066.033.097.052.045.028.091.058.142.077.05.017.1.023.152.031.038.003.072.02.111.02l14.09 0c.161 0 .302-.059.426-.144.014-.009.03-.005.044-.014.014-.011.02-.025.033-.036.044-.038.08-.081.114-.128.028-.038.055-.072.075-.111.022-.044.034-.091.049-.141.014-.052.028-.102.031-.155.002-.019.011-.033.011-.052l0-14.09c0-.434-.351-.784-.783-.784m-12.417 14.09l2.446-2.936 2.576 1.288c.34.171.75.072.977-.23l1.722-2.295 3.13 4.173-10.852 0m11.634-1.567l-3.287-4.383c-.296-.394-.958-.394-1.252 0l-1.957 2.608-2.547-1.273c-.327-.164-.72-.08-.952.199l-2.528 3.033 0-11.14 12.522 0 0 10.955m-9.391-6.259c.862 0 1.565-.703 1.565-1.565 0-.862-.703-1.565-1.565-1.565-.862 0-1.565.703-1.565 1.565 0 .862.703 1.565 1.565 1.565" transform="translate(594 569)" fill="#40b1d0" fill-rule="nonzero"/></g></svg></span>
<span>
<?php _e( 'Need help or have questions?', 'imagify' ); ?>
<a class="imagify-documentation-link" href="<?php echo esc_url( imagify_get_external_url( 'documentation' ) ); ?>" target="_blank"><?php _e( 'Check our documentation.', 'imagify' ); ?></a>
<span>
</li>
</ul>
</div><!-- imagify-swal-content -->
<?php

View File

@@ -0,0 +1,20 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-bulk-table imagify-newbie">
<p class="imagify-new-feature"><?php _e( 'New Feature!', 'imagify' ); ?></p>
<div class="imagify-table-header imagify-flex imagify-vcenter">
<div class="imagify-th-titles imagify-flex imagify-vcenter">
<span class="dashicons dashicons-admin-plugins"></span>
<div class="imagify-th-titles">
<p class="imagify-th-title"><?php _e( 'Optimize the images from your site\'s folders', 'imagify' ); ?></p>
</div>
</div>
<div class="imagify-th-action">
<a class="hide-if-no-js button imagify-button-secondary" href="<?php echo esc_url( get_imagify_admin_url() ); ?>#custom-folders">
<?php esc_html_e( 'Choose your folders to optimize', 'imagify' ); ?>
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,21 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$overquota_url = imagify_get_external_url( 'subscription', array(
'utm_source' => 'plugin',
'utm_medium' => 'imagify-wp',
'utm_content' => 'over-quota',
) );
?>
<div class="imagify-swal-subtitle"><?php esc_html_e( 'Upgrade your account to continue optimizing your images.', 'imagify' ); ?></div>
<div class="imagify-swal-content imagify-txt-start">
<?php if ( Imagify_Requirements::is_api_key_valid() ) { ?>
<strong><?php esc_html_e( 'To continue optimizing your images, you can upgrade your subscription.', 'imagify' ); ?></strong>
<?php } ?>
</div>
<div class="imagify-swal-buttonswrapper">
<a href="<?php echo esc_url( $overquota_url ); ?>" target="_blank" class="imagify-button imagify-button-primary button">
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="#000" fill-rule="nonzero" transform="translate(1 1)" stroke="#fff"><polygon points="8.75 0 8.75 0.7 12.8065 0.7 5.0015 8.5015 5.4985 8.9985 13.3 1.1935 13.3 5.25 14 5.25 14 0"/><polygon points="11.9 13.3 0.7 13.3 0.7 2.1 6.3 2.1 6.3 1.4 0 1.4 0 14 12.6 14 12.6 7.7 11.9 7.7"/></g></svg>
<?php esc_html_e( 'See our plans on the Imagify website', 'imagify' ); ?>
</a>
</div>

View File

@@ -0,0 +1,51 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<!-- The Success/Complete bar -->
<div class="imagify-row-complete hidden" aria-hidden="true">
<div class="imagify-all-complete">
<div class="imagify-ac-report">
<div class="imagify-ac-chart" data-percent="0">
<span class="imagify-chart">
<span class="imagify-chart-container">
<canvas id="imagify-ac-chart" width="46" height="46"></canvas>
</span>
</span>
</div>
<div class="imagify-ac-report-text">
<p class="imagify-ac-rt-big"><?php _e( 'Well done!', 'imagify' ); ?></p>
<p>
<?php
printf(
// translators: %1$s = number of images, %2$s = data size, %3$s = data size.
__( 'You optimized %1$s images and saved %2$s out of %3$s', 'imagify' ),
'<strong class="imagify-ac-rt-total-images"></strong>',
'<strong class="imagify-ac-rt-total-gain"></strong>',
'<strong class="imagify-ac-rt-total-original"></strong>'
);
?>
</p>
</div>
</div>
<div class="imagify-ac-spread-word">
<h3><?php esc_html_e( 'How about spreading the word?', 'imagify' ); ?></h3>
<p>
<?php
printf(
// translators: 1 is a link tag start, 2 is the link tag end.
__( 'Please take a few seconds to leave a review on %1$sWordPress.org%2$s. It would mean the world to us!', 'imagify' ),
'<a href="' . esc_url( imagify_get_external_url( 'rate' ) ) . '" target="_blank">',
'</a>'
);
?>
<br>
<a class="stars" aria-hidden="true" href="<?php echo esc_url( imagify_get_external_url( 'rate' ) ); ?>" target="_blank"><?php echo str_repeat( '<span class="dashicons dashicons-star-empty"></span>', 5 ); ?></a>
</p>
</div>
<div class="imagify-ac-leave-review">
<a href="<?php echo esc_url( imagify_get_external_url( 'rate' ) ); ?>" target="_blank" class="button button-primary"><?php esc_html_e( 'Leave a review', 'imagify' ); ?></a>
</div>
</div>
</div>
<?php

View File

@@ -0,0 +1,50 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<tr class="imagify-row-folder-type" data-group-id="<?php echo $data['group_id']; ?>" data-context="<?php echo $data['context']; ?>">
<td class="imagify-cell-checkbox">
<p>
<span class="imagify-cell-checkbox-loader <?php echo $data['spinner_class']; ?>" <?php echo $data['spinner_aria']; ?>>
<svg width="27" height="28" viewBox="0 0 27 28" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m13.3.254c-.773 0-1.4.627-1.4 1.4l0 4.2c0 .773.627 1.4 1.4 1.4.773 0 1.4-.627 1.4-1.4l0-4.2c0-.773-.627-1.4-1.4-1.4m-8.422 3.478c-.358 0-.711.142-.984.416-.547.547-.547 1.444 0 1.991l2.975 2.953c.547.547 1.422.547 1.969 0 .547-.547.547-1.422 0-1.969l-2.953-2.975c-.273-.273-.648-.416-1.01-.416m16.844 0c-.358 0-.733.142-1.01.416l-2.953 2.975c-.547.547-.547 1.422 0 1.969.547.547 1.422.547 1.969 0l2.975-2.953c.547-.547.547-1.444 0-1.991-.273-.273-.626-.416-.984-.416m-20.322 8.422c-.773 0-1.4.627-1.4 1.4 0 .773.627 1.4 1.4 1.4l4.2 0c.773 0 1.4-.627 1.4-1.4 0-.773-.627-1.4-1.4-1.4l-4.2 0m19.6 0c-.773 0-1.4.627-1.4 1.4 0 .773.627 1.4 1.4 1.4l4.2 0c.773 0 1.4-.627 1.4-1.4 0-.773-.627-1.4-1.4-1.4l-4.2 0m-13.147 5.447c-.358 0-.711.142-.984.416l-2.975 2.953c-.547.547-.547 1.444 0 1.991.547.547 1.444.547 1.991 0l2.953-2.975c.547-.547.547-1.422 0-1.969-.273-.273-.626-.416-.984-.416m10.894 0c-.358 0-.711.142-.984.416-.547.547-.547 1.422 0 1.969l2.953 2.975c.547.547 1.444.547 1.991 0 .547-.547.547-1.444 0-1.991l-2.975-2.953c-.273-.273-.626-.416-.984-.416m-5.447 2.253c-.773 0-1.4.627-1.4 1.4l0 4.2c0 .773.627 1.4 1.4 1.4.773 0 1.4-.627 1.4-1.4l0-4.2c0-.773-.627-1.4-1.4-1.4" fill="#40b1d0" fill-rule="nonzero"/></g></svg>
</span>
<span class="imagify-cell-checkbox-box <?php echo $data['checkbox_class']; ?>" <?php echo $data['checkbox_aria']; ?>>
<input id="cb-select-<?php echo $data['group_id']; ?>" type="checkbox" name="group[]" checked="checked" value="<?php echo $data['group_id']; ?>" />
<label for="cb-select-<?php echo $data['group_id']; ?>"></label>
</span>
</p>
</td>
<td class="imagify-cell-title">
<label for="cb-select-<?php echo $data['group_id']; ?>"><?php echo $data['title']; ?></label>
</td>
<td class="imagify-cell-count-optimized">
<?php echo $data['count-optimized']; ?>
</td>
<td class="imagify-cell-count-errors">
<?php echo $data['count-errors']; ?>
</td>
<td class="imagify-cell-optimized-size-size">
<?php echo $data['optimized-size']; ?>
</td>
<td class="imagify-cell-original-size-size">
<?php echo $data['original-size']; ?>
</td>
<td class="imagify-cell-level">
<?php
$this->print_template( 'input/selector', [
'current_label' => __( 'Current level:', 'imagify' ),
'name' => 'level[' . $data['group_id'] . ']',
'value' => $data['level'],
'values' => [
0 => imagify_get_optimization_level_label( 0, '%ICON% %s' ),
2 => imagify_get_optimization_level_label( 2, '%ICON% %s' ),
],
] );
?>
</td>
</tr>
<tr>
<td class="imagify-bulk-table-footer" colspan="7">
<?php echo $data['footer']; ?>
</td>
</tr><!-- .imagify-bulk-table-footer -->

View File

@@ -0,0 +1,113 @@
<?php
use Imagify\Bulk\Bulk;
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-bulk-table">
<div class="imagify-table-header imagify-flex imagify-vcenter imagify-resting">
<div class="imagify-th-titles imagify-flex imagify-vcenter">
<span class="dashicons dashicons-<?php echo $data['icon']; ?>"></span>
<div class="imagify-th-titles">
<p class="imagify-th-title"><?php echo $data['title']; ?></p>
</div>
</div>
</div>
<?php
$types = [];
$total = 0;
$remaining = 0;
$percentage = 0;
foreach ( $data['groups'] as $group ) {
$types[ $group['group_id'] . '|' . $group['context'] ] = true;
$transient = get_transient( "imagify_{$group['context']}_optimize_running" );
if ( false !== $transient ) {
$total += $transient['total'];
$remaining += $transient['remaining'];
}
}
if ( 0 !== $total ) {
$percentage = ( $total - $remaining ) / $total * 100;
}
$bulk = Bulk::get_instance();
$aria_hidden = 'aria-hidden="true"';
$hidden = 'hidden';
$style = '';
$display = '';
if (
0 !== $percentage
&&
100 !== $percentage
) {
$percentage = round( $percentage );
$aria_hidden = '';
$hidden = '';
$style = 'style="width:' . $percentage . '%;"';
$display = 'style="display:block;"';
}
?>
<div class="imagify-bulk-table-content">
<div class="imagify-bulk-table-container">
<div <?php echo $aria_hidden; ?> class="imagify-row-progress <?php echo $hidden; ?>" <?php echo $display; ?>>
<div class="media-item">
<div class="progress">
<div class="bar" <?php echo $style; ?>><div class="percent"><?php echo $percentage; ?>%</div></div>
</div>
</div>
</div>
<table>
<thead>
<tr class="screen-reader-text">
<th class="imagify-cell-checkbox"><?php esc_html_e( 'Group selection', 'imagify' ); ?></th>
<th class="imagify-cell-title"><?php esc_html_e( 'Group name', 'imagify' ); ?></th>
<th class="imagify-cell-count-optimized"><?php esc_html_e( 'Number of images optimized', 'imagify' ); ?></th>
<th class="imagify-cell-count-errors"><?php esc_html_e( 'Errors', 'imagify' ); ?></th>
<th class="imagify-cell-optimized-size-size"><?php esc_html_e( 'Optimized Size', 'imagify' ); ?></th>
<th class="imagify-cell-original-size-size"><?php esc_html_e( 'Original Size', 'imagify' ); ?></th>
<th class="imagify-cell-level"><?php esc_html_e( 'Level Selection', 'imagify' ); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ( $data['groups'] as $group ) {
$context_data = $bulk->get_bulk_instance( $group['context'] )->get_context_data();
$group = array_merge( $group, $context_data );
$default_level = Imagify_Options::get_instance()->get( 'optimization_level' );
if ( Imagify_Options::get_instance()->get( 'lossless' ) ) {
$default_level = 0;
}
$group['level'] = $default_level;
$running = get_transient( "imagify_{$group['context']}_optimize_running" );
$group['spinner_class'] = 'hidden';
$group['spinner_aria'] = 'aria-hidden="true"';
$group['checkbox_class'] = '';
$group['checkbox_aria'] = 'aria-hidden="false"';
if ( false !== $running ) {
$group['spinner_class'] = '';
$group['spinner_aria'] = 'aria-hidden="false"';
$group['checkbox_class'] = 'hidden';
$group['checkbox_aria'] = 'aria-hidden="true"';
}
$this->print_template( 'part-bulk-optimization-table-row-folder-type', $group );
}
?>
</tbody>
</table>
</div><!-- .imagify-bulk-table-container -->
</div><!-- .imagify-bulk-table-content -->
</div>

View File

@@ -0,0 +1,26 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="imagify-modal-promotion" aria-hidden="true">
<p class="imagify-promo-title">
<?php
printf(
/* translators: %1$s is a formatted percentage, %2$s is a subscription plan name. */
__( '%1$s OFF on %2$s subscriptions', 'imagify' ),
'<span class="imagify-promotion-number"></span>',
'<span class="imagify-promotion-plan-name"></span>'
);
?>
</p>
<p class="imagify-until-date">
<?php
printf(
/* translators: %s is a formatted date. */
__( 'Special Offer<br><strong>Until %s</strong>', 'imagify' ),
'<span class="imagify-promotion-date"></span>'
);
?>
</p>
</div>
<?php

View File

@@ -0,0 +1,14 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<p class="imagify-documentation-link-box">
<span class="imagify-documentation-link-icon" aria-hidden="true">
<svg viewBox="0 0 23 31" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="nonzero"><g fill="#40b1d0"><path d="m22.361 31h-21.722c-.353 0-.639-.289-.639-.646v-21.958c0-.172.068-.336.187-.457l7.667-7.75c.12-.12.282-.189.452-.189h14.06c.353 0 .639.289.639.646v29.708c0 .357-.286.646-.639.646m-21.08-1.292h20.444v-28.417h-13.152l-7.292 7.372v21.05"/><path d="m8.306 9.04h-7.667c-.353 0-.639-.289-.639-.646 0-.357.286-.646.639-.646h7.03v-7.104c0-.357.286-.646.639-.646.353 0 .639.289.639.646v7.75c0 .357-.286.646-.639.646"/></g><g fill="#f2f5f7"><path d="m18.375 11h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/><path d="m19.333 7h-6.667c-.368 0-.667-.224-.667-.5 0-.276.299-.5.667-.5h6.667c.368 0 .667.224.667.5 0 .276-.299.5-.667.5"/><path d="m18.375 15h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/><path d="m18.375 19h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/><path d="m18.375 23h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/><path d="m18.375 27h-13.75c-.345 0-.625-.224-.625-.5 0-.276.28-.5.625-.5h13.75c.345 0 .625.224.625.5 0 .276-.28.5-.625.5"/></g></g></svg>
</span>
<span>
<?php _e( 'Need help or have questions?', 'imagify' ); ?><br/>
<a class="imagify-documentation-link" href="<?php echo esc_url( imagify_get_external_url( 'documentation' ) ); ?>" target="_blank"><?php _e( 'Check our documentation.', 'imagify' ); ?></a>
</span>
</p>
<?php

View File

@@ -0,0 +1,6 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<h1><?php esc_html_e( 'Other Media optimized by Imagify', 'imagify' ); ?></h1>
<?php

View File

@@ -0,0 +1,58 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$plugins = get_plugins();
if ( isset( $plugins['wp-rocket/wp-rocket.php'] ) ) {
return '';
}
$notice = 'wp-rocket';
$user_id = get_current_user_id();
$notices = get_user_meta( $user_id, '_imagify_ignore_ads', true );
$notices = $notices && is_array( $notices ) ? array_flip( $notices ) : array();
if ( isset( $notices[ $notice ] ) ) {
return;
}
$discount_percent = '20%';
$dismiss_url = wp_nonce_url( admin_url( 'admin-post.php?action=imagify_dismiss_ad&ad=' . $notice ), 'imagify-dismiss-ad' );
?>
<div class="imagify-col imagify-sidebar">
<div class="imagify-sidebar-section">
<p class="imagify-sidebar-title">
<?php _e( 'We recommend for you', 'corporate' ); ?>
</p>
<img src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>logo-wprocket.png" srcset="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>logo-wprocket.svg 1x, <?php echo IMAGIFY_ASSETS_IMG_URL; ?>logo-wprocket.svg 2x" alt="WP Rocket" width="232" height="63">
<p class="imagify-sidebar-description">
<?php
/* translators: 1 is a "bold" tag opening, 2 is the "bold" tag closing. Please use a non-breaking space for WP Rocket. */
printf( __( 'WP Rocket is a %1$sspeed optimization plugin for WordPress%2$s helping you to implement a variety of speed-boosting features to your WordPress site.', 'imagify' ), '<strong>', '</strong>' );
?>
</p>
<p>
<a class="btn btn-rocket" href="<?php echo esc_url( imagify_get_wp_rocket_url() ); ?>" target="_blank">
<?php
/* translators: %s is a percentage. */
printf( __( 'Get %s OFF Now!', 'imagify' ), $discount_percent );
?>
</a>
</p>
<ul>
<li><?php _e( 'Improve your Google PageSpeed Score.', 'imagify' ); ?></li>
<li><?php _e( 'Boost your SEO.', 'imagify' ); ?></li>
<li><?php _e( 'WooCommerce compatibility.', 'imagify' ); ?></li>
<li><?php _e( 'Immediate results.', 'imagify' ); ?></li>
</ul>
<a class="imagify-sidebar-close" href="<?php echo esc_url( $dismiss_url ); ?>"><span class="screen-reader-text"><?php _e( 'Remove the ad', 'imagify' ); ?></span><i class="dashicons dashicons-no-alt" aria-hidden="true"></i></a>
</div>
</div>
<?php

View File

@@ -0,0 +1,91 @@
<?php
use Imagify\User\User;
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
if ( defined( 'IMAGIFY_HIDDEN_ACCOUNT' ) && IMAGIFY_HIDDEN_ACCOUNT ) {
if ( ! defined( 'IMAGIFY_API_KEY' ) || ! IMAGIFY_API_KEY ) {
$options = Imagify_Options::get_instance();
?>
<input type="hidden" value="<?php echo esc_attr( $options->get( 'api_key' ) ); ?>" name="<?php echo $options->get_option_name(); ?>[api_key]">
<?php
}
return;
}
if ( Imagify_Requirements::is_api_key_valid() ) {
$user = imagify_get_cached_user();
if ( ! $user ) {
// Lazyload user.
Imagify_Assets::get_instance()->localize_script( 'options', 'imagifyUser', array(
'action' => 'imagify_get_user_data',
'_wpnonce' => wp_create_nonce( 'imagify_get_user_data' ),
) );
}
}
?>
<div class="imagify-settings-section">
<?php $this->print_template( 'part-upsell' ); ?>
<?php
if ( ! defined( 'IMAGIFY_API_KEY' ) || ! IMAGIFY_API_KEY ) {
if ( Imagify_Requirements::is_api_key_valid() ) {
?>
<h2 class="imagify-options-title">
<?php esc_html_e( 'API Key', 'imagify' ); ?>
</h2>
<?php
} else {
?>
<h2 class="imagify-options-title"><?php esc_html_e( 'Your Account', 'imagify' ); ?></h2>
<p class="imagify-options-subtitle"><?php esc_html_e( 'Options page isnt available until you enter your API Key', 'imagify' ); ?></p>
<?php
}
?>
<?php
/**
* API key field.
*/
$options = Imagify_Options::get_instance();
if ( ! $options->get( 'api_key' ) ) {
?>
<p class="imagify-api-key-invite"><?php esc_html_e( 'Don\'t have an API Key yet?', 'imagify' ); ?></p>
<p><a id="imagify-signup" class="button imagify-button-secondary" href="<?php echo esc_url( imagify_get_external_url( 'register' ) ); ?>" target="_blank"><?php esc_html_e( 'Create a Free API Key', 'imagify' ); ?></a></p>
<?php
}
?>
<div class="imagify-api-line">
<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>
<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">
<?php
if ( Imagify_Requirements::is_api_key_valid() ) {
?>
<span id="imagify-check-api-container" class="imagify-valid">
<span class="imagify-icon">✓</span> <?php esc_html_e( 'Your API key is valid.', 'imagify' ); ?>
</span>
<?php
} elseif ( ! Imagify_Requirements::is_api_key_valid() && $options->get( 'api_key' ) ) {
?>
<span id="imagify-check-api-container">
<span class="dashicons dashicons-no"></span> <?php esc_html_e( 'Your API key isn\'t valid!', 'imagify' ); ?>
</span>
<?php
}
?>
<input id="check_api_key" type="hidden" value="<?php echo esc_attr( $options->get( 'api_key' ) ); ?>" name="check_api_key">
</div><!-- .imagify-api-line -->
<?php
}
?>
</div>
<?php

View File

@@ -0,0 +1,191 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
if ( ! imagify_can_optimize_custom_folders() ) {
return;
}
// Get folders, remove excluded ones, sort them, add labels.
$custom_folders = Imagify_Folders_DB::get_instance()->get_active_folders_column( 'path' );
$themes = array();
if ( $custom_folders ) {
$custom_folders = array_combine( $custom_folders, $custom_folders );
$custom_folders = array_map( array( 'Imagify_Files_Scan', 'remove_placeholder' ), $custom_folders );
$custom_folders = array_map( 'trailingslashit', $custom_folders );
$custom_folders = array_filter( $custom_folders, array( 'Imagify_Files_Scan', 'is_path_autorized' ) );
}
if ( $custom_folders ) {
$custom_folders = array_map( array( $this->filesystem, 'make_path_relative' ), $custom_folders );
$custom_folders = array_map( 'untrailingslashit', $custom_folders );
natcasesort( $custom_folders );
$custom_folders = array_map( 'trailingslashit', $custom_folders );
if ( isset( $custom_folders['{{ROOT}}/'] ) ) {
$custom_folders['{{ROOT}}/'] = __( 'Site\'s root', 'imagify' );
}
}
// Current used theme(s).
if ( ! is_network_admin() ) {
$current_theme = wp_get_theme();
$themes_not_added = array();
foreach ( array( $current_theme, $current_theme->parent() ) as $theme ) {
if ( ! $theme || ! $theme->exists() ) {
continue;
}
$theme_path = trailingslashit( $theme->get_stylesheet_directory() );
if ( ! Imagify_Files_Scan::is_path_forbidden( $theme_path ) ) {
$theme = array(
'name' => $theme->display( 'Name' ),
'path' => Imagify_Files_Scan::add_placeholder( $theme_path ),
'label' => $this->filesystem->make_path_relative( $theme_path ),
);
$themes[ $theme['path'] ] = $theme;
$added = false;
$rel_path = strtolower( $theme['label'] );
foreach ( $custom_folders as $path => $label ) {
if ( strpos( $rel_path, strtolower( $label ) ) === 0 ) {
$added = true;
break;
}
}
if ( ! $added ) {
$themes_not_added[] = $theme['path'];
}
}
}
$themes_count = count( $themes );
}
?>
<div class="imagify-custom-folders-section">
<div class="imagify-col" id="custom-folders">
<h3 class="imagify-options-subtitle"><?php _e( 'Custom Folders', 'imagify' ); ?></h3>
<div id="imagify-custom-folders" class="hide-if-no-js imagify-mt2">
<?php if ( $themes ) { ?>
<div class="imagify-folder-themes-suggestion">
<div class="imagify-fts-header imagify-flex imagify-vcenter">
<span><i class="dashicons dashicons-info"></i></span>
<p>
<?php
$theme = reset( $themes );
/* translators: %s is a theme name. */
printf( __( 'Youre using %s', 'imagify' ), '<strong>' . $theme['name'] . '</strong>' );
if ( $themes_count > 1 ) {
$theme = end( $themes );
echo '<br>';
/* translators: %s is a theme name. */
printf( __( 'child theme of %s', 'imagify' ), '<strong>' . $theme['name'] . '</strong>' );
}
?>
</p>
</div>
<div class="imagify-fts-content">
<?php
if ( ! $themes_not_added ) {
?>
<p class="imagify-mb0"><?php echo _n( 'Your theme is already in the optimization process. All Good!', 'Your themes are already in the optimization process. All Good!', $themes_count, 'imagify' ); ?></p>
<?php
} elseif ( count( $themes_not_added ) !== $themes_count ) {
$theme = reset( $themes_not_added );
$theme = $themes[ $theme ];
?>
<p><?php _e( 'Only one of your current themes is in the optimization process, would you like to also optimize the other one?', 'imagify' ); ?></p>
<button id="imagify-add-themes-to-custom-folder"
class="button imagify-button-clean imagify-add-themes" type="button"
data-theme="<?php echo esc_attr( $theme['path'] ) . '#///#' . esc_attr( $theme['label'] ); ?>">
<span class="dashicons dashicons-plus"></span>
<span class="button-text"><?php
/* translators: %s is a theme name. */
printf( __( 'Add %s to optimization', 'imagify' ), '<strong>' . $theme['name'] . '</strong>' );
?></span>
</button>
<?php
} else {
foreach ( $themes as $path => $theme ) {
$themes[ $path ] = esc_attr( $theme['path'] ) . '#///#' . esc_attr( $theme['label'] );
}
?>
<p><?php echo _n( 'Would you like to optimize your theme?', 'Would you like to optimize your themes?', $themes_count, 'imagify' ); ?></p>
<button id="imagify-add-themes-to-custom-folder"
class="button imagify-button-clean imagify-add-themes" type="button"
data-theme="<?php echo implode( '" data-theme-parent="', $themes ); ?>">
<span class="dashicons dashicons-plus"></span>
<span
class="button-text"><?php echo _n( 'Add the theme to optimization', 'Add the themes to optimization', $themes_count, 'imagify' ); ?></span>
</button>
<?php
}
?>
</div>
</div>
<?php } ?>
<p class="imagify-kindof-title imagify-flex imagify-vcenter">
<span><?php _e( 'Select folders for optimization.', 'imagify' ); ?></span>
<span>
<button id="imagify-add-custom-folder"
class="button imagify-button-mini imagify-button-primary imagify-add-custom-folder"
type="button">
<span class="dashicons dashicons-plus"></span>
<span class="button-text"><?php _e( 'Add folders', 'imagify' ); ?></span>
</button>
<img class="imagify-loader" aria-hidden="true" alt="<?php esc_attr_e( 'Loading...', 'imagify' ); ?>" src="<?php echo esc_url( IMAGIFY_ASSETS_IMG_URL . 'loader-balls.svg' ); ?>" width="38" height="24"/>
</span>
</p>
<fieldset id="imagify-custom-folders-selected">
<?php
if ( $custom_folders ) {
foreach ( $custom_folders as $placeholder => $label ) {
$this->print_template( 'part-settings-row-custom-folder', array(
'value' => $placeholder,
'label' => $label,
) );
}
}
?>
</fieldset>
<p>
<?php
printf(
/* translators: 1 and 2 are <strong> opening and closing tags. */
__( '%1$sSelecting a folder will also optimize images in sub-folders.%2$s The only exception is "Sites root": when selected, only images that are directly at the sites root will be optimized (sub-folders can be selected separately).', 'imagify' ),
'<strong>',
'</strong>'
);
?>
<br/>
<?php _e( 'Folders that are hidden in the folder selector window are excluded and will not be optimized even if a parent folder is selected.', 'imagify' ); ?>
</p>
<p class="imagify-success hidden"><?php _e( 'You changed your custom folder settings, don\'t forget to save your changes!', 'imagify' ); ?></p>
<script type="text/html" id="tmpl-imagify-custom-folder">
<?php
$this->print_template( 'part-settings-row-custom-folder', array(
'value' => '{{ data.value }}',
'label' => '{{ data.label }}',
) );
?>
</script>
</div>
</div>
</div>
<?php

View File

@@ -0,0 +1,55 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$disabled_attr = disabled( true, $data['checkbox_selected'], false );
$disabled_class = $data['checkbox_selected'] ? ' disabled' : '';
$folder_icon = '<svg width="20px" height="17px" viewBox="0 0 20 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-608.000000, -318.000000)" stroke-linecap="round" stroke-linejoin="round"><g transform="translate(609.000000, 319.000000)" stroke="#000000" stroke-width="2"><path d="M0,14.1428571 L18,14.1428571 L18,1.92857143 L7.71428571,1.92857143 L5.14285714,0 L0,0 L0,14.1428571 Z M18,5.14285714 L0,5.14285714 L18,5.14285714 Z"></path></g></g></svg>';
?>
<li<?php echo $data['checkbox_selected'] ? ' class="imagify-folder-already-selected"' : ''; ?>>
<?php if ( empty( $data['no_button'] ) ) : ?>
<button type="button" class="imagify-folder" data-folder="<?php echo $data['relative_path']; ?>"<?php echo $disabled_attr; ?> title="<?php
if ( $data['checkbox_selected'] ) {
/* translators: %s is a folder path. */
printf( esc_attr__( 'The folder "%s" is already selected.', 'imagify' ), $data['relative_path'] );
} else {
/* translators: %s is a folder path. */
printf( esc_attr__( 'Open/Close the folder "%s".', 'imagify' ), $data['relative_path'] );
}
?>">
<?php if ( ! $data['checkbox_selected'] ) { ?>
<span class="imagify-loader"><img alt="<?php esc_attr_e( 'Loading...', 'imagify' ); ?>" src="<?php echo esc_url( IMAGIFY_ASSETS_IMG_URL . 'spinner.gif' ); ?>" width="20" height="20"/></span>
<?php } ?>
<span class="imagify-folder-icon"><?php echo $folder_icon; ?></span>
</button>
<?php else : ?>
<span class="imagify-folder<?php echo $disabled_class; ?>">
<span class="imagify-folder-icon"><?php echo $folder_icon; ?></span>
</span>
<?php endif; ?>
<input type="checkbox" name="imagify-custom-files[]" value="<?php echo $data['checkbox_value']; ?>" id="imagify-custom-folder-<?php echo $data['checkbox_id']; ?>" class="screen-reader-text"<?php echo $disabled_attr; ?>/>
<label for="imagify-custom-folder-<?php echo $data['checkbox_id']; ?>" title="<?php
if ( $data['checkbox_selected'] ) {
/* translators: %s is a folder path. */
printf( esc_attr__( 'The folder "%s" is already selected.', 'imagify' ), $data['relative_path'] );
} else {
/* translators: %s is a folder path. */
printf( esc_attr__( 'Select the folder "%s".', 'imagify' ), $data['relative_path'] );
}
?>">
<?php echo esc_html( $data['label'] ); ?>
<span class="imagify-add-ed-folder">
<?php
if ( $data['checkbox_selected'] ) {
_e( 'Folder Added', 'imagify' );
} else {
_ex( 'Add Folder', 'checkbox label', 'imagify' );
}
?>
<span class="imagify-fake-checkbox"></span>
</span>
</label>
</li>

View File

@@ -0,0 +1,28 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<div class="submit imagify-clearfix">
<?php
// Classical submit.
submit_button();
if ( Imagify_Requirements::is_api_key_valid() ) {
$user_can = imagify_get_context( 'wp' )->current_user_can( 'bulk-optimize' ) || imagify_get_context( 'custom-folders' )->current_user_can( 'bulk-optimize' );
if ( $user_can ) {
// Submit and go to bulk page.
submit_button(
esc_html__( 'Save & Go to Bulk Optimizer', 'imagify' ),
'secondary imagify-button-secondary', // Type/classes.
'submit-goto-bulk', // Name (id).
true, // Wrap.
array() // Other attributes.
);
}
}
?>
</div>
<?php

View File

@@ -0,0 +1,41 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<h1 class="screen-reader-text"><?php esc_html_e( 'Settings', 'imagify' ); ?> — Imagify <?php echo IMAGIFY_VERSION; ?></h1>
<div class="imagify-title">
<p class="imagify-logo-block">
<span class="imagify-lb-icon">
<svg width="38px" height="39px" viewBox="0 0 38 39" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(-30.000000, -33.000000)"><g fill="#40B1D0" fill-rule="nonzero" stroke="#40B1D0"><g transform="translate(31.000000, 28.000000)"><g transform="translate(0.000000, 6.000000)"><path d="M21.54416,37.0285714 L14.458596,37.0285714 C13.6283527,37.0285714 12.9259577,36.4176 12.8258356,35.6076 L12.2158609,31.3493143 C11.382537,30.9728571 10.5753988,30.5038286 9.80830952,29.9499429 L5.79880447,31.5622286 C5.00398903,31.8507429 4.13831794,31.5298286 3.75477328,30.8262857 L0.221233299,24.7026857 C-0.180795443,23.9636571 -0.00827736236,23.0765143 0.621721701,22.5766286 L4.02279244,19.9121143 C3.97196122,19.3906286 3.94577544,18.9385714 3.94577544,18.5142857 C3.94577544,18.09 3.97196122,17.6379429 4.02587312,17.1164571 L0.627883061,14.4565714 C-0.0190597424,13.9443429 -0.190037483,13.0278857 0.227394659,12.3212571 L3.76555566,6.1884 C4.15064066,5.48177143 5.02555379,5.16394286 5.79418345,5.4648 L9.81447088,7.08171429 C10.616988,6.50777143 11.4102631,6.04645714 12.2174013,5.6808 L12.8289163,1.40554286 C12.927498,0.610971429 13.6298931,0 14.4601363,0 L21.5457004,0 C22.3759436,0 23.0783387,0.610971429 23.1784608,1.42097143 L23.7884354,5.6808 C24.6217594,6.05571429 25.4273572,6.52474286 26.1944465,7.08017143 L30.2039516,5.46788571 C30.994146,5.17628571 31.8613574,5.49874286 32.2479828,6.20382857 L35.7815227,12.3274286 C36.1850918,13.0664571 36.0110334,13.9536 35.379494,14.4534857 L31.9784233,17.1164571 C32.0215528,17.5268571 32.0585209,18.0066857 32.0585209,18.5142857 C32.0585209,19.0218857 32.0230931,19.5017143 31.9784233,19.9121143 L35.3764133,22.5735429 C36.0110334,23.0780571 36.1835515,23.9652 35.7907648,24.6872571 L32.2387407,30.8417143 C31.8536557,31.5483429 30.9756619,31.8630857 30.2101129,31.5653143 L26.1898255,29.9484 C25.3873084,30.5223429 24.5940333,30.9836571 23.7868951,31.3493143 L23.1753801,35.6230286 C23.0767984,36.4176 22.3744033,37.0285714 21.54416,37.0285714 Z M9.92383502,28.3006286 C10.0901917,28.3006286 10.2565485,28.3546286 10.3936387,28.4610857 C11.2793342,29.1430286 12.2266433,29.6938286 13.2109206,30.0980571 C13.4635364,30.2014286 13.6422158,30.4313143 13.6822646,30.7028571 L14.3553932,35.4039429 L21.54416,35.4857143 L22.3220317,30.7013143 C22.3605402,30.4297714 22.54076,30.1998857 22.7933758,30.0965143 C23.7391446,29.7092571 24.6618082,29.1708 25.616819,28.4549143 C25.8324666,28.2944571 26.1158892,28.2558857 26.3654243,28.3561714 L30.7754177,30.1304571 L34.4445076,23.9312571 C34.4691531,23.8880571 34.4614514,23.8186286 34.4214025,23.7862286 L30.6876183,20.8609714 C30.4750514,20.6943429 30.3641469,20.4258857 30.3980344,20.1574286 C30.4565673,19.6884 30.5166406,19.1268 30.5166406,18.5142857 C30.5166406,17.9033143 30.4565673,17.3401714 30.3980344,16.8711429 C30.3641469,16.6011429 30.4750514,16.3342286 30.6876183,16.1676 L34.4260235,13.2408 C34.4629917,13.2114857 34.4691531,13.1436 34.4368059,13.0834286 L30.9032659,6.95982857 L26.3669646,8.67394286 C26.1128085,8.77731429 25.8278456,8.7372 25.6106577,8.57057143 C24.7234218,7.88708571 23.7761127,7.33628571 22.7933758,6.9336 C22.54076,6.83022857 22.3620806,6.60034286 22.3220317,6.3288 L21.6504435,1.62617143 L14.4601363,1.54285714 L13.6807243,6.3288 C13.6422158,6.5988 13.4635364,6.82868571 13.2109206,6.9336 C12.2651518,7.32085714 11.3409478,7.85777143 10.3874774,8.5752 C10.1702894,8.7372 9.8884072,8.77577143 9.63733177,8.67394286 L5.22733833,6.89965714 L1.55824843,13.0988571 L5.31513771,16.1676 C5.52770463,16.3342286 5.63860911,16.6011429 5.60472163,16.8711429 C5.52462395,17.5191429 5.48611545,18.0406286 5.48611545,18.5142857 C5.48611545,18.9879429 5.52308361,19.5109714 5.60472163,20.1574286 C5.63860911,20.4258857 5.52770463,20.6943429 5.31513771,20.8609714 L1.57673251,23.7877714 C1.53976435,23.8170857 1.53360299,23.8865143 1.56595013,23.9466857 L5.09949011,30.0702857 L9.63579143,28.3561714 C9.72975217,28.3176 9.8267936,28.3006286 9.92383502,28.3006286 Z M18.001378,26.2285714 C13.7546606,26.2285714 10.299678,22.7679429 10.299678,18.5142857 C10.299678,14.2606286 13.7546606,10.8 18.001378,10.8 C22.2480954,10.8 25.7030781,14.2606286 25.7030781,18.5142857 C25.7030781,22.7679429 22.2480954,26.2285714 18.001378,26.2285714 Z M18.001378,12.3428571 C14.603388,12.3428571 11.840018,15.1107429 11.840018,18.5142857 C11.840018,21.9178286 14.603388,24.6857143 18.001378,24.6857143 C21.3993681,24.6857143 24.1627381,21.9178286 24.1627381,18.5142857 C24.1627381,15.1107429 21.3993681,12.3428571 18.001378,12.3428571 Z"></path></g></g></g></g></svg>
</span>
<span class="imagify-lb-text">
<img width="139" height="16" alt="Imagify" src="<?php echo IMAGIFY_ASSETS_IMG_URL; ?>imagify-logo.png" class="imagify-logo" />
<?php _e( 'Settings', 'imagify' ); ?>
</span>
</p>
<?php
if ( Imagify_Options::get_instance()->get( 'api_key' ) ) {
?>
<p class="imagify-rate-us">
<?php
printf(
/* translators: 1 is a "bold" tag start, 2 is the "bold" tag end + a line break tag, 3 is a link tag start, 4 is the link tag end. */
__( '%1$sDo you like this plugin?%2$s Please take a few seconds to %3$srate it on WordPress.org%4$s!', 'imagify' ),
'<strong>',
'</strong><br />',
'<a href="' . esc_url( imagify_get_external_url( 'rate' ) ) . '" target="_blank">',
'</a>'
);
?>
<br>
<a class="stars" aria-hidden="true" href="<?php echo esc_url( imagify_get_external_url( 'rate' ) ); ?>" target="_blank"><?php echo str_repeat( '<span class="dashicons dashicons-star-filled"></span>', 5 ); ?></a>
</p>
<?php
}
?>
<?php $this->print_template( 'part-documentation-link' ); ?>
</div>
<?php

View File

@@ -0,0 +1,100 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$settings = Imagify_Settings::get_instance();
$options = Imagify_Options::get_instance();
$option_name = $options->get_option_name();
?>
<div class="imagify-media-lib-section">
<div class="<?php echo imagify_can_optimize_custom_folders() ? 'imagify-col' : ''; ?>">
<h3 class="imagify-options-subtitle"><?php esc_html_e( 'Media Library', 'imagify' ); ?></h3>
<p class="imagify-setting-line">
<?php
$settings->field_checkbox(
[
'option_name' => 'resize_larger',
'label' => __( 'Resize larger images', 'imagify' ),
'attributes' => [
'aria-describedby' => 'describe-resize_larger',
],
]
);
?>
<span class="imagify-options-line">
<label for="imagify_resize_larger_w">
<?php
$max_sizes = get_imagify_max_intermediate_image_size();
$resize_larger_w = $options->get( 'resize_larger_w' );
printf(
/* translators: 1 is a text input for a number of pixels (don't use %d). */
esc_html__( 'to maximum %s pixels width', 'imagify' ),
'<input type="number" id="imagify_resize_larger_w" min="' . $max_sizes['width'] . '" name="' . $option_name . '[resize_larger_w]" value="' . ( $resize_larger_w ? $resize_larger_w : '' ) . '" size="5">'
);
?>
</label>
</span>
<span id="describe-resize_larger" class="imagify-info">
<span class="dashicons dashicons-info"></span>
<?php
printf(
/* translators: 1 is a number of pixels. */
esc_html__( 'This option is recommended to reduce larger images. You can save up to 80%% after resizing. The new width should not be less than your largest thumbnail width, which is actually %dpx.', 'imagify' ),
$max_sizes['width']
);
echo ' ';
if ( function_exists( 'wp_get_original_image_path' ) ) {
// WP 5.3+.
echo '<strong>' . esc_html__( 'Resizing is done on upload or during optimization.', 'imagify' ) . '</strong>';
} else {
esc_html_e( 'Resizing is done only during optimization.', 'imagify' );
}
?>
</span>
</p>
<?php if ( ! imagify_is_active_for_network() ) : ?>
<div class="imagify-divider"></div>
<h4 class="imagify-h4-like"><?php esc_html_e( 'Files optimization', 'imagify' ); ?></h4>
<p>
<?php esc_html_e( 'You can choose to optimize different image sizes created by WordPress here.', 'imagify' ); ?>
</p>
<p>
<?php
printf(
/* translators: 1 is a "bold" tag start, 2 is the "bold" tag end. */
esc_html__( 'The %1$soriginal size%2$s is %1$sautomatically optimized%2$s by Imagify.', 'imagify' ),
'<strong>', '</strong>'
);
?>
<br>
<span class="imagify-success">
<?php esc_html_e( 'Remember each additional image size will affect your Imagify monthly usage!', 'imagify' ); ?>
</span>
</p>
<?php
/**
* Disallowed thumbnail sizes.
*/
$settings->field_checkbox_list(
[
'option_name' => 'disallowed-sizes',
'legend' => __( 'Choose the sizes to optimize', 'imagify' ),
'values' => Imagify_Settings::get_thumbnail_sizes(),
'reverse_check' => true,
]
);
?>
<?php endif; ?>
</div>
</div>
<?php

View File

@@ -0,0 +1,8 @@
<?php
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
?>
<p class="imagify-custom-folder-line" data-path="<?php echo '{{ROOT}}/' === $data['value'] ? '/' : esc_attr( $data['label'] ); ?>">
<input type="hidden" name="imagify_settings[custom_folders][]" value="<?php echo esc_attr( $data['value'] ); ?>" />
<?php echo esc_html( $data['label'] ); ?>
<button type="button" class="imagify-custom-folders-remove"><span class="imagify-custom-folders-remove-text"><?php _ex( 'Remove', 'custom folder', 'imagify' ); ?></span><i class="dashicons dashicons-no-alt" aria-hidden="true"></i></button>
</p>

View File

@@ -0,0 +1,17 @@
<p>
<?php
echo esc_html(
sprintf(
/* translators: %s is a formatted number (dont use %d). */
_n(
'It seems that you have %s optimized image without WebP versions. You can generate it here.',
'It seems that you have %s optimized images without WebP versions. You can generate them here.',
$data['count'],
'imagify'
),
number_format_i18n( $data['count'] )
)
);
?>
</p>

View File

@@ -0,0 +1,181 @@
<?php
use Imagify\Stats\OptimizedMediaWithoutWebp;
use Imagify\Webp\Display;
use Imagify\Webp\Picture\Display as PictureDisplay;
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$settings = Imagify_Settings::get_instance();
?>
<div>
<h3 class="imagify-options-subtitle"><?php _e( 'WebP format', 'imagify' ); ?></h3>
<div class="imagify-setting-line">
<?php
$settings->field_checkbox( [
'option_name' => 'convert_to_webp',
'label' => __( 'Create WebP versions of images', 'imagify' ),
'attributes' => [
'aria-describedby' => 'describe-convert_to_webp',
],
] );
?>
<div class="imagify-options-line">
<?php
$settings->field_checkbox( [
'option_name' => 'display_webp',
'label' => __( 'Display images in WebP format on the site', 'imagify' ),
] );
?>
<div class="imagify-options-line">
<?php
$settings->field_radio_list( [
'option_name' => 'display_webp_method',
'values' => [
'rewrite' => __( 'Use rewrite rules', 'imagify' ),
/* translators: 1 and 2 are <em> tag opening and closing. */
'picture' => sprintf( __( 'Use &lt;picture&gt; tags %1$s(preferred)%2$s', 'imagify' ), '<em>', '</em>' ),
],
'attributes' => [
'aria-describedby' => 'describe-convert_to_webp',
],
] );
?>
<div class="imagify-options-line">
<?php
$cdn_source = PictureDisplay::get_instance()->get_cdn_source();
if ( 'option' !== $cdn_source['source'] ) {
if ( 'constant' === $cdn_source['source'] ) {
printf(
/* translators: 1 is an URL, 2 is a php constant name. */
esc_html__( 'Your CDN URL is set to %1$s by the constant %2$s.', 'imagify' ),
'<code>' . esc_url( $cdn_source['url'] ) . '</code>',
'<code>' . esc_html( $cdn_source['name'] ) . '</code>'
);
} elseif ( ! empty( $cdn_source['name'] ) ) {
printf(
/* translators: 1 is an URL, 2 is a plugin name. */
esc_html__( 'Your CDN URL is set to %1$s by %2$s.', 'imagify' ),
'<code>' . esc_url( $cdn_source['url'] ) . '</code>',
'<code>' . esc_html( $cdn_source['name'] ) . '</code>'
);
} else {
printf(
/* translators: %s is an URL. */
esc_html__( 'Your CDN URL is set to %1$s by filter.', 'imagify' ),
'<code>' . esc_url( $cdn_source['url'] ) . '</code>'
);
}
$settings->field_hidden( [
'option_name' => 'cdn_url',
'current_value' => $cdn_source['url'],
] );
} else {
$settings->field_text_box( [
'option_name' => 'cdn_url',
'label' => __( 'If you use a CDN, specify the URL:', 'imagify' ),
'attributes' => [
'size' => 30,
'placeholder' => __( 'https://cdn.example.com', 'imagify' ),
],
] );
}
?>
</div>
</div>
<div id="describe-display_webp_method" class="imagify-info">
<span class="dashicons dashicons-info"></span>
<?php
$conf_file_path = Display::get_instance()->get_file_path( true );
if ( $conf_file_path ) {
printf(
/* translators: 1 is a file name, 2 is a <strong> tag opening, 3 is the <strong> tag closing. */
esc_html__( 'The first option adds rewrite rules to your sites configuration file (%1$s) and does not alter your pages code. %2$sThis does not work with CDN though.%3$s', 'imagify' ),
'<code>' . esc_html( $conf_file_path ) . '</code>',
'<strong>',
'</strong>'
);
echo '<br/>';
}
printf(
/* translators: 1 and 2 are HTML tag names, 3 is a <strong> tag opening, 4 is the <strong> tag closing. */
esc_html__( 'The second option replaces the %1$s tags with %2$s tags. %3$sThis is the preferred solution but some themes may break%4$s, so make sure to verify that everything seems fine.', 'imagify' ),
'<code>&lt;img&gt;</code>',
'<code>&lt;picture&gt;</code>',
'<strong>',
'</strong>'
);
echo '<br/>';
/**
* Add more information about WebP.
*
* @since 1.9
* @author Grégory Viguier
*/
do_action( 'imagify_settings_webp_info' );
?>
</div>
</div>
<?php
$count = OptimizedMediaWithoutWebp::get_instance()->get_cached_stat();
if ( $count ) {
?>
<div class="imagify-options-line hide-if-no-js generate-missing-webp">
<?php $this->print_template( 'part-settings-webp-missing-message', [ 'count' => $count ] ); ?>
<button id="imagify-generate-webp-versions" class="button imagify-button-primary imagify-button-mini" type="button">
<span class="dashicons dashicons-admin-generic"></span>
<span class="button-text"><?php esc_html_e( 'Generate missing WebP versions', 'imagify' ); ?></span>
</button>
<?php
$remaining = OptimizedMediaWithoutWebp::get_instance()->get_stat();
$total = get_transient( 'imagify_missing_webp_total' );
$progress = 0;
$aria = ' aria-hidden="true"';
$class = 'hidden';
$style = '';
if ( false !== $total ) {
$aria = '';
$class = '';
$processed = $total - $remaining;
$progress = $processed . '/' . $total;
$percent = $processed / $total * 100;
$style = 'style="width:' . $percent . '%;"';
}
?>
<div <?php echo $aria; ?> class="imagify-progress <?php echo $class; ?>">
<div class="progress">
<div class="bar" <?php echo $style; ?>><div class="percent"><?php echo $progress; ?></div></div>
</div>
</div>
</div>
<?php
if ( Imagify_Requirements::is_api_key_valid() ) {
?>
<script type="text/html" id="tmpl-imagify-overquota-alert">
<?php $this->print_template( 'part-bulk-optimization-overquota-alert' ); ?>
</script>
<?php
}
}
?>
</div>
</div>
<?php

View File

@@ -0,0 +1,95 @@
<?php
use Imagify\User\User;
defined( 'ABSPATH' ) || die( 'Cheatin uh?' );
$imagify_user = new User();
$unconsumed_quota = $imagify_user ? $imagify_user->get_percent_unconsumed_quota() : 0;
$infinite = $imagify_user->is_infinite();
$upgrade = '';
$price = '';
$upgrade_link = '';
$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()
&&
$api_key_valid
&&
$unconsumed_quota > 20
) {
?>
<div class="imagify-col-content imagify-block-secondary imagify-mt2">
<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' ); ?>
</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
}
if (
Imagify_Requirements::is_api_key_valid()
&&
! $infinite
&&
! isset( $notices['upsell-banner'] )
&&
$unconsumed_quota <= 20
) {
?>
<div class="imagify-col-content imagify-upsell">
<div class="imagify-flex imagify-vcenter">
<span class="imagify-meteo-icon imagify-noshrink"><?php echo $this->get_quota_icon(); ?></span>
<div class="imagify-space-left imagify-full-width">
<p>
<?php
printf(
/* translators: %s is a data quota. */
__( 'You have %s space credit left', 'imagify' ),
'<span class="imagify-unconsumed-percent">' . $this->get_quota_percent() . '%</span>'
);
?>
</p>
<div class="<?php echo $this->get_quota_class(); ?>">
<div class="imagify-unconsumed-bar imagify-progress" style="width: <?php echo $this->get_quota_percent() . '%'; ?>;"></div>
</div>
</div>
</div>
<?php
if ( $imagify_user->is_free() ) {
$upgrade = esc_html__( 'Upgrade your plan now for more!', 'imagify' );
$price = esc_html__( 'From $4.99/month only, keep going with image optimization!', 'imagify' );
$upgrade_link = IMAGIFY_APP_DOMAIN . '/subscription/?utm_source=plugin&utm_medium=upsell_banner';
} elseif ( $imagify_user->is_growth() ) {
$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';
} 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';
}
}
?>
<p><?php echo $upgrade; ?></p>
<p><?php echo $price; ?></p>
<a href="<?php echo esc_url( $upgrade_link ); ?>" target="_blank" rel="noopener noreferrer" class="imagify-upsell-button"><span class="imagify-upsell-arrow"><?php esc_html_e( 'Upgrade now', 'imagify' ); ?></span></a>
<a href="<?php echo esc_url( get_imagify_admin_url( 'dismiss-notice', 'upsell-banner' ) ); ?>" class="imagify-notice-dismiss imagify-upsell-dismiss" title="<?php esc_attr_e( 'Dismiss this notice', 'imagify' ); ?>"><span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice', 'imagify' ); ?></span></a>
</div><!-- .imagify-col-content -->
<?php
}
?>