| @@ -1,7 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | -defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' ); | |
| 3 | 2 | |
| 3 | +use Imagify\Traits\InstanceGetterTrait; | |
| 4 | + | |
| 4 | 5 | /** |
| 5 | 6 | * Class that handles the cron that calculate and cache the library size. |
| 6 | 7 | * |
| 7 | 8 | * @since 1.7 |
| @@ -7,8 +8,9 @@ | ||
| 7 | 8 | * @since 1.7 |
| 8 | 9 | * @author Grégory Viguier |
| 9 | 10 | */ |
| 10 | 11 | class Imagify_Cron_Library_Size extends Imagify_Abstract_Cron { |
| 12 | + use InstanceGetterTrait; | |
| 11 | 13 | |
| 12 | 14 | /** |
| 13 | 15 | * Class version. |
| 14 | 16 | * |
| @@ -43,35 +45,8 @@ | ||
| 43 | 45 | * @access protected |
| 44 | 46 | */ |
| 45 | 47 | protected $event_time = '04:00'; |
| 46 | 48 | |
| 47 | - /** | |
| 48 | - * The single instance of the class. | |
| 49 | - * | |
| 50 | - * @var object | |
| 51 | - * @since 1.7 | |
| 52 | - * @access protected | |
| 53 | - */ | |
| 54 | - protected static $_instance; | |
| 55 | - | |
| 56 | - /** | |
| 57 | - * Get the main Instance. | |
| 58 | - * | |
| 59 | - * @since 1.7 | |
| 60 | - * @access public | |
| 61 | - * @author Grégory Viguier | |
| 62 | - * | |
| 63 | - * @return object Main instance. | |
| 64 | - */ | |
| 65 | - public static function get_instance() { | |
| 66 | - if ( ! isset( self::$_instance ) ) { | |
| 67 | - self::$_instance = new self(); | |
| 68 | - } | |
| 69 | - | |
| 70 | - return self::$_instance; | |
| 71 | - } | |
| 72 | - | |
| 73 | - | |
| 74 | 49 | /** ----------------------------------------------------------------------------------------- */ |
| 75 | 50 | /** HOOKS =================================================================================== */ |
| 76 | 51 | /** ----------------------------------------------------------------------------------------- */ |
| 77 | 52 | |
| @@ -82,10 +57,12 @@ | ||
| 82 | 57 | * @access public |
| 83 | 58 | * @author Grégory Viguier |
| 84 | 59 | */ |
| 85 | 60 | public function do_event() { |
| 86 | - imagify_do_async_job( array( | |
| 87 | - 'action' => 'imagify_update_estimate_sizes', | |
| 88 | - '_ajax_nonce' => wp_create_nonce( 'update_estimate_sizes' ), | |
| 89 | - ) ); | |
| 61 | + imagify_do_async_job( | |
| 62 | + [ | |
| 63 | + 'action' => 'imagify_update_estimate_sizes', | |
| 64 | + '_ajax_nonce' => wp_create_nonce( 'update_estimate_sizes' ), | |
| 65 | + ] | |
| 66 | + ); | |
| 90 | 67 | } |
| 91 | 68 | } |