<commit_before><?php namespace RainLab\GoogleAnalytics;

/**
 * The plugin.php file (called the plugin initialization script) defines the plugin information class.
 */

use System\Classes\PluginBase;

class Plugin extends PluginBase
{

    public function pluginDetails()
    {
        return [
            'name'        => 'Google Analytics',
            'description' => 'rainlab.googleanalytics::lang.strings.plugin_desc',
            'author'      => '<NAME>, <NAME>',
            'icon'        => 'icon-bar-chart-o'
        ];
    }

    public function registerComponents()
    {
        return [
            '\RainLab\GoogleAnalytics\Components\Tracker' => 'googleTracker'
        ];
    }

    public function registerPermissions()
    {
        return [
            'rainlab.googleanalytics.access_settings' => [
                'tab'   => 'rainlab.googleanalytics::lang.permissions.tab',
                'label' => 'rainlab.googleanalytics::lang.permissions.settings',
            ],
        ];
    }

    public function registerReportWidgets()
    {
        return [
            'RainLab\GoogleAnalytics\ReportWidgets\TrafficOverview'=>[
                'label'   => 'Google Analytics traffic overview',
                'context' => 'dashboard'
            ],
            'RainLab\GoogleAnalytics\ReportWidgets\TrafficSources'=>[
                'label'   => 'Google Analytics traffic sources',
                'context' => 'dashboard'
            ],
            'RainLab\GoogleAnalytics\ReportWidgets\Browsers'=>[
                'label'   => 'Google Analytics browsers',
                'context' => 'dashboard'
            ],
            'RainLab\GoogleAnalytics\ReportWidgets\TrafficGoal'=>[
                'label'   => 'Google Analytics traffic goal',
                'context' => 'dashboard'
            ],
            'RainLab\GoogleAnalytics\ReportWidgets\TopPages'=>[
                'label'   => 'Google Analytics top pages',
                'context' => 'dashboard'
            ]
        ];
    }

    public function registerSettings()
    {
        return [
            'config' => [
                'label'       => 'Google Analytics',
                'icon'        => 'icon-bar-chart-o',
                'description' => 'rainlab.googleanalytics::lang.strings.settings_desc',
                'class'       => 'RainLab\GoogleAnalytics\Models\Settings',
                'permissions' => ['rainlab.googleanalytics.settings'],
                'order'       => 600
            ]
        ];
    }

    public function boot()
    {
        set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__.'/vendor/google/apiclient/src');
    }
}<commit_msg>Fix used permission key<commit_after><?php namespace RainLab\GoogleAnalytics;

/**
 * The plugin.php file (called the plugin initialization script) defines the plugin information class.
 */

use System\Classes\PluginBase;

class Plugin extends PluginBase
{

    public function pluginDetails()
    {
        return [
            'name'        => 'Google Analytics',
            'description' => 'rainlab.googleanalytics::lang.strings.plugin_desc',
            'author'      => '<NAME>, <NAME>',
            'icon'        => 'icon-bar-chart-o'
        ];
    }

    public function registerComponents()
    {
        return [
            '\RainLab\GoogleAnalytics\Components\Tracker' => 'googleTracker'
        ];
    }

    public function registerPermissions()
    {
        return [
            'rainlab.googleanalytics.access_settings' => [
                'tab'   => 'rainlab.googleanalytics::lang.permissions.tab',
                'label' => 'rainlab.googleanalytics::lang.permissions.settings',
            ],
        ];
    }

    public function registerReportWidgets()
    {
        return [
            'RainLab\GoogleAnalytics\ReportWidgets\TrafficOverview'=>[
                'label'   => 'Google Analytics traffic overview',
                'context' => 'dashboard'
            ],
            'RainLab\GoogleAnalytics\ReportWidgets\TrafficSources'=>[
                'label'   => 'Google Analytics traffic sources',
                'context' => 'dashboard'
            ],
            'RainLab\GoogleAnalytics\ReportWidgets\Browsers'=>[
                'label'   => 'Google Analytics browsers',
                'context' => 'dashboard'
            ],
            'RainLab\GoogleAnalytics\ReportWidgets\TrafficGoal'=>[
                'label'   => 'Google Analytics traffic goal',
                'context' => 'dashboard'
            ],
            'RainLab\GoogleAnalytics\ReportWidgets\TopPages'=>[
                'label'   => 'Google Analytics top pages',
                'context' => 'dashboard'
            ]
        ];
    }

    public function registerSettings()
    {
        return [
            'config' => [
                'label'       => 'Google Analytics',
                'icon'        => 'icon-bar-chart-o',
                'description' => 'rainlab.googleanalytics::lang.strings.settings_desc',
                'class'       => 'RainLab\GoogleAnalytics\Models\Settings',
                'permissions' => ['rainlab.googleanalytics.access_settings'],
                'order'       => 600,
            ]
        ];
    }

    public function boot()
    {
        set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__.'/vendor/google/apiclient/src');
    }
}
{'fraction_non_alphanumeric': 0.12383612662942271, 'fraction_numerical': 0.0011173184357541898, 'mean_word_length': 1.731943031536114, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5025069', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1383, 'n_words': 239}