This commit is contained in:
2024-05-20 15:37:46 +03:00
commit 00b7dbd0b7
10404 changed files with 3285853 additions and 0 deletions

View File

@ -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>

View File

@ -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>

View File

@ -0,0 +1,78 @@
<?php
/**
* Links in the footer.
*
* @package WP_Smush
*/
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>'
);
if ( WP_Smush::is_pro() ) {
$hide_footer = apply_filters( 'wpmudev_branding_change_footer', $hide_footer );
$footer_text = apply_filters( 'wpmudev_branding_footer_text', $footer_text );
}
?>
<div class="sui-footer">
<?php echo wp_kses_post( $footer_text ); ?>
</div>
<ul class="sui-footer-nav">
<?php if ( ! WP_Smush::is_pro() ) : ?>
<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="https://wpmudev.com/roadmap/" 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="https://wpmudev.com/docs/" target="_blank">
<?php esc_html_e( 'Docs', 'wp-smushit' ); ?>
</a></li>
<li><a href="https://wpmudev.com/hub-welcome/" target="_blank">
<?php esc_html_e( 'The Hub', 'wp-smushit' ); ?>
</a></li>
<li><a href="https://wpmudev.com/terms-of-service/" 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>
<?php elseif ( ! $hide_footer ) : ?>
<li><a href="https://wpmudev.com/hub2/" target="_blank">
<?php esc_html_e( 'The Hub', 'wp-smushit' ); ?>
</a></li>
<li><a href="https://wpmudev.com/projects/category/plugins/" target="_blank">
<?php esc_html_e( 'Plugins', 'wp-smushit' ); ?>
</a></li>
<li><a href="https://wpmudev.com/roadmap/" target="_blank">
<?php esc_html_e( 'Roadmap', 'wp-smushit' ); ?>
</a></li>
<li><a href="https://wpmudev.com/hub2/support/" target="_blank">
<?php esc_html_e( 'Support', 'wp-smushit' ); ?>
</a></li>
<li><a href="https://wpmudev.com/docs/" target="_blank">
<?php esc_html_e( 'Docs', 'wp-smushit' ); ?>
</a></li>
<li><a href="https://wpmudev.com/hub2/community/" target="_blank">
<?php esc_html_e( 'Community', 'wp-smushit' ); ?>
</a></li>
<li><a href="https://wpmudev.com/terms-of-service/" 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>
<?php endif; ?>
</ul>

View File

@ -0,0 +1,72 @@
<?php
/**
* Plugins upsell in the footer.
*
* @package WP_Smush
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
?>
<div class="sui-row" id="sui-cross-sell-footer">
<div><span class="sui-icon-plugin-2"></span></div>
<h3><?php esc_html_e( 'Check out our other free wordpress.org plugins!', 'wp-smushit' ); ?></h3>
</div>
<div class="sui-row sui-cross-sell-modules wp-smush-sui-cross-sell-modules">
<div class="sui-col-md-4">
<div class="sui-cross-1 sui-cross-hummingbird"><span></span></div>
<div class="sui-box">
<div class="sui-box-body">
<h3><?php esc_html_e( 'Hummingbird Page Speed Optimization', 'wp-smushit' ); ?></h3>
<p><?php esc_html_e( 'Performance Tests, File Optimization & Compression, Page, Browser & Gravatar Caching, GZIP Compression, CloudFlare Integration & more.', 'wp-smushit' ); ?></p>
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/hummingbird-performance/' ); ?>" class="sui-button sui-button-ghost" target="_blank">
<?php esc_html_e( 'View features', 'wp-smushit' ); ?> <i class="sui-icon-arrow-right"></i>
</a>
</div>
</div>
</div>
<div class="sui-col-md-4">
<div class="sui-cross-2 sui-cross-defender"><span></span></div>
<div class="sui-box">
<div class="sui-box-body">
<h3><?php esc_html_e( 'Defender Security, Monitoring, and Hack Protection', 'wp-smushit' ); ?></h3>
<p><?php esc_html_e( 'Security Tweaks & Recommendations, File & Malware Scanning, Login & 404 Lockout Protection, Two-Factor Authentication & more.', 'wp-smushit' ); ?></p>
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/defender-security/' ); ?>" class="sui-button sui-button-ghost" target="_blank">
<?php esc_html_e( 'View features', 'wp-smushit' ); ?> <i class="sui-icon-arrow-right"></i>
</a>
</div>
</div>
</div>
<div class="sui-col-md-4">
<div class="sui-cross-3 sui-cross-smartcrawl"><span></span></div>
<div class="sui-box">
<div class="sui-box-body">
<h3><?php esc_html_e( 'SmartCrawl Search Engine Optimization', 'wp-smushit' ); ?></h3>
<p><?php esc_html_e( 'Customize Titles & Metadata, OpenGraph, Twitter & Pinterest Support, Auto-Keyword Linking, SEO & Readability Analysis, Sitemaps, URL Crawler & more.', 'wp-smushit' ); ?></p>
<a href="<?php echo esc_url( 'https://wordpress.org/plugins/smartcrawl-seo/' ); ?>" class="sui-button sui-button-ghost" target="_blank">
<?php esc_html_e( 'View features', 'wp-smushit' ); ?> <i class="sui-icon-arrow-right"></i>
</a>
</div>
</div>
</div>
</div>
<div class="sui-cross-sell-bottom">
<?php
$site_url = add_query_arg(
array(
'utm_source' => 'smush',
'utm_medium' => 'plugin',
'utm_campaign' => 'smush_footer_upsell_notice',
),
esc_url( 'https://wpmudev.com' )
);
?>
<h3><?php esc_html_e( 'WPMU DEV - Your WordPress Toolkit', 'wp-smushit' ); ?></h3>
<p><?php esc_html_e( 'Pretty much everything you need for developing and managing WordPress based websites, and then some more.', 'wp-smushit' ); ?></p>
<a class="sui-button sui-button-blue" href="<?php echo esc_url( $site_url ); ?>" id="dash-uptime-update-membership" target="_blank">
<?php esc_html_e( 'Learn more', 'wp-smushit' ); ?>
</a>
</div>

View File

@ -0,0 +1,53 @@
<?php
/**
* Footer meta box, common to one or more modules.
*
* @since 3.2.0
* @package WP_Smush
*
* @var \Smush\App\Abstract_Page $this
*/
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?
*/
$enabled = 'smush-integrations' === $current_tab ? apply_filters( 'wp_smush_integration_show_submit', false ) : true;
if ( 'smush-cdn' === $current_tab && ! WP_Smush::get_instance()->core()->mod->cdn->get_status() ) {
$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( $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>

View File

@ -0,0 +1,75 @@
<?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
* @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
if ( $background_processing_enabled ) {
$desc = $background_in_processing_notice;
} else {
$desc = $in_processing_notice;
}
echo wp_kses_post( $desc );
?>
</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 = $background_processing_enabled ? 'wp-smush-bo-cancel-bulk' : 'wp-smush-cancel-bulk';
$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-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 id="bulk-smush-resume-button" class="sui-hidden">
<a class="wp-smush-all 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>

View File

@ -0,0 +1,46 @@
<?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="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>
<span>
<?php esc_html_e( 'Some images might need to be rechecked to ensure statistical data is accurate.', 'wp-smushit' ); ?>
</span>
<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>

View File

@ -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 This is taking longer than expected, please hold on.', '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'
);

View File

@ -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>