At the beginning of the PHP that generates all the pages of my site is like
log_visitor_info(
$_SERVER['REMOTE_ADDR'],
$_SERVER['REQUEST_URI'],
$_SERVER['HTTP_REFERER'],
$_SERVER['HTTP_USER_AGENT']
);
which calls the function
function log_visitor_info ( $ip, $pgurl, $refurl, $aginfo )
{
global $wpdb, $ipsToIgnore;
if (!in_array($ip, $ipsToIgnore)) {
$wpdb->insert('wp_nas_visits', array(
'ip'=>$ip,
'refurl'=>$refurl,
'pgurl'=>$pgurl,
'aginfo'=>$aginfo
));
}
}
where the $wpdb->insert
is inserting something to the database. Because I don't need any of this info anywhere else in the page, I would prefer if it were possible to execute log_visitor_info
asynchronously or "in the background", if you will. I think it's slowing down my page loads. Is there some way that I can put log_visitor_info
on my server's queue that executes separately (if such a thing even exists ...) ? I have Windows Server 2012.