| @@ -1,23 +1,17 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Imagify\Bulk; |
| 3 | 3 | |
| 4 | -defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); | |
| 5 | - | |
| 6 | 4 | /** |
| 7 | 5 | * Interface to use for bulk. |
| 8 | 6 | * |
| 9 | - * @since 1.9 | |
| 10 | - * @author Grégory Viguier | |
| 7 | + * @since 1.9 | |
| 11 | 8 | */ |
| 12 | 9 | interface BulkInterface { |
| 13 | - | |
| 14 | 10 | /** |
| 15 | 11 | * Get all unoptimized media ids. |
| 16 | 12 | * |
| 17 | - * @since 1.9 | |
| 18 | - * @access public | |
| 19 | - * @author Grégory Viguier | |
| 13 | + * @since 1.9 | |
| 20 | 14 | * |
| 21 | 15 | * @param int $optimization_level The optimization level. |
| 22 | 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. |
| 23 | 17 | */ |
| @@ -23,15 +17,23 @@ | ||
| 23 | 17 | */ |
| 24 | 18 | public function get_unoptimized_media_ids( $optimization_level ); |
| 25 | 19 | |
| 26 | 20 | /** |
| 27 | - * Get ids of all optimized media without WebP versions. | |
| 21 | + * Get ids of all optimized media that have a backup file available for restore. | |
| 28 | 22 | * |
| 29 | - * @since 1.9 | |
| 30 | - * @since 1.9.5 The method doesn't return the IDs directly anymore. | |
| 31 | - * @access public | |
| 32 | - * @author Grégory Viguier | |
| 23 | + * @since 2.3 | |
| 33 | 24 | * |
| 25 | + * @return int[] A flat list of media IDs. | |
| 26 | + */ | |
| 27 | + public function get_optimized_media_ids(): array; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * Get ids of all optimized media without Next gen versions. | |
| 31 | + * | |
| 32 | + * @since 2.2 | |
| 33 | + * | |
| 34 | + * @param string $format Format we are looking for. (webp|avif). | |
| 35 | + * | |
| 34 | 36 | * @return array { |
| 35 | 37 | * @type array $ids A list of media IDs. |
| 36 | 38 | * @type array $errors { |
| 37 | 39 | * @type array $no_file_path A list of media IDs. |
| @@ -38,27 +40,24 @@ | ||
| 38 | 40 | * @type array $no_backup A list of media IDs. |
| 39 | 41 | * } |
| 40 | 42 | * } |
| 41 | 43 | */ |
| 42 | - public function get_optimized_media_ids_without_webp(); | |
| 44 | + public function get_optimized_media_ids_without_format( $format ); | |
| 43 | 45 | |
| 46 | + | |
| 44 | 47 | /** |
| 45 | - * Tell if there are optimized media without WebP versions. | |
| 48 | + * Tell if there are optimized media without next-gen versions. | |
| 46 | 49 | * |
| 47 | - * @since 1.9 | |
| 48 | - * @access public | |
| 49 | - * @author Grégory Viguier | |
| 50 | + * @since 2.2 | |
| 50 | 51 | * |
| 51 | 52 | * @return int The number of media. |
| 52 | 53 | */ |
| 53 | - public function has_optimized_media_without_webp(); | |
| 54 | + public function has_optimized_media_without_nextgen(); | |
| 54 | 55 | |
| 55 | 56 | /** |
| 56 | 57 | * Get the context data. |
| 57 | 58 | * |
| 58 | - * @since 1.9 | |
| 59 | - * @access public | |
| 60 | - * @author Grégory Viguier | |
| 59 | + * @since 1.9 | |
| 61 | 60 | * |
| 62 | 61 | * @return array { |
| 63 | 62 | * The formated data. |
| 64 | 63 | * The array keys corresponds to the table cell classes: "imagify-cell-{key}". |