PluginProbe ʕ •ᴥ•ʔ
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings / 1.0.239
Rank Math SEO – AI SEO Tools to Dominate SEO Rankings v1.0.239
1.0.273 1.0.272 1.0.271 1.0.271.1 1.0.270 1.0.269 trunk 1.0.216 1.0.217 1.0.218 1.0.219 1.0.220 1.0.221 1.0.222 1.0.223 1.0.224 1.0.225 1.0.226 1.0.227 1.0.227.1 1.0.228 1.0.229 1.0.230 1.0.231 1.0.232 1.0.233 1.0.234 1.0.234.1 1.0.235 1.0.236 1.0.237 1.0.238 1.0.239 1.0.240 1.0.241 1.0.242 1.0.243 1.0.244 1.0.245 1.0.246 1.0.247 1.0.248 1.0.249 1.0.250 1.0.251 1.0.251.1 1.0.252 1.0.252.1 1.0.253 1.0.254 1.0.255 1.0.256 1.0.257 1.0.258 1.0.259 1.0.259.1 1.0.260 1.0.261 1.0.262 1.0.263 1.0.264 1.0.264.1 1.0.265 1.0.266 1.0.266.1 1.0.267 1.0.268
seo-by-rank-math / vendor / mythemeshop / wordpress-helpers / src / helpers / class-db.php
seo-by-rank-math / vendor / mythemeshop / wordpress-helpers / src / helpers Last commit date
class-arr.php 2 years ago class-attachment.php 2 years ago class-conditional.php 2 years ago class-db.php 2 years ago class-html.php 2 years ago class-param.php 2 years ago class-str.php 2 years ago class-url.php 2 years ago class-wordpress.php 2 years ago index.php 2 years ago
class-db.php
68 lines
1 <?php
2 /**
3 * The database helpers.
4 *
5 * @since 1.0.0
6 * @package MyThemeShop
7 * @subpackage MyThemeShop\Helpers
8 * @author MyThemeShop <admin@mythemeshop.com>
9 */
10
11 namespace MyThemeShop\Helpers;
12
13 use MyThemeShop\Database\Database;
14
15 /**
16 * DB class.
17 */
18 class DB {
19
20 /**
21 * Retrieve a Database instance by table name.
22 *
23 * @param string $table_name A Database instance id.
24 *
25 * @return Database Database object instance.
26 */
27 public static function query_builder( $table_name ) {
28 return Database::table( $table_name );
29 }
30
31 /**
32 * Check if table exists in db or not.
33 *
34 * @param string $table_name Table name to check for existance.
35 *
36 * @return bool
37 */
38 public static function check_table_exists( $table_name ) {
39 global $wpdb;
40
41 if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->prefix . $table_name ) ) ) === $wpdb->prefix . $table_name ) {
42 return true;
43 }
44
45 return false;
46 }
47
48 /**
49 * Check if table has more rows than X.
50 *
51 * @since 1.1.16
52 *
53 * @param string $table_name Table name to check.
54 * @param int $limit Number of rows to check against.
55 *
56 * @return bool
57 */
58 public static function table_size_exceeds( $table_name, $limit ) {
59 global $wpdb;
60
61 $check_table = $wpdb->query( "SELECT 1 FROM {$table_name} LIMIT {$limit}, 1" );
62
63 return ! empty( $check_table );
64 }
65
66
67 }
68