File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/notifications.tar
notification-audience.php 0000644 00000007707 15154233524 0011535 0 ustar 00 <?php
/**
* Add audience notification
* Recurrence: 30 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Audience extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_audience';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Build Notification
*
* @param array $notification
* @param array $data
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$data = $this->get_notification_data();
if ( ! is_array( $data ) || empty( $data ) ) {
return false;
}
$notification['title'] = sprintf(
/* translators: 1: Percentage of audience, 2: Country. */
__( '%1$s%% of Your Audience is From %2$s', 'google-analytics-for-wordpress' ),
$data['percentage'],
$data['country']
);
$notification['content'] = sprintf(
/* translators: Placeholders add a link to an article. */
__( 'Is your site properly translated? By adding translated content specific to your audience you could gain big boosts in pageviews, time spent on page and a reduced bounce rate.<br><br>If you need help choosing a translation plugin to get you started take a look at %1$sthis article%2$s for the best options available.', 'google-analytics-for-wordpress' ),
'<a href="' . $this->build_external_link( 'https://www.wpbeginner.com/showcase/9-best-translation-plugins-for-wordpress-websites/' ) . '" target="_blank">',
'</a>'
);
$notification['btns'] = array(
"view_report" => array(
'url' => $this->get_view_url( 'monsterinsights-report-top-countries', 'monsterinsights_reports' ),
'text' => __( 'View Report', 'google-analytics-for-wordpress' )
),
"learn_more" => array(
'url' => $this->build_external_link( 'https://www.wpbeginner.com/showcase/9-best-translation-plugins-for-wordpress-websites/' ),
'text' => __( 'Learn More', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
/**
* Add report to notifications
*
* @since 7.12.3
*/
public function get_notification_data() {
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
$data = array();
$report = $this->get_report();
$sessions = isset( $report['data']['infobox']['sessions']['value'] ) ? $report['data']['infobox']['sessions']['value'] : 0;
$countries = isset( $report['data']['countries'] ) ? $report['data']['countries'] : 0;
$english_speaking_countries = monsterinsights_get_english_speaking_countries();
if ( $sessions > 0 && is_array( $countries ) && ! empty( $countries ) ) {
foreach ( $countries as $country ) {
if ( empty( $country['iso'] ) || array_key_exists( $country['iso'], $english_speaking_countries ) ) {
continue;
}
if ( $country['sessions'] > 0 ) {
// get the country's session percentage by comparing with the total sessions
$country_session_percentage = round( $country['sessions'] * 100 / $sessions );
if ( $country_session_percentage < 15 ) {
continue;
}
$site_language = get_locale();
$translations = wp_get_available_translations();
if ( is_array( $translations ) && ! empty( $translations ) ) {
$site_iso = isset( $translations[ $site_language ]['iso'] ) ? $translations[ $site_language ]['iso'] : array(); // keep empty array, because site language has no iso setup for en_US language
if ( is_array( $site_iso ) && ! in_array( $country['iso'], $site_iso ) ) {
$data['country'] = $country['name'];
$data['percentage'] = $country_session_percentage;
break;
}
}
}
}
}
return $data;
}
}
// initiate the class
new MonsterInsights_Notification_Audience();
notification-bounce-rate.php 0000644 00000004637 15154233524 0012163 0 ustar 00 <?php
/**
* Add notification when bounce rate is higher than 70%
* Recurrence: Once weekly
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Bounce_Rate extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_bounce_rate';
public $notification_interval = 30; // In days.
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Build Notification data.
*
* @param array $notification The notification data array to filter.
*
* @return array|bool $notification notification is ready to add or false if no data.
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$report = $this->get_report( 'overview' );
$bounce_rate = isset( $report['data']['infobox']['bounce']['value'] ) ? $report['data']['infobox']['bounce']['value'] : 0;
if ( $bounce_rate ) {
$is_em = function_exists( 'ExactMetrics' );
$learn_more_url = 'https://www.monsterinsights.com/how-to-reduce-bounce-rate/';
$notification['title'] = sprintf(
/* translators: Bounce rate. */
__( 'Your Website Bounce Rate is Higher Than %s', 'google-analytics-for-wordpress' ),
$bounce_rate
);
// Translators: Bounce rate notification content.
$notification['content'] = sprintf( __( 'Your site\'s bounce rate is %1$s. Double check your site is working properly and be sure it loads quickly. %2$sHere%3$s are some points to remember and steps to follow to get your bounce rates back to manageable levels.', 'google-analytics-for-wordpress' ), $bounce_rate, '<a href="' . $this->build_external_link( 'https://www.monsterinsights.com/how-to-reduce-bounce-rate/' ) . '" target="_blank">', '</a>' );
$notification['btns'] = array(
'view_report' => array(
'url' => $this->get_view_url( 'monsterinsights-report-infobox-bounce-rate', 'monsterinsights_reports' ),
'text' => __( 'View Report', 'google-analytics-for-wordpress' ),
),
);
if ( ! $is_em ) {
$notification['btns']['learn_more'] = array(
'url' => $this->build_external_link( $learn_more_url ),
'text' => __( 'Learn More', 'google-analytics-for-wordpress' ),
'is_external' => true,
);
}
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_Bounce_Rate(); notification-events.php 0000644 00000005441 15154233524 0011255 0 ustar 00 <?php
$base = MonsterInsights();
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-install-user-feedback.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-visitors.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-audience.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-mobile-device-high-traffic.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-mobile-device-low-traffic.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-upgrade-to-pro.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-upgrade-to-pro-high-traffic.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-bounce-rate.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-returning-visitors.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-traffic-dropping.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-upgrade-for-post-templates.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-upgrade-for-events-reporting.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-upgrade-for-search-console.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-upgrade-for-form-conversion.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-upgrade-for-email-summaries.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-upgrade-for-custom-dimensions.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-upgrade-eu-traffic.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-to-add-more-file-extensions.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-to-setup-affiliate-links.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-headline-analyzer.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-install-optinmonster.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-install-aioseo.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-install-wp-forms.php';
require_once plugin_dir_path( $base->file ) . '/includes/admin/notifications/notification-multiple-gtags.php';
notification-headline-analyzer.php 0000644 00000003471 15154233524 0013346 0 ustar 00 <?php
/**
* Add notification for headline analyzer
* Recurrence: 60 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Headline_Analyzer extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_headline_analyzer';
public $notification_interval = 60; // in days
public $notification_first_run_time = '+7 day';
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$is_em = defined( 'EXACTMETRICS_VERSION' );
$learn_more_url = $is_em
? 'https://www.exactmetrics.com/headline-analyzer/'
: 'https://www.monsterinsights.com/headline-analyzer/';
$notification['title'] = __( 'Try the Headline Analyzer to Boost Your Clicks & Traffic', 'google-analytics-for-wordpress' );
// Translators: Headline Analyzer notification content.
$notification['content'] = sprintf( __( 'Try the %1$sMonsterInsights Headline Analyzer%2$s tool. We built it to help increase engagement and make your content get more traffic from search engines.', 'google-analytics-for-wordpress' ), '<a href="' . $this->build_external_link( 'https://www.monsterinsights.com/announcing-monsterinsights-new-headline-analyzer/' ) . '" target="_blank">', '</a>' );
$notification['btns'] = array(
"learn_more" => array(
'url' => $this->build_external_link( $learn_more_url ),
'text' => __( 'Learn More', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Headline_Analyzer();
notification-install-aioseo.php 0000644 00000002305 15154233524 0012670 0 ustar 00 <?php
/**
* Add notification after 1 week of lite version installation
* Recurrence: 40 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Install_AIOSEO extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_install_aioseo';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_icon = 'star';
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$seo_plugin_active = function_exists( 'YoastSEO' ) || function_exists( 'aioseo' );
if ( ! $seo_plugin_active ) {
$notification['title'] = __( 'Install All-In-One SEO', 'google-analytics-for-wordpress' );
$notification['content'] = __( 'Install All in One SEO to optimize your site for better search engine rankings.', 'google-analytics-for-wordpress' );
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_Install_AIOSEO();
notification-install-optinmonster.php 0000644 00000002611 15154233524 0014152 0 ustar 00 <?php
/**
* Add notification after 1 week of lite version installation
* Recurrence: 40 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Install_OptinMonster extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_install_optinmonster';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_icon = 'star';
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$report = $this->get_report();
$sessions = isset( $report['data']['infobox']['sessions']['value'] ) ? $report['data']['infobox']['sessions']['value'] : 0;
$om_plugin_active = class_exists( 'OMAPI' );
if ( $sessions > 1000 && ! $om_plugin_active ) {
$notification['title'] = __( 'Increase Engagement on Your Site', 'google-analytics-for-wordpress' );
$notification['content'] = __( 'Get more leads and subscribers from your traffic by creating engaging campaigns with OptinMonster.', 'google-analytics-for-wordpress' );
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_Install_OptinMonster();
notification-install-user-feedback.php 0000644 00000004312 15154233524 0014111 0 ustar 00 <?php
/**
* Add userfeedback install and activate notifications.
* Recurrence: 30 Days
*
* @since 8.14
*/
final class MonsterInsights_Notification_Install_User_Feedback extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_install_user_feedback';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_icon = 'lightning';
public $notification_category = 'insight';
public $notification_priority = 1;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 8.14
*/
public function prepare_notification_data( $notification ) {
$is_em = class_exists( 'ExactMetrics' ) || class_exists( 'ExactMetrics_Lite' );
$uf_plugin_active = class_exists( 'UserFeedback_Base' );
if( ! $uf_plugin_active ) {
// Translators: user feedback notification title
$notification['title'] = sprintf( __( 'What Are Your Users Really Thinking?', 'google-analytics-for-wordpress' ) );
// Translators: user feedback notification content
$notification['content'] = sprintf( __( 'MonsterInsights tells you WHAT your website visitors are doing on your website, but our latest plugin, UserFeedback, tells you WHY. Use its short surveys to make more money, increase engagement, and grow your business faster with candid customer feedback.', 'google-analytics-for-wordpress' ) );
if ( $is_em ) {
// Translators: user feedback notification content
$notification['content'] = sprintf( __( 'ExactMetrics tells you WHAT your website visitors are doing on your website, but UserFeedback tells you WHY. Use its short surveys to make more money, increase engagement, and grow your business faster with candid customer feedback.', 'google-analytics-for-wordpress' ) );
}
$notification['btns'] = array(
"cta_install_user_feedback" => array(
'url' => $this->get_view_url( false, 'userfeedback_onboarding' ),
'text' => __( 'Install & Activate', 'google-analytics-for-wordpress' ),
),
);
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_Install_User_Feedback();
notification-install-wp-forms.php 0000644 00000002362 15154233524 0013166 0 ustar 00 <?php
/**
* Add notification after 1 week of lite version installation
* Recurrence: 40 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Install_WPForms extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_install_wpforms';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_icon = 'star';
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$form_plugin_active = class_exists( 'GFAPI' ) || function_exists( 'frm_forms_autoloader' ) || function_exists( 'wpforms' );
if ( ! $form_plugin_active ) {
$notification['title'] = __( 'Create a Contact Form in Only Minutes', 'google-analytics-for-wordpress' );
$notification['content'] = __( 'Install WPForms and create contact forms in a matter of minutes.', 'google-analytics-for-wordpress' );
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_Install_WPForms();
notification-mobile-device-high-traffic.php 0000644 00000003514 15154233524 0015005 0 ustar 00 <?php
/**
* Add notification when percentage of visitors from mobile devices is more than 70%
* Recurrence: 30 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Mobile_Device_High_Traffic extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_mobile_device_high_traffic';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Prepare Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$report = $this->get_report( 'overview', $this->report_start_from, $this->report_end_to );
$mobile_traffic = isset( $report['data']['devices']['mobile'] ) ? $report['data']['devices']['mobile'] : 0;
$tablet_traffic = isset( $report['data']['devices']['tablet'] ) ? $report['data']['devices']['tablet'] : 0;
$total_mobile_traffic_percentage = $mobile_traffic + $tablet_traffic;
if ( $total_mobile_traffic_percentage > 70 ) {
// Translators: Mobile device notification title
$notification['title'] = sprintf( __( 'Traffic From Mobile Devices is %s%%', 'google-analytics-for-wordpress' ), $total_mobile_traffic_percentage );
// Translators: Mobile device notification content
$notification['content'] = sprintf( __( 'In the last 30 days, your site has received %s%% of traffic through a mobile or tablet device. Make sure your site is optimized for these visitors to maximize engagement.', 'google-analytics-for-wordpress' ), $total_mobile_traffic_percentage );
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_Mobile_Device_High_Traffic();
notification-mobile-device-low-traffic.php 0000644 00000005007 15154233524 0014666 0 ustar 00 <?php
/**
* Add notification when percentage of visitors from mobile device is less than 10%
* Recurrence: 15 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Mobile_Device_Low_Traffic extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_mobile_device';
public $notification_interval = 15; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Prepare Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$data = array();
$report = $this->get_report( 'overview', $this->report_start_from, $this->report_end_to );
$data['percentage_of_mobile_visitors'] = isset( $report['data']['devices']['mobile'] ) ? $report['data']['devices']['mobile'] : 0;
if ( ! empty( $data ) && $data['percentage_of_mobile_visitors'] < 10 ) {
// Translators: Mobile device notification title
$notification['title'] = sprintf( __( 'Traffic From Mobile Devices %s%%', 'google-analytics-for-wordpress' ), $data['percentage_of_mobile_visitors'] );
/* translators: Placeholders add a link to an article. */
$notification['content'] = sprintf( __( 'Traffic from mobile devices is considerably lower on your site compared to desktop devices. This could be an indicator that your site is not optimised for mobile devices.<br><br>Take a look now at %1$sshow your site looks%2$s on mobile and make sure all your content can be accessed correctly.', 'google-analytics-for-wordpress' ), '<a href="' . $this->build_external_link( 'https://www.wpbeginner.com/beginners-guide/how-to-preview-the-mobile-layout-of-your-site/' ) . '" target="_blank">', '</a>' );
$notification['btns'] = array(
"view_report" => array(
'url' => $this->get_view_url( 'devices', 'monsterinsights_reports' ),
'text' => __( 'View Report', 'google-analytics-for-wordpress' )
),
"learn_more" => array(
'url' => $this->build_external_link( 'https://www.wpbeginner.com/beginners-guide/how-to-preview-the-mobile-layout-of-your-site/' ),
'text' => __( 'Learn More', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_Mobile_Device_Low_Traffic();
notification-multiple-gtags.php 0000644 00000002647 15154233524 0012714 0 ustar 00 <?php
class MonsterInsights_Notification_Multiple_Gtags extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_multiple_gtags';
public $notification_interval = 30;
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'alert';
public $notification_icon = 'warning';
public $notification_priority = 1;
public function prepare_notification_data( $notification ) {
$response = wp_remote_get( site_url() );
if ( is_array( $response ) ) {
$content = $response['body'];
$document = new DOMDocument();
libxml_use_internal_errors( true );
@$document->loadHTML( $content );
libxml_clear_errors();
$gtag_count = 0;
foreach ( $document->getElementsByTagName( 'script' ) as $script ) {
$script_src = $script->getAttribute( 'src' );
if ( preg_match( "/googletagmanager.com\/gtag\/js/i", $script_src ) ) {
$gtag_count ++;
}
}
if ( $gtag_count < 2 ) {
return false;
}
$notification['title'] = __( "Multiple Google Analytics Tags Found", "google-analytics-for-wordpress" );
$notification['content'] = __( "MonsterInsights has detected multiple analytics tags on your website. Please disable the other plugin to ensure accurate tracking.", 'google-analytics-for-wordpress' );
return $notification;
}
return false;
}
}
new MonsterInsights_Notification_Multiple_Gtags();
notification-returning-visitors.php 0000644 00000004067 15154233524 0013651 0 ustar 00 <?php
/**
* Add notification when returning visitor rate is lower than 10%
* Recurrence: 15 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Returning_Visitors extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_returning_visitors';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$report = $this->get_report( 'overview', $this->report_start_from, $this->report_end_to );
$returning = isset( $report['data']['newvsreturn']['returning'] ) ? $report['data']['newvsreturn']['returning'] : 0;
if ( $returning < 25 ) {
$is_em = function_exists( 'ExactMetrics' );
$learn_more_url = 'https://www.monsterinsights.com/optinmonster-review/';
// Translators: Returning visitors notification title
$notification['title'] = sprintf( __( 'Only %s%% of Your Visitors Return to Your Site', 'google-analytics-for-wordpress' ), $returning );
// Translators: Returning visitors notification content
$notification['content'] = sprintf( __( 'Your site has received a low number of returning users over the past 30 days. Try a tool like %1$sOptinMonster%2$s to increase engagement.', 'google-analytics-for-wordpress' ), '<a href="' . $this->build_external_link( 'https://www.monsterinsights.com/optinmonster-review/' ) . '" target="_blank">', '</a>' );
if ( ! $is_em ) {
$notification['btns'] = array(
'learn_more' => array(
'url' => $this->build_external_link( $learn_more_url ),
'text' => __( 'Learn More', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
}
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_Returning_Visitors(); notification-to-add-more-file-extensions.php 0000644 00000004547 15154233524 0015201 0 ustar 00 <?php
/**
* Add notification when there is no extension added or only the default extensions exist
* Recurrence: 20 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_To_Add_More_File_Extensions extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_to_add_more_file_extensions';
public $notification_interval = 20; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$download_extensions = monsterinsights_get_option( 'extensions_of_files', '' );
if ( empty( $download_extensions ) || "doc,pdf,ppt,zip,xls,docx,pptx,xlsx" === $download_extensions ) {
$settings_url = is_network_admin() ? $this->get_view_url( 'monsterinsights-settings-block-file-downloads', 'monsterinsights_network', 'engagement' ) : $this->get_view_url( 'monsterinsights-settings-block-file-downloads', 'monsterinsights_settings', 'engagement' );
$publishers_report_url = $this->get_view_url( 'monsterinsights-report-download-links', 'monsterinsights_reports', 'publishers' );
$notification['title'] = __( 'Track Your Website Downloads', 'google-analytics-for-wordpress' );
$notification['content'] = sprintf(
/* translators: Placeholders add links to settings pages. */
__( 'By default, MonsterInsights automatically tracks downloads of the following file extensions: doc, pdf, ppt, zip, xls, docx, pptx, and xlsx. You can easily add or remove extensions from that list in the %1$sEngagement settings%2$s of MonsterInsights.<br><br> You can view your Top Downloads report directly in the MonsterInsights %3$sPublishers report%4$s.', 'google-analytics-for-wordpress' ),
'<a href="' . $settings_url . '">',
'</a>',
'<a href="' . $publishers_report_url . '">',
'</a>'
);
$notification['btns'] = array(
"add_more_file_extensions" => array(
'url' => $settings_url,
'text' => __( 'Add File Extensions', 'google-analytics-for-wordpress' )
),
);
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_To_Add_More_File_Extensions();
notification-to-setup-affiliate-links.php 0000644 00000005174 15154233524 0014574 0 ustar 00 <?php
/**
* Add notification when no links set up for Affiliate tracking or just the default links exist
* Recurrence: 25 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_To_Setup_Affiliate_Links extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_to_setup_affiliate_links';
public $notification_interval = 25; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$affiliate_links = monsterinsights_get_option( 'affiliate_links', array() );
$no_new_links = false;
if ( is_array( $affiliate_links ) && ! empty( $affiliate_links ) ) {
if ( 2 === count( $affiliate_links ) && isset( $affiliate_links[0]['path'] ) && isset( $affiliate_links[1]['path'] ) ) {
$no_new_links = "/go/" === $affiliate_links[0]['path'] && "/recommend/" === $affiliate_links[1]['path'] ? true : false;
}
}
if ( true === $no_new_links || ( is_array( $affiliate_links ) && empty( $affiliate_links ) ) ) {
$is_em = defined( 'EXACTMETRICS_VERSION' );
$learn_more_url = $is_em
? 'https://www.exactmetrics.com/how-to-set-up-affiliate-link-tracking-in-wordpress/'
: 'https://www.monsterinsights.com/how-to-set-up-affiliate-link-tracking-in-wordpress/';
$notification['title'] = __( 'Set Up Affiliate Link Tracking', 'google-analytics-for-wordpress' );
$notification['content'] = sprintf(
/* translators: Placeholders add a link to an article. */
__( 'By tracking your affiliate links in Google Analytics, you can gather all the data you need to optimize your links for maximizing affiliate revenue. You can track affiliate link clicks on your website with little configuration needed.<br><br>%1$sIn this article%2$s, we’ll show you how to set up affiliate link tracking in WordPress.', 'google-analytics-for-wordpress' ),
'<a href="' . $this->build_external_link( 'https://www.monsterinsights.com/how-to-set-up-affiliate-link-tracking-in-wordpress/' ) . '" target="_blank">',
'</a>'
);
$notification['btns'] = array(
"read_more" => array(
'url' => $this->build_external_link( $learn_more_url ),
'text' => __( 'Read More', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_To_Setup_Affiliate_Links();
notification-traffic-dropping.php 0000644 00000005057 15154233524 0013212 0 ustar 00 <?php
/**
* Add notification when the number of total sessions is less than the previous 30 days.
* Recurrence: 30 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Traffic_Dropping extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_traffic_dropping';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$data = array();
$report = $this->get_report();
$data['prev_sessions_difference'] = isset( $report['data']['infobox']['sessions']['prev'] ) ? $report['data']['infobox']['sessions']['prev'] : 0;
if ( ! empty( $data ) && $data['prev_sessions_difference'] < 0 ) {
$is_em = function_exists( 'ExactMetrics' );
$learn_more_url = $is_em
? 'https://www.exactmetrics.com/epic-list-of-marketing-hacks-for-explosive-traffic-growth/'
: 'https://www.monsterinsights.com/marketing-hacks-guaranteed-to-grow-your-traffic/';
$notification['title'] = __( 'Your Website Traffic is Dropping', 'google-analytics-for-wordpress' );
// Translators: Traffic dropping notification content
$notification['content'] = sprintf( __( 'Your website traffic is decreasing and that’s a reason to take action now. Less traffic means less opportunities to make your brand known, make relationships and ultimately sell your service or product. <br><br>Follow the marketing hacks of %1$sthis article%2$s to start growing your traffic again.', 'google-analytics-for-wordpress' ), '<a href="' . $this->build_external_link( 'https://www.monsterinsights.com/marketing-hacks-guaranteed-to-grow-your-traffic/' ) . '" target="_blank">', '</a>' );
$notification['btns'] = array(
'learn_more' => array(
'url' => $this->build_external_link( $learn_more_url ),
'text' => __( 'Learn More', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
'view_report' => array(
'url' => $this->get_view_url( 'monsterinsights-report-overview', 'monsterinsights_reports' ),
'text' => __( 'View Report', 'google-analytics-for-wordpress' ),
),
);
return $notification;
}
return false;
}
}
// initialize the class
new MonsterInsights_Notification_Traffic_Dropping(); notification-upgrade-eu-traffic.php 0000644 00000004365 15154233524 0013427 0 ustar 00 <?php
/**
* Add notification for high EU Traffic
* Recurrence: 30 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Upgrade_EU_Traffic extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_eu_traffic';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite' );
public $notification_icon = 'star';
public $notification_category = 'insight';
public $notification_priority = 1;
/**
* Build Notification
*
* @return array|false $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$eu_countries = [
'AT',
'BE',
'BG',
'HR',
'CY',
'CZ',
'DK',
'EE',
'FI',
'FR',
'DE',
'GR',
'HU',
'IE',
'IT',
'LU',
'MT',
'NL',
'PL',
'PT',
'RO',
'SK',
'SI',
'ES',
'SE'
];
$report = $this->get_report();
if ( ! $report || ! $report['success'] ) {
return false;
}
$sessions = isset( $report['data']['infobox']['sessions']['value'] ) ? $report['data']['infobox']['sessions']['value'] : 0;
$all_countries = isset( $report['data']['countries'] ) ? $report['data']['countries'] : [];
$eu_sessions = 0;
foreach ( $all_countries as $country ) {
if ( in_array( $country['iso'], $eu_countries ) ) {
$eu_sessions += intval( $country['sessions'] );
}
}
if ( empty( $sessions ) ) {
return false;
}
$eu_sessions_percentage = $eu_sessions / $sessions * 100;
if ( $eu_sessions_percentage < 1 ) {
return false;
}
$notification['title'] = __( 'Help Your Site Become GDPR Compliant', 'google-analytics-for-wordpress' );
$notification['content'] = __( 'Your site is receiving traffic from the EU. Help ensure your site is more compliant with GDPR by upgrading to MonsterInsights Pro and enable our EU Privacy addon.', 'google-analytics-for-wordpress' );
$notification['btns'] = array(
"get_monsterinsights_pro" => array(
'url' => $this->get_upgrade_url(),
'text' => __( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
new MonsterInsights_Notification_Upgrade_EU_Traffic();
notification-upgrade-for-custom-dimensions.php 0000644 00000002745 15154233524 0015646 0 ustar 00 <?php
/**
* Add notification when lite version activated
* Recurrence: 20 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Upgrade_For_Custom_Dimensions extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_upgrade_for_custom_dimensions';
public $notification_interval = 20; // in days
public $notification_type = array( 'basic', 'lite', 'plus' );
public $notification_icon = 'star';
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$notification['title'] = __( 'Upgrade to MonsterInsights Pro', 'google-analytics-for-wordpress' );
// Translators: upgrade for form conversion notification content
$notification['content'] = __( 'Upgrade to enable Custom Dimensions. Track logged in users, determine when is your best time to post, measure if your SEO strategy is working, and find your most popular author.', 'google-analytics-for-wordpress' );
$notification['btns'] = array(
"get_monsterinsights_pro" => array(
'url' => $this->get_upgrade_url(),
'text' => __( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Upgrade_For_Custom_Dimensions();
notification-upgrade-for-email-summaries.php 0000644 00000003453 15154233524 0015255 0 ustar 00 <?php
/**
* Add notification when lite version activated
* Recurrence: 30 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Upgrade_For_Email_Summaries extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_upgrade_for_email_summaries';
public $notification_interval = 30; // in days
public $notification_type = array( 'lite' );
public $notification_icon = 'warning';
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$notification['title'] = __( 'Get Weekly Email Reports', 'google-analytics-for-wordpress' );
$notification['content'] = sprintf(
/* translators: Placeholders add a link to an article. */
__( 'Wouldn’t it be easy if you could get your website’s performance report in your email inbox every week? With Email Summaries, you can view all your important stats in a simple report that’s delivered straight to your inbox. <br><br>You get an overview of your site\'s performance without logging in to WordPress or going through different analytics reports. %1$sUpgrade to MonsterInsights Pro%2$s to enable the Email Summaries feature.', 'google-analytics-for-wordpress' ),
'<a href="' . $this->get_upgrade_url() . '" target="_blank">',
'</a>'
);
$notification['btns'] = array(
"get_monsterinsights_pro" => array(
'url' => $this->get_upgrade_url(),
'text' => __( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Upgrade_For_Email_Summaries();
notification-upgrade-for-events-reporting.php 0000644 00000002632 15154233524 0015474 0 ustar 00 <?php
/**
* Add notification when lite version activated
* Recurrence: 20 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Upgrade_For_Events_Reporting extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_upgrade_for_events_reporting';
public $notification_interval = 20; // in days
public $notification_type = array( 'basic', 'lite', 'plus' );
public $notification_icon = 'star';
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$notification['title'] = __( 'Upgrade to MonsterInsights Pro', 'google-analytics-for-wordpress' );
// Translators: upgrade for form conversion notification content
$notification['content'] = __( 'Upgrade to MonsterInsights Pro to see which content and events your visitors are performing in real time.', 'google-analytics-for-wordpress' );
$notification['btns'] = array(
"get_monsterinsights_pro" => array(
'url' => $this->get_upgrade_url(),
'text' => __( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Upgrade_For_Events_Reporting();
notification-upgrade-for-form-conversion.php 0000644 00000002650 15154233524 0015307 0 ustar 00 <?php
/**
* Add notification when lite version activated
* Recurrence: 20 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Upgrade_For_Form_Conversion extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_upgrade_for_form_conversion';
public $notification_interval = 20; // in days
public $notification_type = array( 'basic', 'lite', 'plus' );
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$notification['title'] = __( 'Easily Track Form Conversions', 'google-analytics-for-wordpress' );
/* translators: Placeholders add a link to the settings page. */
$notification['content'] = sprintf( __( 'Track your website\'s form conversion rates by upgrading to %1$sMonsterInsights Pro%2$s.', 'google-analytics-for-wordpress' ), '<a href="' . $this->get_upgrade_url() . '" target="_blank">', '</a>' );
$notification['btns'] = array(
"get_monsterinsights_pro" => array(
'url' => $this->get_upgrade_url(),
'text' => __( 'Upgrade Now', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Upgrade_For_Form_Conversion();
notification-upgrade-for-post-templates.php 0000644 00000002661 15154233524 0015144 0 ustar 00 <?php
/**
* Add notification when lite version activated
* Recurrence: 20 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Upgrade_For_Post_Templates extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_upgrade_for_popular_posts_templates';
public $notification_interval = 20; // in days
public $notification_type = array( 'basic', 'lite', 'plus' );
public $notification_icon = 'star';
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$notification['title'] = __( 'Upgrade to MonsterInsights Pro', 'google-analytics-for-wordpress' );
// Translators: upgrade for form conversion notification content
$notification['content'] = __( 'Upgrade MonsterInsights Pro and use up to 20+ Popular Post templates to help improve engagement and interaction on your site.', 'google-analytics-for-wordpress' );
$notification['btns'] = array(
"get_monsterinsights_pro" => array(
'url' => $this->get_upgrade_url(),
'text' => __( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Upgrade_For_Post_Templates();
notification-upgrade-for-search-console.php 0000644 00000002754 15154233524 0015073 0 ustar 00 <?php
/**
* Add notification when lite version activated
* Recurrence: 30 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Upgrade_For_Search_Console extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_upgrade_for_search_console_report';
public $notification_interval = 30; // in days
public $notification_type = array( 'lite' );
public $notification_icon = 'warning';
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$notification['title'] = __( 'See Top Performing Keywords', 'google-analytics-for-wordpress' );
/* translators: Placeholders add a link to the upgrade url. */
$notification['content'] = sprintf( __( '%1$sUpgrade to MonsterInsights Pro%2$s to see which keywords are driving traffic to your website so you can focus on what\'s working.', 'google-analytics-for-wordpress' ), '<a href="' . $this->get_upgrade_url() . '" target="_blank">', '</a>' );
$notification['btns'] = array(
"get_monsterinsights_pro" => array(
'url' => $this->get_upgrade_url(),
'text' => __( 'Upgrade Now', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Upgrade_For_Search_Console();
notification-upgrade-to-pro-high-traffic.php 0000644 00000003207 15154233524 0015145 0 ustar 00 <?php
/**
* Add notification after 1 week of lite version installation
* Recurrence: 30 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Upgrade_To_Pro_High_Traffic extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_upgrade_to_pro_high_traffic';
public $notification_interval = 30; // in days
public $notification_type = array( 'lite' );
public $notification_icon = 'star';
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$report = $this->get_report();
$sessions = isset( $report['data']['infobox']['sessions']['value'] ) ? $report['data']['infobox']['sessions']['value'] : 0;
if ( $sessions < 2000 ) {
return false;
}
$notification['title'] = __( 'Upgrade to Unlock Advanced Tracking & Reports', 'google-analytics-for-wordpress' );
// Translators: upgrade to pro notification content
$notification['content'] = __( 'Upgrade to MonsterInsights Pro to take advantage of advanced Google Analytics settings, unlock advanced insights, utilize Custom Dimensions, and more.', 'google-analytics-for-wordpress' );
$notification['btns'] = array(
"upgrade_to_pro" => array(
'url' => $this->get_upgrade_url(),
'text' => __( 'Upgrade to Pro', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Upgrade_To_Pro_High_Traffic();
notification-upgrade-to-pro.php 0000644 00000002754 15154233524 0012622 0 ustar 00 <?php
/**
* Add notification after 1 week of lite version installation
* Recurrence: 40 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Upgrade_To_Pro extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_upgrade_to_pro';
public $notification_interval = 40; // in days
public $notification_first_run_time = '+7 day';
public $notification_type = array( 'lite' );
public $notification_icon = 'star';
public $notification_category = 'insight';
public $notification_priority = 3;
/**
* Build Notification
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$notification['title'] = __( 'Upgrade to Unlock Advanced Tracking & Reports', 'google-analytics-for-wordpress' );
// Translators: upgrade to pro notification content
$notification['content'] = __( 'By upgrading to MonsterInsights Pro you get access to additional reports right in your WordPress dashboard and advanced tracking features like eCommerce, Custom Dimensions, Forms tracking and more!', 'google-analytics-for-wordpress' );
$notification['btns'] = array(
"upgrade_to_pro" => array(
'url' => $this->get_upgrade_url(),
'text' => __( 'Upgrade to Pro', 'google-analytics-for-wordpress' ),
'is_external' => true,
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Upgrade_To_Pro();
notification-visitors.php 0000644 00000003346 15154233524 0011635 0 ustar 00 <?php
/**
* Add visitors notification
* Recurrence: 30 Days
*
* @since 7.12.3
*/
final class MonsterInsights_Notification_Visitors extends MonsterInsights_Notification_Event {
public $notification_id = 'monsterinsights_notification_visitors';
public $notification_interval = 30; // in days
public $notification_type = array( 'basic', 'lite', 'master', 'plus', 'pro' );
public $notification_icon = 'lightning';
public $notification_category = 'insight';
public $notification_priority = 2;
/**
* Build Notification
*
* @param array $report Overview report
*
* @return array $notification notification is ready to add
*
* @since 7.12.3
*/
public function prepare_notification_data( $notification ) {
$report = $this->get_report();
if ( ! is_array( $report ) || empty( $report ) ) {
return false;
}
$total_visitors = isset( $report['data']['infobox']['sessions']['value'] ) ? $report['data']['infobox']['sessions']['value'] : 0;
// Translators: visitors notification title
$notification['title'] = sprintf( __( 'See how %s Visitors Found Your Site!', 'google-analytics-for-wordpress' ), $total_visitors );
// Translators: visitors notification content
$notification['content'] = sprintf( __( 'Your website has been visited by %s visitors in the past 30 days. Click the button below to view the full analytics report.', 'google-analytics-for-wordpress' ), $total_visitors );
$notification['btns'] = array(
"view_report" => array(
'url' => $this->get_view_url( 'monsterinsights-report-overview', 'monsterinsights_reports' ),
'text' => __( 'View Report', 'google-analytics-for-wordpress' ),
),
);
return $notification;
}
}
// initialize the class
new MonsterInsights_Notification_Visitors();