function wp_auto_spinner_log() { global $wpdb; // FILTER $filter = ''; $filter_params = array(); if (isset($_POST['action_type'])) { $act = sanitize_text_field($_POST['action_type']); if ($act === 'Error') { $filter .= " action LIKE %s"; $filter_params[] = '%Error%'; } elseif ($act === 'approved') { $filter .= " action LIKE %s"; $filter_params[] = 'Comment approved%'; } } // Date filters if (isset($_POST['from']) && !empty($_POST['from'])) { $from = sanitize_text_field($_POST['from']); $filter .= ($filter ? ' AND ' : '') . " `date` >= %s"; $filter_params[] = date('Y-m-d H:i:s', strtotime($from)); } if (isset($_POST['to']) && !empty($_POST['to'])) { $to = sanitize_text_field($_POST['to']); $filter .= ($filter ? ' AND ' : '') . " `date` <= %s"; $filter_params[] = date('Y-m-d H:i:s', strtotime($to)); } // Records number $num = isset($_POST['number']) ? sanitize_text_field($_POST['number']) : '100'; $limit = ($num === 'all') ? '' : 'LIMIT %d'; if ($num !== 'all' && is_numeric($num)) { $filter_params[] = intval($num); } // Prepare query $query = $wpdb->prepare( "SELECT * FROM wp_auto_spinner_log WHERE $filter ORDER BY id DESC $limit", ...$filter_params ); $res = $wpdb->get_results($query); ?>
It is where you can find all actions done by the plugin
Index | Date | Type of action | Data Processed |
---|---|---|---|
Index | Date | Type of action | Data Processed |