GRAYBYTE WORDPRESS FILE MANAGER6458

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/chahida.co.in/wp-content/plugins/wpforms-lite/src/Logger/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/chahida.co.in/wp-content/plugins/wpforms-lite/src/Logger//RecordQuery.php
<?php

// phpcs:ignore Generic.Commenting.DocComment.MissingShort
/** @noinspection PhpIllegalPsrClassPathInspection */

namespace WPForms\Logger;

/**
 * Class RecordQuery.
 *
 * @since 1.6.3
 */
class RecordQuery {

	/**
	 * Build query.
	 *
	 * @since 1.6.3
	 *
	 * @param int    $limit  Query limit of records.
	 * @param int    $offset Offset of records.
	 * @param string $search Search.
	 * @param string $type   Type of records.
	 *
	 * @return array
	 */
	public function get( $limit, $offset = 0, $search = '', $type = '' ) {

		global $wpdb;
		//phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
		return (array) $wpdb->get_results(
			$this->build_query( $limit, $offset, $search, $type )
		);
		//phpcs:enable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.NotPrepared
	}

	/**
	 * Build query.
	 *
	 * @since 1.6.3
	 *
	 * @param int    $limit  Query limit of records.
	 * @param int    $offset Offset of records.
	 * @param string $search Search.
	 * @param string $type   Type of records.
	 *
	 * @return string
	 */
	private function build_query( $limit, $offset = 0, $search = '', $type = '' ) {

		global $wpdb;

		$sql   = 'SELECT SQL_CALC_FOUND_ROWS * FROM ' . Repository::get_table_name();
		$where = [];

		if ( ! empty( $search ) ) {
			$where[] = $wpdb->prepare(
				'`title` REGEXP %s OR `message` REGEXP %s',
				$search,
				$search
			);
		}

		if ( ! empty( $type ) ) {
			$where[] = $wpdb->prepare(
				'`types` REGEXP %s',
				$type
			);
		}

		if ( $where ) {
			$sql .= ' WHERE ' . implode( ' AND ', $where );
		}

		$sql .= ' ORDER BY `create_at` DESC, `id` DESC';
		$sql .= $wpdb->prepare( ' LIMIT %d, %d', absint( $offset ), absint( $limit ) );

		return $sql;
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:22
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:22
giriqfky / giriqfky
0644
ListTable.php
12.46 KB
June 05 2025 16:54:44
giriqfky / giriqfky
0644
Log.php
5.275 KB
August 08 2024 19:32:00
giriqfky / giriqfky
0644
Record.php
4.28 KB
November 28 2023 16:59:36
giriqfky / giriqfky
0644
RecordQuery.php
1.819 KB
September 26 2024 15:36:36
giriqfky / giriqfky
0644
Records.php
1.939 KB
February 03 2022 16:56:54
giriqfky / giriqfky
0644
Repository.php
5.949 KB
November 07 2024 17:15:50
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF