CMS Project Sync
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Meta box layout.
|
||||
*
|
||||
* @package WP_Smush
|
||||
* @since 3.7.2
|
||||
*
|
||||
* @var boolean $all_done Whether all images were already smushed.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="sui-notice sui-notice-success wp-smush-all-done<?php echo $all_done ? '' : ' sui-hidden'; ?>">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-check-tick sui-md" aria-hidden="true"></i>
|
||||
<p><?php esc_html_e( 'All attachments have been smushed. Awesome!', 'wp-smushit' ); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* @var string $percent_grade Circle grade class.
|
||||
* @var int|float $percent_metric Metric to calculate circle score.
|
||||
* @var int $percent_optimized Percent optimized.
|
||||
* @var string $progressbar_description Progressbar description.
|
||||
*/
|
||||
if ( ! isset( $progressbar_description ) ) {
|
||||
$progressbar_description = __( 'Images optimized in the media library', 'wp-smushit' );
|
||||
}
|
||||
?>
|
||||
<div class="sui-summary-image-space" aria-hidden="true">
|
||||
<div class="sui-circle-score <?php echo esc_attr( $percent_grade ); ?> loaded" data-score="<?php echo absint( $percent_optimized ); ?>" id="smush-image-score">
|
||||
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle stroke-width="16" cx="50" cy="50" r="42"></circle>
|
||||
<circle stroke-width="16" cx="50" cy="50" r="42" style="--metric-array: <?php echo 2.63893782902 * absint( $percent_metric ); ?> <?php echo 263.893782902 - absint( $percent_metric ); ?>"></circle>
|
||||
</svg>
|
||||
<span class="sui-circle-score-label"><?php echo absint( $percent_optimized ); ?></span>
|
||||
</div>
|
||||
<small><?php echo esc_html( $progressbar_description ); ?></small>
|
||||
</div>
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* Links in the footer.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*/
|
||||
use Smush\Core\Helper;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
$hide_footer = false;
|
||||
$footer_text = sprintf( /* translators: %s - icon */
|
||||
esc_html__( 'Made with %s by WPMU DEV', 'wp-smushit' ),
|
||||
'<span aria-hidden="true" class="sui-icon-heart"></span>'
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<div class="sui-footer">
|
||||
<?php echo wp_kses_post( $footer_text ); ?>
|
||||
</div>
|
||||
|
||||
<ul class="sui-footer-nav">
|
||||
<?php
|
||||
$roadmap_link = Helper::get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => 'smush_footer_roadmap',
|
||||
),
|
||||
'https://wpmudev.com/roadmap/'
|
||||
);
|
||||
|
||||
$docs_link = Helper::get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => 'smush_footer_docs',
|
||||
),
|
||||
'https://wpmudev.com/docs/'
|
||||
);
|
||||
|
||||
$terms_link = Helper::get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => 'smush_footer_tos',
|
||||
),
|
||||
'https://wpmudev.com/terms-of-service/'
|
||||
);
|
||||
|
||||
?>
|
||||
<?php
|
||||
$hub_link = Helper::get_utm_link(
|
||||
array( 'utm_campaign' => 'smush_footer_hub' ),
|
||||
'https://wpmudev.com/hub-welcome/'
|
||||
);
|
||||
?>
|
||||
<li><a href="https://profiles.wordpress.org/wpmudev#content-plugins" target="_blank">
|
||||
<?php esc_html_e( 'Free Plugins', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="<?php echo esc_url( $roadmap_link ); ?>" target="_blank">
|
||||
<?php esc_html_e( 'Roadmap', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="https://wordpress.org/support/plugin/wp-smushit" target="_blank">
|
||||
<?php esc_html_e( 'Support', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="<?php echo esc_url( $docs_link ); ?>" target="_blank">
|
||||
<?php esc_html_e( 'Docs', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="<?php echo esc_url( $hub_link ); ?>" target="_blank">
|
||||
<?php esc_html_e( 'The Hub', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="<?php echo esc_url( $terms_link ); ?>" target="_blank">
|
||||
<?php esc_html_e( 'Terms of Service', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
<li><a href="https://incsub.com/privacy-policy/" target="_blank">
|
||||
<?php esc_html_e( 'Privacy Policy', 'wp-smushit' ); ?>
|
||||
</a></li>
|
||||
</ul>
|
||||
<?php if ( ! $hide_footer ) : ?>
|
||||
<ul class="sui-footer-social">
|
||||
<li>
|
||||
<a href="https://www.facebook.com/wpmudev" target="_blank">
|
||||
<i class="sui-icon-social-facebook" aria-hidden="true"></i>
|
||||
<span class="sui-screen-reader-text">Facebook</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://twitter.com/wpmudev" target="_blank">
|
||||
<i class="sui-icon-social-twitter" aria-hidden="true"></i>
|
||||
</a>
|
||||
<span class="sui-screen-reader-text">Twitter</span>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://www.instagram.com/wpmu_dev/" target="_blank">
|
||||
<i class="sui-icon-instagram" aria-hidden="true"></i>
|
||||
<span class="sui-screen-reader-text">Instagram</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Footer meta box, common to one or more modules.
|
||||
*
|
||||
* @since 3.2.0
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var \Smush\App\Abstract_Page $this
|
||||
*/
|
||||
|
||||
use Smush\Core\CDN\CDN_Helper;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
$current_tab = $this->get_slug();
|
||||
$button_msg = 'smush-bulk' === $current_tab ? '' : __( 'Saving changes...', 'wp-smushit' );
|
||||
$button_text = __( 'Save changes', 'wp-smushit' );
|
||||
|
||||
/**
|
||||
* Filter to enable/disable submit button in integration settings.
|
||||
*
|
||||
* @param bool $show_submit Should show submit?
|
||||
*/
|
||||
if ( ! isset( $is_submit_enabled ) ) {
|
||||
$is_submit_enabled = 'smush-integrations' === $current_tab ? apply_filters( 'wp_smush_integration_show_submit', false ) : true;
|
||||
}
|
||||
|
||||
if ( 'smush-cdn' === $current_tab && ! CDN_Helper::get_instance()->is_cdn_active() ) {
|
||||
$button_text = __( 'Save & Activate', 'wp-smushit' );
|
||||
$button_msg = __( 'Activating CDN...', 'wp-smushit' );
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="sui-actions-right">
|
||||
<?php if ( 'smush-integrations' === $current_tab || 'smush-bulk' === $current_tab ) : ?>
|
||||
<span class="sui-field-prefix">
|
||||
<?php esc_html_e( 'Smush will automatically check for any images that need re-smushing.', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<button type="submit" class="sui-button sui-button-blue" id="save-settings-button" aria-live="polite" <?php disabled( $is_submit_enabled, false ); ?>>
|
||||
<span class="sui-button-text-default sui-loading-text">
|
||||
<span class="sui-icon-save" aria-hidden="true"></span> <?php echo esc_html( $button_text ); ?>
|
||||
</span>
|
||||
|
||||
<?php if ( ! empty( $button_msg ) ) : ?>
|
||||
<span class="sui-button-text-onload">
|
||||
<span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
|
||||
<?php echo esc_html( $button_msg ); ?>
|
||||
</span>
|
||||
<?php else : ?>
|
||||
<span class="sui-icon-loader sui-loading" aria-hidden="true"></span>
|
||||
<?php endif; ?>
|
||||
</button>
|
||||
</div>
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/**
|
||||
* Progress bar block.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var integer $count Total number of images to smush.
|
||||
* @var string $in_processing_notice
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="wp-smush-bulk-progress-bar-wrapper sui-hidden">
|
||||
<div class="sui-notice sui-notice-warning sui-hidden"></div>
|
||||
|
||||
<div id="wp-smush-running-notice" class="sui-notice">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php
|
||||
echo wp_kses_post( $in_processing_notice );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-progress-block sui-progress-can-close">
|
||||
<div class="sui-progress">
|
||||
<span class="sui-progress-icon" aria-hidden="true">
|
||||
<i class="sui-icon-loader sui-loading"></i>
|
||||
</span>
|
||||
<div class="sui-progress-text">
|
||||
<span class="wp-smush-images-percent">0%</span>
|
||||
</div>
|
||||
<div class="sui-progress-bar">
|
||||
<span class="wp-smush-progress-inner" style="width: 0%"></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$cancel_btn_class = 'wp-smush-cancel-btn';
|
||||
?>
|
||||
<button class="sui-progress-close <?php echo esc_attr( $cancel_btn_class ); ?>" type="button">
|
||||
<?php esc_html_e( 'Cancel', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
<button class="sui-progress-close sui-button-icon sui-tooltip wp-smush-all sui-hidden" type="button" data-tooltip="<?php esc_html_e( 'Resume scan.', 'wp-smushit' ); ?>">
|
||||
<i class="sui-icon-play"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="sui-box-footer" style="border-top:none;margin:10px 0 0;padding:0;">
|
||||
<div class="sui-actions-left" style="margin:0">
|
||||
<div class="wp-smush-bulk-hold-on-notice sui-hidden">
|
||||
<p class="sui-p-small" style="color:#333">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: Open <strong> tag, 2: Close </strong> tag */
|
||||
esc_html__( '%1$sNote:%2$s The process is taking longer than expected, please hold on while we try to resolve this for you.', 'wp-smushit' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Elements aligned to right -->
|
||||
<div class="sui-actions-right">
|
||||
<div class="sui-progress-state">
|
||||
<span class="sui-progress-state-text"><span>0</span>/<span class="wp-smush-total-count"><?php echo absint( $count ); ?></span> </span>
|
||||
<span class="sui-progress-state-unit"><?php esc_html_e( 'images optimized', 'wp-smushit' ); ?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="bulk-smush-resume-button" class="sui-hidden">
|
||||
<a class="sui-button wp-smush-started wp-smush-resume-bulk-smush">
|
||||
<i class="sui-icon-play" aria-hidden="true"></i>
|
||||
<?php esc_html_e( 'Resume', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$this->view(
|
||||
'stop-bulk-smush',
|
||||
array(),
|
||||
'modals'
|
||||
);
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* Progress bar block.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var integer $count Total number of images to smush.
|
||||
* @var string $background_in_processing_notice
|
||||
* @var bool $background_processing_enabled
|
||||
*/
|
||||
use Smush\Core\Media_Library\Background_Media_Library_Scanner;
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
$background_scan_status = Background_Media_Library_Scanner::get_instance()->get_background_process()->get_status();
|
||||
$recheck_images_notice = __( 'Some images might need to be rechecked to ensure statistical data is accurate.', 'wp-smushit' );
|
||||
$docs_link = $this->get_utm_link(
|
||||
array(
|
||||
'utm_campaign' => 'smush_troubleshooting_docs',
|
||||
'utm_content' => 'scan_failed_notice',
|
||||
),
|
||||
'https://wpmudev.com/docs/wpmu-dev-plugins/smush/#troubleshooting-guide'
|
||||
);
|
||||
?>
|
||||
<div class="sui-notice sui-notice-warning wp-smush-recheck-images-notice-warning">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php if ( $background_scan_status->is_dead() ) : ?>
|
||||
<span data-original-text="<?php echo esc_attr( $recheck_images_notice ); ?>">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: Open span tag <span>, 2: Open a link, 3: Close the link, 4: Close span tag </span>*/
|
||||
esc_html__( 'Scan failed due to limited resources on your site. We have adjusted the scan to use fewer resources the next time. %1$sPlease retry or refer to our %2$stroubleshooting guide%3$s to help resolve this.%4$s', 'wp-smushit' ),
|
||||
'<span style="display:block;margin-top:10px;margin-bottom:5px">',
|
||||
'<a style="text-decoration:underline" target="_blank" href="' . esc_url( $docs_link ) . '">',
|
||||
'</a>',
|
||||
'</span>'
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
<?php else : ?>
|
||||
<span>
|
||||
<?php echo esc_html( $recheck_images_notice ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<a href="#" class="wp-smush-trigger-background-scan">
|
||||
<?php esc_html_e( 'Re-check Now', 'wp-smushit' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="sui-notice-actions"><button class="sui-button-icon" type="button"><span class="sui-icon-check" aria-hidden="true"></span><span class="sui-screen-reader-text"><?php esc_html_e( 'Close this notice', 'wp-smushit' ); ?></span></button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sui-notice sui-notice-success wp-smush-recheck-images-notice-success sui-hidden">
|
||||
<div class="sui-notice-content">
|
||||
<div class="sui-notice-message">
|
||||
<i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: %s: Resume Bulk Smush link */
|
||||
printf( esc_html__( 'Image re-check complete. %s', 'wp-smushit' ), '<a href="#" class="wp-smush-trigger-bulk-smush">' . esc_html__( 'Resume Bulk Smush', 'wp-smushit' ) . '</a>' );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="sui-notice-actions"><button class="sui-button-icon" type="button"><span class="sui-icon-check" aria-hidden="true"></span><span class="sui-screen-reader-text"><?php esc_html_e( 'Close this notice', 'wp-smushit' ); ?></span></button></div>
|
||||
</div>
|
||||
</div>
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* Progress bar block.
|
||||
*
|
||||
* @package WP_Smush
|
||||
*
|
||||
* @var integer $count Total number of images to smush.
|
||||
* @var string $background_in_processing_notice
|
||||
* @var bool $background_processing_enabled
|
||||
*/
|
||||
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="wp-smush-scan-progress-bar-wrapper sui-hidden">
|
||||
<div class="wp-smush-scan-progress-bar-inner">
|
||||
<div class="wp-smush-progress-status">
|
||||
<div class="wp-smush-scan-description">
|
||||
<h4><?php esc_html_e( 'Scanning Media Library', 'wp-smushit' ); ?></h4>
|
||||
<span class="wp-smush-progress-percent">0%</span>
|
||||
<p>
|
||||
<?php
|
||||
/* translators: 1: Open span tag <span> 2: Close span tag </span> */
|
||||
printf( esc_html__( 'Image re-check in progress - %1$s0 seconds%2$s remaining', 'wp-smushit' ), '<span class="wp-smush-remaining-time">', '</span>' );
|
||||
?>
|
||||
</p>
|
||||
<p class="wp-smush-scan-hold-on-notice sui-hidden">
|
||||
<?php
|
||||
/* translators: 1: <strong> 2: </strong> */
|
||||
printf( esc_html__( '%1$sNote:%2$s The process is taking longer than expected, please hold on while we try to resolve this for you.', 'wp-smushit' ), '<strong>', '</strong>' );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="sui-button wp-smush-cancel-scan-progress-btn">
|
||||
<?php esc_html_e( 'Cancel Scan', 'wp-smushit' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
<div class="sui-progress">
|
||||
<div class="sui-progress-bar">
|
||||
<span class="wp-smush-progress-inner" style="width: 0.1%"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$this->view(
|
||||
'stop-scanning',
|
||||
array(),
|
||||
'modals'
|
||||
);
|
||||
|
||||
$this->view(
|
||||
'retry-scan-notice',
|
||||
array(),
|
||||
'modals'
|
||||
);
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @var string $human_bytes
|
||||
* @var int $resize_count Number of resizes images.
|
||||
* @var int $total_optimized Total nubmer of images optimized.
|
||||
* @var string|int $stats_percent
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="sui-summary-segment">
|
||||
<div class="sui-summary-details">
|
||||
<span class="sui-summary-large wp-smush-stats-human">
|
||||
<?php echo esc_html( $human_bytes ); ?>
|
||||
</span>
|
||||
<span class="sui-summary-detail wp-smush-savings">
|
||||
/<span class="wp-smush-stats-percent"><?php echo esc_html( $stats_percent ); ?></span>% </span>
|
||||
<span class="sui-summary-sub">
|
||||
<?php esc_html_e( 'Total Savings', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
<span class="smushed-items-count">
|
||||
<span class="wp-smush-count-total">
|
||||
<span class="sui-summary-detail wp-smush-total-optimised">
|
||||
<?php echo esc_html( $total_optimized ); ?>
|
||||
</span>
|
||||
<span class="sui-summary-sub">
|
||||
<?php esc_html_e( 'Images Smushed', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</span>
|
||||
<span class="wp-smush-count-resize-total <?php echo $resize_count > 0 ? '' : 'sui-hidden'; ?>">
|
||||
<span class="sui-summary-detail wp-smush-total-optimised">
|
||||
<?php echo esc_html( $resize_count ); ?>
|
||||
</span>
|
||||
<span class="sui-summary-sub">
|
||||
<?php esc_html_e( 'Images Resized', 'wp-smushit' ); ?>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user