| @@ -3,13 +3,16 @@ | ||
| 3 | 3 | |
| 4 | 4 | use ImageOptimization\Classes\Module_Base; |
| 5 | 5 | use ImageOptimization\Modules\Backups\Rest\Restore_Single; |
| 6 | 6 | use ImageOptimization\Modules\Optimization\Rest\Optimize_Single_Image; |
| 7 | +use ImageOptimization\Modules\Settings\Module as Settings_Module; | |
| 7 | 8 | use Throwable; |
| 8 | 9 | |
| 10 | +// @codeCoverageIgnoreStart | |
| 9 | 11 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | 12 | exit; // Exit if accessed directly. |
| 11 | 13 | } |
| 14 | +// @codeCoverageIgnoreEnd | |
| 12 | 15 | |
| 13 | 16 | class Module extends Module_Base { |
| 14 | 17 | public function get_name(): string { |
| 15 | 18 | return 'optimization'; |
| @@ -14,9 +17,9 @@ | ||
| 14 | 17 | public function get_name(): string { |
| 15 | 18 | return 'optimization'; |
| 16 | 19 | } |
| 17 | 20 | |
| 18 | - public static function routes_list() : array { | |
| 21 | + public static function routes_list(): array { | |
| 19 | 22 | return [ |
| 20 | 23 | 'Optimize_Single_Image', |
| 21 | 24 | 'Optimize_Bulk', |
| 22 | 25 | 'Get_Bulk_Optimization_Images', |
| @@ -24,10 +27,11 @@ | ||
| 24 | 27 | 'Cancel_Bulk_Optimization', |
| 25 | 28 | ]; |
| 26 | 29 | } |
| 27 | 30 | |
| 28 | - public static function component_list() : array { | |
| 31 | + public static function component_list(): array { | |
| 29 | 32 | return [ |
| 33 | + 'Avif_Compatibility', | |
| 30 | 34 | 'Media_Control', |
| 31 | 35 | 'Single_Optimization', |
| 32 | 36 | 'Upload_Optimization', |
| 33 | 37 | 'Bulk_Optimization', |
| @@ -33,8 +37,11 @@ | ||
| 33 | 37 | 'Bulk_Optimization', |
| 34 | 38 | 'List_View_Pointer', |
| 35 | 39 | 'Admin_Bulk_Actions', |
| 36 | 40 | 'Admin_Filter', |
| 41 | + 'Retry', | |
| 42 | + 'Bulk_Operation_Recovery', | |
| 43 | + 'Actions_Cleanup', | |
| 37 | 44 | ]; |
| 38 | 45 | } |
| 39 | 46 | |
| 40 | 47 | /** |
| @@ -46,8 +53,10 @@ | ||
| 46 | 53 | foreach ( $asset_file['dependencies'] as $style ) { |
| 47 | 54 | wp_enqueue_style( $style ); |
| 48 | 55 | } |
| 49 | 56 | |
| 57 | + add_thickbox(); | |
| 58 | + | |
| 50 | 59 | wp_enqueue_style( |
| 51 | 60 | 'image-optimization-control', |
| 52 | 61 | $this->get_css_assets_url( 'control' ), |
| 53 | 62 | [], |
| @@ -69,8 +78,9 @@ | ||
| 69 | 78 | 'imageOptimizerControlSettings', |
| 70 | 79 | [ |
| 71 | 80 | 'optimizeSingleImageNonce' => wp_create_nonce( Optimize_Single_Image::NONCE_NAME ), |
| 72 | 81 | 'restoreSingleImageNonce' => wp_create_nonce( Restore_Single::NONCE_NAME ), |
| 82 | + 'connectLink' => admin_url( 'admin.php?page=' . Settings_Module::SETTING_BASE_SLUG . '&action=connect' ), | |
| 73 | 83 | ] |
| 74 | 84 | ); |
| 75 | 85 | } |
| 76 | 86 | |
| @@ -76,9 +86,9 @@ | ||
| 76 | 86 | |
| 77 | 87 | public static function load_template( $path, $name, $args = [] ): bool { |
| 78 | 88 | $templates_path = sprintf( |
| 79 | 89 | '%s/templates/%s/%s.php', |
| 80 | - dirname( __FILE__ ), | |
| 90 | + __DIR__, | |
| 81 | 91 | $path, |
| 82 | 92 | $name |
| 83 | 93 | ); |
| 84 | 94 | |