one-click-accessibility/modules/analytics/module.php
VasylD 38bdaef8b6
[APP-1107] Add dashboard for analytics (#204)
* [APP-1108][APP-1109][APP-1110] Add analytics backend logic

* [APP-1108][APP-1109][APP-1110] Add analytics backend logic

* Add nonce to the widget settings

* Update routes and DB table

* Fix comments

* Fix comments

* Fix comments

* Fix comments

* Fix comments

* Fix comments

* [APP-1107] Add dashboard for analytics

* [APP-1107] Add dashboard for analytics

* [APP-1107] Add dashboard for analytics

* [APP-1107] Add dashboard for analytics

* [APP-1107] Add dashboard for analytics

* [APP-1107] Add dashboard for analytics

* [APP-1107] Add dashboard for analytics

* [APP-1107] Add dashboard for analytics

* [APP-1107] Add dashboard for analytics

* [APP-1107] Add dashboard for analytics

* [APP-1201] add accessibility rules

* [APP-1107] fixed API endpoint

* [APP-1107] fixed API endpoint

* [APP-1107] fixed API endpoint

* [APP-1107] add check for is_active

* update to the latest

* update to the latest

* update to the latest

* fix bugs, add changes

* fix bugs, add changes

* fix bugs, add changes

* fix bugs, add changes
2025-03-17 12:26:52 +02:00

60 lines
1.2 KiB
PHP

<?php
namespace EA11y\Modules\Analytics;
use EA11y\Classes\Module_Base;
use EA11y\Modules\Analytics\Database\Analytics_Table;
use EA11y\Modules\Settings\Classes\Settings;
use EA11y\Modules\Settings\Module as SettingsModule;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
/**
* Class Module
*/
class Module extends Module_Base {
/**
* Get module name.
* Retrieve the module name.
* @access public
* @return string Module name.
*/
public function get_name(): string {
return 'analytics';
}
public static function component_list(): array {
return [
'Analytics_Daily',
];
}
public static function routes_list() : array {
return [
'Events',
'Statistic',
];
}
public static function is_active(): bool {
$plan_data = Settings::get( Settings::PLAN_DATA );
$is_analytics_enabled = Settings::get( Settings::ANALYTICS_SETTINGS );
return (
isset( $plan_data->plan->features->analytics ) &&
$plan_data->plan->features->analytics &&
$is_analytics_enabled
);
}
public function __construct() {
$this->register_components();
$this->register_routes();
// this make sure the database table is created and or updated when needed
Analytics_Table::install();
}
}