PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.3.0
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.3.0
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 2.3.0, at classes/Bulk/Noop.php

84 lines 2.0 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 /**
5 * Falback class for bulk.
6 *
7 * @since 1.9
8 */
9 class Noop extends AbstractBulk {
10 /**
11 * Get all unoptimized media ids.
12 *
13 * @since 1.9
14 *
15 * @param int $optimization_level The optimization level.
16 * @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.
17 */
18 public function get_unoptimized_media_ids( $optimization_level ) {
19 return [];
20 }
21
22 /**
23 * Get all optimized media ids that can be restored.
24 *
25 * @since 2.3
26 *
27 * @return array A list of optimized media IDs with backup files available.
28 */
29 public function get_optimized_media_ids(): array {
30 return [];
31 }
32
33 /**
34 * * Get ids of all optimized media without Next gen versions.
35 *
36 * @since 2.2
37 *
38 * @param string $format Format we are looking for. (webp|avif).
39 *
40 * @return array {
41 * @type array $ids A list of media IDs.
42 * @type array $errors {
43 * @type array $no_file_path A list of media IDs.
44 * @type array $no_backup A list of media IDs.
45 * }
46 * }
47 */
48 public function get_optimized_media_ids_without_format( $format ) {
49 return [
50 'ids' => [],
51 'errors' => [
52 'no_file_path' => [],
53 'no_backup' => [],
54 ],
55 ];
56 }
57
58 /**
59 * Get the context data.
60 *
61 * @since 1.9
62 *
63 * @return array {
64 * The formated data.
65 *
66 * @type string $count-optimized Number of media optimized.
67 * @type string $count-errors Number of media having an optimization error, with a link to the page listing the optimization errors.
68 * @type string $optimized-size Optimized filesize.
69 * @type string $original-size Original filesize.
70 * }
71 */
72 public function get_context_data() {
73 $data = [
74 'count-optimized' => 0,
75 'count-errors' => 0,
76 'optimized-size' => 0,
77 'original-size' => 0,
78 'errors_url' => get_imagify_admin_url( 'folder-errors', 'noop' ),
79 ];
80
81 return $this->format_context_data( $data );
82 }
83 }
84