PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / trunk
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF vtrunk
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
← All changes | inc/classes/class-imagify-cron-library-size.php +9 -32 1.10 → trunk View file →
@@ -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 }