|
Server : Apache System : Linux vps-1289444.devslamantis.cl 3.10.0-1160.139.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Nov 3 13:30:41 UTC 2025 x86_64 User : vspt ( 1013) PHP Version : 7.4.33 Disable Function : NONE Directory : /home/vspt/public_html/tarapaca.vsptdigital.cl/wp-content/plugins/winwheel4wp/lib/ |
<?php
if ( ! defined( 'ABSPATH' ) ) { exit; }
class winwheel4wp_ace_engine {
private $db_run_log_table;
public function __construct( $config ) {
$this->db_run_log_table = $config;
}
public function count_spins( $args ) {
global $wpdb;
return $wpdb->get_row($wpdb->prepare('SELECT COUNT(*) as count FROM '.$this->db_run_log_table.' WHERE wheel_id = %s AND '.$args['column'].' = %s AND timestamp > %s AND skip_counting = 0',
$args['wheel_hash'],
$args['form_data'],
time() - ($args['max_age'])))->count;
}
public function last_timestamp( $args ) {
global $wpdb;
return $wpdb->get_row($wpdb->prepare('SELECT timestamp FROM '.$this->db_run_log_table.' WHERE wheel_id = %s AND '.$args['column'].' = %s AND skip_counting = 0 ORDER BY timestamp DESC',
$args['wheel_hash'],
$args['form_data']))->timestamp;
}
public function remaining_minutes( $args ) {
return ceil((($args['max_age']) - (time() - $this->last_timestamp( $args ) ))/60);
}
}