PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.84
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.84
5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 5.5.42 All 160 releases
← All changes | WPDataAccess/Plugin_Table_Models/WPDA_App_Model.php +31 -14 5.5.225.5.84 View file →
@@ -10,9 +10,9 @@
10 10
11 11 public static function get_by_id( $app_id ) {
12 12
13 13 global $wpdb;
14 - $dataset = $wpdb->get_results(
14 + $dataset = $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table
15 15 $wpdb->prepare(
16 16 'SELECT * FROM `%1s` WHERE app_id = %d', // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders
17 17 array(
18 18 WPDA::remove_backticks( self::get_base_table_name() ),
@@ -19,9 +19,9 @@
19 19 $app_id,
20 20 )
21 21 ), // db call ok; no-cache ok.
22 22 'ARRAY_A'
23 - ); // phpcs:ignore Standard.Category.SniffName.ErrorCode
23 + );
24 24
25 25 return 1 === $wpdb->num_rows ? $dataset : false;
26 26
27 27 }
@@ -28,9 +28,9 @@
28 28
29 29 public static function get_by_name( $app_name ) {
30 30
31 31 global $wpdb;
32 - $dataset = $wpdb->get_results(
32 + $dataset = $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table
33 33 $wpdb->prepare(
34 34 'SELECT * FROM `%1s` WHERE app_name = %s', // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders
35 35 array(
36 36 WPDA::remove_backticks( self::get_base_table_name() ),
@@ -37,9 +37,9 @@
37 37 $app_name,
38 38 )
39 39 ), // db call ok; no-cache ok.
40 40 'ARRAY_A'
41 - ); // phpcs:ignore Standard.Category.SniffName.ErrorCode
41 + );
42 42
43 43 return 1 === $wpdb->num_rows ? $dataset : false;
44 44
45 45 }
@@ -46,9 +46,9 @@
46 46
47 47 public static function list() {
48 48
49 49 global $wpdb;
50 - return $wpdb->get_results(
50 + return $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table
51 51 $wpdb->prepare(
52 52 'SELECT * FROM `%1s` ORDER BY app_name', // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders
53 53 array(
54 54 WPDA::remove_backticks( self::get_base_table_name() ),
@@ -54,16 +54,33 @@
54 54 WPDA::remove_backticks( self::get_base_table_name() ),
55 55 )
56 56 ), // db call ok; no-cache ok.
57 57 'ARRAY_A'
58 - ); // phpcs:ignore Standard.Category.SniffName.ErrorCode
58 + );
59 59
60 60 }
61 61
62 - public static function add_to_dashboard_menu() {
62 + public static function has_any() {
63 63
64 + global $wpdb;
65 + $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table
66 + $wpdb->prepare(
67 + 'SELECT 1 FROM `%1s` LIMIT 1', // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders
68 + array(
69 + WPDA::remove_backticks( self::get_base_table_name() ),
70 + )
71 + ), // db call ok; no-cache ok.
72 + 'ARRAY_A'
73 + );
74 +
75 + return 1 === $wpdb->num_rows;
76 +
77 + }
78 +
79 + public static function add_to_dashboard_menu() {
80 +
64 81 global $wpdb;
65 - return $wpdb->get_results(
82 + return $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table
66 83 $wpdb->prepare(
67 84 'SELECT * FROM `%1s` WHERE `app_add_to_menu` = 1 ORDER BY app_name', // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders
68 85 array(
69 86 WPDA::remove_backticks( self::get_base_table_name() ),
@@ -69,9 +86,9 @@
69 86 WPDA::remove_backticks( self::get_base_table_name() ),
70 87 )
71 88 ), // db call ok; no-cache ok.
72 89 'ARRAY_A'
73 - ); // phpcs:ignore Standard.Category.SniffName.ErrorCode
90 + );
74 91
75 92 }
76 93
77 94 public static function create(
@@ -81,9 +98,9 @@
81 98 $app_settings
82 99 ) {
83 100
84 101 global $wpdb;
85 - if ( 1 === $wpdb->insert(
102 + if ( 1 === $wpdb->insert( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- plugin table
86 103 static::get_base_table_name(),
87 104 array(
88 105 'app_name' => $app_name,
89 106 'app_title' => $app_title,
@@ -106,9 +123,9 @@
106 123
107 124 public static function delete( $app_id ) {
108 125
109 126 global $wpdb;
110 - return $wpdb->delete(
127 + return $wpdb->delete( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table
111 128 static::get_base_table_name(),
112 129 array(
113 130 'app_id' => $app_id,
114 131 )
@@ -125,9 +142,9 @@
125 142 $app_add_to_menu
126 143 ) {
127 144
128 145 global $wpdb;
129 - $wpdb->update(
146 + $wpdb->update( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table
130 147 static::get_base_table_name(),
131 148 array(
132 149 'app_name' => $app_name,
133 150 'app_title' => $app_title,
@@ -162,9 +179,9 @@
162 179 }
163 180
164 181 // Copy app
165 182 global $wpdb;
166 - if ( 1 === $wpdb->insert(
183 + if ( 1 === $wpdb->insert( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- plugin table
167 184 static::get_base_table_name(),
168 185 array(
169 186 'app_name' => $new_app_name,
170 187 'app_title' => $app[0]['app_title'],
@@ -224,9 +241,9 @@
224 241 $app_theme
225 242 ) {
226 243
227 244 global $wpdb;
228 - $wpdb->update(
245 + $wpdb->update( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- plugin table
229 246 static::get_base_table_name(),
230 247 array(
231 248 'app_theme' => $app_theme,
232 249 ),