PluginProbe ʕ •ᴥ•ʔ
10Web Booster – Website speed optimization, Cache & Page Speed optimizer / trunk
10Web Booster – Website speed optimization, Cache & Page Speed optimizer vtrunk
2.33.0 2.30.5 2.30.7 2.30.9 2.31.10 2.31.8 2.32.11 2.32.21 2.32.3 2.32.4 2.32.7 2.6.31 2.6.40 2.6.42 2.6.7 2.7.37 2.7.44 2.7.47 2.8.18 2.8.19 2.8.32 2.8.34 2.8.35 2.9.23 2.9.24 2.9.25 2.9.27 v2.27.4 trunk 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.17 2.0.18 2.0.21 2.0.22 2.0.25 2.0.26 2.0.27 2.0.3 2.0.7 2.0.9 2.10.46 2.10.65 2.10.66 2.10.68 2.11.41 2.11.42 2.11.43 2.12.15 2.12.21 2.12.22 2.12.23 2.12.26 2.13.37 2.13.40 2.13.41 2.13.42 2.13.44 2.13.45 2.13.47 2.14.49 2.14.50 2.15.18 2.17.21 2.17.23 2.18.17 2.19.44 2.19.45 2.19.46 2.19.49 2.2.12 2.2.15 2.2.16 2.2.18 2.2.8 2.20.31 2.20.32 2.20.33 2.21.11 2.21.12 2.21.16 2.21.25 2.22.32 2.23.13 2.23.15 2.23.16 2.23.18 2.24.12 2.24.14 2.24.18 2.25.14 2.26.6 2.28.10 2.28.13 2.28.14 2.28.7 2.29.1 2.29.2 2.29.3 2.3.0 2.3.1 2.3.2 2.3.3 2.30.18
tenweb-speed-optimizer / vendor / 10web-utils / tenweb-image-optimizer / src / TenWebIO / Config.php
tenweb-speed-optimizer / vendor / 10web-utils / tenweb-image-optimizer / src / TenWebIO Last commit date
Exceptions 4 years ago Queue 2 years ago Views 2 years ago Api.php 2 years ago Attachments.php 2 years ago Backup.php 2 years ago CLI.php 3 years ago Compress.php 2 years ago CompressDataService.php 3 years ago CompressService.php 3 years ago Config.php 2 years ago Init.php 2 years ago LastCompress.php 3 years ago Logs.php 2 years ago PreInit.php 3 years ago Rest.php 2 years ago Settings.php 3 years ago Utils.php 1 year ago
Config.php
111 lines
1 <?php
2 namespace TenWebIO;
3
4 class Config
5 {
6 private $debug_mode = 0;
7 private $images_limit_for_restart = 20;
8 private $auto_optimize_with_rest = 1;
9 private $queue_chunk_images_limit = 1000;
10 private $stat_chunk_images_limit = 500000;
11 private $compress_only_full_size = 0;
12
13 public function __construct()
14 {
15 $config = get_site_option(TENWEBIO_PREFIX . '_configs');
16 if (!empty($config['debug_mode'])) {
17 $this->debug_mode = (int)$config['debug_mode'];
18 } else {
19 $this->debug_mode = 0;
20 }
21 if (!empty($config['auto_optimize_with_rest'])) {
22 $this->auto_optimize_with_rest = (int)$config['auto_optimize_with_rest'];
23 } else {
24 $this->auto_optimize_with_rest = 1;
25 }
26
27 if (!empty($config['images_limit_for_restart'])) {
28 $this->images_limit_for_restart = (int)$config['images_limit_for_restart'];
29 }
30
31 if (!empty($config['queue_chunk_images_limit'])) {
32 $this->queue_chunk_images_limit = (int)$config['queue_chunk_images_limit'];
33 }
34
35 if (!empty($config['stat_chunk_images_limit'])) {
36 $this->stat_chunk_images_limit = (int)$config['stat_chunk_images_limit'];
37 }
38 if (!empty($config['compress_only_full_size'])) {
39 $this->compress_only_full_size = (int)$config['compress_only_full_size'];
40 } else {
41 $this->compress_only_full_size = 0;
42 }
43 }
44
45 public function getDebugMode()
46 {
47 return $this->debug_mode;
48 }
49
50 public function getImagesLimitForRestart()
51 {
52 return $this->images_limit_for_restart;
53 }
54
55 public function getAutoOptimizeWithRest()
56 {
57 return $this->auto_optimize_with_rest;
58 }
59
60 public function getQueueChunkImagesLimit()
61 {
62 return $this->queue_chunk_images_limit;
63 }
64
65 public function getStatChunkImagesLimit()
66 {
67 return $this->stat_chunk_images_limit;
68 }
69
70 public function getCompressOnlyFullSize()
71 {
72 return $this->compress_only_full_size;
73 }
74
75 public function save($data)
76 {
77 if (isset($data['debug_mode'])) {
78 $this->debug_mode = 1;
79 } else {
80 $this->debug_mode = 0;
81 }
82 if (isset($data['images_limit_for_restart'])) {
83 $this->images_limit_for_restart = (int)$data['images_limit_for_restart'];
84 }
85 if (isset($data['auto_optimize_with_rest'])) {
86 $this->auto_optimize_with_rest = 1;
87 } else {
88 $this->auto_optimize_with_rest = 0;
89 }
90 if (isset($data['queue_chunk_images_limit'])) {
91 $this->queue_chunk_images_limit = (int)$data['queue_chunk_images_limit'];
92 }
93 if (isset($data['stat_chunk_images_limit'])) {
94 $this->stat_chunk_images_limit = (int)$data['stat_chunk_images_limit'];
95 }
96 if (isset($data['compress_only_full_size'])) {
97 $this->compress_only_full_size = 1;
98 } else {
99 $this->compress_only_full_size = 0;
100 }
101 update_site_option(TENWEBIO_PREFIX . '_configs', array(
102 'debug_mode' => $this->debug_mode,
103 'images_limit_for_restart' => $this->images_limit_for_restart,
104 'auto_optimize_with_rest' => $this->auto_optimize_with_rest,
105 'queue_chunk_images_limit' => $this->queue_chunk_images_limit,
106 'stat_chunk_images_limit' => $this->stat_chunk_images_limit,
107 'compress_only_full_size' => $this->compress_only_full_size,
108 ));
109 }
110
111 }