', ''); // phpcs:ignore ?>
license = new MonsterInsights_License_Compat();
}
}
/**
* Loads MonsterInsights Auth
*
* Loads auth used by MonsterInsights
*
* @return void
* @since 7.0.0
* @access public
*
*/
public function load_auth() {
if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/auth.php';
self::$instance->auth = new MonsterInsights_Auth();
}
}
/**
* Loads all files into scope.
*
* @access public
* @return void
* @since 6.0.0
*
*/
public function require_files() {
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/capabilities.php';
if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
// Lite and Pro files
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'assets/lib/pandora/class-am-deactivation-survey.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/ajax.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/admin.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/common.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/notice.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/licensing/autoupdate.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/review.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/setup-checklist.php';
// Pages
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/settings.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/tools.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/reports.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/pages/addons.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/api-auth.php';
// Reports
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/reports/abstract-report.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/reports/overview.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/reports/site-summary.php';
// Reporting Functionality
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/reporting.php';
// Routes used by Vue
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/routes.php';
// Load gutenberg editor functions
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/gutenberg/gutenberg.php';
// Emails
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/emails/class-emails.php';
// Notifications class.
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/notifications.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/notification-event.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/notification-event-runner.php';
// Add notification manual events for lite version.
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/notifications/notification-events.php';
}
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/exclude-page-metabox.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/frontend/verified-badge/Controller.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/site-notes/Controller.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/api-request.php';
if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
// Late loading classes (self instantiating)
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/tracking.php';
}
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/frontend/frontend.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/frontend/seedprod.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/measurement-protocol-v4.php';
require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/admin/feature-feedback/class-monsterInsights-feature-feedback.php';
}
/**
* Get the tracking mode for the frontend scripts.
*
* @return string
* @deprecated Since 8.3 with the removal of ga compatibility
*/
public function get_tracking_mode() {
if ( ! isset( $this->tracking_mode ) ) {
// This will already be set to 'analytics' to anybody already using the plugin before 7.15.0.
$this->tracking_mode = monsterinsights_get_option( 'tracking_mode', 'gtag' );
}
return $this->tracking_mode;
}
}
/**
* Fired when the plugin is activated.
*
* @access public
*
* @param boolean $network_wide True if WPMU superadmin uses "Network Activate" action, false otherwise.
*
* @return void
* @global object $wpdb The WordPress database object.
* @since 6.0.0
*
* @global int $wp_version The version of WordPress for this install.
*/
function monsterinsights_lite_activation_hook( $network_wide ) {
$url = admin_url( 'plugins.php' );
// Check for MS dashboard
if ( is_network_admin() ) {
$url = network_admin_url( 'plugins.php' );
}
if ( class_exists( 'MonsterInsights' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die(sprintf(esc_html__('Please uninstall and remove MonsterInsights Pro before activating Google Analytics for WordPress by MonsterInsights. The Lite version has not been activated. %1$sClick here to return to the Dashboard%2$s.', 'google-analytics-by-wordpress'), '