PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 1.9.8
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v1.9.8
2.3.4 2.3.3 2.3.2 2.3.1 2.3.0 2.2.9 2.2.8 trunk 1.10 1.3.3 1.3.4 1.3.5 1.3.5.1 1.3.5.2 1.3.6 1.3.6.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 All 103 releases
imagify / classes / Bulk / Noop.php

Noop.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 1.9.8, at classes/Bulk/Noop.php

95 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Imagify\Bulk;
3
4 defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
5
6 /**
7 * Falback class for bulk.
8 *
9 * @since 1.9
10 * @author Grégory Viguier
11 */
12 class Noop implements BulkInterface {
13
14 /**
15 * Get all unoptimized media ids.
16 *
17 * @since 1.9
18 * @access public
19 * @author Grégory Viguier
20 *
21 * @param int $optimization_level The optimization level.
22 * @return array A list of unoptimized media. Array keys are media IDs prefixed with an underscore character, array values are the main file’s URL.
23 */
24 public function get_unoptimized_media_ids( $optimization_level ) {
25 return [];
26 }
27
28 /**
29 * Get ids of all optimized media without webp versions.
30 *
31 * @since 1.9
32 * @since 1.9.5 The method doesn't return the IDs directly anymore.
33 * @access public
34 * @author Grégory Viguier
35 *
36 * @return array {
37 * @type array $ids A list of media IDs.
38 * @type array $errors {
39 * @type array $no_file_path A list of media IDs.
40 * @type array $no_backup A list of media IDs.
41 * }
42 * }
43 */
44 public function get_optimized_media_ids_without_webp() {
45 return [
46 'ids' => [],
47 'errors' => [
48 'no_file_path' => [],
49 'no_backup' => [],
50 ],
51 ];
52 }
53
54 /**
55 * Tell if there are optimized media without webp versions.
56 *
57 * @since 1.9
58 * @access public
59 * @author Grégory Viguier
60 *
61 * @return int The number of media.
62 */
63 public function has_optimized_media_without_webp() {
64 return 0;
65 }
66
67 /**
68 * Get the context data.
69 *
70 * @since 1.9
71 * @access public
72 * @author Grégory Viguier
73 *
74 * @return array {
75 * The formated data.
76 *
77 * @type string $count-optimized Number of media optimized.
78 * @type string $count-errors Number of media having an optimization error, with a link to the page listing the optimization errors.
79 * @type string $optimized-size Optimized filesize.
80 * @type string $original-size Original filesize.
81 * }
82 */
83 public function get_context_data() {
84 $data = [
85 'count-optimized' => 0,
86 'count-errors' => 0,
87 'optimized-size' => 0,
88 'original-size' => 0,
89 'errors_url' => get_imagify_admin_url( 'folder-errors', 'noop' ),
90 ];
91
92 return $this->format_context_data( $data );
93 }
94 }
95