PluginProbe
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF / 2.3.3
Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF v2.3.3
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
imagify / inc / classes / class-imagify-cron-library-size.php

class-imagify-cron-library-size.php in Imagify Image Optimization: Optimize Images | Compress & Convert to WebP/AVIF 2.3.3, at inc/classes/class-imagify-cron-library-size.php

69 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use Imagify\Traits\InstanceGetterTrait;
4
5 /**
6 * Class that handles the cron that calculate and cache the library size.
7 *
8 * @since 1.7
9 * @author Grégory Viguier
10 */
11 class Imagify_Cron_Library_Size extends Imagify_Abstract_Cron {
12 use InstanceGetterTrait;
13
14 /**
15 * Class version.
16 *
17 * @var string
18 * @since 1.7
19 */
20 const VERSION = '1.0';
21
22 /**
23 * Cron name.
24 *
25 * @var string
26 * @since 1.7
27 * @access protected
28 */
29 protected $event_name = 'imagify_update_library_size_calculations_event';
30
31 /**
32 * Cron recurrence.
33 *
34 * @var string
35 * @since 1.7
36 * @access protected
37 */
38 protected $event_recurrence = 'weekly';
39
40 /**
41 * Cron time.
42 *
43 * @var string
44 * @since 1.7
45 * @access protected
46 */
47 protected $event_time = '04:00';
48
49 /** ----------------------------------------------------------------------------------------- */
50 /** HOOKS =================================================================================== */
51 /** ----------------------------------------------------------------------------------------- */
52
53 /**
54 * The event action.
55 *
56 * @since 1.7
57 * @access public
58 * @author Grégory Viguier
59 */
60 public function do_event() {
61 imagify_do_async_job(
62 [
63 'action' => 'imagify_update_estimate_sizes',
64 '_ajax_nonce' => wp_create_nonce( 'update_estimate_sizes' ),
65 ]
66 );
67 }
68 }
69