Marketplace
1 month ago
PluginSuggestions
2 months ago
TrackingSettings
1 month ago
views
1 month ago
AccessSettings.php
4 years ago
AdBlockDetector.php
6 months ago
Admin.php
1 month ago
AdminSettings.php
2 months ago
AdminSettingsInterface.php
6 years ago
AdvancedSettings.php
10 months ago
Chart.php
1 month ago
CookieConsent.php
4 years ago
Dashboard.php
2 months ago
ExclusionSettings.php
6 months ago
GeolocationSettings.php
2 years ago
GetStarted.php
2 months ago
ImportWpStatistics.php
2 months ago
Info.php
2 months ago
InvalidIpException.php
4 years ago
Marketplace.php
1 month ago
MarketplaceSetupWizard.php
1 month ago
MarketplaceSetupWizardBody.php
1 month ago
MatomoPage.php
2 months ago
MatomoPageContent.php
2 months ago
Menu.php
1 month ago
PluginMeasurableSettings.php
2 years ago
PrivacySettings.php
1 year ago
SafeModeMenu.php
2 months ago
Summary.php
2 months ago
SystemReport.php
1 month ago
TrackingSettings.php
1 month ago
WhatsNewNotifications.php
2 months ago
Chart.php
27 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package matomo |
| 4 | */ |
| 5 | namespace WpMatomo\Admin; |
| 6 | |
| 7 | use WpMatomo\Feature; |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; // if accessed directly |
| 11 | } |
| 12 | |
| 13 | class Chart extends Feature { |
| 14 | public function register_hooks() { |
| 15 | add_action( 'matomo_load_chartjs', [ $this, 'load_chartjs' ] ); |
| 16 | } |
| 17 | |
| 18 | public function load_chartjs() { |
| 19 | wp_enqueue_script( 'chart.js', plugins_url( 'node_modules/chart.js/dist/chart.min.js', MATOMO_ANALYTICS_FILE ), [], matomo_get_asset_version(), true ); |
| 20 | wp_enqueue_script( 'matomo_chart.js', plugins_url( 'assets/chart.js', MATOMO_ANALYTICS_FILE ), [], matomo_get_asset_version(), true ); |
| 21 | } |
| 22 | |
| 23 | public function is_active() { |
| 24 | return is_admin(); |
| 25 | } |
| 26 | } |
| 27 |