PluginProbe
Independent Analytics – WordPress Analytics Plugin / 2.13.5
Independent Analytics – WordPress Analytics Plugin v2.13.5
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 All 120 releases
independent-analytics / IAWP / AJAX / Import_Reports.php
Import_Reports.php
37 lines 846 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IAWP\AJAX;
4
5 use IAWP\Report_Finder;
6 use IAWP\Report_Options_Parser;
7 /** @internal */
8 class Import_Reports extends \IAWP\AJAX\AJAX
9 {
10 /**
11 * @inheritDoc
12 */
13 protected function action_required_fields() : array
14 {
15 return ['json'];
16 }
17 /**
18 * @inheritDoc
19 */
20 protected function action_name() : string
21 {
22 return 'iawp_import_reports';
23 }
24 /**
25 * @inheritDoc
26 */
27 protected function action_callback() : void
28 {
29 $report_archive = \json_decode(\stripslashes($_POST['json']), \true);
30 foreach ($report_archive['reports'] as $report) {
31 $report_options = new Report_Options_Parser($report);
32 Report_Finder::new()->insert_report($report_options->get_options_for_creating());
33 }
34 \wp_send_json_success([]);
35 }
36 }
37