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 | classes/Context/CustomFolders.php +3 -31 1.10 → trunk View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2 namespace Imagify\Context;
3 3
4 -defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
4 +use Imagify\Traits\InstanceGetterTrait;
5 5
6 6 /**
7 7 * Context class used for the custom folders.
8 8 *
@@ -8,10 +8,10 @@
8 8 *
9 9 * @since 1.9
10 10 * @author Grégory Viguier
11 11 */
12 -class CustomFolders extends AbstractContext {
13 - use \Imagify\Traits\InstanceGetterTrait;
12 +final class CustomFolders extends AbstractContext {
13 + use InstanceGetterTrait;
14 14
15 15 /**
16 16 * Context "short name".
17 17 *
@@ -16,9 +16,8 @@
16 16 * Context "short name".
17 17 *
18 18 * @var string
19 19 * @since 1.9
20 - * @access protected
21 20 * @author Grégory Viguier
22 21 */
23 22 protected $context = 'custom-folders';
24 23
@@ -34,9 +33,8 @@
34 33 * @type bool $crop True to crop, false to resize.
35 34 * @type string $name The size name.
36 35 * }
37 36 * @since 1.9
38 - * @access public
39 37 * @author Grégory Viguier
40 38 */
41 39 protected $thumbnail_sizes = [];
42 40
@@ -44,9 +42,8 @@
44 42 * Get images max width for this context. This is used when resizing.
45 43 * 0 means to not resize.
46 44 *
47 45 * @since 1.9.8
48 - * @access public
49 46 * @author Grégory Viguier
50 47 *
51 48 * @return int
52 49 */
@@ -57,18 +54,13 @@
57 54 /**
58 55 * Tell if the optimization process is allowed to backup in this context.
59 56 *
60 57 * @since 1.9
61 - * @access public
62 58 * @author Grégory Viguier
63 59 *
64 60 * @return bool
65 61 */
66 62 public function can_backup() {
67 - if ( isset( $this->can_backup ) ) {
68 - return $this->can_backup;
69 - }
70 -
71 63 $this->can_backup = get_imagify_option( 'backup' );
72 64
73 65 return $this->can_backup;
74 66 }
@@ -73,31 +65,11 @@
73 65 return $this->can_backup;
74 66 }
75 67
76 68 /**
77 - * Tell if the optimization process is allowed to keep exif in this context.
78 - *
79 - * @since 1.9
80 - * @access public
81 - * @author Grégory Viguier
82 - *
83 - * @return bool
84 - */
85 - public function can_keep_exif() {
86 - if ( isset( $this->can_keep_exif ) ) {
87 - return $this->can_keep_exif;
88 - }
89 -
90 - $this->can_keep_exif = get_imagify_option( 'exif' );
91 -
92 - return $this->can_keep_exif;
93 - }
94 -
95 - /**
96 69 * Get user capacity to operate Imagify in this context.
97 70 *
98 71 * @since 1.9
99 - * @access public
100 72 * @author Grégory Viguier
101 73 *
102 74 * @param string $describer Capacity describer. Possible values are like 'manage', 'bulk-optimize', 'manual-optimize', 'auto-optimize'.
103 75 * @return string