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-folders-db.php +7 -31 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 * DB class that handles files in "custom folders".
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_Folders_DB extends Imagify_Abstract_DB {
12 + use InstanceGetterTrait;
11 13
12 14 /**
13 15 * Class version.
14 16 *
@@ -16,17 +18,8 @@
16 18 */
17 19 const VERSION = '1.0.1';
18 20
19 21 /**
20 - * The single instance of the class.
21 - *
22 - * @var object
23 - * @since 1.7
24 - * @access protected
25 - */
26 - protected static $_instance;
27 -
28 - /**
29 22 * The suffix used in the name of the database table (so, without the wpdb prefix).
30 23 *
31 24 * @var string
32 25 * @since 1.7
@@ -61,25 +54,8 @@
61 54 */
62 55 protected $primary_key = 'folder_id';
63 56
64 57 /**
65 - * Get the main Instance.
66 - *
67 - * @since 1.7
68 - * @access public
69 - * @author Grégory Viguier
70 - *
71 - * @return object Main instance.
72 - */
73 - public static function get_instance() {
74 - if ( ! isset( self::$_instance ) ) {
75 - self::$_instance = new self();
76 - }
77 -
78 - return self::$_instance;
79 - }
80 -
81 - /**
82 58 * Whitelist of columns.
83 59 *
84 60 * @since 1.7
85 61 * @access public
@@ -87,13 +63,13 @@
87 63 *
88 64 * @return array
89 65 */
90 66 public function get_columns() {
91 - return array(
67 + return [
92 68 'folder_id' => '%d',
93 69 'path' => '%s',
94 70 'active' => '%d',
95 - );
71 + ];
96 72 }
97 73
98 74 /**
99 75 * Default column values.
@@ -104,13 +80,13 @@
104 80 *
105 81 * @return array
106 82 */
107 83 public function get_column_defaults() {
108 - return array(
84 + return [
109 85 'folder_id' => 0,
110 86 'path' => '',
111 87 'active' => 0,
112 - );
88 + ];
113 89 }
114 90
115 91 /**
116 92 * Get the query to create the table fields.