| Server IP : 127.0.1.1 / Your IP : 127.0.0.1 Web Server : Apache/2.4.52 (Ubuntu) System : Linux sealall 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64 User : devops ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/domains/sealall.ca/wp-content/plugins/independent-analytics/IAWP/AJAX/ |
Upload File : |
<?php
namespace IAWP\AJAX;
use IAWP\Report_Finder;
use IAWP\Report_Options_Parser;
/** @internal */
class Import_Reports extends \IAWP\AJAX\AJAX
{
/**
* @inheritDoc
*/
protected function action_required_fields() : array
{
return ['json'];
}
/**
* @inheritDoc
*/
protected function action_name() : string
{
return 'iawp_import_reports';
}
/**
* @inheritDoc
*/
protected function requires_write_access() : bool
{
return \true;
}
protected function action_callback() : void
{
$report_archive = \json_decode(\stripslashes($_POST['json']), \true);
foreach ($report_archive['reports'] as $report) {
$report_options = new Report_Options_Parser($report);
Report_Finder::new()->insert_report($report_options->get_options_for_creating());
}
\wp_send_json_success([]);
}
}