PluginProbe
QuickWebP – WebP & AVIF Image Optimizer, Compression & SEO for WordPress / 4.1.2
QuickWebP – WebP & AVIF Image Optimizer, Compression & SEO for WordPress v4.1.2
4.1.2 4.1.1 4.1.0 4.0.1 4.0.0 3.3.1 3.3.0 trunk 1.0.0 2.0.0 2.1.0 3.0.0 3.1.0 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8
← All changes | admin/templates/page-settings.php +359 -549 3.3.14.1.2 View file →
@@ -1,413 +1,17 @@
1 1 <?php
2 -if ( ! defined( 'ABSPATH' ) ) {
3 - exit;
4 -}
2 +if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3 +
5 4 /**
6 5 * The admin settings of the plugin.
7 6 * @since 1.0.0
8 7 */
9 -$wpmtk_is_active = in_array( 'wpmastertoolkit/wp-mastertoolkit.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
10 -
11 -if ( isset( $_POST['quickwebp_settings_conversion'] ) ) {
12 - update_option( 'quickwebp_settings_onboarding_completed', '1' );
13 -}
14 -
15 -$show_onboarding = '1' !== (string) get_option( 'quickwebp_settings_onboarding_completed', '0' );
16 -
17 -$conversion_enabled = '1' === (string) get_option( 'quickwebp_settings_conversion', quickwebp_settings_default( 'quickwebp_settings_conversion' ) );
18 -$save_original = get_option( 'quickwebp_settings_conversion_save_original', quickwebp_settings_default( 'quickwebp_settings_conversion_save_original' ) );
19 -$save_original = is_array( $save_original ) ? $save_original : array();
20 -$save_original_enabled = in_array( 'checked', $save_original, true );
21 -$display_mode = get_option( 'quickwebp_settings_conversion_display_webp_mode', quickwebp_settings_default( 'quickwebp_settings_conversion_display_webp_mode' ) );
22 -
23 -$profile_label = __( 'Custom profile', QUICKWEBP_TEXT_DOMAIN );
24 -if ( $conversion_enabled && ! $save_original_enabled ) {
25 - $profile_label = __( 'New site profile', QUICKWEBP_TEXT_DOMAIN );
26 -}
27 -if ( $conversion_enabled && $save_original_enabled ) {
28 - $profile_label = __( 'Existing site profile', QUICKWEBP_TEXT_DOMAIN );
29 -}
30 8 ?>
31 9 <div class="quickwebp-settings-v2" data-current-profile="<?php echo esc_attr( $profile_label ); ?>">
32 - <style>
33 - .quickwebp-settings-v2 {
34 - --quickwebp-surface: #ffffff;
35 - --quickwebp-text: #111827;
36 - --quickwebp-muted: #4b5563;
37 - --quickwebp-border: #d6deeb;
38 - --quickwebp-accent: #0f766e;
39 - --quickwebp-accent-soft: #e6f7f6;
40 - --quickwebp-info-soft: #eef4ff;
41 - --quickwebp-warning-soft: #fff8e8;
42 - max-width: 1320px;
43 - margin-top: 14px;
44 - color: var(--quickwebp-text);
45 - }
46 10
47 - .quickwebp-hero {
48 - background: linear-gradient(120deg, #e9f8f6 0%, #eef4ff 45%, #ffffff 100%);
49 - border: 1px solid var(--quickwebp-border);
50 - border-radius: 14px;
51 - padding: 20px;
52 - margin-bottom: 16px;
53 - }
54 -
55 - .quickwebp-hero h1 {
56 - margin: 0 0 8px;
57 - font-size: 28px;
58 - line-height: 1.2;
59 - }
60 -
61 - .quickwebp-hero p {
62 - margin: 0;
63 - color: var(--quickwebp-muted);
64 - font-size: 14px;
65 - }
66 -
67 - .quickwebp-layout {
68 - display: grid;
69 - grid-template-columns: minmax(0, 1fr) 320px;
70 - gap: 16px;
71 - align-items: start;
72 - }
73 -
74 - .quickwebp-main,
75 - .quickwebp-aside {
76 - min-width: 0;
77 - }
78 -
79 - .quickwebp-card {
80 - background: var(--quickwebp-surface);
81 - border: 1px solid var(--quickwebp-border);
82 - border-radius: 14px;
83 - margin-bottom: 14px;
84 - overflow: hidden;
85 - }
86 -
87 - .quickwebp-card-head {
88 - padding: 14px 16px;
89 - border-bottom: 1px solid #ebeff7;
90 - background: #fbfdff;
91 - }
92 -
93 - .quickwebp-card-head h2 {
94 - margin: 0;
95 - font-size: 16px;
96 - line-height: 1.3;
97 - }
98 -
99 - .quickwebp-card-head p {
100 - margin: 4px 0 0;
101 - color: var(--quickwebp-muted);
102 - font-size: 13px;
103 - }
104 -
105 - .quickwebp-card-body {
106 - padding: 10px 16px 4px;
107 - }
108 -
109 - .quickwebp-card-body .form-table {
110 - margin-top: 0;
111 - }
112 -
113 - .quickwebp-card-body .form-table th {
114 - width: 300px;
115 - }
116 -
117 - .quickwebp-card-body .form-table td,
118 - .quickwebp-card-body .form-table th {
119 - padding-top: 12px;
120 - padding-bottom: 12px;
121 - }
122 -
123 - .quickwebp-onboarding-grid {
124 - display: grid;
125 - grid-template-columns: repeat(2, minmax(0, 1fr));
126 - gap: 10px;
127 - margin: 10px 0 0;
128 - }
129 -
130 - .quickwebp-onboarding-option {
131 - border: 1px solid var(--quickwebp-border);
132 - border-radius: 10px;
133 - padding: 12px;
134 - background: #fff;
135 - text-align: left;
136 - cursor: pointer;
137 - }
138 -
139 - .quickwebp-onboarding-option strong {
140 - display: block;
141 - margin-bottom: 3px;
142 - }
143 -
144 - .quickwebp-onboarding-option span {
145 - color: var(--quickwebp-muted);
146 - font-size: 12px;
147 - }
148 -
149 - .quickwebp-onboarding-option:hover,
150 - .quickwebp-onboarding-option:focus {
151 - border-color: #88bbb7;
152 - background: #f8fffe;
153 - outline: none;
154 - }
155 -
156 - .quickwebp-onboarding-feedback {
157 - margin: 8px 0 0;
158 - color: #0f5b56;
159 - font-weight: 600;
160 - }
161 -
162 - .quickwebp-guidance-box {
163 - margin: 6px 0 0;
164 - padding: 10px;
165 - border-radius: 8px;
166 - background: var(--quickwebp-info-soft);
167 - border: 1px solid #cad7f7;
168 - }
169 -
170 - .quickwebp-guidance-message {
171 - margin: 0;
172 - color: #1f3a73;
173 - font-size: 12px;
174 - }
175 -
176 - .quickwebp-display-warning {
177 - margin: 8px 0 0;
178 - padding: 8px 10px;
179 - border-radius: 8px;
180 - background: var(--quickwebp-warning-soft);
181 - border: 1px solid #f6dc9e;
182 - color: #8a5a00;
183 - font-size: 12px;
184 - font-weight: 600;
185 - }
186 -
187 - .quickwebp-aside-inner {
188 - position: sticky;
189 - top: 36px;
190 - }
191 -
192 - .quickwebp-summary-list {
193 - margin: 0;
194 - padding: 0;
195 - list-style: none;
196 - }
197 -
198 - .quickwebp-summary-list li {
199 - border: 1px solid #e7edf8;
200 - border-radius: 10px;
201 - padding: 10px;
202 - margin-bottom: 8px;
203 - background: #fff;
204 - }
205 -
206 - .quickwebp-summary-label {
207 - display: block;
208 - margin-bottom: 2px;
209 - color: var(--quickwebp-muted);
210 - font-size: 12px;
211 - }
212 -
213 - .quickwebp-summary-value {
214 - display: block;
215 - font-size: 13px;
216 - font-weight: 700;
217 - }
218 -
219 - .quickwebp-quick-links {
220 - display: grid;
221 - gap: 6px;
222 - }
223 -
224 - .quickwebp-quick-links a {
225 - text-decoration: none;
226 - color: #0f5b56;
227 - font-weight: 600;
228 - font-size: 13px;
229 - }
230 -
231 - .quickwebp-migration-video {
232 - max-width: 100%;
233 - border-radius: 10px;
234 - border: 1px solid #d9e4fb;
235 - margin-top: 8px;
236 - }
237 -
238 - .quickwebp-submit-wrap {
239 - display: flex;
240 - align-items: center;
241 - gap: 10px;
242 - margin-top: 12px;
243 - padding: 14px 16px;
244 - border: 1px solid var(--quickwebp-border);
245 - border-radius: 12px;
246 - background: #fff;
247 - }
248 -
249 - .quickwebp-submit-wrap .submit {
250 - margin: 0;
251 - padding: 0;
252 - }
253 -
254 - .quickwebp-submit-note {
255 - margin: 0;
256 - color: var(--quickwebp-muted);
257 - font-size: 12px;
258 - }
259 -
260 - .quickwebp-credits {
261 - margin-top: 8px;
262 - color: var(--quickwebp-muted);
263 - font-size: 12px;
264 - }
265 -
266 - .quickwebp-seo-example {
267 - margin-top: 10px;
268 - border: 1px solid #dbe6fb;
269 - border-radius: 10px;
270 - background: #f8fbff;
271 - padding: 12px;
272 - }
273 -
274 - .quickwebp-seo-example h3 {
275 - margin: 0 0 4px;
276 - font-size: 13px;
277 - }
278 -
279 - .quickwebp-seo-example p {
280 - margin: 0 0 8px;
281 - color: var(--quickwebp-muted);
282 - font-size: 12px;
283 - }
284 -
285 - .quickwebp-seo-example-input {
286 - width: 100%;
287 - margin-bottom: 8px;
288 - }
289 -
290 - .quickwebp-seo-example-grid {
291 - display: grid;
292 - grid-template-columns: repeat(2, minmax(0, 1fr));
293 - gap: 8px;
294 - }
295 -
296 - .quickwebp-seo-example-item {
297 - background: #fff;
298 - border: 1px solid #e3ebfb;
299 - border-radius: 8px;
300 - padding: 8px;
301 - }
302 -
303 - .quickwebp-seo-example-item.is-disabled {
304 - opacity: 0.45;
305 - background: #f3f5f9;
306 - border-color: #dde3ef;
307 - }
308 -
309 - .quickwebp-seo-example-item strong {
310 - display: block;
311 - margin-bottom: 3px;
312 - font-size: 11px;
313 - color: #4f648f;
314 - text-transform: uppercase;
315 - letter-spacing: 0.02em;
316 - }
317 -
318 - .quickwebp-seo-example-item span {
319 - display: block;
320 - font-size: 12px;
321 - color: #1f2937;
322 - word-break: break-word;
323 - }
324 -
325 - .quickwebp-cleanup-example {
326 - margin-top: 10px;
327 - border: 1px solid #d9efdb;
328 - border-radius: 10px;
329 - background: #f8fff8;
330 - padding: 12px;
331 - }
332 -
333 - .quickwebp-cleanup-example h3 {
334 - margin: 0 0 4px;
335 - font-size: 13px;
336 - }
337 -
338 - .quickwebp-cleanup-example p {
339 - margin: 0 0 8px;
340 - color: var(--quickwebp-muted);
341 - font-size: 12px;
342 - }
343 -
344 - .quickwebp-cleanup-example-input {
345 - width: 100%;
346 - margin-bottom: 8px;
347 - }
348 -
349 - .quickwebp-cleanup-example-grid {
350 - display: grid;
351 - grid-template-columns: repeat(2, minmax(0, 1fr));
352 - gap: 8px;
353 - }
354 -
355 - .quickwebp-cleanup-example-item {
356 - background: #fff;
357 - border: 1px solid #dceede;
358 - border-radius: 8px;
359 - padding: 8px;
360 - }
361 -
362 - .quickwebp-cleanup-example-item strong {
363 - display: block;
364 - margin-bottom: 3px;
365 - font-size: 11px;
366 - color: #3f6f44;
367 - text-transform: uppercase;
368 - letter-spacing: 0.02em;
369 - }
370 -
371 - .quickwebp-cleanup-example-item span {
372 - display: block;
373 - font-size: 12px;
374 - color: #1f2937;
375 - word-break: break-word;
376 - }
377 -
378 - .quickwebp-cleanup-example-item.is-disabled {
379 - opacity: 0.45;
380 - background: #f3f5f9;
381 - border-color: #dde3ef;
382 - }
383 -
384 - @media (max-width: 1190px) {
385 - .quickwebp-layout {
386 - grid-template-columns: minmax(0, 1fr);
387 - }
388 -
389 - .quickwebp-aside-inner {
390 - position: static;
391 - }
392 -
393 - .quickwebp-onboarding-grid {
394 - grid-template-columns: minmax(0, 1fr);
395 - }
396 -
397 - .quickwebp-seo-example-grid {
398 - grid-template-columns: minmax(0, 1fr);
399 - }
400 -
401 - .quickwebp-cleanup-example-grid {
402 - grid-template-columns: minmax(0, 1fr);
403 - }
404 - }
405 - </style>
406 -
407 11 <header class="quickwebp-hero">
408 - <h1><?php esc_html_e( 'QuickWebP Settings', QUICKWEBP_TEXT_DOMAIN ); ?></h1>
409 - <p><?php esc_html_e( 'Configure your image workflow with coherent presets, guarded options, and an optimized media delivery strategy.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
12 + <h1><?php esc_html_e( 'QuickWebP Settings', 'quickwebp' ); ?></h1>
13 + <p><?php esc_html_e( 'Configure your image workflow with coherent presets, guarded options, and an optimized media delivery strategy.', 'quickwebp' ); ?></p>
410 14 </header>
411 15
412 16 <form action="" method="post" class="quickwebp-settings-form">
413 17 <div class="quickwebp-layout">
@@ -414,20 +18,20 @@
414 18 <main class="quickwebp-main">
415 19 <?php if ( $show_onboarding ) : ?>
416 20 <section class="quickwebp-card" id="quickwebp-onboarding">
417 21 <div class="quickwebp-card-head">
418 - <h2><?php esc_html_e( 'Quick setup assistant', QUICKWEBP_TEXT_DOMAIN ); ?></h2>
419 - <p><?php esc_html_e( 'Start from a recommended profile and refine only what you need.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
22 + <h2><?php esc_html_e( 'Quick setup assistant', 'quickwebp' ); ?></h2>
23 + <p><?php esc_html_e( 'Start from a recommended profile and refine only what you need.', 'quickwebp' ); ?></p>
420 24 </div>
421 25 <div class="quickwebp-card-body">
422 26 <div class="quickwebp-onboarding-grid">
423 27 <button type="button" class="quickwebp-onboarding-option quickwebp-onboarding-apply" data-profile="new-site">
424 - <strong><?php esc_html_e( 'New site with few media', QUICKWEBP_TEXT_DOMAIN ); ?></strong>
425 - <span><?php esc_html_e( 'Replace originals on upload for the simplest and fastest workflow.', QUICKWEBP_TEXT_DOMAIN ); ?></span>
28 + <strong><?php esc_html_e( 'New site with few media', 'quickwebp' ); ?></strong>
29 + <span><?php esc_html_e( 'Replace originals on upload for the simplest and fastest workflow.', 'quickwebp' ); ?></span>
426 30 </button>
427 31 <button type="button" class="quickwebp-onboarding-option quickwebp-onboarding-apply" data-profile="existing-site">
428 - <strong><?php esc_html_e( 'Existing site with many media', QUICKWEBP_TEXT_DOMAIN ); ?></strong>
429 - <span><?php esc_html_e( 'Keep originals, enable rewrite delivery, and run bulk optimization.', QUICKWEBP_TEXT_DOMAIN ); ?></span>
32 + <strong><?php esc_html_e( 'Existing site with many media', 'quickwebp' ); ?></strong>
33 + <span><?php esc_html_e( 'Keep originals, enable rewrite delivery, and run bulk optimization.', 'quickwebp' ); ?></span>
430 34 </button>
431 35 </div>
432 36 <p class="quickwebp-onboarding-feedback" aria-live="polite"></p>
433 37 </div>
@@ -435,50 +39,116 @@
435 39 <?php endif; ?>
436 40
437 41 <section class="quickwebp-card" id="quickwebp-conversion">
438 42 <div class="quickwebp-card-head">
439 - <h2><?php esc_html_e( 'Conversion and Delivery', QUICKWEBP_TEXT_DOMAIN ); ?></h2>
440 - <p><?php esc_html_e( 'Define how images are converted, preserved, and delivered on frontend pages.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
43 + <h2><?php esc_html_e( 'Conversion and Delivery', 'quickwebp' ); ?></h2>
44 + <p><?php esc_html_e( 'Define how images are converted, preserved, and delivered on frontend pages.', 'quickwebp' ); ?></p>
441 45 </div>
442 46 <div class="quickwebp-card-body">
443 47 <table class="form-table">
444 -
48 +
445 49 <?php $this->render_component( array(
446 - 'type' => 'toggle',
50 + 'type' => 'button-group',
447 51 'name' => 'quickwebp_settings_conversion',
448 - 'label' => __( 'Enable/disable image conversion to WEBP format', QUICKWEBP_TEXT_DOMAIN ),
52 + 'label' => __( 'Image Format Optimization', 'quickwebp' ),
449 53 'default' => quickwebp_settings_default( 'quickwebp_settings_conversion' ),
450 - 'classes' => 'toggle-with-children',
54 + 'options' => array(
55 + array(
56 + 'label' => __( 'Off', 'quickwebp' ),
57 + 'color' => '#000000',
58 + 'desc' => __( '0% saved', 'quickwebp' ),
59 + 'value' => '0',
60 + 'classes' => 'toggle-with-children',
61 + ),
62 + array(
63 + 'label' => __( 'WebP', 'quickwebp' ),
64 + 'color' => '#316BFF',
65 + 'desc' => __( '≈ −30% on average across a site', 'quickwebp' ),
66 + 'value' => '1',
67 + 'classes' => 'toggle-with-children',
68 + ),
69 + array(
70 + 'label' => __( 'AVIF', 'quickwebp' ),
71 + 'color' => '#16A34A',
72 + 'desc' => __( '≈ −50% on average across a site', 'quickwebp' ),
73 + 'value' => '2',
74 + 'classes' => 'toggle-with-children',
75 + 'parent_classes' => 'quickwebp__pro-popup-open',
76 + 'disabled' => ! $license_valid || ! $php_version_valid,
77 + 'taglines' => array(
78 + array(
79 + 'label' => 'Pro',
80 + 'value' => 'pro',
81 + 'show' => ! $license_valid,
82 + ),
83 + array(
84 + 'label' => 'Requires PHP 8.1+',
85 + 'value' => 'pro',
86 + 'show' => ! $php_version_valid,
87 + ),
88 + array(
89 + 'label' => __( 'Recommended', 'quickwebp' ),
90 + 'value' => 'recommended',
91 + 'show' => true,
92 + ),
93 + ),
94 + )
95 + )
451 96 ) ); ?>
452 97
453 98 <tbody class="form-table children">
454 99
455 - <?php $this->render_component( array(
456 - 'type' => 'range-slider',
457 - 'min' => 0,
458 - 'max' => 100,
459 - 'step' => 1,
460 - 'unit' => '%',
461 - 'name' => 'quickwebp_settings_conversion_quality',
462 - 'label' => __( 'Quality', QUICKWEBP_TEXT_DOMAIN ),
463 - 'default' => quickwebp_settings_default( 'quickwebp_settings_conversion_quality' )
464 - ) ); ?>
100 + <?php $this->render_component( array(
101 + 'type' => 'button-group',
102 + 'name' => 'quickwebp_settings_conversion_quality',
103 + 'label' => __( 'Image Quality', 'quickwebp' ),
104 + 'default' => quickwebp_settings_default( 'quickwebp_settings_conversion_quality' ),
105 + 'options' => array(
106 + array(
107 + 'label' => __( 'Low', 'quickwebp' ),
108 + 'value' => 'low',
109 + 'color' => '#E74C3C',
110 + 'desc' => __( 'Smallest size', 'quickwebp' ),
111 + ),
112 + array(
113 + 'label' => __( 'Medium', 'quickwebp' ),
114 + 'value' => 'medium',
115 + 'color' => '#E67E22',
116 + 'desc' => __( 'Good balance', 'quickwebp' ),
117 + ),
118 + array(
119 + 'label' => __( 'High', 'quickwebp' ),
120 + 'value' => 'high',
121 + 'color' => '#16A34A',
122 + 'desc' => __( 'High quality & good size', 'quickwebp' ),
123 + 'taglines' => array(
124 + array(
125 + 'label' => __( 'Recommended', 'quickwebp' ),
126 + 'value' => 'recommended',
127 + 'show' => true,
128 + ),
129 + ),
130 + ),
131 + array(
132 + 'label' => __( 'Extra High', 'quickwebp' ),
133 + 'value' => 'extra_high',
134 + 'color' => '#2563EB',
135 + 'desc' => __( 'Maximum quality', 'quickwebp' ),
136 + ),
137 + )
138 + ) ); ?>
465 139
466 - <?php $this->render_component( array(
467 - 'type' => 'range-slider',
468 - 'min' => 0,
469 - 'max' => 100,
470 - 'step' => 1,
471 - 'unit' => '%',
472 - 'name' => 'quickwebp_settings_conversion_sharpen',
473 - 'label' => __( 'Sharpen', QUICKWEBP_TEXT_DOMAIN ),
474 - 'default' => quickwebp_settings_default( 'quickwebp_settings_conversion_sharpen' )
475 - ) ); ?>
140 + <tr>
141 + <th><label><?php esc_html_e( 'Preview', 'quickwebp' ); ?></label></th>
142 + <td>
143 + <?php include QUICKWEBP_PLUGIN_PATH . 'admin/templates/popup-settings-preview.php'; ?>
144 + </td>
145 + </tr>
476 146
477 147 <?php $this->render_component( array(
478 148 'type' => 'checkbox',
479 149 'name' => 'quickwebp_settings_conversion_ignore_webp',
480 - 'label' => __( 'Do not compress images already in WebP', QUICKWEBP_TEXT_DOMAIN ),
150 + 'label' => __( 'Do not compress images already in same format', 'quickwebp' ),
481 151 'default' => quickwebp_settings_default( 'quickwebp_settings_conversion_ignore_webp' ),
482 152 'options' => array(
483 153 array(
484 154 'label' => '',
@@ -489,9 +159,9 @@
489 159
490 160 <?php $this->render_component( array(
491 161 'type' => 'checkbox',
492 162 'name' => 'quickwebp_settings_conversion_save_original',
493 - 'label' => __( 'Save original images', QUICKWEBP_TEXT_DOMAIN ),
163 + 'label' => __( 'Save original images', 'quickwebp' ),
494 164 'default' => quickwebp_settings_default( 'quickwebp_settings_conversion_save_original' ),
495 165 'options' => array(
496 166 array(
497 167 'label' => '',
@@ -501,9 +171,9 @@
501 171 ) ); ?>
502 172
503 173 <tr class="quickwebp-guidance-row">
504 174 <th>
505 - <label><?php esc_html_e( 'Consistency guidance', QUICKWEBP_TEXT_DOMAIN ); ?></label>
175 + <label><?php esc_html_e( 'Consistency guidance', 'quickwebp' ); ?></label>
506 176 </th>
507 177 <td>
508 178 <div class="quickwebp-guidance-box">
509 179 <p class="quickwebp-guidance-message" aria-live="polite"></p>
@@ -510,37 +180,36 @@
510 180 </div>
511 181 </td>
512 182 </tr>
513 183
514 - <tr>
515 - <th>
516 - <label><?php esc_html_e( 'Before saving, test your configuration with preview mode.', QUICKWEBP_TEXT_DOMAIN ); ?></label>
517 - </th>
518 - <td>
519 - <?php include QUICKWEBP_PLUGIN_PATH . 'admin/templates/popup-settings-preview.php'; ?>
520 - </td>
521 - </tr>
522 -
523 184 <?php
524 - $description_for_nginx = $is_nginx ? __( "If you choose to use rewrite rules, the file conf/quickwebp.conf will be created and must be included into the server's configuration file (then restart the server).", QUICKWEBP_TEXT_DOMAIN ) : '';
185 + $quickwebp_description_for_nginx = $is_nginx ? __( "If you choose to use rewrite rules, the file conf/quickwebp.conf will be created and must be included into the server's configuration file (then restart the server).", 'quickwebp' ) : '';
525 186
526 187 $this->render_component( array(
527 188 'type' => 'radio',
528 189 'name' => 'quickwebp_settings_conversion_display_webp_mode',
529 - 'label' => __( 'Display images in WebP format on the site', QUICKWEBP_TEXT_DOMAIN ),
530 - 'description' => sprintf( __( 'If activated, this option allows to deliver optimized images in bulk via QuickWebP in WebP format (useless for images converted to import). %s', QUICKWEBP_TEXT_DOMAIN ), $description_for_nginx ),
190 + 'label' => __( 'Display images in WebP format on the site', 'quickwebp' ),
191 + 'description' => sprintf(
192 + // translators: %s is a placeholder for the description for nginx.
193 + __( 'If activated, this option allows to deliver optimized images in bulk via QuickWebP in WebP format (useless for images converted to import). %s', 'quickwebp' ),
194 + $quickwebp_description_for_nginx
195 + ),
531 196 'default' => quickwebp_settings_default( 'quickwebp_settings_conversion_display_webp_mode' ),
532 197 'options' => array(
533 198 array(
534 - 'label' => __( 'Deactivate', QUICKWEBP_TEXT_DOMAIN ),
199 + 'label' => __( 'Deactivate', 'quickwebp' ),
535 200 'value' => 'disabled'
536 201 ),
537 202 array(
538 - 'label' => __( 'Use <picture> tags', QUICKWEBP_TEXT_DOMAIN ),
203 + 'label' => __( 'Use <picture> tags', 'quickwebp' ),
539 204 'value' => 'picture'
540 205 ),
541 206 array(
542 - 'label' => sprintf( __( 'Use rewrite rules %s', QUICKWEBP_TEXT_DOMAIN ), $is_nginx ? '(beta)' : '' ),
207 + 'label' => sprintf(
208 + // translators: %s is a placeholder for the text "(beta)" if the server is Nginx.
209 + __( 'Use rewrite rules %s', 'quickwebp' ),
210 + $is_nginx ? '(beta)' : ''
211 + ),
543 212 'value' => 'rewrite'
544 213 )
545 214 )
546 215 ) );
@@ -547,9 +216,9 @@
547 216 ?>
548 217
549 218 <tr class="quickwebp-display-warning-row" style="display:none;">
550 219 <th>
551 - <label><?php esc_html_e( 'Why this is locked', QUICKWEBP_TEXT_DOMAIN ); ?></label>
220 + <label><?php esc_html_e( 'Why this is locked', 'quickwebp' ); ?></label>
552 221 </th>
553 222 <td>
554 223 <p class="quickwebp-display-warning"></p>
555 224 </td>
@@ -556,9 +225,9 @@
556 225 </tr>
557 226
558 227 <tr class="quickwebp-row-bulk-optimization">
559 228 <th>
560 - <label><?php esc_html_e( 'Bulk optimization', QUICKWEBP_TEXT_DOMAIN ); ?></label>
229 + <label><?php esc_html_e( 'Bulk optimization', 'quickwebp' ); ?></label>
561 230 </th>
562 231 <td>
563 232 <?php include QUICKWEBP_PLUGIN_PATH . 'admin/templates/bulk-optimization.php'; ?>
564 233 </td>
@@ -571,10 +240,10 @@
571 240 </section>
572 241
573 242 <section class="quickwebp-card" id="quickwebp-resize">
574 243 <div class="quickwebp-card-head">
575 - <h2><?php esc_html_e( 'Resize', QUICKWEBP_TEXT_DOMAIN ); ?></h2>
576 - <p><?php esc_html_e( 'Keep your uploads under control to reduce bandwidth and processing costs.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
244 + <h2><?php esc_html_e( 'Resize', 'quickwebp' ); ?></h2>
245 + <p><?php esc_html_e( 'Keep your uploads under control to reduce bandwidth and processing costs.', 'quickwebp' ); ?></p>
577 246 </div>
578 247 <div class="quickwebp-card-body">
579 248 <table class="form-table">
580 249 <?php $this->render_component( array(
@@ -579,12 +248,12 @@
579 248 <table class="form-table">
580 249 <?php $this->render_component( array(
581 250 'type' => 'toggle',
582 251 'name' => 'quickwebp_settings_resize',
583 - 'label' => __( 'Enable/disable image resizing', QUICKWEBP_TEXT_DOMAIN ),
252 + 'label' => __( 'Enable/disable image resizing', 'quickwebp' ),
584 253 'default' => quickwebp_settings_default( 'quickwebp_settings_resize' ),
585 254 'classes' => 'toggle-with-children',
586 - 'description' => __( 'By default, WordPress limits the maximum width of uploaded images to 2560 pixels.', QUICKWEBP_TEXT_DOMAIN ),
255 + 'description' => __( 'By default, WordPress limits the maximum width of uploaded images to 2560 pixels.', 'quickwebp' ),
587 256 ) ); ?>
588 257
589 258 <tbody class="form-table children">
590 259 <?php $this->render_component( array(
@@ -589,9 +258,9 @@
589 258 <tbody class="form-table children">
590 259 <?php $this->render_component( array(
591 260 'type' => 'number',
592 261 'name' => 'quickwebp_settings_resize_value',
593 - 'label' => __( 'Max size', QUICKWEBP_TEXT_DOMAIN ),
262 + 'label' => __( 'Max size', 'quickwebp' ),
594 263 'default' => quickwebp_settings_default( 'quickwebp_settings_resize_value' )
595 264 ) ); ?>
596 265 </tbody>
597 266 </table>
@@ -599,10 +268,10 @@
599 268 </section>
600 269
601 270 <section class="quickwebp-card" id="quickwebp-seo">
602 271 <div class="quickwebp-card-head">
603 - <h2><?php esc_html_e( 'SEO metadata automation', QUICKWEBP_TEXT_DOMAIN ); ?></h2>
604 - <p><?php esc_html_e( 'Auto-fill media fields from image names for a faster editorial workflow.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
272 + <h2><?php esc_html_e( 'SEO metadata automation', 'quickwebp' ); ?></h2>
273 + <p><?php esc_html_e( 'Auto-fill media fields from image names for a faster editorial workflow.', 'quickwebp' ); ?></p>
605 274 </div>
606 275 <div class="quickwebp-card-body">
607 276 <table class="form-table">
608 277 <?php $this->render_component( array(
@@ -607,12 +276,12 @@
607 276 <table class="form-table">
608 277 <?php $this->render_component( array(
609 278 'type' => 'toggle',
610 279 'name' => 'quickwebp_settings_completion',
611 - 'label' => __( 'Enable/disable smart media completion for SEO', QUICKWEBP_TEXT_DOMAIN ),
280 + 'label' => __( 'Enable/disable smart media completion for SEO', 'quickwebp' ),
612 281 'default' => quickwebp_settings_default( 'quickwebp_settings_completion' ),
613 282 'classes' => 'toggle-with-children',
614 - 'description' => __( 'This feature will automatically complete the media information (title, caption, alt text, description) from the image name.', QUICKWEBP_TEXT_DOMAIN ),
283 + 'description' => __( 'This feature will automatically complete the media information (title, caption, alt text, description) from the image name.', 'quickwebp' ),
615 284 ) ); ?>
616 285
617 286 <tbody class="form-table children">
618 287 <?php $this->render_component( array(
@@ -620,21 +289,21 @@
620 289 'name' => 'quickwebp_settings_completion_options',
621 290 'default' => quickwebp_settings_default( 'quickwebp_settings_completion_options' ),
622 291 'options' => array(
623 292 array(
624 - 'label' => __( 'Title completion from image name', QUICKWEBP_TEXT_DOMAIN ),
293 + 'label' => __( 'Title completion from image name', 'quickwebp' ),
625 294 'value' => 'title',
626 295 ),
627 296 array(
628 - 'label' => __( 'Caption completion from image name.', QUICKWEBP_TEXT_DOMAIN ),
297 + 'label' => __( 'Caption completion from image name.', 'quickwebp' ),
629 298 'value' => 'caption',
630 299 ),
631 300 array(
632 - 'label' => __( 'Alt text completion from image name.', QUICKWEBP_TEXT_DOMAIN ),
301 + 'label' => __( 'Alt text completion from image name.', 'quickwebp' ),
633 302 'value' => 'alt',
634 303 ),
635 304 array(
636 - 'label' => __( 'Description completion from image name.', QUICKWEBP_TEXT_DOMAIN ),
305 + 'label' => __( 'Description completion from image name.', 'quickwebp' ),
637 306 'value' => 'description',
638 307 )
639 308 )
640 309 ) ); ?>
@@ -641,32 +310,32 @@
641 310 </tbody>
642 311 </table>
643 312
644 313 <div class="quickwebp-seo-example">
645 - <h3><?php esc_html_e( 'Live example', QUICKWEBP_TEXT_DOMAIN ); ?></h3>
646 - <p><?php esc_html_e( 'Use a descriptive filename once (including spaces or apostrophes), and metadata is auto-filled from that original filename without the extension.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
314 + <h3><?php esc_html_e( 'Live example', 'quickwebp' ); ?></h3>
315 + <p><?php esc_html_e( 'Use a descriptive filename once (including spaces or apostrophes), and metadata is auto-filled from that original filename without the extension.', 'quickwebp' ); ?></p>
647 316 <input
648 317 type="text"
649 318 class="quickwebp-seo-example-input"
650 319 value="Men's Summer Shoes - Limited Edition 2026.jpg"
651 - aria-label="<?php echo esc_attr__( 'SEO metadata example filename', QUICKWEBP_TEXT_DOMAIN ); ?>"
320 + aria-label="<?php echo esc_attr__( 'SEO metadata example filename', 'quickwebp' ); ?>"
652 321 >
653 322
654 323 <div class="quickwebp-seo-example-grid">
655 324 <div class="quickwebp-seo-example-item">
656 - <strong><?php esc_html_e( 'Title', QUICKWEBP_TEXT_DOMAIN ); ?></strong>
325 + <strong><?php esc_html_e( 'Title', 'quickwebp' ); ?></strong>
657 326 <span class="quickwebp-seo-preview-title"></span>
658 327 </div>
659 328 <div class="quickwebp-seo-example-item">
660 - <strong><?php esc_html_e( 'Caption', QUICKWEBP_TEXT_DOMAIN ); ?></strong>
329 + <strong><?php esc_html_e( 'Caption', 'quickwebp' ); ?></strong>
661 330 <span class="quickwebp-seo-preview-caption"></span>
662 331 </div>
663 332 <div class="quickwebp-seo-example-item">
664 - <strong><?php esc_html_e( 'Alt text', QUICKWEBP_TEXT_DOMAIN ); ?></strong>
333 + <strong><?php esc_html_e( 'Alt text', 'quickwebp' ); ?></strong>
665 334 <span class="quickwebp-seo-preview-alt"></span>
666 335 </div>
667 336 <div class="quickwebp-seo-example-item">
668 - <strong><?php esc_html_e( 'Description', QUICKWEBP_TEXT_DOMAIN ); ?></strong>
337 + <strong><?php esc_html_e( 'Description', 'quickwebp' ); ?></strong>
669 338 <span class="quickwebp-seo-preview-description"></span>
670 339 </div>
671 340 </div>
672 341 </div>
@@ -674,10 +343,10 @@
674 343 </section>
675 344
676 345 <section class="quickwebp-card" id="quickwebp-tools">
677 346 <div class="quickwebp-card-head">
678 - <h2><?php esc_html_e( 'Other tools', QUICKWEBP_TEXT_DOMAIN ); ?></h2>
679 - <p><?php esc_html_e( 'Fine tune file naming, paste behavior, and backend image library.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
347 + <h2><?php esc_html_e( 'Other tools', 'quickwebp' ); ?></h2>
348 + <p><?php esc_html_e( 'Fine tune file naming, paste behavior, and local image processing.', 'quickwebp' ); ?></p>
680 349 </div>
681 350 <div class="quickwebp-card-body">
682 351 <table class="form-table">
683 352 <?php $this->render_component( array(
@@ -682,11 +351,11 @@
682 351 <table class="form-table">
683 352 <?php $this->render_component( array(
684 353 'type' => 'toggle',
685 354 'name' => 'quickwebp_settings_cleanup',
686 - 'label' => __( 'Enable/disable file name cleanup', QUICKWEBP_TEXT_DOMAIN ),
355 + 'label' => __( 'Enable/disable file name cleanup', 'quickwebp' ),
687 356 'default' => quickwebp_settings_default( 'quickwebp_settings_cleanup' ),
688 - // 'description' => __( 'Remove special characters from file names.', QUICKWEBP_TEXT_DOMAIN ),
357 + // 'description' => __( 'Remove special characters from file names.', 'quickwebp' ),
689 358 ) ); ?>
690 359
691 360 <tr class="quickwebp-cleanup-example-row">
692 361 <th>
@@ -693,22 +362,22 @@
693 362
694 363 </th>
695 364 <td>
696 365 <div class="quickwebp-cleanup-example">
697 - <p><?php esc_html_e( 'Use a filename with spaces, apostrophes, or accents to preview the cleaned filename.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
366 + <p><?php esc_html_e( 'Use a filename with spaces, apostrophes, or accents to preview the cleaned filename.', 'quickwebp' ); ?></p>
698 367 <input
699 368 type="text"
700 369 class="quickwebp-cleanup-example-input"
701 370 value="Men's Summer Shoes - Limited Edition 2026.jpg"
702 - aria-label="<?php echo esc_attr__( 'Cleanup filename example input', QUICKWEBP_TEXT_DOMAIN ); ?>"
371 + aria-label="<?php echo esc_attr__( 'Cleanup filename example input', 'quickwebp' ); ?>"
703 372 >
704 373 <div class="quickwebp-cleanup-example-grid">
705 374 <div class="quickwebp-cleanup-example-item">
706 - <strong><?php esc_html_e( 'Original filename', QUICKWEBP_TEXT_DOMAIN ); ?></strong>
375 + <strong><?php esc_html_e( 'Original filename', 'quickwebp' ); ?></strong>
707 376 <span class="quickwebp-cleanup-preview-original"></span>
708 377 </div>
709 378 <div class="quickwebp-cleanup-example-item">
710 - <strong><?php esc_html_e( 'Cleaned filename', QUICKWEBP_TEXT_DOMAIN ); ?></strong>
379 + <strong><?php esc_html_e( 'Cleaned filename', 'quickwebp' ); ?></strong>
711 380 <span class="quickwebp-cleanup-preview-cleaned"></span>
712 381 </div>
713 382 </div>
714 383 </div>
@@ -717,29 +386,23 @@
717 386
718 387 <?php $this->render_component( array(
719 388 'type' => 'toggle',
720 389 'name' => 'quickwebp_settings_paste_image',
721 - 'label' => __( 'Enable/disable paste picture directly (beta)', QUICKWEBP_TEXT_DOMAIN ),
390 + 'label' => __( 'Enable/disable paste picture directly (beta)', 'quickwebp' ),
722 391 'default' => quickwebp_settings_default( 'quickwebp_settings_paste_image' ),
723 - 'description' => __( 'With this feature you can paste directly your picture in WordPress media.', QUICKWEBP_TEXT_DOMAIN ),
392 + 'description' => __( 'With this feature you can paste directly your picture in WordPress media.', 'quickwebp' ),
724 393 ) ); ?>
725 394
726 395 <?php $this->render_component( array(
727 - 'type' => 'select',
728 - 'options' => array(
729 - array(
730 - 'value' => 'gd',
731 - 'label' => 'GD'
732 - ),
733 - array(
734 - 'value' => 'imagick',
735 - 'label' => 'Imagick'
736 - )
396 + 'type' => 'toggle',
397 + 'name' => 'quickwebp_settings_debug_mode',
398 + 'label' => __( 'Enable/disable debug mode', 'quickwebp' ),
399 + 'default' => quickwebp_settings_default( 'quickwebp_settings_debug_mode' ),
400 + 'description' => sprintf(
401 + /* translators: %s: debug log path. */
402 + __( 'Write detailed optimization logs to %s.', 'quickwebp' ),
403 + quickwebp_get_debug_log_path()
737 404 ),
738 - 'name' => 'quickwebp_settings_library',
739 - 'label' => __( 'Library to use', QUICKWEBP_TEXT_DOMAIN ),
740 - 'default' => quickwebp_settings_default( 'quickwebp_settings_library' ),
741 - 'description' => __( 'We use the GD library as the default option. However, if the GD library is not available, we will use Imagick instead.', QUICKWEBP_TEXT_DOMAIN )
742 405 ) ); ?>
743 406 </table>
744 407 </div>
745 408 </section>
@@ -745,23 +408,23 @@
745 408 </section>
746 409
747 410 <section class="quickwebp-card" id="quickwebp-migration">
748 411 <div class="quickwebp-card-head">
749 - <h2><?php esc_html_e( 'Migration notice', QUICKWEBP_TEXT_DOMAIN ); ?></h2>
750 - <p><?php esc_html_e( 'QuickWebP is now available inside WPMasterToolKit.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
412 + <h2><?php esc_html_e( 'Migration notice', 'quickwebp' ); ?></h2>
413 + <p><?php esc_html_e( 'QuickWebP is now available inside WPMasterToolKit.', 'quickwebp' ); ?></p>
751 414 </div>
752 415 <div class="quickwebp-card-body">
753 - <p><?php esc_html_e( 'QuickWebP is now part of the WPMasterToolKit plugin. You can download it for free on the WordPress repository.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
416 + <p><?php esc_html_e( 'QuickWebP is now part of the WPMasterToolKit plugin. You can download it for free on the WordPress repository.', 'quickwebp' ); ?></p>
754 417 <video autoplay loop muted controls class="quickwebp-migration-video">
755 418 <source src="<?php echo esc_url( QUICKWEBP_PLUGIN_URL . 'public/assets/video/wpmastertoolkit.mp4' ); ?>" type="video/mp4">
756 - <?php esc_html_e( 'Your browser does not support the video tag.', QUICKWEBP_TEXT_DOMAIN ); ?>
419 + <?php esc_html_e( 'Your browser does not support the video tag.', 'quickwebp' ); ?>
757 420 </video>
758 421 <?php if ( $wpmtk_is_active ) : ?>
759 - <p><strong><?php esc_html_e( 'You can now deactivate QuickWebP and finish the migration.', QUICKWEBP_TEXT_DOMAIN ); ?></strong></p>
422 + <p><strong><?php esc_html_e( 'You can now deactivate QuickWebP and finish the migration.', 'quickwebp' ); ?></strong></p>
760 423 <?php else : ?>
761 424 <p>
762 - <a href="<?php echo esc_url( admin_url( 'plugin-install.php?s=wpmastertoolkit&tab=search&type=term' ) ); ?>" class="button button-primary" target="_blank"><?php esc_html_e( 'Download WPMasterToolKit', QUICKWEBP_TEXT_DOMAIN ); ?></a>
763 - <a href="https://wordpress.org/plugins/wpmastertoolkit/" class="button button-secondary" target="_blank"><?php esc_html_e( 'Download WPMasterToolKit from wordpress.org', QUICKWEBP_TEXT_DOMAIN ); ?></a>
425 + <a href="<?php echo esc_url( admin_url( 'plugin-install.php?s=wpmastertoolkit&tab=search&type=term' ) ); ?>" class="button button-primary" target="_blank"><?php esc_html_e( 'Download WPMasterToolKit', 'quickwebp' ); ?></a>
426 + <a href="https://wordpress.org/plugins/wpmastertoolkit/" class="button button-secondary" target="_blank"><?php esc_html_e( 'Download WPMasterToolKit from wordpress.org', 'quickwebp' ); ?></a>
764 427 </p>
765 428 <?php endif; ?>
766 429 </div>
767 430 </section>
@@ -766,21 +429,21 @@
766 429 </div>
767 430 </section>
768 431
769 432 <div class="quickwebp-submit-wrap">
770 - <?php submit_button( __( 'Save settings', QUICKWEBP_TEXT_DOMAIN ), 'primary', 'submit', false ); ?>
771 - <p class="quickwebp-submit-note"><?php esc_html_e( 'Your consistency rules are enforced automatically when saving.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
433 + <?php submit_button( __( 'Save settings', 'quickwebp' ), 'primary', 'submit', false ); ?>
434 + <p class="quickwebp-submit-note"><?php esc_html_e( 'Your consistency rules are enforced automatically when saving.', 'quickwebp' ); ?></p>
772 435 </div>
773 436
774 437 <div class="quickwebp-credits">
775 438 <p>
776 - <?php esc_html_e( 'This plugin is developed by', QUICKWEBP_TEXT_DOMAIN ); ?>
439 + <?php esc_html_e( 'This plugin is developed by', 'quickwebp' ); ?>
777 440 <a href="https://webdeclic.com/" target="_blank">Webdeclic</a>.
778 - <?php esc_html_e( 'You can support this project here:', QUICKWEBP_TEXT_DOMAIN ); ?>
779 - <a href="https://www.buymeacoffee.com/ludwig" target="_blank"><?php esc_html_e( 'Buy me a coffee', QUICKWEBP_TEXT_DOMAIN ); ?></a>.
441 + <?php esc_html_e( 'You can support this project here:', 'quickwebp' ); ?>
442 + <a href="https://www.buymeacoffee.com/ludwig" target="_blank"><?php esc_html_e( 'Buy me a coffee', 'quickwebp' ); ?></a>.
780 443 </p>
781 444 <p>
782 - <?php esc_html_e( 'You can show all Webdeclic plugins on', QUICKWEBP_TEXT_DOMAIN ); ?>
445 + <?php esc_html_e( 'You can show all Webdeclic plugins on', 'quickwebp' ); ?>
783 446 <a href="https://wordpress.org/plugins/search/webdeclic/" target="_blank">wordpress.org</a>.
784 447 </p>
785 448 </div>
786 449 </main>
@@ -788,28 +451,28 @@
788 451 <aside class="quickwebp-aside">
789 452 <div class="quickwebp-aside-inner">
790 453 <section class="quickwebp-card">
791 454 <div class="quickwebp-card-head">
792 - <h2><?php esc_html_e( 'Live configuration summary', QUICKWEBP_TEXT_DOMAIN ); ?></h2>
793 - <p><?php esc_html_e( 'This panel updates instantly while you edit your settings.', QUICKWEBP_TEXT_DOMAIN ); ?></p>
455 + <h2><?php esc_html_e( 'Live configuration summary', 'quickwebp' ); ?></h2>
456 + <p><?php esc_html_e( 'This panel updates instantly while you edit your settings.', 'quickwebp' ); ?></p>
794 457 </div>
795 458 <div class="quickwebp-card-body">
796 459 <ul class="quickwebp-summary-list">
797 460 <li>
798 - <span class="quickwebp-summary-label"><?php esc_html_e( 'Conversion', QUICKWEBP_TEXT_DOMAIN ); ?></span>
799 - <span class="quickwebp-summary-value quickwebp-summary-conversion-side"><?php echo esc_html( $conversion_enabled ? __( 'Enabled', QUICKWEBP_TEXT_DOMAIN ) : __( 'Disabled', QUICKWEBP_TEXT_DOMAIN ) ); ?></span>
461 + <span class="quickwebp-summary-label"><?php esc_html_e( 'Conversion', 'quickwebp' ); ?></span>
462 + <span class="quickwebp-summary-value quickwebp-summary-conversion-side"><?php echo esc_html( $conversion_enabled ? __( 'Enabled', 'quickwebp' ) : __( 'Disabled', 'quickwebp' ) ); ?></span>
800 463 </li>
801 464 <li>
802 - <span class="quickwebp-summary-label"><?php esc_html_e( 'Original images', QUICKWEBP_TEXT_DOMAIN ); ?></span>
803 - <span class="quickwebp-summary-value quickwebp-summary-originals-side"><?php echo esc_html( $save_original_enabled ? __( 'Preserved', QUICKWEBP_TEXT_DOMAIN ) : __( 'Replaced', QUICKWEBP_TEXT_DOMAIN ) ); ?></span>
465 + <span class="quickwebp-summary-label"><?php esc_html_e( 'Original images', 'quickwebp' ); ?></span>
466 + <span class="quickwebp-summary-value quickwebp-summary-originals-side"><?php echo esc_html( $save_original_enabled ? __( 'Preserved', 'quickwebp' ) : __( 'Replaced', 'quickwebp' ) ); ?></span>
804 467 </li>
805 468 <li>
806 - <span class="quickwebp-summary-label"><?php esc_html_e( 'Frontend display', QUICKWEBP_TEXT_DOMAIN ); ?></span>
469 + <span class="quickwebp-summary-label"><?php esc_html_e( 'Frontend display', 'quickwebp' ); ?></span>
807 470 <span class="quickwebp-summary-value quickwebp-summary-display-side"><?php echo esc_html( $display_mode ); ?></span>
808 471 </li>
809 472 <li>
810 - <span class="quickwebp-summary-label"><?php esc_html_e( 'Bulk optimization', QUICKWEBP_TEXT_DOMAIN ); ?></span>
811 - <span class="quickwebp-summary-value quickwebp-summary-bulk-side"><?php echo esc_html( $save_original_enabled ? __( 'Available', QUICKWEBP_TEXT_DOMAIN ) : __( 'Unavailable', QUICKWEBP_TEXT_DOMAIN ) ); ?></span>
473 + <span class="quickwebp-summary-label"><?php esc_html_e( 'Bulk optimization', 'quickwebp' ); ?></span>
474 + <span class="quickwebp-summary-value quickwebp-summary-bulk-side"><?php echo esc_html( $save_original_enabled ? __( 'Available', 'quickwebp' ) : __( 'Unavailable', 'quickwebp' ) ); ?></span>
812 475 </li>
813 476 </ul>
814 477 </div>
815 478 </section>
@@ -815,29 +478,173 @@
815 478 </section>
816 479
817 480 <section class="quickwebp-card">
818 481 <div class="quickwebp-card-head">
819 - <h2><?php esc_html_e( 'Quick navigation', QUICKWEBP_TEXT_DOMAIN ); ?></h2>
482 + <h2><?php esc_html_e( 'Quick navigation', 'quickwebp' ); ?></h2>
820 483 </div>
821 484 <div class="quickwebp-card-body quickwebp-quick-links">
822 485 <?php if ( $show_onboarding ) : ?>
823 - <a href="#quickwebp-onboarding"><?php esc_html_e( 'Quick setup assistant', QUICKWEBP_TEXT_DOMAIN ); ?></a>
486 + <a href="#quickwebp-onboarding"><?php esc_html_e( 'Quick setup assistant', 'quickwebp' ); ?></a>
824 487 <?php endif; ?>
825 - <a href="#quickwebp-conversion"><?php esc_html_e( 'Conversion and delivery', QUICKWEBP_TEXT_DOMAIN ); ?></a>
826 - <a href="#quickwebp-resize"><?php esc_html_e( 'Resize', QUICKWEBP_TEXT_DOMAIN ); ?></a>
827 - <a href="#quickwebp-seo"><?php esc_html_e( 'SEO metadata automation', QUICKWEBP_TEXT_DOMAIN ); ?></a>
828 - <a href="#quickwebp-tools"><?php esc_html_e( 'Other tools', QUICKWEBP_TEXT_DOMAIN ); ?></a>
829 - <a href="#quickwebp-migration"><?php esc_html_e( 'Migration notice', QUICKWEBP_TEXT_DOMAIN ); ?></a>
488 + <a href="#quickwebp-conversion"><?php esc_html_e( 'Conversion and delivery', 'quickwebp' ); ?></a>
489 + <a href="#quickwebp-resize"><?php esc_html_e( 'Resize', 'quickwebp' ); ?></a>
490 + <a href="#quickwebp-seo"><?php esc_html_e( 'SEO metadata automation', 'quickwebp' ); ?></a>
491 + <a href="#quickwebp-tools"><?php esc_html_e( 'Other tools', 'quickwebp' ); ?></a>
492 + <a href="#quickwebp-migration"><?php esc_html_e( 'Migration notice', 'quickwebp' ); ?></a>
830 493 </div>
831 494 </section>
495 +
496 + <section class="quickwebp-card">
497 + <div class="quickwebp-card-head">
498 + <h2><?php esc_html_e( 'License', 'quickwebp' ); ?></h2>
499 + </div>
500 + <div class="quickwebp-card-body quickwebp-license">
501 + <div class="quickwebp-license__status">
502 + <div class="quickwebp-license__status__text"><?php esc_html_e( 'State', 'quickwebp' ); ?>:</div>
503 + <div class="quickwebp-license__status__icon <?php echo $license_valid ? 'valid' : 'invalid'; ?>"></div>
504 + </div>
505 +
506 + <div class="quickwebp-license__link">
507 + <a href="<?php echo esc_url( admin_url( 'admin.php?page=quickwebp-manage-license' ) ); ?>" class="<?php echo $license_valid ? 'valid' : 'invalid'; ?>">
508 + <?php if ( $license_valid ) : ?>
509 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/key-disable.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
510 + <?php esc_html_e( 'Deactivate the license', 'quickwebp' ); ?>
511 + <?php else : ?>
512 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/key.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
513 + <?php esc_html_e( 'Activate the license', 'quickwebp' ); ?>
514 + <?php endif; ?>
515 + </a>
516 + </div>
517 + </div>
518 + </section>
832 519 </div>
833 520 </aside>
834 521 </div>
835 522 </form>
836 523
524 + <?php if ( ! $license_valid ): ?>
525 + <div class="quickwebp__pro-popup">
526 + <div class="quickwebp__pro-popup__overlay"></div>
527 + <div class="quickwebp__pro-popup__content">
528 + <div class="quickwebp__pro-popup__content__header">
529 + <div class="quickwebp__pro-popup__content__header__text">
530 + <div class="quickwebp__pro-popup__content__header__text__subtitle">
531 + <div class="quickwebp__pro-popup__content__header__text__subtitle__tag"><?php esc_html_e( 'Pro', 'quickwebp' ); ?></div>
532 + <div class="quickwebp__pro-popup__content__header__text__subtitle__text"><?php esc_html_e( 'AVIF Format', 'quickwebp' ); ?></div>
533 + </div>
534 + <div class="quickwebp__pro-popup__content__header__text__title">
535 + <?php esc_html_e( 'Go further with', 'quickwebp' ); ?>
536 + <span class="highlight"> AVIF</span>
537 + </div>
538 + <div class="quickwebp__pro-popup__content__header__text__desc">
539 + <?php esc_html_e( 'The next-generation image format, available with', 'quickwebp' ); ?>
540 + <span class="highlight">QuickWebP Pro.</span>
541 + </div>
542 + </div>
543 +
544 + <div class="quickwebp__pro-popup__content__header__close">
545 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/close.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
546 + </div>
547 + </div>
548 + <div class="quickwebp__pro-popup__content__body">
549 + <div class="quickwebp__pro-popup__content__body__top">
550 + <div class="quickwebp__pro-popup__content__body__top__item">
551 + <div class="quickwebp__pro-popup__content__body__top__item__icon">
552 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/gauge.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
553 + </div>
554 + <div class="quickwebp__pro-popup__content__body__top__item__text">
555 + <div class="quickwebp__pro-popup__content__body__top__item__text__title">-50%</div>
556 + <div class="quickwebp__pro-popup__content__body__top__item__text__desc"><?php esc_html_e( 'Vs jpeg/png on average', 'quickwebp' ); ?></div>
557 + </div>
558 + </div>
559 +
560 + <div class="quickwebp__pro-popup__content__body__top__item second">
561 + <div class="quickwebp__pro-popup__content__body__top__item__icon">
562 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/chart-line.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
563 + </div>
564 + <div class="quickwebp__pro-popup__content__body__top__item__text">
565 + <div class="quickwebp__pro-popup__content__body__top__item__text__title">-30%</div>
566 + <div class="quickwebp__pro-popup__content__body__top__item__text__desc"><?php esc_html_e( 'Vs webp on average', 'quickwebp' ); ?></div>
567 + </div>
568 + </div>
569 +
570 + <div class="quickwebp__pro-popup__content__body__top__item third">
571 + <div class="quickwebp__pro-popup__content__body__top__item__icon">
572 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/global.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
573 + </div>
574 + <div class="quickwebp__pro-popup__content__body__top__item__text">
575 + <div class="quickwebp__pro-popup__content__body__top__item__text__title">100%</div>
576 + <div class="quickwebp__pro-popup__content__body__top__item__text__desc"><?php esc_html_e( 'of modern browsers supported', 'quickwebp' ); ?></div>
577 + </div>
578 + </div>
579 + </div>
580 +
581 + <div class="quickwebp__pro-popup__content__body__middle">
582 + <div class="quickwebp__pro-popup__content__body__middle__item">
583 + <div class="quickwebp__pro-popup__content__body__middle__item__icon">
584 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/check-mark.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
585 + </div>
586 + <div class="quickwebp__pro-popup__content__body__middle__item__text">
587 + <strong><?php echo wp_kses_post(
588 + // translators: %s is a placeholder for the text "</strong>".
589 + sprintf( __( 'The best compression available %s images typically half the size of your originals.', 'quickwebp' ), '</strong>' )
590 + ); ?>
591 + </div>
592 + </div>
593 +
594 + <div class="quickwebp__pro-popup__content__body__middle__item">
595 + <div class="quickwebp__pro-popup__content__body__middle__item__icon">
596 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/check-mark.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
597 + </div>
598 + <div class="quickwebp__pro-popup__content__body__middle__item__text">
599 + <strong><?php echo wp_kses_post(
600 + // translators: %s is a placeholder for the text "</strong>".
601 + sprintf( __( 'Sharper images at lower weight %s for faster pages and better Core Web Vitals.', 'quickwebp' ), '</strong>' )
602 + ); ?>
603 + </div>
604 + </div>
605 +
606 + <div class="quickwebp__pro-popup__content__body__middle__item">
607 + <div class="quickwebp__pro-popup__content__body__middle__item__icon">
608 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/check-mark.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
609 + </div>
610 + <div class="quickwebp__pro-popup__content__body__middle__item__text">
611 + <strong><?php echo wp_kses_post(
612 + // translators: %s is a placeholder for the text "</strong>".
613 + sprintf( __( 'Automatic fallback %s so older browsers keep receiving a compatible format.', 'quickwebp' ), '</strong>' )
614 + ); ?>
615 + </div>
616 + </div>
617 +
618 + </div>
619 +
620 + <div class="quickwebp__pro-popup__content__body__bottom">
621 + <div class="quickwebp__pro-popup__content__body__bottom__upgrade">
622 + <a href="<?php echo esc_url( quickwebp_get_pro_url( 'settings-upgrade-popup' ) ); ?>" class="quickwebp__pro-popup__content__body__bottom__upgrade__link" target="_blank">
623 + <span class="quickwebp__pro-popup__content__body__bottom__upgrade__link__icon">
624 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/crown.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
625 + </span>
626 + <?php esc_html_e( 'Upgrade to QuickWebP Pro', 'quickwebp' ); ?>
627 + </a>
628 + </div>
629 +
630 + <div class="quickwebp__pro-popup__content__body__bottom__license">
631 + <a href="<?php echo esc_url( admin_url( 'admin.php?page=quickwebp-manage-license' ) ); ?>" class="quickwebp__pro-popup__content__body__bottom__license__link">
632 + <span class="quickwebp__pro-popup__content__body__bottom__license__link__icon">
633 + <?php echo wp_kses( file_get_contents( QUICKWEBP_PLUGIN_PATH . 'public/assets/svg/shield-check.svg' ), quickwebp_allowed_tags_for_svg_files() ); ?>
634 + </span>
635 + <?php esc_html_e( 'I already have a license', 'quickwebp' ); ?>
636 + </a>
637 + </div>
638 + </div>
639 + </div>
640 + </div>
641 + </div>
642 + <?php endif; ?>
643 +
837 644 <script>
838 645 document.addEventListener('DOMContentLoaded', function () {
839 - const conversionToggle = document.querySelector('input[type="checkbox"][name="quickwebp_settings_conversion"]');
646 + const conversionToggles = document.querySelectorAll('input[type="radio"][name="quickwebp_settings_conversion"]');
840 647 const saveOriginalCheckbox = document.querySelector('input[type="checkbox"][name="quickwebp_settings_conversion_save_original[]"]');
841 648 const displayModeInputs = document.querySelectorAll('input[type="radio"][name="quickwebp_settings_conversion_display_webp_mode"]');
842 649 const disabledDisplayModeInput = document.querySelector('input[type="radio"][name="quickwebp_settings_conversion_display_webp_mode"][value="disabled"]');
843 650 const pictureDisplayModeInput = document.querySelector('input[type="radio"][name="quickwebp_settings_conversion_display_webp_mode"][value="picture"]');
@@ -871,26 +678,26 @@
871 678 sideBulk: document.querySelector('.quickwebp-summary-bulk-side')
872 679 };
873 680
874 681 const strings = {
875 - noOriginals: <?php echo wp_json_encode( __( 'Current mode: originals are replaced on upload. Frontend display mode and bulk optimization are hidden because they are designed for preserved originals.', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
876 - withOriginals: <?php echo wp_json_encode( __( 'Current mode: originals are preserved. Choose a frontend display strategy and run bulk optimization for existing media.', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
877 - conversionOff: <?php echo wp_json_encode( __( 'Conversion is disabled. Frontend display mode is forced to Deactivate.', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
878 - warningNoOriginals: <?php echo wp_json_encode( __( 'Display mode is locked to Deactivate because original images are not preserved.', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
879 - warningConversionOff: <?php echo wp_json_encode( __( 'Display mode is locked to Deactivate because image conversion is disabled.', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
880 - appliedNewSite: <?php echo wp_json_encode( __( 'Preset applied: New site profile. Originals are replaced and display mode is set to Deactivate.', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
881 - appliedExistingSite: <?php echo wp_json_encode( __( 'Preset applied: Existing site profile. Originals are preserved and rewrite mode is selected.', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
882 - profileNew: <?php echo wp_json_encode( __( 'New site profile', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
883 - profileExisting: <?php echo wp_json_encode( __( 'Existing site profile', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
884 - profileCustom: <?php echo wp_json_encode( __( 'Custom profile', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
885 - enabled: <?php echo wp_json_encode( __( 'Enabled', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
886 - disabled: <?php echo wp_json_encode( __( 'Disabled', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
887 - preserved: <?php echo wp_json_encode( __( 'Preserved', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
888 - replaced: <?php echo wp_json_encode( __( 'Replaced', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
889 - available: <?php echo wp_json_encode( __( 'Available', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
890 - unavailable: <?php echo wp_json_encode( __( 'Unavailable', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
891 - disabledPreview: <?php echo wp_json_encode( __( 'Disabled in current settings', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
892 - cleanupDisabledPreview: <?php echo wp_json_encode( __( 'Cleanup disabled in current settings', QUICKWEBP_TEXT_DOMAIN ) ); ?>,
682 + noOriginals: <?php echo wp_json_encode( __( 'Current mode: originals are replaced on upload. Frontend display mode and bulk optimization are hidden because they are designed for preserved originals.', 'quickwebp' ) ); ?>,
683 + withOriginals: <?php echo wp_json_encode( __( 'Current mode: originals are preserved. Choose a frontend display strategy and run bulk optimization for existing media.', 'quickwebp' ) ); ?>,
684 + conversionOff: <?php echo wp_json_encode( __( 'Conversion is disabled. Frontend display mode is forced to Deactivate.', 'quickwebp' ) ); ?>,
685 + warningNoOriginals: <?php echo wp_json_encode( __( 'Display mode is locked to Deactivate because original images are not preserved.', 'quickwebp' ) ); ?>,
686 + warningConversionOff: <?php echo wp_json_encode( __( 'Display mode is locked to Deactivate because image conversion is disabled.', 'quickwebp' ) ); ?>,
687 + appliedNewSite: <?php echo wp_json_encode( __( 'Preset applied: New site profile. Originals are replaced and display mode is set to Deactivate.', 'quickwebp' ) ); ?>,
688 + appliedExistingSite: <?php echo wp_json_encode( __( 'Preset applied: Existing site profile. Originals are preserved and rewrite mode is selected.', 'quickwebp' ) ); ?>,
689 + profileNew: <?php echo wp_json_encode( __( 'New site profile', 'quickwebp' ) ); ?>,
690 + profileExisting: <?php echo wp_json_encode( __( 'Existing site profile', 'quickwebp' ) ); ?>,
691 + profileCustom: <?php echo wp_json_encode( __( 'Custom profile', 'quickwebp' ) ); ?>,
692 + enabled: <?php echo wp_json_encode( __( 'Enabled', 'quickwebp' ) ); ?>,
693 + disabled: <?php echo wp_json_encode( __( 'Disabled', 'quickwebp' ) ); ?>,
694 + preserved: <?php echo wp_json_encode( __( 'Preserved', 'quickwebp' ) ); ?>,
695 + replaced: <?php echo wp_json_encode( __( 'Replaced', 'quickwebp' ) ); ?>,
696 + available: <?php echo wp_json_encode( __( 'Available', 'quickwebp' ) ); ?>,
697 + unavailable: <?php echo wp_json_encode( __( 'Unavailable', 'quickwebp' ) ); ?>,
698 + disabledPreview: <?php echo wp_json_encode( __( 'Disabled in current settings', 'quickwebp' ) ); ?>,
699 + cleanupDisabledPreview: <?php echo wp_json_encode( __( 'Cleanup disabled in current settings', 'quickwebp' ) ); ?>,
893 700 };
894 701
895 702 function setDisplayMode(value) {
896 703 displayModeInputs.forEach((input) => {
@@ -907,9 +714,11 @@
907 714 return !!saveOriginalCheckbox && saveOriginalCheckbox.checked;
908 715 }
909 716
910 717 function isConversionEnabled() {
911 - return !!conversionToggle && conversionToggle.checked;
718 + let conversionToggle = document.querySelector('input[type="radio"][name="quickwebp_settings_conversion"]:checked');
719 +
720 + return !!conversionToggle && conversionToggle.value !== '0';
912 721 }
913 722
914 723 function getProfile(hasOriginals, conversionEnabled) {
915 724 if (!conversionEnabled) {
@@ -1119,8 +928,9 @@
1119 928 onboardingButtons.forEach((button) => {
1120 929 button.addEventListener('click', function () {
1121 930 const profile = this.getAttribute('data-profile');
1122 931
932 + let conversionToggle = document.querySelector('input[type="radio"][name="quickwebp_settings_conversion"][value="1"]');
1123 933 if (conversionToggle) {
1124 934 conversionToggle.checked = true;
1125 935 conversionToggle.dispatchEvent(new Event('change', { bubbles: true }));
1126 936 }
@@ -1162,11 +972,11 @@
1162 972 if (saveOriginalCheckbox) {
1163 973 saveOriginalCheckbox.addEventListener('change', updateUiConsistency);
1164 974 }
1165 975
1166 - if (conversionToggle) {
1167 - conversionToggle.addEventListener('change', updateUiConsistency);
1168 - }
976 + conversionToggles.forEach((toggle) => {
977 + toggle.addEventListener('change', updateUiConsistency);
978 + });
1169 979
1170 980 displayModeInputs.forEach((input) => {
1171 981 input.addEventListener('change', updateSummary);
1172 982 });
@@ -1207,5 +1017,5 @@
1207 1017
1208 1018 updateUiConsistency();
1209 1019 });
1210 1020 </script>
1211 -</div>
1021 +</div>