@@ -34,23 +34,23 @@ discard block |
||
34 | 34 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
35 | 35 | |
36 | 36 | if ( $dashboards_disabled || ( current_user_can( 'monsterinsights_save_settings' ) && ! current_user_can( 'monsterinsights_view_dashboard' ) ) ) { |
37 | - // If dashboards disabled, first settings page |
|
38 | - add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
39 | - $hook = 'monsterinsights_settings'; |
|
37 | + // If dashboards disabled, first settings page |
|
38 | + add_menu_page( __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page', $menu_icon_inline, '100.00013467543' ); |
|
39 | + $hook = 'monsterinsights_settings'; |
|
40 | 40 | |
41 | - add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
|
41 | + add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings' ); |
|
42 | 42 | } else { |
43 | - // if dashboards enabled, first dashboard |
|
44 | - add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
43 | + // if dashboards enabled, first dashboard |
|
44 | + add_menu_page( __( 'General:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page', $menu_icon_inline, '100.00013467543' ); |
|
45 | 45 | |
46 | - $hook = 'monsterinsights_reports'; |
|
46 | + $hook = 'monsterinsights_reports'; |
|
47 | 47 | |
48 | - add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
|
48 | + add_submenu_page( $hook, __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Reports', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'monsterinsights_reports', 'monsterinsights_reports_page' ); |
|
49 | 49 | |
50 | - // then settings page |
|
51 | - add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' ); |
|
50 | + // then settings page |
|
51 | + add_submenu_page( $hook, __( 'MonsterInsights', 'google-analytics-for-wordpress' ), __( 'Settings', 'google-analytics-for-wordpress' ), 'monsterinsights_save_settings', 'monsterinsights_settings', 'monsterinsights_settings_page' ); |
|
52 | 52 | |
53 | - // Add dashboard submenu. |
|
53 | + // Add dashboard submenu. |
|
54 | 54 | add_submenu_page( 'index.php', __( 'General Reports:', 'google-analytics-for-wordpress' ), __( 'Insights', 'google-analytics-for-wordpress' ), 'monsterinsights_view_dashboard', 'admin.php?page=monsterinsights_reports' ); |
55 | 55 | } |
56 | 56 | |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | // First, let's see if this is an MS network enabled plugin. If it is, we should load the license |
78 | 78 | // menu page and the updater on the network panel |
79 | 79 | if ( ! function_exists( 'is_plugin_active_for_network' ) ) { |
80 | - require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
80 | + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $plugin = plugin_basename( MONSTERINSIGHTS_PLUGIN_FILE ); |
84 | 84 | if ( ! is_plugin_active_for_network( $plugin ) ) { |
85 | - return; |
|
85 | + return; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | $menu_icon_inline = monsterinsights_get_inline_menu_icon(); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | function monsterinsights_add_admin_body_class( $classes ) { |
109 | 109 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
110 | 110 | if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) === false ) { |
111 | - return $classes; |
|
111 | + return $classes; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | return "$classes monsterinsights_page "; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
126 | 126 | |
127 | 127 | if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_tools' ) === false || 'insights_page_monsterinsights_tools' === $screen->id ) { |
128 | - return $classes; |
|
128 | + return $classes; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | return "$classes insights_page_monsterinsights_tools "; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | function monsterinsights_add_admin_body_class_addons_page( $classes ) { |
142 | 142 | $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false; |
143 | 143 | if ( empty( $screen ) || empty( $screen->id ) || strpos( $screen->id, 'monsterinsights_addons' ) === false || 'insights_page_monsterinsights_addons' === $screen->id ) { |
144 | - return $classes; |
|
144 | + return $classes; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return "$classes insights_page_monsterinsights_addons "; |
@@ -161,17 +161,17 @@ discard block |
||
161 | 161 | |
162 | 162 | // If lite, show a link where they can get pro from |
163 | 163 | if ( ! monsterinsights_is_pro_version() ) { |
164 | - $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/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
165 | - array_unshift( $links, $get_pro ); |
|
164 | + $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/docs/" ) .'">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; |
|
165 | + array_unshift( $links, $get_pro ); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | // If Lite, support goes to forum. If pro, it goes to our website |
169 | 169 | if ( monsterinsights_is_pro_version() ) { |
170 | - $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>'; |
|
171 | - array_unshift( $links, $support ); |
|
170 | + $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>'; |
|
171 | + array_unshift( $links, $support ); |
|
172 | 172 | } else { |
173 | - $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>'; |
|
174 | - array_unshift( $links, $support ); |
|
173 | + $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>'; |
|
174 | + array_unshift( $links, $support ); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | $settings_link = '<a href="' . esc_url( admin_url( 'admin.php?page=monsterinsights_settings' ) ) . '">' . esc_html__( 'Settings', 'google-analytics-for-wordpress' ) . '</a>'; |
@@ -196,26 +196,26 @@ discard block |
||
196 | 196 | function monsterinsights_load_admin_partial( $template, $data = array() ) { |
197 | 197 | |
198 | 198 | if ( monsterinsights_is_pro_version() ) { |
199 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
199 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'pro/includes/admin/partials' ); |
|
200 | 200 | |
201 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
202 | - require_once( $dir . $template . '.php' ); |
|
203 | - return true; |
|
204 | - } |
|
201 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
202 | + require_once( $dir . $template . '.php' ); |
|
203 | + return true; |
|
204 | + } |
|
205 | 205 | } else { |
206 | - $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
206 | + $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'lite/includes/admin/partials' ); |
|
207 | 207 | |
208 | - if ( file_exists( $dir . $template . '.php' ) ) { |
|
209 | - require_once( $dir . $template . '.php' ); |
|
210 | - return true; |
|
211 | - } |
|
208 | + if ( file_exists( $dir . $template . '.php' ) ) { |
|
209 | + require_once( $dir . $template . '.php' ); |
|
210 | + return true; |
|
211 | + } |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | $dir = trailingslashit( plugin_dir_path( MonsterInsights()->file ) . 'includes/admin/partials' ); |
215 | 215 | |
216 | 216 | if ( file_exists( $dir . $template . '.php' ) ) { |
217 | - require_once( $dir . $template . '.php' ); |
|
218 | - return true; |
|
217 | + require_once( $dir . $template . '.php' ); |
|
218 | + return true; |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | return false; |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | function monsterinsights_admin_footer( $text ) { |
233 | 233 | global $current_screen; |
234 | 234 | if ( ! empty( $current_screen->id ) && strpos( $current_screen->id, 'monsterinsights' ) !== false ) { |
235 | - $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
236 | - $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%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>' ); |
|
235 | + $url = 'https://wordpress.org/support/view/plugin-reviews/google-analytics-for-wordpress?filter=5'; |
|
236 | + $text = sprintf( esc_html__( 'Please rate %sMonsterInsights%s %s on %sWordPress.org%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>' ); |
|
237 | 237 | } |
238 | 238 | return $text; |
239 | 239 | } |
@@ -244,12 +244,12 @@ discard block |
||
244 | 244 | // Don't show on MonsterInsights pages |
245 | 245 | $screen = get_current_screen(); |
246 | 246 | if ( empty( $screen->id ) || strpos( $screen->id, 'monsterinsights' ) !== false ) { |
247 | - return; |
|
247 | + return; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | // Make sure they have the permissions to do something |
251 | 251 | if ( ! current_user_can( 'monsterinsights_save_settings' ) ) { |
252 | - return; |
|
252 | + return; |
|
253 | 253 | } |
254 | 254 | |
255 | 255 | // Priority: |
@@ -266,45 +266,45 @@ discard block |
||
266 | 266 | |
267 | 267 | // 1. Google Analytics not authenticated |
268 | 268 | if ( ! is_network_admin() && ! monsterinsights_get_ua() ) { |
269 | - $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
270 | - $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
271 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
272 | - return; |
|
269 | + $page = admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
270 | + $message = sprintf( esc_html__( 'Please configure your %1$sGoogle Analytics settings%2$s!', 'google-analytics-for-wordpress' ),'<a href="' . $page . '">', '</a>' ); |
|
271 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
272 | + return; |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | // 2. License key not entered for pro |
276 | 276 | $key = monsterinsights_is_pro_version() ? MonsterInsights()->license->get_license_key() : ''; |
277 | 277 | if ( monsterinsights_is_pro_version() && empty( $key ) ) { |
278 | - $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
279 | - $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>' ); |
|
280 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
281 | - return; |
|
278 | + $page = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
|
279 | + $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>' ); |
|
280 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
281 | + return; |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | // 3. License key not valid/okay for pro |
285 | 285 | if ( monsterinsights_is_pro_version() ) { |
286 | - $message = ''; |
|
287 | - if ( MonsterInsights()->license->get_site_license_key() ){ |
|
288 | - if ( MonsterInsights()->license->site_license_expired() ) { |
|
289 | - $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>' ); |
|
290 | - } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
291 | - $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
292 | - } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
293 | - $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' ); |
|
294 | - } |
|
295 | - } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
296 | - if ( MonsterInsights()->license->network_license_expired() ) { |
|
297 | - $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>' ); |
|
298 | - } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
299 | - $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
300 | - } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
301 | - $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' ); |
|
302 | - } |
|
303 | - } |
|
304 | - if ( ! empty( $message ) ) { |
|
305 | - echo '<div class="error"><p>'. $message.'</p></div>'; |
|
306 | - return; |
|
307 | - } |
|
286 | + $message = ''; |
|
287 | + if ( MonsterInsights()->license->get_site_license_key() ){ |
|
288 | + if ( MonsterInsights()->license->site_license_expired() ) { |
|
289 | + $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>' ); |
|
290 | + } else if ( MonsterInsights()->license->site_license_disabled() ) { |
|
291 | + $message = esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
292 | + } else if ( MonsterInsights()->license->site_license_invalid() ) { |
|
293 | + $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' ); |
|
294 | + } |
|
295 | + } else if ( MonsterInsights()->license->get_network_license_key() ) { |
|
296 | + if ( MonsterInsights()->license->network_license_expired() ) { |
|
297 | + $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>' ); |
|
298 | + } else if ( MonsterInsights()->license->network_license_disabled() ) { |
|
299 | + $message = esc_html__( 'Your network license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
|
300 | + } else if ( MonsterInsights()->license->network_license_invalid() ) { |
|
301 | + $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' ); |
|
302 | + } |
|
303 | + } |
|
304 | + if ( ! empty( $message ) ) { |
|
305 | + echo '<div class="error"><p>'. $message.'</p></div>'; |
|
306 | + return; |
|
307 | + } |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | // 4. Notices for PHP/WP version deprecations |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | |
369 | 369 | $notices = get_option( 'monsterinsights_notices' ); |
370 | 370 | if ( ! is_array( $notices ) ) { |
371 | - $notices = array(); |
|
371 | + $notices = array(); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | // 6. Authenticate, not manual |
@@ -376,12 +376,12 @@ discard block |
||
376 | 376 | $url = is_network_admin() ? network_admin_url( 'admin.php?page=monsterinsights_network' ) : admin_url( 'admin.php?page=monsterinsights_settings' ); |
377 | 377 | |
378 | 378 | if ( empty( $authed ) && ! isset( $notices['monsterinsights_auth_not_manual' ] ) ) { |
379 | - echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
|
380 | - echo '<p>'; |
|
381 | - echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
382 | - echo '</p>'; |
|
383 | - echo '</div>'; |
|
384 | - return; |
|
379 | + echo '<div class="notice notice-info is-dismissible monsterinsights-notice" data-notice="monsterinsights_auth_not_manual">'; |
|
380 | + echo '<p>'; |
|
381 | + echo sprintf( esc_html__( 'Important: You are currently using manual UA code output. We highly recommend %1$sauthenticating with MonsterInsights%2$s so that you can access our new reporting area and take advantage of new MonsterInsights features.', 'google-analytics-for-wordpress' ), '<a href="' . $url .'">', '</a>' ); |
|
382 | + echo '</p>'; |
|
383 | + echo '</div>'; |
|
384 | + return; |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | // 7. Automatic updates not configured |
@@ -401,64 +401,64 @@ discard block |
||
401 | 401 | |
402 | 402 | // 8. WooUpsell |
403 | 403 | if ( ! monsterinsights_is_pro_version() && class_exists( 'WooCommerce' ) ) { |
404 | - if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
405 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
406 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
407 | - echo '<p><strong>'; |
|
408 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
409 | - echo '</strong></p>'; |
|
410 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
411 | - echo '<p>'; |
|
412 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
413 | - echo '</p>'; |
|
414 | - echo '<p>'; |
|
415 | - 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' ); |
|
416 | - echo '</p>'; |
|
417 | - echo '<p>'; |
|
418 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
419 | - echo '</p>'; |
|
420 | - echo '<p>'; |
|
421 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
422 | - echo '</p>'; |
|
423 | - 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>' ); |
|
424 | - echo '</p>'; |
|
425 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
426 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
427 | - echo '</div>'; |
|
428 | - echo '</div>'; |
|
429 | - return; |
|
430 | - } |
|
404 | + if ( ! isset( $notices['monsterinsights_woocommerce_tracking_available' ] ) ) { |
|
405 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_woocommerce_tracking_available">'; |
|
406 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
407 | + echo '<p><strong>'; |
|
408 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your WooCommerce Store', 'google-analytics-for-wordpress' ); |
|
409 | + echo '</strong></p>'; |
|
410 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
411 | + echo '<p>'; |
|
412 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
413 | + echo '</p>'; |
|
414 | + echo '<p>'; |
|
415 | + 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' ); |
|
416 | + echo '</p>'; |
|
417 | + echo '<p>'; |
|
418 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
419 | + echo '</p>'; |
|
420 | + echo '<p>'; |
|
421 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
422 | + echo '</p>'; |
|
423 | + 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>' ); |
|
424 | + echo '</p>'; |
|
425 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
426 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
427 | + echo '</div>'; |
|
428 | + echo '</div>'; |
|
429 | + return; |
|
430 | + } |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | // 9. EDDUpsell |
434 | 434 | if ( ! monsterinsights_is_pro_version() && class_exists( 'Easy_Digital_Downloads' ) ) { |
435 | - if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
436 | - echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
437 | - echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
438 | - echo '<p><strong>'; |
|
439 | - echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
440 | - echo '</strong></p>'; |
|
441 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
442 | - echo '<p>'; |
|
443 | - echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
444 | - echo '</p>'; |
|
445 | - echo '<p>'; |
|
446 | - 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' ); |
|
447 | - echo '</p>'; |
|
448 | - echo '<p>'; |
|
449 | - echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
450 | - echo '</p>'; |
|
451 | - echo '<p>'; |
|
452 | - echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
453 | - echo '</p>'; |
|
454 | - 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>' ); |
|
455 | - echo '</p>'; |
|
456 | - echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
457 | - echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
458 | - echo '</div>'; |
|
459 | - echo '</div>'; |
|
460 | - return; |
|
461 | - } |
|
435 | + if ( ! isset( $notices['monsterinsights_edd_tracking_available' ] ) ) { |
|
436 | + echo '<div class="notice notice-success is-dismissible monsterinsights-notice monsterinsights-wooedd-upsell-row" data-notice="monsterinsights_edd_tracking_available">'; |
|
437 | + echo '<div class="monsterinsights-wooedd-upsell-left">'; |
|
438 | + echo '<p><strong>'; |
|
439 | + echo esc_html( 'Enhanced Ecommerce Analytics for Your Easy Digital Downloads Store', 'google-analytics-for-wordpress' ); |
|
440 | + echo '</strong></p>'; |
|
441 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-small" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
442 | + echo '<p>'; |
|
443 | + echo esc_html( 'MonsterInsights Pro gives you detailed stats and insights about your customers.', 'google-analytics-for-wordpress' ); |
|
444 | + echo '</p>'; |
|
445 | + echo '<p>'; |
|
446 | + 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' ); |
|
447 | + echo '</p>'; |
|
448 | + echo '<p>'; |
|
449 | + echo esc_html( 'Pro customers also get Form Tracking, Custom Dimensions Tracking, UserID Tracking and much more.', 'google-analytics-for-wordpress' ); |
|
450 | + echo '</p>'; |
|
451 | + echo '<p>'; |
|
452 | + echo esc_html( 'Start making data-driven decisions to grow your business.', 'google-analytics-for-wordpress' ); |
|
453 | + echo '</p>'; |
|
454 | + 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>' ); |
|
455 | + echo '</p>'; |
|
456 | + echo '</div><div class="monsterinsights-wooedd-upsell-right">'; |
|
457 | + echo '<img class="monsterinsights-wooedd-upsell-image monsterinsights-wooedd-upsell-image-large" src="' . trailingslashit( MONSTERINSIGHTS_PLUGIN_URL ) . 'assets/images/upsell/woo-edd-upsell.png">'; |
|
458 | + echo '</div>'; |
|
459 | + echo '</div>'; |
|
460 | + return; |
|
461 | + } |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | if ( isset( $notices['monsterinsights_cross_domains_extracted'] ) && false === $notices['monsterinsights_cross_domains_extracted'] ) { |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | // AM Notices |
477 | 477 | function monsterinsights_am_notice_optout( $super_admin ) { |
478 | 478 | if ( monsterinsights_get_option( 'hide_am_notices', false ) || monsterinsights_get_option( 'network_hide_am_notices', false ) ) { |
479 | - return false; |
|
479 | + return false; |
|
480 | 480 | } |
481 | 481 | return $super_admin; |
482 | 482 | } |
@@ -44,37 +44,37 @@ discard block |
||
44 | 44 | |
45 | 45 | // Get addons data from transient or perform API query if no transient. |
46 | 46 | if ( false === ( $addons = get_transient( '_monsterinsights_addons' ) ) ) { |
47 | - $addons = monsterinsights_get_addons_data( $key ); |
|
47 | + $addons = monsterinsights_get_addons_data( $key ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // If no Addons exist, return false |
51 | 51 | if ( ! $addons ) { |
52 | - return false; |
|
52 | + return false; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | // Iterate through Addons, to build two arrays: |
56 | 56 | // - Addons the user is licensed to use, |
57 | 57 | // - Addons the user isn't licensed to use. |
58 | 58 | $results = array( |
59 | - 'licensed' => array(), |
|
60 | - 'unlicensed'=> array(), |
|
59 | + 'licensed' => array(), |
|
60 | + 'unlicensed'=> array(), |
|
61 | 61 | ); |
62 | 62 | foreach ( (array) $addons as $i => $addon ) { |
63 | 63 | |
64 | - // Determine whether the user is licensed to use this Addon or not. |
|
65 | - if ( |
|
66 | - empty( $type ) || |
|
67 | - ( in_array( 'Pro', $addon->categories ) && ( $type != 'pro' && $type != 'master' ) ) || |
|
68 | - ( in_array( 'Plus', $addon->categories ) && $type != 'plus' && $type != 'pro' && $type != 'master' ) || |
|
69 | - ( in_array( 'Basic', $addon->categories ) && ( $type != 'basic' && $type != 'plus' && $type != 'pro' && $type != 'master' ) ) |
|
70 | - ) { |
|
71 | - // Unlicensed |
|
72 | - $results['unlicensed'][] = $addon; |
|
73 | - continue; |
|
74 | - } |
|
75 | - |
|
76 | - // Licensed |
|
77 | - $results['licensed'][] = $addon; |
|
64 | + // Determine whether the user is licensed to use this Addon or not. |
|
65 | + if ( |
|
66 | + empty( $type ) || |
|
67 | + ( in_array( 'Pro', $addon->categories ) && ( $type != 'pro' && $type != 'master' ) ) || |
|
68 | + ( in_array( 'Plus', $addon->categories ) && $type != 'plus' && $type != 'pro' && $type != 'master' ) || |
|
69 | + ( in_array( 'Basic', $addon->categories ) && ( $type != 'basic' && $type != 'plus' && $type != 'pro' && $type != 'master' ) ) |
|
70 | + ) { |
|
71 | + // Unlicensed |
|
72 | + $results['unlicensed'][] = $addon; |
|
73 | + continue; |
|
74 | + } |
|
75 | + |
|
76 | + // Licensed |
|
77 | + $results['licensed'][] = $addon; |
|
78 | 78 | |
79 | 79 | } |
80 | 80 | |
@@ -95,21 +95,21 @@ discard block |
||
95 | 95 | // Get Addons |
96 | 96 | // If the key is valid, we'll get personalised upgrade URLs for each Addon (if necessary) and plugin update information. |
97 | 97 | if ( monsterinsights_is_pro_version() && $key ) { |
98 | - $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-addons-data-v600', array( 'tgm-updater-key' => $key ) ); |
|
98 | + $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-addons-data-v600', array( 'tgm-updater-key' => $key ) ); |
|
99 | 99 | } else { |
100 | - $addons = monsterinsights_get_all_addons_data(); |
|
100 | + $addons = monsterinsights_get_all_addons_data(); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // If there was an API error, set transient for only 10 minutes. |
104 | 104 | if ( ! $addons ) { |
105 | - set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS ); |
|
106 | - return false; |
|
105 | + set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS ); |
|
106 | + return false; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | // If there was an error retrieving the addons, set the error. |
110 | 110 | if ( isset( $addons->error ) ) { |
111 | - set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS ); |
|
112 | - return false; |
|
111 | + set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS ); |
|
112 | + return false; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | // Otherwise, our request worked. Save the data and return it. |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | $keys = array_keys( get_plugins() ); |
174 | 174 | |
175 | 175 | foreach ( $keys as $key ) { |
176 | - if ( preg_match( '|^' . $slug . '|', $key ) ) { |
|
177 | - return $key; |
|
178 | - } |
|
176 | + if ( preg_match( '|^' . $slug . '|', $key ) ) { |
|
177 | + return $key; |
|
178 | + } |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | return $slug; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function __construct( $args = array() ) { |
27 | 27 | |
28 | - parent::__construct(); |
|
28 | + parent::__construct(); |
|
29 | 29 | |
30 | 30 | } |
31 | 31 | |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function set_upgrader( &$upgrader ) { |
40 | 40 | |
41 | - if ( is_object( $upgrader ) ) { |
|
42 | - $this->upgrader =& $upgrader; |
|
43 | - } |
|
41 | + if ( is_object( $upgrader ) ) { |
|
42 | + $this->upgrader =& $upgrader; |
|
43 | + } |
|
44 | 44 | |
45 | 45 | } |
46 | 46 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function set_result( $result ) { |
55 | 55 | |
56 | - $this->result = $result; |
|
56 | + $this->result = $result; |
|
57 | 57 | |
58 | 58 | } |
59 | 59 |