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/3rd-party/nextgen-gallery/classes/DB.php +7 -32 1.10 → trunk View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2 namespace Imagify\ThirdParty\NGG;
3 3
4 -defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );
4 +use Imagify\Traits\InstanceGetterTrait;
5 5
6 6 /**
7 7 * Imagify NextGen Gallery DB class.
8 8 *
@@ -9,8 +9,9 @@
9 9 * @since 1.5
10 10 * @author Jonathan Buttigieg
11 11 */
12 12 class DB extends \Imagify_Abstract_DB {
13 + use InstanceGetterTrait;
13 14
14 15 /**
15 16 * Class version.
16 17 *
@@ -18,17 +19,8 @@
18 19 */
19 20 const VERSION = '1.1.1';
20 21
21 22 /**
22 - * The single instance of the class.
23 - *
24 - * @var object
25 - * @since 1.5
26 - * @access protected
27 - */
28 - protected static $_instance;
29 -
30 - /**
31 23 * The suffix used in the name of the database table (so, without the wpdb prefix).
32 24 *
33 25 * @var string
34 26 * @since 1.7
@@ -65,25 +57,8 @@
65 57 */
66 58 protected $primary_key = 'pid';
67 59
68 60 /**
69 - * Get the main Instance.
70 - *
71 - * @since 1.6.5
72 - * @access public
73 - * @author Grégory Viguier
74 - *
75 - * @return object Main instance.
76 - */
77 - public static function get_instance() {
78 - if ( ! isset( self::$_instance ) ) {
79 - self::$_instance = new self();
80 - }
81 -
82 - return self::$_instance;
83 - }
84 -
85 - /**
86 61 * Whitelist of columns.
87 62 *
88 63 * @since 1.5
89 64 * @access public
@@ -91,15 +66,15 @@
91 66 *
92 67 * @return array
93 68 */
94 69 public function get_columns() {
95 - return array(
70 + return [
96 71 'data_id' => '%d',
97 72 'pid' => '%d',
98 73 'optimization_level' => '%s',
99 74 'status' => '%s',
100 75 'data' => '%s',
101 - );
76 + ];
102 77 }
103 78
104 79 /**
105 80 * Default column values.
@@ -110,15 +85,15 @@
110 85 *
111 86 * @return array
112 87 */
113 88 public function get_column_defaults() {
114 - return array(
89 + return [
115 90 'data_id' => 0,
116 91 'pid' => 0,
117 92 'optimization_level' => '',
118 93 'status' => '',
119 - 'data' => array(),
120 - );
94 + 'data' => [],
95 + ];
121 96 }
122 97
123 98 /**
124 99 * Get the query to create the table fields.