@@ -93,12 +93,12 @@ discard block |
||
| 93 | 93 | $data['usagetracking'] = get_option( 'monsterinsights_usage_tracking_config', false ); |
| 94 | 94 | $data['usercount'] = function_exists( 'get_user_count' ) ? get_user_count() : 'Not Set'; |
| 95 | 95 | $data['usesauth'] = $usesauth; |
| 96 | - $data['timezoneoffset']= date('P'); |
|
| 96 | + $data['timezoneoffset'] = date( 'P' ); |
|
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | // Retrieve current plugin information |
| 101 | - if( ! function_exists( 'get_plugins' ) ) { |
|
| 101 | + if ( ! function_exists( 'get_plugins' ) ) { |
|
| 102 | 102 | include ABSPATH . '/wp-admin/includes/plugin.php'; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | foreach ( $plugins as $key => $plugin ) { |
| 109 | 109 | if ( in_array( $plugin, $active_plugins ) ) { |
| 110 | 110 | // Remove active plugins from list so we can show active and inactive separately |
| 111 | - unset( $plugins[ $key ] ); |
|
| 111 | + unset( $plugins[$key] ); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | return false; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - if( ! $this->tracking_allowed() && ! $override ) { |
|
| 129 | + if ( ! $this->tracking_allowed() && ! $override ) { |
|
| 130 | 130 | return false; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -158,15 +158,15 @@ discard block |
||
| 158 | 158 | public function schedule_send() { |
| 159 | 159 | if ( ! wp_next_scheduled( 'monsterinsights_usage_tracking_cron' ) ) { |
| 160 | 160 | $tracking = array(); |
| 161 | - $tracking['day'] = rand( 0, 6 ); |
|
| 161 | + $tracking['day'] = rand( 0, 6 ); |
|
| 162 | 162 | $tracking['hour'] = rand( 0, 23 ); |
| 163 | 163 | $tracking['minute'] = rand( 0, 59 ); |
| 164 | 164 | $tracking['second'] = rand( 0, 59 ); |
| 165 | - $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) + |
|
| 166 | - ( $tracking['hour'] * HOUR_IN_SECONDS ) + |
|
| 165 | + $tracking['offset'] = ( $tracking['day'] * DAY_IN_SECONDS ) + |
|
| 166 | + ( $tracking['hour'] * HOUR_IN_SECONDS ) + |
|
| 167 | 167 | ( $tracking['minute'] * MINUTE_IN_SECONDS ) + |
| 168 | 168 | $tracking['second']; |
| 169 | - $tracking['initsend'] = strtotime("next sunday") + $tracking['offset']; |
|
| 169 | + $tracking['initsend'] = strtotime( "next sunday" ) + $tracking['offset']; |
|
| 170 | 170 | |
| 171 | 171 | wp_schedule_event( $tracking['initsend'], 'weekly', 'monsterinsights_usage_tracking_cron' ); |
| 172 | 172 | update_option( 'monsterinsights_usage_tracking_config', $tracking ); |
@@ -356,11 +356,11 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_DIR' ) ) { |
| 359 | - define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
| 359 | + define( 'MONSTERINSIGHTS_PLUGIN_DIR', plugin_dir_path( $this->file ) ); |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | if ( ! defined( 'MONSTERINSIGHTS_PLUGIN_URL' ) ) { |
| 363 | - define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
| 363 | + define( 'MONSTERINSIGHTS_PLUGIN_URL', plugin_dir_url( $this->file ) ); |
|
| 364 | 364 | } |
| 365 | 365 | } |
| 366 | 366 | |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | // Traditional WordPress plugin locale filter. |
| 383 | - $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
| 383 | + $mi_locale = apply_filters( 'plugin_locale', $mi_locale, 'google-analytics-for-wordpress' ); |
|
| 384 | 384 | $mi_mofile = sprintf( '%1$s-%2$s.mo', 'google-analytics-for-wordpress', $mi_locale ); |
| 385 | 385 | |
| 386 | 386 | // Look for wp-content/languages/google-analytics-for-wordpress/google-analytics-for-wordpress-{lang}_{country}.mo |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | public function monsterinsights_wp_notice() { |
| 420 | 420 | $url = admin_url( 'plugins.php' ); |
| 421 | 421 | // Check for MS dashboard |
| 422 | - if( is_network_admin() ) { |
|
| 422 | + if ( is_network_admin() ) { |
|
| 423 | 423 | $url = network_admin_url( 'plugins.php' ); |
| 424 | 424 | } |
| 425 | 425 | ?> |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | public function monsterinsights_pro_notice() { |
| 441 | 441 | $url = admin_url( 'plugins.php' ); |
| 442 | 442 | // Check for MS dashboard |
| 443 | - if( is_network_admin() ) { |
|
| 443 | + if ( is_network_admin() ) { |
|
| 444 | 444 | $url = network_admin_url( 'plugins.php' ); |
| 445 | 445 | } |
| 446 | 446 | ?> |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/options.php'; |
| 467 | 467 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/helpers.php'; |
| 468 | 468 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'includes/deprecated.php'; |
| 469 | - $monsterinsights_settings = monsterinsights_get_options(); |
|
| 469 | + $monsterinsights_settings = monsterinsights_get_options(); |
|
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | * |
| 481 | 481 | * @return void |
| 482 | 482 | */ |
| 483 | - public function load_licensing(){ |
|
| 483 | + public function load_licensing() { |
|
| 484 | 484 | if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { |
| 485 | 485 | require_once MONSTERINSIGHTS_PLUGIN_DIR . 'lite/includes/license-compat.php'; |
| 486 | 486 | self::$instance->license = new MonsterInsights_License_Compat(); |
@@ -797,7 +797,7 @@ discard block |
||
| 797 | 797 | * |
| 798 | 798 | * @return void |
| 799 | 799 | */ |
| 800 | -function monsterinsights_lite_call_install_and_upgrade(){ |
|
| 800 | +function monsterinsights_lite_call_install_and_upgrade() { |
|
| 801 | 801 | add_action( 'wp_loaded', 'monsterinsights_lite_install_and_upgrade' ); |
| 802 | 802 | } |
| 803 | 803 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | final class MonsterInsights_Auth { |
| 20 | 20 | |
| 21 | - private $profile = array(); |
|
| 21 | + private $profile = array(); |
|
| 22 | 22 | private $network = array(); |
| 23 | 23 | |
| 24 | 24 | /** |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - public function set_analytics_profile( $data = array() ){ |
|
| 70 | + public function set_analytics_profile( $data = array() ) { |
|
| 71 | 71 | update_option( 'monsterinsights_site_profile', $data ); |
| 72 | - $this->profile = $data; |
|
| 72 | + $this->profile = $data; |
|
| 73 | 73 | |
| 74 | 74 | // If this is the first time, save the date when they connected. |
| 75 | 75 | $over_time = get_option( 'monsterinsights_over_time', array() ); |
@@ -87,12 +87,12 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - public function set_network_analytics_profile( $data = array() ){ |
|
| 90 | + public function set_network_analytics_profile( $data = array() ) { |
|
| 91 | 91 | update_site_option( 'monsterinsights_network_profile', $data ); |
| 92 | - $this->network = $data; |
|
| 92 | + $this->network = $data; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - public function delete_analytics_profile( $migrate = true ){ |
|
| 95 | + public function delete_analytics_profile( $migrate = true ) { |
|
| 96 | 96 | if ( $migrate ) { |
| 97 | 97 | $newdata = array(); |
| 98 | 98 | if ( isset( $this->profile['ua'] ) ) { |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - public function delete_network_analytics_profile( $migrate = true ){ |
|
| 109 | + public function delete_network_analytics_profile( $migrate = true ) { |
|
| 110 | 110 | if ( $migrate ) { |
| 111 | 111 | $newdata = array(); |
| 112 | 112 | if ( isset( $this->network['ua'] ) ) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | do_action( 'monsterinsights_reports_delete_aggregate_data' ); |
| 141 | 141 | |
| 142 | - $this->profile = $data; |
|
| 142 | + $this->profile = $data; |
|
| 143 | 143 | $this->set_analytics_profile( $data ); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -196,55 +196,55 @@ discard block |
||
| 196 | 196 | return ! empty( $this->network['ua'] ) ? monsterinsights_is_valid_ua( $this->network['ua'] ) : ''; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - public function get_viewname(){ |
|
| 199 | + public function get_viewname() { |
|
| 200 | 200 | return ! empty( $this->profile['viewname'] ) ? $this->profile['viewname'] : ''; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - public function get_network_viewname(){ |
|
| 203 | + public function get_network_viewname() { |
|
| 204 | 204 | return ! empty( $this->network['viewname'] ) ? $this->network['viewname'] : ''; |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | - public function get_accountid(){ |
|
| 207 | + public function get_accountid() { |
|
| 208 | 208 | return ! empty( $this->profile['a'] ) ? $this->profile['a'] : ''; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | - public function get_network_accountid(){ |
|
| 211 | + public function get_network_accountid() { |
|
| 212 | 212 | return ! empty( $this->network['a'] ) ? $this->network['a'] : ''; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - public function get_propertyid(){ |
|
| 215 | + public function get_propertyid() { |
|
| 216 | 216 | return ! empty( $this->profile['w'] ) ? $this->profile['w'] : ''; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - public function get_network_propertyid(){ |
|
| 219 | + public function get_network_propertyid() { |
|
| 220 | 220 | return ! empty( $this->network['w'] ) ? $this->network['w'] : ''; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - public function get_viewid(){ // also known as profileID |
|
| 223 | + public function get_viewid() { // also known as profileID |
|
| 224 | 224 | return ! empty( $this->profile['p'] ) ? $this->profile['p'] : ''; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - public function get_network_viewid(){ // also known as profileID |
|
| 227 | + public function get_network_viewid() { // also known as profileID |
|
| 228 | 228 | return ! empty( $this->network['p'] ) ? $this->network['p'] : ''; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - public function get_key(){ |
|
| 231 | + public function get_key() { |
|
| 232 | 232 | return ! empty( $this->profile['key'] ) ? $this->profile['key'] : ''; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - public function get_network_key(){ |
|
| 235 | + public function get_network_key() { |
|
| 236 | 236 | return ! empty( $this->network['key'] ) ? $this->network['key'] : ''; |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - public function get_token(){ |
|
| 239 | + public function get_token() { |
|
| 240 | 240 | return ! empty( $this->profile['token'] ) ? $this->profile['token'] : ''; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - public function get_network_token(){ |
|
| 243 | + public function get_network_token() { |
|
| 244 | 244 | return ! empty( $this->network['token'] ) ? $this->network['token'] : ''; |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - public function get_referral_url(){ |
|
| 247 | + public function get_referral_url() { |
|
| 248 | 248 | $url = ''; |
| 249 | 249 | |
| 250 | 250 | if ( $this->is_authed() ) { |
@@ -27,22 +27,22 @@ discard block |
||
| 27 | 27 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
| 28 | 28 | |
| 29 | 29 | if ( $hook === 'monsterinsights_settings' ) { |
| 30 | - // If dashboards disabled, first settings page |
|
| 31 | - add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
| 32 | - $hook = 'monsterinsights_settings'; |
|
| 30 | + // If dashboards disabled, first settings page |
|
| 31 | + add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
| 32 | + $hook = 'monsterinsights_settings'; |
|
| 33 | 33 | |
| 34 | - add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
|
| 34 | + add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
|
| 35 | 35 | } else { |
| 36 | - // if dashboards enabled, first dashboard |
|
| 37 | - add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
| 36 | + // if dashboards enabled, first dashboard |
|
| 37 | + add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
| 38 | 38 | |
| 39 | - add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
|
| 39 | + add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
|
| 40 | 40 | |
| 41 | - // then settings page |
|
| 42 | - add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' ); |
|
| 41 | + // then settings page |
|
| 42 | + add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' ); |
|
| 43 | 43 | |
| 44 | - // Add dashboard submenu. |
|
| 45 | - add_submenu_page( 'index.php', __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'admin.php?page=monsterinsights_reports' ); |
|
| 44 | + // Add dashboard submenu. |
|
| 45 | + add_submenu_page( 'index.php', __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'admin.php?page=monsterinsights_reports' ); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $submenu_base = add_query_arg( 'page', 'monsterinsights_settings', admin_url( 'admin.php' ) ); |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | add_submenu_page( $hook, __( 'Popular Posts:', 'google-analytics-for-wordpress' ), __( 'Popular Posts', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', $submenu_base . '#/popular-posts' ); |
| 52 | 52 | |
| 53 | 53 | if ( function_exists( 'aioseo' ) ) { |
| 54 | - $seo_url = monsterinsights_aioseo_dashboard_url(); |
|
| 54 | + $seo_url = monsterinsights_aioseo_dashboard_url(); |
|
| 55 | 55 | } else { |
| 56 | - $seo_url = $submenu_base . '#/seo'; |
|
| 56 | + $seo_url = $submenu_base . '#/seo'; |
|
| 57 | 57 | } |
| 58 | 58 | // then SEO |
| 59 | 59 | add_submenu_page( $hook, __( 'SEO', 'google-analytics-for-wordpress' ), __( 'SEO', 'google-analytics-for-wordpress' ), 'manage_options', $seo_url ); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | // then addons |
| 65 | 65 | $network_key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_network_license_key() : ''; |
| 66 | 66 | if ( ! monsterinsights_is_network_active() || ( monsterinsights_is_network_active() && empty( $network_key ) ) ) { |
| 67 | - add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:' . monsterinsights_menu_highlight_color() . '"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', $submenu_base . '#/addons' ); |
|
| 67 | + add_submenu_page( $hook, __( 'Addons:', 'google-analytics-for-wordpress' ), '<span style="color:' . monsterinsights_menu_highlight_color() . '"> ' . __( 'Addons', 'google-analytics-for-wordpress' ) . '</span>', 'monsterinsights_save_settings', $submenu_base . '#/addons' ); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // Add About us page. |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | function monsterinsights_get_menu_hook() { |
| 98 | 98 | $dashboards_disabled = monsterinsights_get_option( 'dashboards_disabled', false ); |
| 99 | 99 | if ( $dashboards_disabled || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) { |
| 100 | - return 'monsterinsights_settings'; |
|
| 100 | + return 'monsterinsights_settings'; |
|
| 101 | 101 | } else { |
| 102 | - return 'monsterinsights_reports'; |
|
| 102 | + return 'monsterinsights_reports'; |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -110,12 +110,12 @@ discard block |
||
| 110 | 110 | // First, let's see if this is an MS network enabled plugin. If it is, we should load the license |
| 111 | 111 | // menu page and the updater on the network panel |
| 112 | 112 | if ( ! function_exists( 'is_plugin_active_for_network' ) ) { |
| 113 | - require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
| 113 | + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $plugin = plugin_basename( MONSTERINSIGHTS_PLUGIN_FILE ); |
| 117 | 117 | if ( ! is_plugin_active_for_network( $plugin ) ) { |
| 118 | - return; |
|
| 118 | + return; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
| 129 | 129 | |
| 130 | 130 | if ( function_exists( 'aioseo' ) ) { |
| 131 | - $seo_url = monsterinsights_aioseo_dashboard_url(); |
|
| 131 | + $seo_url = monsterinsights_aioseo_dashboard_url(); |
|
| 132 | 132 | } else { |
| 133 | - $seo_url = $submenu_base . '#/seo'; |
|
| 133 | + $seo_url = $submenu_base . '#/seo'; |
|
| 134 | 134 | } |
| 135 | 135 | // then seo |
| 136 | 136 | add_submenu_page( $hook, __( 'SEO:', 'google-analytics-for-wordpress' ), __( 'SEO', 'google-analytics-for-wordpress' ), 'manage_options', $seo_url, 'monsterinsights_seo_page' ); |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | function monsterinsights_add_admin_body_class( $classes ) { |
| 155 | 155 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 156 | 156 | if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) { |
| 157 | - return $classes; |
|
| 157 | + return $classes; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | return "$classes monsterinsights_page "; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 172 | 172 | |
| 173 | 173 | if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) { |
| 174 | - return $classes; |
|
| 174 | + return $classes; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return "$classes insights_page_monsterinsights_tools "; |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | function monsterinsights_add_admin_body_class_addons_page( $classes ) { |
| 188 | 188 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 189 | 189 | if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) { |
| 190 | - return $classes; |
|
| 190 | + return $classes; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return "$classes insights_page_monsterinsights_addons "; |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | // If Lite, support goes to forum. If pro, it goes to our website |
| 209 | 209 | if ( monsterinsights_is_pro_version() ) { |
| 210 | - $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 211 | - array_unshift( $links, $support ); |
|
| 210 | + $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 211 | + array_unshift( $links, $support ); |
|
| 212 | 212 | } else { |
| 213 | - $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 214 | - array_unshift( $links, $support ); |
|
| 213 | + $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 214 | + array_unshift( $links, $support ); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | if ( is_network_admin() ) { |
@@ -246,26 +246,26 @@ discard block |
||
| 246 | 246 | function monsterinsights_load_admin_partial( $template, $data = array() ) { |
| 247 | 247 | |
| 248 | 248 | if ( monsterinsights_is_pro_version() ) { |
| 249 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
| 249 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
| 250 | 250 | |
| 251 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
| 252 | - require_once( $dir . $template . '.php' ); |
|
| 253 | - return true; |
|
| 254 | - } |
|
| 251 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
| 252 | + require_once( $dir . $template . '.php' ); |
|
| 253 | + return true; |
|
| 254 | + } |
|
| 255 | 255 | } else { |
| 256 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
| 256 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
| 257 | 257 | |
| 258 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
| 259 | - require_once( $dir . $template . '.php' ); |
|
| 260 | - return true; |
|
| 261 | - } |
|
| 258 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
| 259 | + require_once( $dir . $template . '.php' ); |
|
| 260 | + return true; |
|
| 261 | + } |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
| 265 | 265 | |
| 266 | 266 | if ( file_exists( $dir . $template . '.php' ) ) { |
| 267 | - require_once( $dir . $template . '.php' ); |
|
| 268 | - return true; |
|
| 267 | + require_once( $dir . $template . '.php' ); |
|
| 268 | + return true; |
|
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | return false; |
@@ -282,9 +282,9 @@ discard block |
||
| 282 | 282 | function monsterinsights_admin_footer( $text ) { |
| 283 | 283 | global $current_screen; |
| 284 | 284 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
| 285 | - $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
| 286 | - // Translators: Placeholders add a link to the wordpress.org repository. |
|
| 287 | - $text = sprintf( esc_html__( 'Please rate %1$sMonsterInsights%2$s on %3$s %4$sWordPress.org%5$s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
| 285 | + $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
| 286 | + // Translators: Placeholders add a link to the wordpress.org repository. |
|
| 287 | + $text = sprintf( esc_html__( 'Please rate %1$sMonsterInsights%2$s on %3$s %4$sWordPress.org%5$s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
| 288 | 288 | } |
| 289 | 289 | return $text; |
| 290 | 290 | } |
@@ -295,12 +295,12 @@ discard block |
||
| 295 | 295 | // Don't show on MonsterInsights pages |
| 296 | 296 | $screen = get_current_screen(); |
| 297 | 297 | if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) { |
| 298 | - return; |
|
| 298 | + return; |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | // Make sure they have the permissions to do something |
| 302 | 302 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
| 303 | - return; |
|
| 303 | + return; |
|
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | // Priority: |
@@ -318,89 +318,89 @@ discard block |
||
| 318 | 318 | // 1. Google Analytics not authenticated |
| 319 | 319 | if ( ! is_network_admin() && ! monsterinsights_get_ua() && ! defined( 'MONSTERINSIGHTS_DISABLE_TRACKING' ) ) { |
| 320 | 320 | |
| 321 | - $submenu_base = is_network_admin() ? add_query_arg( 'page', 'monsterinsights_network', network_admin_url( 'admin.php' ) ) : add_query_arg( 'page', 'monsterinsights_settings', admin_url( 'admin.php' ) ); |
|
| 322 | - $title = esc_html__( 'Please Setup Website Analytics to See Audience Insights', 'google-analytics-for-wordpress' ); |
|
| 323 | - $primary = esc_html__( 'Connect MonsterInsights and Setup Website Analytics', 'google-analytics-for-wordpress' ); |
|
| 324 | - $urlone = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights-onboarding' ) : admin_url( 'admin.php?page=monsterinsights-onboarding' ); |
|
| 325 | - $secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' ); |
|
| 326 | - $urltwo = $submenu_base . '#/about/getting-started'; |
|
| 327 | - $message = esc_html__( 'MonsterInsights, WordPress analytics plugin, helps you connect your website with Google Analytics, so you can see how people find and use your website. Over 3 million website owners use MonsterInsights to see the stats that matter and grow their business.', 'google-analytics-for-wordpress' ); |
|
| 328 | - echo '<div class="notice notice-info"><p style="font-weight:700">'. $title .'</p><p>'. $message.'</p><p><a href="'. $urlone .'" class="button-primary">'. $primary .'</a> <a href="'. $urltwo .'" class="button-secondary">'. $secondary .'</a></p></div>'; |
|
| 329 | - return; |
|
| 321 | + $submenu_base = is_network_admin() ? add_query_arg( 'page', 'monsterinsights_network', network_admin_url( 'admin.php' ) ) : add_query_arg( 'page', 'monsterinsights_settings', admin_url( 'admin.php' ) ); |
|
| 322 | + $title = esc_html__( 'Please Setup Website Analytics to See Audience Insights', 'google-analytics-for-wordpress' ); |
|
| 323 | + $primary = esc_html__( 'Connect MonsterInsights and Setup Website Analytics', 'google-analytics-for-wordpress' ); |
|
| 324 | + $urlone = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights-onboarding' ) : admin_url( 'admin.php?page=monsterinsights-onboarding' ); |
|
| 325 | + $secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' ); |
|
| 326 | + $urltwo = $submenu_base . '#/about/getting-started'; |
|
| 327 | + $message = esc_html__( 'MonsterInsights, WordPress analytics plugin, helps you connect your website with Google Analytics, so you can see how people find and use your website. Over 3 million website owners use MonsterInsights to see the stats that matter and grow their business.', 'google-analytics-for-wordpress' ); |
|
| 328 | + echo '<div class="notice notice-info"><p style="font-weight:700">'. $title .'</p><p>'. $message.'</p><p><a href="'. $urlone .'" class="button-primary">'. $primary .'</a> <a href="'. $urltwo .'" class="button-secondary">'. $secondary .'</a></p></div>'; |
|
| 329 | + return; |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | // 2. License key not entered for pro |
| 333 | 333 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
| 334 | 334 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
| 335 | - $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
| 336 | - // Translators: Adds a link to retrieve the license. |
|
| 337 | - $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 338 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 339 | - return; |
|
| 335 | + $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
| 336 | + // Translators: Adds a link to retrieve the license. |
|
| 337 | + $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 338 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 339 | + return; |
|
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | // 3. License key not valid/okay for pro |
| 343 | 343 | if ( monsterinsights_is_pro_version() ) { |
| 344 | - $message = ''; |
|
| 345 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
| 346 | - if ( MonsterInsights()->license->site_license_expired() ) { |
|
| 347 | - // Translators: Adds a link to the license renewal. |
|
| 348 | - $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 349 | - } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
| 350 | - $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 351 | - } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
| 352 | - $message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 353 | - } |
|
| 354 | - } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
| 355 | - if ( MonsterInsights()->license->network_license_expired() ) { |
|
| 356 | - // Translators: Adds a link to renew license. |
|
| 357 | - $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 358 | - } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
| 359 | - $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 360 | - } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
| 361 | - $message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 362 | - } |
|
| 363 | - } |
|
| 364 | - if ( ! empty( $message ) ) { |
|
| 365 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 366 | - return; |
|
| 367 | - } |
|
| 344 | + $message = ''; |
|
| 345 | + if ( MonsterInsights()->license->get_site_license_key() ){ |
|
| 346 | + if ( MonsterInsights()->license->site_license_expired() ) { |
|
| 347 | + // Translators: Adds a link to the license renewal. |
|
| 348 | + $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 349 | + } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
| 350 | + $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 351 | + } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
| 352 | + $message = esc_html__( 'Your license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 353 | + } |
|
| 354 | + } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
| 355 | + if ( MonsterInsights()->license->network_license_expired() ) { |
|
| 356 | + // Translators: Adds a link to renew license. |
|
| 357 | + $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 358 | + } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
| 359 | + $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 360 | + } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
| 361 | + $message = esc_html__( 'Your network license key for MonsterInsights is invalid. The key no longer exists or the user associated with the key has been deleted. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
| 362 | + } |
|
| 363 | + } |
|
| 364 | + if ( ! empty( $message ) ) { |
|
| 365 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 366 | + return; |
|
| 367 | + } |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | // 4. Notices for PHP/WP version deprecations |
| 371 | 371 | if ( current_user_can( 'update_core' ) ) { |
| 372 | - global $wp_version; |
|
| 373 | - |
|
| 374 | - // PHP 5.2-5.5 |
|
| 375 | - if ( version_compare( phpversion(), '5.6', '<' ) ) { |
|
| 376 | - $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
|
| 377 | - // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break. |
|
| 378 | - $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress stopped supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
|
| 379 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 380 | - return; |
|
| 381 | - } |
|
| 382 | - // WordPress 3.0 - 4.5 |
|
| 383 | - else if ( version_compare( $wp_version, '4.9', '<' ) ) { |
|
| 384 | - $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
|
| 385 | - // Translators: Placeholders add the current WordPress version and links to the MonsterInsights blog |
|
| 386 | - $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.9 in 2020.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
|
| 387 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 388 | - return; |
|
| 389 | - } |
|
| 390 | - // PHP 5.4/5.5 |
|
| 391 | - // else if ( version_compare( phpversion(), '5.6', '<' ) ) { |
|
| 392 | - // $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
|
| 393 | - // $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress will stop supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
|
| 394 | - // echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 395 | - // return; |
|
| 396 | - // } |
|
| 397 | - // // WordPress 4.6 - 4.8 |
|
| 398 | - // else if ( version_compare( $wp_version, '4.9', '<' ) ) { |
|
| 399 | - // $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
|
| 400 | - // $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.9 in October, 2019.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
|
| 401 | - // echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 402 | - // return; |
|
| 403 | - // } |
|
| 372 | + global $wp_version; |
|
| 373 | + |
|
| 374 | + // PHP 5.2-5.5 |
|
| 375 | + if ( version_compare( phpversion(), '5.6', '<' ) ) { |
|
| 376 | + $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
|
| 377 | + // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break. |
|
| 378 | + $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress stopped supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
|
| 379 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 380 | + return; |
|
| 381 | + } |
|
| 382 | + // WordPress 3.0 - 4.5 |
|
| 383 | + else if ( version_compare( $wp_version, '4.9', '<' ) ) { |
|
| 384 | + $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
|
| 385 | + // Translators: Placeholders add the current WordPress version and links to the MonsterInsights blog |
|
| 386 | + $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.9 in 2020.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
|
| 387 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 388 | + return; |
|
| 389 | + } |
|
| 390 | + // PHP 5.4/5.5 |
|
| 391 | + // else if ( version_compare( phpversion(), '5.6', '<' ) ) { |
|
| 392 | + // $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
|
| 393 | + // $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress will stop supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
|
| 394 | + // echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 395 | + // return; |
|
| 396 | + // } |
|
| 397 | + // // WordPress 4.6 - 4.8 |
|
| 398 | + // else if ( version_compare( $wp_version, '4.9', '<' ) ) { |
|
| 399 | + // $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
|
| 400 | + // $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.9 in October, 2019.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
|
| 401 | + // echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 402 | + // return; |
|
| 403 | + // } |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | // 5. Optin setting not configured |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | |
| 431 | 431 | $notices = get_option( 'monsterinsights_notices' ); |
| 432 | 432 | if ( ! is_array( $notices ) ) { |
| 433 | - $notices = array(); |
|
| 433 | + $notices = array(); |
|
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | // 6. Authenticate, not manual |
@@ -474,75 +474,75 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | // 8. WooUpsell |
| 476 | 476 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
| 477 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
| 478 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
| 479 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
| 480 | - echo '<p><strong>'; |
|
| 481 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
| 482 | - echo '</strong></p>'; |
|
| 483 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 484 | - echo '<p>'; |
|
| 485 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
| 486 | - echo '</p>'; |
|
| 487 | - echo '<p>'; |
|
| 488 | - echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
| 489 | - echo '</p>'; |
|
| 490 | - echo '<p>'; |
|
| 491 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
| 492 | - echo '</p>'; |
|
| 493 | - echo '<p>'; |
|
| 494 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
| 495 | - echo '</p>'; |
|
| 496 | - // Translators: Placeholders add a link to the MonsterInsights website. |
|
| 497 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
| 498 | - echo '</p>'; |
|
| 499 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
| 500 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 501 | - echo '</div>'; |
|
| 502 | - echo '</div>'; |
|
| 503 | - echo '<style type="text/css">.monsterinsights-wooedd-upsell-left{width:50%;display:table-cell;float:left}.monsterinsights-wooedd-upsell-right{width:50%;display:table-cell;float:left}.monsterinsights-wooedd-upsell-image{width:100%;height:auto;padding:20px}.monsterinsights-wooedd-upsell-image-small{display:none}.monsterinsights-wooedd-upsell-row{display:table}.monsterinsights-wooedd-upsell-left p{margin:1em 0;font-size:16px}@media (max-width:900px){.monsterinsights-wooedd-upsell-left{width:100%}.monsterinsights-wooedd-upsell-right{display:none}.monsterinsights-wooedd-upsell-image-small{display:block}.monsterinsights-wooedd-upsell-image-large{display:none}}</style>'; |
|
| 504 | - return; |
|
| 505 | - } |
|
| 477 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
| 478 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
| 479 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
| 480 | + echo '<p><strong>'; |
|
| 481 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
| 482 | + echo '</strong></p>'; |
|
| 483 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 484 | + echo '<p>'; |
|
| 485 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
| 486 | + echo '</p>'; |
|
| 487 | + echo '<p>'; |
|
| 488 | + echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
| 489 | + echo '</p>'; |
|
| 490 | + echo '<p>'; |
|
| 491 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
| 492 | + echo '</p>'; |
|
| 493 | + echo '<p>'; |
|
| 494 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
| 495 | + echo '</p>'; |
|
| 496 | + // Translators: Placeholders add a link to the MonsterInsights website. |
|
| 497 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
| 498 | + echo '</p>'; |
|
| 499 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
| 500 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 501 | + echo '</div>'; |
|
| 502 | + echo '</div>'; |
|
| 503 | + echo '<style type="text/css">.monsterinsights-wooedd-upsell-left{width:50%;display:table-cell;float:left}.monsterinsights-wooedd-upsell-right{width:50%;display:table-cell;float:left}.monsterinsights-wooedd-upsell-image{width:100%;height:auto;padding:20px}.monsterinsights-wooedd-upsell-image-small{display:none}.monsterinsights-wooedd-upsell-row{display:table}.monsterinsights-wooedd-upsell-left p{margin:1em 0;font-size:16px}@media (max-width:900px){.monsterinsights-wooedd-upsell-left{width:100%}.monsterinsights-wooedd-upsell-right{display:none}.monsterinsights-wooedd-upsell-image-small{display:block}.monsterinsights-wooedd-upsell-image-large{display:none}}</style>'; |
|
| 504 | + return; |
|
| 505 | + } |
|
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | // 9. EDDUpsell |
| 509 | 509 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
| 510 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
| 511 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
| 512 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
| 513 | - echo '<p><strong>'; |
|
| 514 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
| 515 | - echo '</strong></p>'; |
|
| 516 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 517 | - echo '<p>'; |
|
| 518 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
| 519 | - echo '</p>'; |
|
| 520 | - echo '<p>'; |
|
| 521 | - echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
| 522 | - echo '</p>'; |
|
| 523 | - echo '<p>'; |
|
| 524 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
| 525 | - echo '</p>'; |
|
| 526 | - echo '<p>'; |
|
| 527 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
| 528 | - echo '</p>'; |
|
| 529 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
| 530 | - echo '</p>'; |
|
| 531 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
| 532 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 533 | - echo '</div>'; |
|
| 534 | - echo '</div>'; |
|
| 535 | - return; |
|
| 536 | - } |
|
| 510 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
| 511 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
| 512 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
| 513 | + echo '<p><strong>'; |
|
| 514 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
| 515 | + echo '</strong></p>'; |
|
| 516 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 517 | + echo '<p>'; |
|
| 518 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
| 519 | + echo '</p>'; |
|
| 520 | + echo '<p>'; |
|
| 521 | + echo esc_html( 'This helps you make data-driven decisions about your content, and marketing strategy so you can increase your website traffic, leads, and sales.', 'google-analytics-for-wordpress' ); |
|
| 522 | + echo '</p>'; |
|
| 523 | + echo '<p>'; |
|
| 524 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
| 525 | + echo '</p>'; |
|
| 526 | + echo '<p>'; |
|
| 527 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
| 528 | + echo '</p>'; |
|
| 529 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
| 530 | + echo '</p>'; |
|
| 531 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
| 532 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
| 533 | + echo '</div>'; |
|
| 534 | + echo '</div>'; |
|
| 535 | + return; |
|
| 536 | + } |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | if ( isset( $notices['monsterinsights_cross_domains_extracted'] ) && false === $notices['monsterinsights_cross_domains_extracted'] ) { |
| 540 | - $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
| 541 | - $page = $page . '#/advanced'; |
|
| 542 | - // Translators: Adds a link to the settings panel. |
|
| 543 | - $message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure. %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 544 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>'; |
|
| 545 | - return; |
|
| 540 | + $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
| 541 | + $page = $page . '#/advanced'; |
|
| 542 | + // Translators: Adds a link to the settings panel. |
|
| 543 | + $message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure. %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 544 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>'; |
|
| 545 | + return; |
|
| 546 | 546 | } |
| 547 | 547 | } |
| 548 | 548 | add_action( 'admin_notices', 'monsterinsights_admin_setup_notices' ); |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | // AM Notices |
| 553 | 553 | function monsterinsights_am_notice_optout( $super_admin ) { |
| 554 | 554 | if ( monsterinsights_get_option( 'hide_am_notices', false ) || monsterinsights_get_option( 'network_hide_am_notices', false ) ) { |
| 555 | - return false; |
|
| 555 | + return false; |
|
| 556 | 556 | } |
| 557 | 557 | return $super_admin; |
| 558 | 558 | } |
@@ -28,13 +28,13 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | if ( $hook === 'monsterinsights_settings' ) { |
| 30 | 30 | // If dashboards disabled, first settings page |
| 31 | - add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
| 31 | + add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
| 32 | 32 | $hook = 'monsterinsights_settings'; |
| 33 | 33 | |
| 34 | 34 | add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
| 35 | 35 | } else { |
| 36 | 36 | // if dashboards enabled, first dashboard |
| 37 | - add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
| 37 | + add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
| 38 | 38 | |
| 39 | 39 | add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
| 40 | 40 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
| 122 | 122 | $hook = 'monsterinsights_network'; |
| 123 | 123 | $submenu_base = add_query_arg( 'page', 'monsterinsights_network', network_admin_url( 'admin.php' ) ); |
| 124 | - add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', $menu_icon_inline, '100.00013467543' ); |
|
| 124 | + add_menu_page( __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ) . MonsterInsights()->notifications->get_menu_count(), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page', $menu_icon_inline, '100.00013467543' ); |
|
| 125 | 125 | |
| 126 | 126 | add_submenu_page( $hook, __( 'Network Settings:', 'google-analytics-for-wordpress' ), __( 'Network Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_network', 'monsterinsights_network_page' ); |
| 127 | 127 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | function monsterinsights_add_admin_body_class_tools_page( $classes ) { |
| 171 | 171 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 172 | 172 | |
| 173 | - if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) { |
|
| 173 | + if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) { |
|
| 174 | 174 | return $classes; |
| 175 | 175 | } |
| 176 | 176 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | function monsterinsights_add_admin_body_class_addons_page( $classes ) { |
| 188 | 188 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
| 189 | - if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) { |
|
| 189 | + if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) { |
|
| 190 | 190 | return $classes; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -202,15 +202,15 @@ discard block |
||
| 202 | 202 | * @return array $links |
| 203 | 203 | */ |
| 204 | 204 | function monsterinsights_add_action_links( $links ) { |
| 205 | - $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="'. monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) .'">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 205 | + $docs = '<a title="' . esc_html__( 'MonsterInsights Knowledge Base', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_url( 'all-plugins', 'kb-link', "https://www.monsterinsights.com/docs/" ) . '">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 206 | 206 | array_unshift( $links, $docs ); |
| 207 | 207 | |
| 208 | 208 | // If Lite, support goes to forum. If pro, it goes to our website |
| 209 | 209 | if ( monsterinsights_is_pro_version() ) { |
| 210 | - $support = '<a title="MonsterInsights Pro Support" href="'. monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 210 | + $support = '<a title="MonsterInsights Pro Support" href="' . monsterinsights_get_url( 'all-plugins', 'pro-support-link', "https://www.monsterinsights.com/my-account/support/" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 211 | 211 | array_unshift( $links, $support ); |
| 212 | 212 | } else { |
| 213 | - $support = '<a title="MonsterInsights Lite Support" href="'. monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) .'">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 213 | + $support = '<a title="MonsterInsights Lite Support" href="' . monsterinsights_get_url( 'all-plugins', 'lite-support-link', "https://www.monsterinsights.com/lite-support/" ) . '">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 214 | 214 | array_unshift( $links, $support ); |
| 215 | 215 | } |
| 216 | 216 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | // If lite, show a link where they can get pro from |
| 226 | 226 | if ( ! monsterinsights_is_pro_version() ) { |
| 227 | - $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) .'" href="'. monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/lite/" ) .'" style="font-weight:700">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 227 | + $get_pro = '<a title="' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '" href="' . monsterinsights_get_upgrade_link( 'all-plugins', 'upgrade-link', "https://www.monsterinsights.com/lite/" ) . '" style="font-weight:700">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
| 228 | 228 | array_unshift( $links, $get_pro ); |
| 229 | 229 | } |
| 230 | 230 | |
@@ -249,14 +249,14 @@ discard block |
||
| 249 | 249 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
| 250 | 250 | |
| 251 | 251 | if ( file_exists( $dir . $template . '.php' ) ) { |
| 252 | - require_once( $dir . $template . '.php' ); |
|
| 252 | + require_once( $dir . $template . '.php' ); |
|
| 253 | 253 | return true; |
| 254 | 254 | } |
| 255 | 255 | } else { |
| 256 | 256 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
| 257 | 257 | |
| 258 | 258 | if ( file_exists( $dir . $template . '.php' ) ) { |
| 259 | - require_once( $dir . $template . '.php' ); |
|
| 259 | + require_once( $dir . $template . '.php' ); |
|
| 260 | 260 | return true; |
| 261 | 261 | } |
| 262 | 262 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
| 265 | 265 | |
| 266 | 266 | if ( file_exists( $dir . $template . '.php' ) ) { |
| 267 | - require_once( $dir . $template . '.php' ); |
|
| 267 | + require_once( $dir . $template . '.php' ); |
|
| 268 | 268 | return true; |
| 269 | 269 | } |
| 270 | 270 | |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
| 285 | 285 | $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
| 286 | 286 | // Translators: Placeholders add a link to the wordpress.org repository. |
| 287 | - $text = sprintf( esc_html__( 'Please rate %1$sMonsterInsights%2$s on %3$s %4$sWordPress.org%5$s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
| 287 | + $text = sprintf( esc_html__( 'Please rate %1$sMonsterInsights%2$s on %3$s %4$sWordPress.org%5$s to help us spread the word. Thank you from the MonsterInsights team!', 'google-analytics-for-wordpress' ), '<strong>', '</strong>', '<a class="monsterinsights-no-text-decoration" href="' . $url . '" target="_blank" rel="noopener noreferrer"><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i><i class="monstericon-star"></i></a>', '<a href="' . $url . '" target="_blank" rel="noopener noreferrer">', '</a>' ); |
|
| 288 | 288 | } |
| 289 | 289 | return $text; |
| 290 | 290 | } |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | $secondary = esc_html__( 'Learn More', 'google-analytics-for-wordpress' ); |
| 326 | 326 | $urltwo = $submenu_base . '#/about/getting-started'; |
| 327 | 327 | $message = esc_html__( 'MonsterInsights, WordPress analytics plugin, helps you connect your website with Google Analytics, so you can see how people find and use your website. Over 3 million website owners use MonsterInsights to see the stats that matter and grow their business.', 'google-analytics-for-wordpress' ); |
| 328 | - echo '<div class="notice notice-info"><p style="font-weight:700">'. $title .'</p><p>'. $message.'</p><p><a href="'. $urlone .'" class="button-primary">'. $primary .'</a> <a href="'. $urltwo .'" class="button-secondary">'. $secondary .'</a></p></div>'; |
|
| 328 | + echo '<div class="notice notice-info"><p style="font-weight:700">' . $title . '</p><p>' . $message . '</p><p><a href="' . $urlone . '" class="button-primary">' . $primary . '</a> <a href="' . $urltwo . '" class="button-secondary">' . $secondary . '</a></p></div>'; |
|
| 329 | 329 | return; |
| 330 | 330 | } |
| 331 | 331 | |
@@ -334,18 +334,18 @@ discard block |
||
| 334 | 334 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
| 335 | 335 | $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
| 336 | 336 | // Translators: Adds a link to retrieve the license. |
| 337 | - $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 338 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 337 | + $message = sprintf( esc_html__( 'Warning: No valid license key has been entered for MonsterInsights. You are currently not getting updates, and are not able to view reports. %1$sPlease click here to enter your license key and begin receiving updates and reports.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . esc_url( $page ) . '">', '</a>' ); |
|
| 338 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
| 339 | 339 | return; |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | // 3. License key not valid/okay for pro |
| 343 | 343 | if ( monsterinsights_is_pro_version() ) { |
| 344 | 344 | $message = ''; |
| 345 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
| 345 | + if ( MonsterInsights()->license->get_site_license_key() ) { |
|
| 346 | 346 | if ( MonsterInsights()->license->site_license_expired() ) { |
| 347 | 347 | // Translators: Adds a link to the license renewal. |
| 348 | - $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 348 | + $message = sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 349 | 349 | } else if ( MonsterInsights()->license->site_license_disabled() ) { |
| 350 | 350 | $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
| 351 | 351 | } else if ( MonsterInsights()->license->site_license_invalid() ) { |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | } else if ( MonsterInsights()->license->get_network_license_key() ) { |
| 355 | 355 | if ( MonsterInsights()->license->network_license_expired() ) { |
| 356 | 356 | // Translators: Adds a link to renew license. |
| 357 | - $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 357 | + $message = sprintf( esc_html__( 'Your network license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'admin-notices', 'expired-license', "https://www.monsterinsights.com/login/" ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
| 358 | 358 | } else if ( MonsterInsights()->license->network_license_disabled() ) { |
| 359 | 359 | $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
| 360 | 360 | } else if ( MonsterInsights()->license->network_license_invalid() ) { |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | if ( ! empty( $message ) ) { |
| 365 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 365 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
| 366 | 366 | return; |
| 367 | 367 | } |
| 368 | 368 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-php/' ); |
| 377 | 377 | // Translators: Placeholders add the PHP version, a link to the MonsterInsights blog and a line break. |
| 378 | 378 | $message = sprintf( esc_html__( 'Your site is running an outdated, insecure version of PHP (%1$s), which could be putting your site at risk for being hacked.%4$sWordPress stopped supporting your PHP version in April, 2019.%4$sUpdating PHP only takes a few minutes and will make your website significantly faster and more secure.%4$s%2$sLearn more about updating PHP%3$s', 'google-analytics-for-wordpress' ), phpversion(), '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
| 379 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 379 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
| 380 | 380 | return; |
| 381 | 381 | } |
| 382 | 382 | // WordPress 3.0 - 4.5 |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $url = monsterinsights_get_url( 'global-notice', 'settings-page', 'https://www.monsterinsights.com/docs/update-wordpress/' ); |
| 385 | 385 | // Translators: Placeholders add the current WordPress version and links to the MonsterInsights blog |
| 386 | 386 | $message = sprintf( esc_html__( 'Your site is running an outdated version of WordPress (%1$s).%4$sMonsterInsights will stop supporting WordPress versions lower than 4.9 in 2020.%4$sUpdating WordPress takes just a few minutes and will also solve many bugs that exist in your WordPress install.%4$s%2$sLearn more about updating WordPress%3$s', 'google-analytics-for-wordpress' ), $wp_version, '<a href="' . $url . '" target="_blank">', '</a>', '<br>' ); |
| 387 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
| 387 | + echo '<div class="error"><p>' . $message . '</p></div>'; |
|
| 388 | 388 | return; |
| 389 | 389 | } |
| 390 | 390 | // PHP 5.4/5.5 |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | // } |
| 429 | 429 | // } |
| 430 | 430 | |
| 431 | - $notices = get_option( 'monsterinsights_notices' ); |
|
| 431 | + $notices = get_option( 'monsterinsights_notices' ); |
|
| 432 | 432 | if ( ! is_array( $notices ) ) { |
| 433 | 433 | $notices = array(); |
| 434 | 434 | } |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | |
| 475 | 475 | // 8. WooUpsell |
| 476 | 476 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
| 477 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
| 477 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available'] ) ) { |
|
| 478 | 478 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
| 479 | 479 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
| 480 | 480 | echo '<p><strong>'; |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
| 495 | 495 | echo '</p>'; |
| 496 | 496 | // Translators: Placeholders add a link to the MonsterInsights website. |
| 497 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) .'">', ' »</a>' ); |
|
| 497 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'woocommerce-upgrade' ) . '">', ' »</a>' ); |
|
| 498 | 498 | echo '</p>'; |
| 499 | 499 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
| 500 | 500 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | |
| 508 | 508 | // 9. EDDUpsell |
| 509 | 509 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
| 510 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
| 510 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available'] ) ) { |
|
| 511 | 511 | echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
| 512 | 512 | echo '<div class="monsterinsights-wooedd-upsell-left">'; |
| 513 | 513 | echo '<p><strong>'; |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | echo '<p>'; |
| 527 | 527 | echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
| 528 | 528 | echo '</p>'; |
| 529 | - echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="'. monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) .'">', ' »</a>' ); |
|
| 529 | + echo sprintf( esc_html__( '%1$sGet MonsterInsights Pro%2$s', 'google-analytics-for-wordpress' ), '<a class="button button-primary button-hero" href="' . monsterinsights_get_upgrade_link( 'admin-notices', 'edd-upgrade' ) . '">', ' »</a>' ); |
|
| 530 | 530 | echo '</p>'; |
| 531 | 531 | echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
| 532 | 532 | echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
@@ -540,8 +540,8 @@ discard block |
||
| 540 | 540 | $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
| 541 | 541 | $page = $page . '#/advanced'; |
| 542 | 542 | // Translators: Adds a link to the settings panel. |
| 543 | - $message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure. %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. esc_url( $page ) . '">', '</a>' ); |
|
| 544 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>'. $message.'</p></div>'; |
|
| 543 | + $message = sprintf( esc_html__( 'Warning: MonsterInsights found cross-domain settings in the custom code field and converted them to the new settings structure. %1$sPlease click here to review and remove the code no longer needed.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . esc_url( $page ) . '">', '</a>' ); |
|
| 544 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice" data-notice="monsterinsights_cross_domains_extracted"><p>' . $message . '</p></div>'; |
|
| 545 | 545 | return; |
| 546 | 546 | } |
| 547 | 547 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $site_license = array( |
|
| 67 | + $site_license = array( |
|
| 68 | 68 | 'key' => MonsterInsights()->license->get_site_license_key(), |
| 69 | 69 | 'type' => MonsterInsights()->license->get_site_license_type(), |
| 70 | 70 | 'is_disabled' => MonsterInsights()->license->site_license_disabled(), |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | // Array fields are needed even if empty. |
| 125 | 125 | $array_fields = array( 'view_reports', 'save_settings', 'ignore_users' ); |
| 126 | 126 | foreach ( $array_fields as $array_field ) { |
| 127 | - if ( ! isset( $options[ $array_field ] ) ) { |
|
| 128 | - $options[ $array_field ] = array(); |
|
| 127 | + if ( ! isset( $options[$array_field] ) ) { |
|
| 128 | + $options[$array_field] = array(); |
|
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | if ( isset( $options['custom_code'] ) ) { |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | if ( $empty ) { |
| 263 | - unset( $value[ $key ] ); |
|
| 263 | + unset( $value[$key] ); |
|
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | } else { |
| 311 | 311 | $addon = $this->get_addon( $installed_plugins, $addons_type, $addon, $slug ); |
| 312 | 312 | } |
| 313 | - $parsed_addons[ $addon->slug ] = $addon; |
|
| 313 | + $parsed_addons[$addon->slug] = $addon; |
|
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | 'slug' => 'wp-mail-smtp', |
| 405 | 405 | ); |
| 406 | 406 | // SeedProd. |
| 407 | - $parsed_addons['coming-soon'] = array( |
|
| 407 | + $parsed_addons['coming-soon'] = array( |
|
| 408 | 408 | 'active' => function_exists( 'seed_csp4_activation' ), |
| 409 | 409 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/plugin-seedprod.png', |
| 410 | 410 | 'title' => 'SeedProd', |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | 'slug' => 'coming-soon', |
| 415 | 415 | ); |
| 416 | 416 | // RafflePress |
| 417 | - $parsed_addons['rafflepress'] = array( |
|
| 417 | + $parsed_addons['rafflepress'] = array( |
|
| 418 | 418 | 'active' => function_exists( 'rafflepress_lite_activation' ), |
| 419 | 419 | 'icon' => plugin_dir_url( MONSTERINSIGHTS_PLUGIN_FILE ) . 'assets/images/pluign-rafflepress.png', |
| 420 | 420 | 'title' => 'RafflePress', |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $installed = false; |
| 487 | 487 | $plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug ); |
| 488 | 488 | |
| 489 | - if ( isset( $installed_plugins[ $plugin_basename ] ) ) { |
|
| 489 | + if ( isset( $installed_plugins[$plugin_basename] ) ) { |
|
| 490 | 490 | $installed = true; |
| 491 | 491 | |
| 492 | 492 | if ( is_multisite() && is_network_admin() ) { |
@@ -501,8 +501,8 @@ discard block |
||
| 501 | 501 | |
| 502 | 502 | $active_version = false; |
| 503 | 503 | if ( $active ) { |
| 504 | - if ( ! empty( $installed_plugins[ $plugin_basename ]['Version'] ) ) { |
|
| 505 | - $active_version = $installed_plugins[ $plugin_basename ]['Version']; |
|
| 504 | + if ( ! empty( $installed_plugins[$plugin_basename]['Version'] ) ) { |
|
| 505 | + $active_version = $installed_plugins[$plugin_basename]['Version']; |
|
| 506 | 506 | } |
| 507 | 507 | } |
| 508 | 508 | |
@@ -637,8 +637,8 @@ discard block |
||
| 637 | 637 | ); |
| 638 | 638 | |
| 639 | 639 | foreach ( $exclude as $e ) { |
| 640 | - if ( ! empty( $new_settings[ $e ] ) ) { |
|
| 641 | - unset( $new_settings[ $e ] ); |
|
| 640 | + if ( ! empty( $new_settings[$e] ) ) { |
|
| 641 | + unset( $new_settings[$e] ); |
|
| 642 | 642 | } |
| 643 | 643 | } |
| 644 | 644 | |
@@ -649,8 +649,8 @@ discard block |
||
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | foreach ( $exclude as $e ) { |
| 652 | - if ( ! empty( $settings[ $e ] ) ) { |
|
| 653 | - $new_settings = $settings[ $e ]; |
|
| 652 | + if ( ! empty( $settings[$e] ) ) { |
|
| 653 | + $new_settings = $settings[$e]; |
|
| 654 | 654 | } |
| 655 | 655 | } |
| 656 | 656 | |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | ), |
| 811 | 811 | admin_url( 'admin.php' ) |
| 812 | 812 | ); |
| 813 | - $url = esc_url( $url ); |
|
| 813 | + $url = esc_url( $url ); |
|
| 814 | 814 | |
| 815 | 815 | ob_start(); |
| 816 | 816 | if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, null ) ) ) { |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | $homepage = get_option( 'page_on_front' ); |
| 917 | 917 | if ( ! $homepage ) { |
| 918 | 918 | $array[] = array( |
| 919 | - 'id' => - 1, |
|
| 919 | + 'id' => -1, |
|
| 920 | 920 | 'title' => __( 'Homepage', 'google-analytics-for-wordpress' ), |
| 921 | 921 | ); |
| 922 | 922 | } |
@@ -990,7 +990,7 @@ discard block |
||
| 990 | 990 | if ( ! post_type_supports( $post_type->name, 'editor' ) || 'product' === $post_type->name ) { |
| 991 | 991 | continue; |
| 992 | 992 | } |
| 993 | - $post_types_parsed[ $post_type->name ] = $post_type->labels->singular_name; |
|
| 993 | + $post_types_parsed[$post_type->name] = $post_type->labels->singular_name; |
|
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | $post_types_parsed = apply_filters( 'monsterinsights_vue_post_types_editor', $post_types_parsed ); |
@@ -1112,18 +1112,18 @@ discard block |
||
| 1112 | 1112 | $value = sanitize_text_field( wp_unslash( $_POST['value'] ) ); // Value of custom style like 12px or #fff. |
| 1113 | 1113 | $settings = get_option( $settings_key, array() ); |
| 1114 | 1114 | |
| 1115 | - if ( ! isset( $settings[ $type ] ) ) { |
|
| 1116 | - $settings[ $type ] = array(); |
|
| 1115 | + if ( ! isset( $settings[$type] ) ) { |
|
| 1116 | + $settings[$type] = array(); |
|
| 1117 | 1117 | } |
| 1118 | - if ( ! isset( $settings[ $type ][ $theme ] ) ) { |
|
| 1119 | - $settings[ $type ][ $theme ] = array(); |
|
| 1118 | + if ( ! isset( $settings[$type][$theme] ) ) { |
|
| 1119 | + $settings[$type][$theme] = array(); |
|
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | - if ( ! isset( $settings[ $type ][ $theme ][ $object ] ) ) { |
|
| 1123 | - $settings[ $type ][ $theme ][ $object ] = array(); |
|
| 1122 | + if ( ! isset( $settings[$type][$theme][$object] ) ) { |
|
| 1123 | + $settings[$type][$theme][$object] = array(); |
|
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | - $settings[ $type ][ $theme ][ $object ][ $key ] = $value; |
|
| 1126 | + $settings[$type][$theme][$object][$key] = $value; |
|
| 1127 | 1127 | |
| 1128 | 1128 | update_option( $settings_key, $settings ); |
| 1129 | 1129 | |