PluginProbe ʕ •ᴥ•ʔ
Smush – Image Optimization, Compression, Lazy Load, WebP & CDN / 3.9.9
Smush – Image Optimization, Compression, Lazy Load, WebP & CDN v3.9.9
4.1.0 4.0.3 4.0.2 2.8.1 2.9.1 3.0.0 3.0.1 3.0.2 3.1.1 3.10.1 3.10.2 3.10.3 3.11.1 3.12.3 3.12.4 3.12.5 3.12.6 3.13.0 3.13.1 3.13.2 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.15.2 3.15.3 3.15.4 3.15.5 3.16.2 3.16.4 3.16.5 3.16.6 3.17.0 3.17.1 3.18.0 3.18.1 3.2.0.1 3.2.1 3.2.2.1 3.2.4 3.20.0 3.21.1 3.22.1 3.22.3 3.23.0 3.23.1 3.23.2 3.23.3 3.23.4 3.24.0 3.24.0-beta.2 3.3.0 3.3.1 3.3.2 3.4.1 3.4.2 3.6.1 3.6.3 3.7.0 3.7.1 3.7.2 3.7.3 3.8.2 3.8.3 3.8.4 3.8.5 3.8.7 3.8.8 3.9.0 3.9.1 3.9.11 3.9.2 3.9.4 3.9.5 3.9.8 3.9.9 trunk 1.0.0 1.0.1 1.0.2 1.1 1.1.1 1.1.2 1.1.3 1.2 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.5.1 1.6.5.2 1.6.5.3 1.6.5.4 1.7 1.7.1 1.7.1.1 2.0 2.0.1 2.0.3 2.0.4 2.0.5 2.0.6 2.0.6.2 2.0.6.3 2.0.6.5 2.0.7 2.0.7.1 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.2 2.3 2.3.1 2.4 2.4.2 2.4.3 2.4.4 2.4.5 2.5.2 2.5.3 2.6.1 2.6.2 2.6.3 2.7 2.7.1 2.7.4 2.7.4.1 2.7.5 2.7.6 2.7.8 2.7.8.1 2.7.9.1 2.8.0 2.8.0.1
wp-smushit / app / pages / class-tools.php
wp-smushit / app / pages Last commit date
class-bulk.php 4 years ago class-cdn.php 4 years ago class-dashboard.php 4 years ago class-directory.php 4 years ago class-integrations.php 4 years ago class-lazy.php 4 years ago class-nextgen.php 4 years ago class-settings.php 4 years ago class-tools.php 4 years ago class-tutorials.php 4 years ago class-upgrade.php 4 years ago class-webp.php 4 years ago
class-tools.php
143 lines
1 <?php
2 /**
3 * Tools page.
4 *
5 * @package Smush\App\Pages
6 */
7
8 namespace Smush\App\Pages;
9
10 use Smush\App\Abstract_Page;
11 use Smush\App\Interface_Page;
12 use WP_Smush;
13
14 if ( ! defined( 'WPINC' ) ) {
15 die;
16 }
17
18 /**
19 * Class Tools
20 */
21 class Tools extends Abstract_Page implements Interface_Page {
22 /**
23 * Function triggered when the page is loaded before render any content.
24 */
25 public function on_load() {
26 add_action( 'smush_setting_column_right_inside', array( $this, 'detection_settings' ), 25, 2 );
27 }
28
29 /**
30 * Register meta boxes.
31 */
32 public function register_meta_boxes() {
33 $box_body_class = WP_Smush::is_pro() ? '' : 'sui-upsell-items';
34
35 $this->add_meta_box(
36 'tools',
37 __( 'Tools', 'wp-smushit' ),
38 array( $this, 'tools_meta_box' ),
39 null,
40 array( $this, 'common_meta_box_footer' ),
41 'main',
42 array(
43 'box_content_class' => "sui-box-body {$box_body_class}",
44 )
45 );
46
47 $this->modals['restore-images'] = array();
48 }
49
50 /**
51 * Common footer meta box.
52 *
53 * @since 3.2.0
54 */
55 public function common_meta_box_footer() {
56 $this->view( 'meta-box-footer', array(), 'common' );
57 }
58
59 /**
60 * Tools meta box.
61 *
62 * @since 3.2.1
63 */
64 public function tools_meta_box() {
65 $this->view(
66 'tools/meta-box',
67 array(
68 'detection' => $this->settings->get( 'detection' ),
69 'backups_count' => count( WP_Smush::get_instance()->core()->mod->backup->get_attachments_with_backups() ),
70 )
71 );
72 }
73
74 /**
75 * Display a description in Tools - Image Resize Detection.
76 *
77 * @since 3.2.1
78 *
79 * @param string $name Setting name.
80 */
81 public function detection_settings( $name ) {
82 // Add only to full size settings.
83 if ( 'detection' !== $name ) {
84 return;
85 }
86 ?>
87
88 <span class="sui-description sui-toggle-description">
89 <?php esc_html_e( 'Note: The highlighting will only be visible to administrators – visitors won’t see the highlighting.', 'wp-smushit' ); ?>
90 <?php if ( $this->settings->get( 'detection' ) ) : ?>
91 <?php if ( $this->settings->get( 'cdn' ) && $this->settings->get( 'auto_resize' ) ) : ?>
92 <div class="sui-notice smush-highlighting-notice">
93 <div class="sui-notice-content">
94 <div class="sui-notice-message">
95 <i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
96 <p>
97 <?php
98 esc_html_e(
99 'Note: Images served via the Smush CDN are automatically resized to fit their containers, these will be skipped.',
100 'wp-smushit'
101 );
102 ?>
103 </p>
104 </div>
105 </div>
106 </div>
107 <?php else : ?>
108 <div class="sui-notice sui-notice-info smush-highlighting-notice">
109 <div class="sui-notice-content">
110 <div class="sui-notice-message">
111 <i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
112 <p>
113 <?php
114 printf(
115 /* translators: %1$s: opening a tag, %2$s: closing a tag */
116 esc_html__(
117 'Incorrect image size highlighting is active. %1$sView the frontend%2$s of your website to see if any images aren\'t the correct size for their containers.',
118 'wp-smushit'
119 ),
120 '<a href="' . esc_url( home_url() ) . '" target="_blank">',
121 '</a>'
122 );
123 ?>
124 </p>
125 </div>
126 </div>
127 </div>
128 <?php endif; ?>
129 <?php else : ?>
130 <div class="sui-notice sui-notice-warning smush-highlighting-warning sui-hidden">
131 <div class="sui-notice-content">
132 <div class="sui-notice-message">
133 <i class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></i>
134 <p><?php esc_html_e( 'Almost there! To finish activating this feature you must save your settings.', 'wp-smushit' ); ?></p>
135 </div>
136 </div>
137 </div>
138 <?php endif; ?>
139 </span>
140 <?php
141 }
142 }
143