=> $result ) { if ( "Created table $table_name" === $result ) { if ( in_array( $table_name, $this->get_tables(), true ) ) { $missing_tables = true; $this->update_missing_tables( $table_name ); } } } if ( false === $missing_tables ) { if ( false === $this->data_exist() || true === $force ) { $this->load_default(); } foreach ( $this->get_tables() as $table ) { $this->update_missing_tables( $table, true ); } update_option( "cky_{$this->table_option}_table_version", CLI_VERSION ); } } /** * Reinstall the tables if not installed. * * @return void */ public function reinstall() { require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta( $this->get_schema(), true ); $this->validate_tables( ! $this->data_exist() ); } /** * Return a list of missing tables. * * @return array */ protected function missing_tables() { return get_option( 'cky_missing_tables', array() ); } /** * Add or delete missing tables * * @param string $table_name Tablename. * @param boolean $clear Whether to keep or remove table name from the list. * @return void */ protected function update_missing_tables( $table_name = null, $clear = false ) { if ( ! $table_name ) { return; } $missing_tables = get_option( 'cky_missing_tables', array() ); if ( true === $clear ) { if ( isset( $missing_tables[ $table_name ] ) ) { unset( $missing_tables[ $table_name ] ); } } else { if ( ! isset( $missing_tables[ $table_name ] ) ) { $missing_tables[ $table_name ] = true; } } update_option( 'cky_missing_tables', $missing_tables ); } /** * Check if table exist. * * @return boolean */ protected function table_exist() { foreach ( $this->get_tables() as $table_name ) { $table = wp_cache_get( $table_name . 'cky_table_exist', 'table-details' ); if ( $table === false ) { global $wpdb; $table = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) ) ); wp_cache_set( $table_name . 'cky_table_exist', $table, 'table-details', MINUTE_IN_SECONDS ); } if ( strtolower( $table_name ) !== strtolower( isset($table) ? $table : '' ) ) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery $this->update_missing_tables( $table_name ); return false; } } return true; } /** * Check if table is empty * * @return boolean */ protected function data_exist() { global $wpdb; $count = 0; foreach ( $this->get_tables() as $table_name ) { if ( ! $this->table_exist() ) { return false; } $count = (int) $wpdb->get_var( "SELECT COUNT(*) FROM {$table_name}" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery if ( $count > 0 ) { return true; } else { $this->update_missing_tables( $table_name ); // Possibility for missing data while creating the table. return false; } } } }
Fatal error: Uncaught Error: Class 'CookieYes\Lite\Includes\Base_Controller' not found in /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/banners/includes/class-controller.php:27 Stack trace: #0 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/class-autoloader.php(47): require() #1 [internal function]: CookieYes\Lite\Autoloader::load_class('CookieYes\\Lite\\...') #2 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/banners/api/class-api.php(55): spl_autoload_call('CookieYes\\Lite\\...') #3 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/banners/class-banners.php(55): CookieYes\Lite\Admin\Modules\Banners\Api\Api->__construct() #4 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/banners/class-banners.php(39): CookieYes\Lite\Admin\Modules\Banners\Banners->load_apis() #5 /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/in in /var/www/html/helitower.com.br/web/wp-content/plugins/cookie-law-info/lite/admin/modules/banners/includes/class-controller.php on line 27