GRAYBYTE WORDPRESS FILE MANAGER9356

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/swamivivekananda.co.in/wp-content/plugins/wpforms/src/Logger/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


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

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.NoCaching
		//phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
		return (array) $wpdb->get_results(
			$this->build_query( $limit, $offset, $search, $type )
		);
		//phpcs:enable WordPress.DB.DirectDatabaseQuery.NoCaching
		//phpcs:enable 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 * 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 `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:29
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:29
giriqfky / giriqfky
0644
ListTable.php
11.328 KB
June 23 2025 07:12:39
giriqfky / giriqfky
0644
Log.php
4.653 KB
June 23 2025 07:12:39
giriqfky / giriqfky
0644
Record.php
4.262 KB
June 23 2025 07:12:39
giriqfky / giriqfky
0644
RecordQuery.php
1.609 KB
June 23 2025 07:12:39
giriqfky / giriqfky
0644
Records.php
1.736 KB
June 23 2025 07:12:39
giriqfky / giriqfky
0644
Repository.php
5.446 KB
June 23 2025 07:12:39
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF