INSERT INTO ' . self::get_table_name() . ' ( `id`, `title`, `message`, `types`, `create_at`, `form_id`, `entry_id`, `user_id` ) VALUES '; foreach ( $this->records as $record ) { $sql .= $wpdb->prepare( '( NULL, %s, %s, %s, %s, %d, %d, %d ),', $record->get_title(), $record->get_message(), implode( ',', $record->get_types() ), $record->get_date( 'sql' ), $record->get_form_id(), $record->get_entry_id(), $record->get_user_id() ); } $sql = rtrim( $sql, ',' ); //phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared $wpdb->query( $sql ); //phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared wp_cache_delete( self::CACHE_TOTAL_KEY ); } /** * Check if the database table exists. * * @since 1.6.4 * * @return bool */ public function table_exists() { return DB::table_exists( self::get_table_name() ); } /** * Get total count of logs. * * @since 1.6.3 * * @return int */ public function get_total() { global $wpdb; $total = wp_cache_get( self::CACHE_TOTAL_KEY ); if ( ! $total ) { //phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared $total = $this->full_total ? $wpdb->get_var( 'SELECT FOUND_ROWS()' ) : $wpdb->get_var( 'SELECT COUNT( ID ) FROM ' . self::get_table_name() ); //phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.NotPrepared wp_cache_set( self::CACHE_TOTAL_KEY, $total, 'wpforms', DAY_IN_SECONDS ); } return absint( $total ); } /** * Clear all records in the Database. * * @since 1.6.3 */ public function clear_all() { global $wpdb; //phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared $wpdb->query( 'TRUNCATE TABLE ' . self::get_table_name() ); } }
Fatal error: Uncaught Error: Class "WPForms\Logger\Repository" not found in /htdocs/wp-content/plugins/wpforms-lite/src/Logger/Log.php:40 Stack trace: #0 /htdocs/wp-content/plugins/wpforms-lite/src/WPForms.php(377): WPForms\Logger\Log->hooks() #1 /htdocs/wp-content/plugins/wpforms-lite/src/WPForms.php(384): WPForms\WPForms->WPForms\{closure}() #2 /htdocs/wp-content/plugins/wpforms-lite/src/WPForms.php(417): WPForms\WPForms->register(Array) #3 /htdocs/wp-content/plugins/wpforms-lite/src/Loader.php(30): WPForms\WPForms->register_bulk(Array) #4 /htdocs/wp-content/plugins/wpforms-lite/src/WPForms.php(377): WPForms\Loader->init() #5 /htdocs/wp-content/plugins/wpforms-lite/src/WPForms.php(384): WPForms\WPForms->WPForms\{closure}() #6 /htdocs/wp-content/plugins/wpforms-lite/src/WPForms.php(255): WPForms\WPForms->register(Array) #7 /htdocs/wp-content/plugins/wpforms-lite/src/WPForms.php(184): WPForms\WPForms->includes_magic() #8 /htdocs/wp-content/plugins/wpforms-lite/src/WPForms.php(135): WPForms\WPForms->includes() #9 /htdocs/wp-content/plugins/wpforms-lite/src/WPForms.php(507): WPForms\WPForms::instance() #10 /htdocs/wp-content/plugins/wpforms-lite/wpforms.php(343): wpforms() #11 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #12 /htdocs/wp-config.php(100): require_once('/htdocs/wp-sett...') #13 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #14 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #15 /htdocs/index.php(17): require('/htdocs/wp-blog...') #16 {main} thrown in /htdocs/wp-content/plugins/wpforms-lite/src/Logger/Log.php on line 40