✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server366.web-hosting.com ​🇻​♯➤ 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 67.223.118.204 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.243
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/wordpress-popup/inc//class-hustle-db.php
<?php
/**
 * File for the Hustle_Db class.
 *
 * @package Hustle
 * @since unknown
 */

/**
 * File for Hustle_Db class.
 *
 * @package Hustle
 * @since unknwon
 */

require_once ABSPATH . 'wp-admin/includes/upgrade.php';
if ( ! class_exists( 'Hustle_Db' ) ) :

	/**
	 * Class Hustle_Db
	 *
	 * Takes care of all the db initializations
	 */
	class Hustle_Db {

		const DB_VERSION_KEY = 'hustle_database_version';

		const TABLE_HUSTLE_MODULES = 'hustle_modules';

		const TABLE_HUSTLE_MODULES_META = 'hustle_modules_meta';

		/**
		 * Last version where the db was updated.
		 * Change this if you want the 'create tables' function and migration (if conditions are met) to run.
		 *
		 * @since 4.0.0
		 */
		const DB_VERSION = '4.8.2';

		/**
		 * Store module's entries.
		 *
		 * @since 4.0.0
		 */
		const TABLE_HUSTLE_ENTRIES = 'hustle_entries';

		/**
		 * Store module's entries' meta.
		 *
		 * @since 4.0.0
		 */
		const TABLE_HUSTLE_ENTRIES_META = 'hustle_entries_meta';

		/**
		 * Store module's views and conversions.
		 *
		 * @since 4.0.0
		 */
		const TABLE_HUSTLE_TRACKING = 'hustle_tracking';

		/**
		 * Current tables.
		 *
		 * @since 4.0.0
		 *
		 * @var array
		 */
		private static $tables = array();

		/**
		 * It's true only for the FIRST load for fresh plugin installations
		 *
		 * @var bool
		 */
		public static $is_fresh_install = false;

		/**
		 * Check whether the db is up to date.
		 *
		 * @since 4.0.0
		 * @return boolean
		 */
		public static function is_db_up_to_date() {
			$stored_db_version = get_option( self::DB_VERSION_KEY, false );

			// Check if current version is equal to database version.
			if ( version_compare( $stored_db_version, self::DB_VERSION, '=' ) ) {
				return true;
			}

			if ( false === $stored_db_version ) {
				self::$is_fresh_install = true;
			}

			return false;
		}

		/**
		 * Creates plugin tables
		 *
		 * @since 1.0.0
		 *
		 * @param bool $force Whether to create tables even if the db is up to date.
		 */
		public static function maybe_create_tables( $force = false ) {
			if ( ! $force && self::is_db_up_to_date() ) {
				return;
			}

			$hustle_db = new self();
			foreach ( $hustle_db->get_tables() as $name => $columns ) {
				$sql    = $hustle_db->create_table_sql( $name, $columns );
				$result = dbDelta( $sql );
			}

			self::remove_old_columns();

			update_option( self::DB_VERSION_KEY, self::DB_VERSION );
		}

		/**
		 * Remove old columns
		 *
		 * @global object $wpdb
		 */
		private static function remove_old_columns() {
			$stored_db_version = get_option( self::DB_VERSION_KEY, 0 );
			if ( version_compare( $stored_db_version, '4.8.2', '<' ) ) {
				// Clean up the `test_mode` column removed from schema in version before 4.0.
				global $wpdb;
				$modules_table    = self::modules_table();
				$test_mode_exists = $wpdb->get_var( "SHOW COLUMNS FROM {$modules_table} LIKE 'test_mode'" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared
				if ( ! is_null( $test_mode_exists ) ) {
					$wpdb->query( "ALTER TABLE {$modules_table} DROP COLUMN `test_mode`" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.SchemaChange
				}
			}
		}

		/**
		 * Generates CREATE TABLE sql script for provided table name and columns list.
		 *
		 * @since 1.0.0
		 *
		 * @access private
		 * @param string $name The name of a table.
		 * @param array  $columns The array  of columns, indexes, constraints.
		 * @return string The sql script for table creation.
		 */
		private function create_table_sql( $name, array $columns ) {
			global $wpdb;
			$charset = '';
			if ( ! empty( $wpdb->charset ) ) {
				$charset = 'DEFAULT CHARACTER SET ' . $wpdb->charset;
			}
			$collate = '';
			if ( ! empty( $wpdb->collate ) ) {
				$collate .= ' COLLATE ' . $wpdb->collate;
			}
			$name = $wpdb->prefix . $name;
			return sprintf(
				'CREATE TABLE %s (%s%s%s)%s%s',
				$name,
				PHP_EOL,
				implode( ',' . PHP_EOL, $columns ),
				PHP_EOL,
				$charset,
				$collate
			);
		}

		/**
		 * Returns "module_meta" table array with their "Create syntax"
		 *
		 * @since 4.0.0
		 * @since 4.0 'module_mode' added. 'test_mode' removed.
		 *
		 * @return array
		 */
		public static function get_table_modules() {
			return array(
				'module_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT',
				"blog_id bigint(20) UNSIGNED NOT NULL DEFAULT '0'",
				'module_name varchar(255) NOT NULL',
				'module_type varchar(100) NOT NULL',
				'active tinyint DEFAULT 1',
				'module_mode varchar(100) NOT NULL',
				'PRIMARY KEY  (module_id)',
				'KEY active (active)',
			);
		}

		/**
		 * Returns "module_meta" table array with their "Create syntax"
		 *
		 * @since 4.0.0
		 * @since 4.0 'module_mode' added. 'test_mode' removed.
		 *
		 * @return array
		 */
		public static function get_table_modules_meta() {
			global $wpdb;
			$collate = '';
			if ( ! empty( $wpdb->collate ) ) {
				$collate .= ' COLLATE ' . $wpdb->collate;
			}
			return array(
				'meta_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT',
				"module_id bigint(20) UNSIGNED NOT NULL DEFAULT '0'",
				'meta_key varchar(191) ' . $collate . ' DEFAULT NULL',
				'meta_value longtext ' . $collate,
				'PRIMARY KEY  (meta_id)',
				'KEY module_id (module_id)',
				'KEY meta_key (meta_key)',
			);
		}

		/**
		 * Returns db table arrays with their "Create syntax"
		 *
		 * @since 1.0.0
		 * @since 4.0 'module_mode' added. 'test_mode' removed.
		 *
		 * @return array
		 */
		private function get_tables() {
			return array(
				self::TABLE_HUSTLE_MODULES      => self::get_table_modules(),
				self::TABLE_HUSTLE_MODULES_META => self::get_table_modules_meta(),
				self::TABLE_HUSTLE_ENTRIES      => array(
					'entry_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT',
					'entry_type varchar(191) NOT NULL',
					'module_id bigint(20) UNSIGNED NOT NULL',
					"date_created datetime NOT NULL default '0000-00-00 00:00:00'",
					'PRIMARY KEY (entry_id)',
					'KEY entry_type (entry_type)',
					'KEY entry_module_id (module_id)',
				),
				self::TABLE_HUSTLE_ENTRIES_META => array(
					'meta_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT',
					'entry_id bigint(20) UNSIGNED NOT NULL',
					'meta_key varchar(191) DEFAULT NULL',
					'meta_value longtext NULL',
					"date_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
					"date_updated datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
					'PRIMARY KEY  (meta_id)',
					'KEY meta_key (meta_key)',
					'KEY meta_entry_id (entry_id ASC )',
					'KEY meta_key_object (entry_id ASC, meta_key ASC)',
				),
				self::TABLE_HUSTLE_TRACKING     => array(
					'tracking_id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT',
					'module_id bigint(20) UNSIGNED NOT NULL',
					'page_id bigint(20) UNSIGNED NOT NULL',
					'module_type varchar(100) NOT NULL',
					'action varchar(100) NOT NULL',
					'ip varchar(191) DEFAULT NULL',
					'counter mediumint(8) UNSIGNED NOT NULL DEFAULT 1',
					"date_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
					"date_updated datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
					'PRIMARY KEY  (tracking_id)',
					'KEY tracking_module_id (module_id ASC )',
					'KEY action (action)',
					'KEY tracking_module_object (action ASC, module_id ASC, module_type ASC)',
					'KEY tracking_module_object_ip (module_id ASC, tracking_id ASC, ip ASC)',
					'KEY tracking_date_created (date_created DESC)',
				),
			);
		}

		/**
		 * Add $wpdb prefix to table name
		 *
		 * @since 4.0.0
		 *
		 * @global object $wpdb
		 * @param string $table Table name.
		 * @return string
		 */
		private static function add_prefix( $table ) {
			global $wpdb;
			return $wpdb->prefix . $table;
		}

		/**
		 * Get modules table name
		 *
		 * @since 4.0.0
		 *
		 * @return string
		 */
		public static function modules_table() {
			return self::add_prefix( self::TABLE_HUSTLE_MODULES );
		}

		/**
		 * Get modules meta table name
		 *
		 * @since 4.0
		 * @return string
		 */
		public static function modules_meta_table() {
			return self::add_prefix( self::TABLE_HUSTLE_MODULES_META );
		}

		/**
		 * Get entries table name
		 *
		 * @since 4.0
		 * @return string
		 */
		public static function entries_table() {
			return self::add_prefix( self::TABLE_HUSTLE_ENTRIES );
		}

		/**
		 * Get entries meta table name
		 *
		 * @since 4.0
		 * @return string
		 */
		public static function entries_meta_table() {
			return self::add_prefix( self::TABLE_HUSTLE_ENTRIES_META );
		}

		/**
		 * Get tracking table name
		 *
		 * @since 4.0
		 * @return string
		 */
		public static function tracking_table() {
			return self::add_prefix( self::TABLE_HUSTLE_TRACKING );
		}
	}

endif;


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
display-conditions
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
front
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
helpers
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
metas
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
multisite
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
palettes
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
provider
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
providers
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
templates
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
update
--
9 Jun 2026 8.38 AM
builxejc / builxejc
0755
class-hustle-admin-page-abstract.php
17.655 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-auth-token.php
2.666 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
class-hustle-condition-factory.php
0.964 KB
26 May 2020 3.58 PM
builxejc / builxejc
0644
class-hustle-cross-sell.php
1.597 KB
15 Sep 2025 10.29 AM
builxejc / builxejc
0644
class-hustle-dashboard-admin.php
15.469 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-data.php
3.123 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-db.php
8.669 KB
12 Oct 2023 2.01 PM
builxejc / builxejc
0644
class-hustle-installer.php
1.258 KB
3 Jan 2022 12.51 PM
builxejc / builxejc
0644
class-hustle-meta.php
1.9 KB
6 Apr 2023 4.20 PM
builxejc / builxejc
0644
class-hustle-module-admin.php
9.39 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-module-collection.php
12.108 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
class-hustle-module-fields.php
0.436 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
class-hustle-module-page-abstract.php
43.598 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-module-validator.php
2.074 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
class-hustle-notifications.php
29.269 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-settings-admin.php
16.863 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
class-hustle-wp-dashboard-page.php
16.575 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
class-opt-in.php
2.35 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-background-conversion-log.php
2.701 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
hustle-deletion.php
7.746 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
hustle-embedded-admin.php
0.712 KB
13 Oct 2022 9.51 AM
builxejc / builxejc
0644
hustle-entries-admin.php
29.812 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-entry-model.php
32.216 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-general-data-protection.php
11.44 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-init.php
1.382 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-mail.php
6.206 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-migration.php
55.115 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-model.php
34.073 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-module-model.php
30.92 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-module-widget-legacy.php
4.953 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-module-widget.php
3.903 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-modules-common-admin-ajax.php
32.168 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-popup-admin.php
0.639 KB
13 Oct 2022 9.51 AM
builxejc / builxejc
0644
hustle-providers-admin.php
6.822 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-providers.php
16.267 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
hustle-settings-admin-ajax.php
24.727 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-settings-page.php
5.03 KB
17 Apr 2023 3.18 PM
builxejc / builxejc
0644
hustle-slidein-admin.php
0.651 KB
13 Oct 2022 9.51 AM
builxejc / builxejc
0644
hustle-sshare-admin.php
2.503 KB
13 Oct 2022 9.51 AM
builxejc / builxejc
0644
hustle-sshare-model.php
21.675 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
hustle-tracking-model.php
25.706 KB
18 Mar 2026 9.34 PM
builxejc / builxejc
0644
interface-hustle-auth-provider.php
0.509 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
opt-in-geo.php
13.099 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644
opt-in-utils.php
41.588 KB
25 May 2026 1.17 PM
builxejc / builxejc
0644
opt-in-wpmudev-api.php
3.985 KB
26 Jan 2026 12.22 PM
builxejc / builxejc
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF