/** * Number of attacks the user has made * * @return integer */ private function attack_count() { global $wpdb; $sql = $wpdb->prepare("SELECT COUNT(*) AS count FROM {$wpdb->posts} WHERE post_content = '%s' AND post_excerpt = 'repeat_attack'", HMWP_MS_Utils::ip_address()); $result = $wpdb->get_row($sql); return (int) $result->count; }
/** * Constructor * * @return void */ public function __construct() { $this->ip = HMWP_MS_Utils::ip_address(); }