| 1 |
<?php |
| 2 |
namespace Imagify\Bulk; |
| 3 |
|
| 4 |
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); |
| 5 |
|
| 6 |
/** |
| 7 |
* Interface to use for bulk. |
| 8 |
* |
| 9 |
* @since 1.9 |
| 10 |
* @author Grégory Viguier |
| 11 |
*/ |
| 12 |
interface 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 |
|
| 26 |
/** |
| 27 |
* Get ids of all optimized media without WebP versions. |
| 28 |
* |
| 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 |
| 33 |
* |
| 34 |
* @return array { |
| 35 |
* @type array $ids A list of media IDs. |
| 36 |
* @type array $errors { |
| 37 |
* @type array $no_file_path A list of media IDs. |
| 38 |
* @type array $no_backup A list of media IDs. |
| 39 |
* } |
| 40 |
* } |
| 41 |
*/ |
| 42 |
public function get_optimized_media_ids_without_webp(); |
| 43 |
|
| 44 |
/** |
| 45 |
* Tell if there are optimized media without WebP versions. |
| 46 |
* |
| 47 |
* @since 1.9 |
| 48 |
* @access public |
| 49 |
* @author Grégory Viguier |
| 50 |
* |
| 51 |
* @return int The number of media. |
| 52 |
*/ |
| 53 |
public function has_optimized_media_without_webp(); |
| 54 |
|
| 55 |
/** |
| 56 |
* Get the context data. |
| 57 |
* |
| 58 |
* @since 1.9 |
| 59 |
* @access public |
| 60 |
* @author Grégory Viguier |
| 61 |
* |
| 62 |
* @return array { |
| 63 |
* The formated data. |
| 64 |
* The array keys corresponds to the table cell classes: "imagify-cell-{key}". |
| 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 |
} |
| 74 |
|