@@ -10,7 +10,9 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly |
| 13 | -if ( !defined( 'ABSPATH' ) ) exit; |
|
| 13 | +if ( !defined( 'ABSPATH' ) ) { |
|
| 14 | + exit; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | /** |
| 16 | 18 | * Get the settings for a section |
@@ -153,7 +155,7 @@ discard block |
||
| 153 | 155 | } |
| 154 | 156 | add_action( 'current_screen', 'monsterinsights_save_settings' ); |
| 155 | 157 | |
| 156 | -function monsterinsights_is_settings_tab( $tab = '' ){ |
|
| 158 | +function monsterinsights_is_settings_tab( $tab = '' ) { |
|
| 157 | 159 | $tabs = monsterinsights_get_settings_tabs(); |
| 158 | 160 | if ( empty( $tab ) || empty( $tabs ) || ! is_string( $tab ) || ! is_array( $tabs ) ) { |
| 159 | 161 | return false; |
@@ -317,7 +319,7 @@ discard block |
||
| 317 | 319 | function monsterinsights_sanitize_multicheck_field( $value, $id, $setting, $previous_value ) { |
| 318 | 320 | $save_value = array(); |
| 319 | 321 | if ( ! empty( $value ) && is_array( $value ) ) { |
| 320 | - foreach( $setting['options'] as $key => $option ){ |
|
| 322 | + foreach( $setting['options'] as $key => $option ) { |
|
| 321 | 323 | if ( in_array( $key, $value ) ) { |
| 322 | 324 | $save_value[] = $key; |
| 323 | 325 | } |
@@ -342,7 +344,7 @@ discard block |
||
| 342 | 344 | if ( ! empty( $value ) && is_array( $value ) ) { |
| 343 | 345 | if ( $setting['multiple'] ) { |
| 344 | 346 | foreach ( $value as $vid => $vname ) { |
| 345 | - foreach( $setting['options'] as $key => $option ){ |
|
| 347 | + foreach( $setting['options'] as $key => $option ) { |
|
| 346 | 348 | if ( $key === $vname ) { |
| 347 | 349 | $save_value[] = $key; |
| 348 | 350 | break; |
@@ -350,11 +352,11 @@ discard block |
||
| 350 | 352 | } |
| 351 | 353 | } |
| 352 | 354 | } else { |
| 353 | - foreach( $setting['options'] as $key => $option ){ |
|
| 355 | + foreach( $setting['options'] as $key => $option ) { |
|
| 354 | 356 | if ( is_array( $value ) && in_array( $key, $value ) ) { |
| 355 | 357 | $save_value = $key; |
| 356 | 358 | break; |
| 357 | - } else if ( is_string( $value ) && $key === $value ){ |
|
| 359 | + } else if ( is_string( $value ) && $key === $value ) { |
|
| 358 | 360 | $save_value = $key; |
| 359 | 361 | break; |
| 360 | 362 | } |
@@ -375,7 +377,7 @@ discard block |
||
| 375 | 377 | function monsterinsights_sanitize_radio_field( $value, $id, $setting, $previous_value ) { |
| 376 | 378 | $save_value = ''; |
| 377 | 379 | if ( ! empty( $value ) ) { |
| 378 | - foreach( $setting['options'] as $key => $option ){ |
|
| 380 | + foreach( $setting['options'] as $key => $option ) { |
|
| 379 | 381 | if ( $key === $value ) { |
| 380 | 382 | $save_value = $key; |
| 381 | 383 | } |
@@ -995,7 +997,8 @@ discard block |
||
| 995 | 997 | /** |
| 996 | 998 | * @todo docbloc |
| 997 | 999 | */ |
| 998 | -function monsterinsights_add_setting_tooltip( $html, $args ) { // @todo: enqueue tooltips |
|
| 1000 | +function monsterinsights_add_setting_tooltip( $html, $args ) { |
|
| 1001 | +// @todo: enqueue tooltips |
|
| 999 | 1002 | |
| 1000 | 1003 | if ( ! empty( $args['tooltip_title'] ) && ! empty( $args['tooltip_desc'] ) ) { |
| 1001 | 1004 | $tooltip = '<span alt="f223" class="monsterinsights-help-tip dashicons dashicons-editor-help" title="<strong>' . $args['tooltip_title'] . '</strong>: ' . $args['tooltip_desc'] . '"></span>'; |
@@ -1052,6 +1055,6 @@ discard block |
||
| 1052 | 1055 | /** |
| 1053 | 1056 | * @todo docbloc |
| 1054 | 1057 | */ |
| 1055 | -function monsterinsights_get_non_setting_types(){ |
|
| 1058 | +function monsterinsights_get_non_setting_types() { |
|
| 1056 | 1059 | return apply_filters( 'monsterinsights_non_setting_types', array( 'descriptive_text', 'hook', 'upgrade_notice', 'install_notice', 'notice' ) ); |
| 1057 | 1060 | } |
| 1058 | 1061 | \ No newline at end of file |
@@ -166,7 +166,7 @@ |
||
| 166 | 166 | |
| 167 | 167 | // Deactivate the addon. |
| 168 | 168 | if ( isset( $_POST['plugin'] ) ) { |
| 169 | - if ( isset( $_POST['isnetwork'] ) && $_POST['isnetwork'] ) { |
|
| 169 | + if ( isset( $_POST['isnetwork'] ) && $_POST['isnetwork'] ) { |
|
| 170 | 170 | $deactivate = deactivate_plugins( $_POST['plugin'], false, true ); |
| 171 | 171 | } else { |
| 172 | 172 | $deactivate = deactivate_plugins( $_POST['plugin'] ); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | <?php |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -function monsterinsights_tools_url_builder_tab(){ |
|
| 54 | +function monsterinsights_tools_url_builder_tab() { |
|
| 55 | 55 | do_action( 'monsterinsights_tools_url_builder_tab' ); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | </th> |
| 71 | 71 | <td> |
| 72 | 72 | <?php |
| 73 | - if ( ! empty( $_REQUEST['action'] ) && ! empty( $_REQUEST['result'] ) && $_REQUEST['action'] === 'import' && $_REQUEST['result'] === 'success' ){ |
|
| 73 | + if ( ! empty( $_REQUEST['action'] ) && ! empty( $_REQUEST['result'] ) && $_REQUEST['action'] === 'import' && $_REQUEST['result'] === 'success' ) { |
|
| 74 | 74 | echo MonsterInsights()->notices->display_inline_notice( 'monsterinsights_standard_notice', '', __( 'Successfully imported settings!','google-analytics-for-wordpress'), 'success', false, array() ); |
| 75 | 75 | } |
| 76 | 76 | ?> |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if ( $_POST['monsterinsights_action'] !== 'monsterinsights_export_settings' ){ |
|
| 136 | + if ( $_POST['monsterinsights_action'] !== 'monsterinsights_export_settings' ) { |
|
| 137 | 137 | return; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | return; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - if ( $_POST['monsterinsights_action'] !== 'monsterinsights_import_settings' ){ |
|
| 167 | + if ( $_POST['monsterinsights_action'] !== 'monsterinsights_import_settings' ) { |
|
| 168 | 168 | return; |
| 169 | 169 | } |
| 170 | 170 | |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | function monsterinsights_rss_link_tagger( $guid ) { |
| 127 | 127 | global $post; |
| 128 | 128 | |
| 129 | - if ( monsterinsights_get_option( 'tag_links_in_rss', false ) ){ |
|
| 129 | + if ( monsterinsights_get_option( 'tag_links_in_rss', false ) ) { |
|
| 130 | 130 | if ( is_feed() ) { |
| 131 | 131 | if ( monsterinsights_get_option( 'allow_anchor', false ) ) { |
| 132 | 132 | $delimiter = '#'; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | 15 | // Exit if accessed directly |
| 16 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 16 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 17 | 17 | exit; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -72,7 +72,8 @@ discard block |
||
| 72 | 72 | // This is the version used for MI upgrade routines. |
| 73 | 73 | update_option( 'monsterinsights_db_version', '6.2.0' ); |
| 74 | 74 | |
| 75 | - } else if ( ! $version && $yoast ) { // if new install and has used Yoast previously |
|
| 75 | + } else if ( ! $version && $yoast ) { |
|
| 76 | +// if new install and has used Yoast previously |
|
| 76 | 77 | |
| 77 | 78 | $this->upgrade_from_yoast(); |
| 78 | 79 | // This is the version used for MI upgrade routines. |
@@ -83,7 +84,8 @@ discard block |
||
| 83 | 84 | $cachec = true; |
| 84 | 85 | } |
| 85 | 86 | |
| 86 | - } else { // if existing install |
|
| 87 | + } else { |
|
| 88 | +// if existing install |
|
| 87 | 89 | if ( version_compare( $version, '6.0.2', '<' ) ) { |
| 88 | 90 | $this->v602_upgrades(); |
| 89 | 91 | } |
@@ -328,7 +330,7 @@ discard block |
||
| 328 | 330 | $network = false; |
| 329 | 331 | // Try network active Premium |
| 330 | 332 | $is_key = get_site_option( 'google-analytics-by-yoast-premium_license', array() ); |
| 331 | - if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ){ |
|
| 333 | + if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ) { |
|
| 332 | 334 | $key = $is_key['key']; |
| 333 | 335 | $found = true; |
| 334 | 336 | $network = true; |
@@ -337,7 +339,7 @@ discard block |
||
| 337 | 339 | // Try single site Premium |
| 338 | 340 | if ( ! $found ) { |
| 339 | 341 | $is_key = get_option( 'google-analytics-by-yoast-premium_license', array() ); |
| 340 | - if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ){ |
|
| 342 | + if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ) { |
|
| 341 | 343 | $key = $is_key['key']; |
| 342 | 344 | $found = true; |
| 343 | 345 | } |
@@ -346,7 +348,7 @@ discard block |
||
| 346 | 348 | // Try network active Premium |
| 347 | 349 | if ( ! $found ) { |
| 348 | 350 | $is_key = get_site_option( 'monsterinsights-pro_license', array() ); |
| 349 | - if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ){ |
|
| 351 | + if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ) { |
|
| 350 | 352 | $key = $is_key['key']; |
| 351 | 353 | $found = true; |
| 352 | 354 | $network = true; |
@@ -356,7 +358,7 @@ discard block |
||
| 356 | 358 | // Try single site Premium |
| 357 | 359 | if ( ! $found ) { |
| 358 | 360 | $is_key = get_option( 'monsterinsights-pro_license', array() ); |
| 359 | - if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ){ |
|
| 361 | + if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ) { |
|
| 360 | 362 | $key = $is_key['key']; |
| 361 | 363 | $found = true; |
| 362 | 364 | } |
@@ -365,7 +367,7 @@ discard block |
||
| 365 | 367 | // Try network active ecommmerce |
| 366 | 368 | if ( ! $found ) { |
| 367 | 369 | $is_key = get_site_option( 'ecommerce-addon_license', array() ); |
| 368 | - if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ){ |
|
| 370 | + if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ) { |
|
| 369 | 371 | $key = $is_key['key']; |
| 370 | 372 | $found = true; |
| 371 | 373 | $network = true; |
@@ -374,7 +376,7 @@ discard block |
||
| 374 | 376 | // Try single site ecommerce |
| 375 | 377 | if ( ! $found ) { |
| 376 | 378 | $is_key = get_option( 'ecommerce-addon_license', array() ); |
| 377 | - if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ){ |
|
| 379 | + if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ) { |
|
| 378 | 380 | $key = $is_key['key']; |
| 379 | 381 | $found = true; |
| 380 | 382 | } |
@@ -516,7 +518,7 @@ discard block |
||
| 516 | 518 | delete_option( 'yoast-ga-access_token' ); |
| 517 | 519 | delete_option( 'yoast-ga-refresh_token' ); |
| 518 | 520 | delete_option( 'yst_ga_api' ); |
| 519 | - } else { |
|
| 521 | + } else { |
|
| 520 | 522 | // if UA in profile profiles, remove others and use that |
| 521 | 523 | if ( ! empty( $options['analytics_profile' ] ) && ! empty( $profiles['ga_api_response_accounts'] ) && is_array( $profiles['ga_api_response_accounts'] ) ) { |
| 522 | 524 | foreach ( $profiles as $account ) { |
@@ -10,7 +10,9 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly |
| 13 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 13 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 14 | + exit; |
|
| 15 | +} |
|
| 14 | 16 | |
| 15 | 17 | /** |
| 16 | 18 | * Callback for displaying the UI for support tab. |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $inbound_paths = array( $inbound_paths ); |
| 97 | 97 | } |
| 98 | 98 | $i = 0; |
| 99 | - foreach ( $inbound_paths as $path ){ |
|
| 99 | + foreach ( $inbound_paths as $path ) { |
|
| 100 | 100 | $inbound_paths[ $i ] = esc_js( trim( $path ) ); |
| 101 | 101 | $i++; |
| 102 | 102 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $download_extensions = array( $download_extensions ); |
| 111 | 111 | } |
| 112 | 112 | $i = 0; |
| 113 | - foreach( $download_extensions as $extension ){ |
|
| 113 | + foreach( $download_extensions as $extension ) { |
|
| 114 | 114 | $download_extensions[ $i ] = esc_js( trim( $extension ) ); |
| 115 | 115 | $i++; |
| 116 | 116 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | <p><?php esc_html_e( 'Activate your MonsterInsights license key on this panel to hide the license key settings and addon pages for subsites.', 'google-analytics-for-wordpress'); ?></p> |
| 53 | 53 | <table class="form-table"> |
| 54 | 54 | <tbody> |
| 55 | - <?php if ( monsterinsights_is_pro_version() ) { |
|
| 55 | + <?php if ( monsterinsights_is_pro_version() ) { |
|
| 56 | 56 | |
| 57 | 57 | $license_key = MonsterInsights()->license->get_network_license_key(); |
| 58 | 58 | $license_key = $license_key ? $license_key : MonsterInsights()->license->get_default_license_key(); |