| Server IP : 35.236.43.222 / Your IP : 216.73.216.143 Web Server : Apache System : Linux order-form-vm-001 5.10.0-37-cloud-amd64 #1 SMP Debian 5.10.247-1 (2025-12-11) x86_64 User : deploy ( 1002) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/mastersystem.app/public/wp-content/plugins/koko-analytics/src/ |
Upload File : |
<?php
/**
* @package koko-analytics
* @license GPL-3.0+
* @author Danny van Kooten
*/
namespace KokoAnalytics;
use KokoAnalytics\Admin\Actions;
use WP_CLI;
class Command
{
/**
* Aggregates stats from the pageview buffer file into permanent storage
*
* ## EXAMPLES
*
* wp koko-analytics aggregate
*
* @param array $args
* @param array $assoc_args
*/
public function aggregate($args, $assoc_args)
{
WP_CLI::line('Aggregating data...');
(new Aggregator())->run();
WP_CLI::success('Data aggregated');
}
/**
* Removes data older than the treshold specified on the settings page
*/
public function prune($args, $assoc_args)
{
WP_CLI::line('Pruning data...');
do_action('koko_analytics_prune_data');
WP_CLI::success('Data pruned');
}
/**
* Migrates the post_stats database qtable to the new v2 structure.
*/
public function migrate_post_stats_to_v2($args, $assoc_args)
{
WP_CLI::line('Migrating post stats...');
(new Actions())->migrate_post_stats_to_v2();
WP_CLI::success('Post stats migrated');
}
/**
* Migrates referrer stats to the new v2 format.
*/
public function migrate_referrer_stats_to_v2($args, $assoc_args)
{
WP_CLI::line('Migrating referrer stats...');
(new Actions())->migrate_referrer_stats_to_v2();
WP_CLI::success('Referrer stats migrated');
}
}