@@ -26,16 +26,16 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $defaults = array( |
| 28 | 28 | 't' => 'event', // Required: Hit type |
| 29 | - 'ec' => '', // Optional: Event category |
|
| 30 | - 'ea' => '', // Optional: Event Action |
|
| 31 | - 'el' => '', // Optional: Event Label |
|
| 32 | - 'ev' => null, // Optional: Event Value |
|
| 29 | + 'ec' => '', // Optional: Event category |
|
| 30 | + 'ea' => '', // Optional: Event Action |
|
| 31 | + 'el' => '', // Optional: Event Label |
|
| 32 | + 'ev' => null, // Optional: Event Value |
|
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | - $body = array_merge( $defaults , $args ); |
|
| 35 | + $body = array_merge( $defaults, $args ); |
|
| 36 | 36 | |
| 37 | 37 | // We want to get the user's IP address when possible |
| 38 | - $ip = ''; |
|
| 38 | + $ip = ''; |
|
| 39 | 39 | if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) && ! filter_var( $_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP ) === false ) { |
| 40 | 40 | $ip = $_SERVER['HTTP_CLIENT_IP']; |
| 41 | 41 | } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && ! filter_var( $_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP ) === false ) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | 'uip' => $ip, |
| 82 | 82 | |
| 83 | 83 | // Optional: User Agent |
| 84 | - 'ua' => ! empty( $user_agent ) ? $user_agent : $_SERVER['HTTP_USER_AGENT'], |
|
| 84 | + 'ua' => ! empty( $user_agent ) ? $user_agent : $_SERVER['HTTP_USER_AGENT'], |
|
| 85 | 85 | |
| 86 | 86 | // Optional: Time of the event |
| 87 | 87 | 'z' => time() |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | // Unset empty values to reduce request size |
| 100 | 100 | foreach ( $body as $key => $value ) { |
| 101 | 101 | if ( empty( $value ) ) { |
| 102 | - unset( $body[ $key ] ); |
|
| 102 | + unset( $body[$key] ); |
|
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | // Optional: Event Value |
| 143 | 143 | 'ev' => null, |
| 144 | 144 | ); |
| 145 | - $args = wp_parse_args( $args, $default_args ); |
|
| 145 | + $args = wp_parse_args( $args, $default_args ); |
|
| 146 | 146 | //$args = apply_filters( 'monsterinsights_mp_track_event_call', $args ); |
| 147 | 147 | |
| 148 | 148 | return monsterinsights_mp_api_call( $args ); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | // Exit if accessed directly |
| 13 | -if ( !defined( 'ABSPATH' ) ) exit; |
|
| 13 | +if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Get the settings for a section |
@@ -82,23 +82,23 @@ discard block |
||
| 82 | 82 | // get subtab |
| 83 | 83 | $settings = monsterinsights_get_registered_settings(); |
| 84 | 84 | $tab = $_POST['monsterinsights_settings_sub_tab']; |
| 85 | - if ( empty( $settings ) || !is_array( $settings ) || empty( $settings[ $tab ] ) || ! is_array( $settings[ $tab ] ) ) { |
|
| 85 | + if ( empty( $settings ) || ! is_array( $settings ) || empty( $settings[$tab] ) || ! is_array( $settings[$tab] ) ) { |
|
| 86 | 86 | return; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | // Okay we're good to sanitize, validate, and save this section's settings |
| 90 | 90 | |
| 91 | 91 | // We only care about this sections's settings |
| 92 | - $settings = $settings[ $tab ]; |
|
| 92 | + $settings = $settings[$tab]; |
|
| 93 | 93 | |
| 94 | 94 | // Run a general sanitization for the tab for special fields |
| 95 | 95 | $input = ! empty( $_POST['monsterinsights_settings'] ) ? $_POST['monsterinsights_settings'] : array(); |
| 96 | 96 | $input = apply_filters( 'monsterinsights_settings_' . $tab . '_sanitize', $input ); |
| 97 | 97 | |
| 98 | - foreach( $settings as $id => $setting ) { |
|
| 98 | + foreach ( $settings as $id => $setting ) { |
|
| 99 | 99 | |
| 100 | 100 | // If the value wasn't passed in, set to false, which will delete the option |
| 101 | - $value = isset( $input[ $id ] ) ? $input[ $id ] : false; |
|
| 101 | + $value = isset( $input[$id] ) ? $input[$id] : false; |
|
| 102 | 102 | $previous_value = monsterinsights_get_option( $id, false ); |
| 103 | 103 | |
| 104 | 104 | // Sanitize/Validate |
@@ -138,9 +138,9 @@ discard block |
||
| 138 | 138 | ) ); |
| 139 | 139 | |
| 140 | 140 | // Sanitize settings |
| 141 | - $value = apply_filters( 'monsterinsights_settings_sanitize_' . $id , $value, $id, $args, $previous_value ); |
|
| 141 | + $value = apply_filters( 'monsterinsights_settings_sanitize_' . $id, $value, $id, $args, $previous_value ); |
|
| 142 | 142 | $value = apply_filters( 'monsterinsights_settings_sanitize_' . $type, $value, $id, $args, $previous_value ); |
| 143 | - $value = apply_filters( 'monsterinsights_settings_sanitize' , $value, $id, $args, $previous_value ); |
|
| 143 | + $value = apply_filters( 'monsterinsights_settings_sanitize', $value, $id, $args, $previous_value ); |
|
| 144 | 144 | |
| 145 | 145 | // Save |
| 146 | 146 | if ( ! has_action( 'monsterinsights_settings_save_' . $args['type'] ) ) { |
@@ -153,13 +153,13 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | add_action( 'current_screen', 'monsterinsights_save_settings' ); |
| 155 | 155 | |
| 156 | -function monsterinsights_is_settings_tab( $tab = '' ){ |
|
| 156 | +function monsterinsights_is_settings_tab( $tab = '' ) { |
|
| 157 | 157 | $tabs = monsterinsights_get_settings_tabs(); |
| 158 | 158 | if ( empty( $tab ) || empty( $tabs ) || ! is_string( $tab ) || ! is_array( $tabs ) ) { |
| 159 | 159 | return false; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - return !empty( $tabs[$tab]); |
|
| 162 | + return ! empty( $tabs[$tab] ); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | if ( ! empty( $settings[$section] ) ) { |
| 177 | 177 | foreach ( $settings[$section] as $setting ) { |
| 178 | 178 | if ( is_array( $setting ) && array_key_exists( 'type', $setting ) ) { |
| 179 | - $setting_types[ $setting['id'] ] = $setting['type']; |
|
| 179 | + $setting_types[$setting['id']] = $setting['type']; |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | foreach ( $settings as $tab ) { |
| 185 | 185 | foreach ( $tab as $setting ) { |
| 186 | 186 | if ( is_array( $setting ) && array_key_exists( 'type', $setting ) ) { |
| 187 | - $setting_types[ $setting['id'] ] = $setting['type']; |
|
| 187 | + $setting_types[$setting['id']] = $setting['type']; |
|
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | } |
@@ -256,14 +256,14 @@ discard block |
||
| 256 | 256 | function _sanitize_text_fields( $str, $keep_newlines = false ) { |
| 257 | 257 | $filtered = wp_check_invalid_utf8( $str ); |
| 258 | 258 | |
| 259 | - if ( strpos($filtered, '<') !== false ) { |
|
| 259 | + if ( strpos( $filtered, '<' ) !== false ) { |
|
| 260 | 260 | $filtered = wp_pre_kses_less_than( $filtered ); |
| 261 | 261 | // This will strip extra whitespace for us. |
| 262 | 262 | $filtered = wp_strip_all_tags( $filtered, false ); |
| 263 | 263 | |
| 264 | 264 | // Use html entities in a special case to make sure no later |
| 265 | 265 | // newline stripping stage could lead to a functional tag |
| 266 | - $filtered = str_replace("<\n", "<\n", $filtered); |
|
| 266 | + $filtered = str_replace( "<\n", "<\n", $filtered ); |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | if ( ! $keep_newlines ) { |
@@ -272,14 +272,14 @@ discard block |
||
| 272 | 272 | $filtered = trim( $filtered ); |
| 273 | 273 | |
| 274 | 274 | $found = false; |
| 275 | - while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) { |
|
| 276 | - $filtered = str_replace($match[0], '', $filtered); |
|
| 275 | + while ( preg_match( '/%[a-f0-9]{2}/i', $filtered, $match ) ) { |
|
| 276 | + $filtered = str_replace( $match[0], '', $filtered ); |
|
| 277 | 277 | $found = true; |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | if ( $found ) { |
| 281 | 281 | // Strip out the whitespace that may now exist after removing the octets. |
| 282 | - $filtered = trim( preg_replace('/ +/', ' ', $filtered) ); |
|
| 282 | + $filtered = trim( preg_replace( '/ +/', ' ', $filtered ) ); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | return $filtered; |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | function monsterinsights_sanitize_multicheck_field( $value, $id, $setting, $previous_value ) { |
| 318 | 318 | $save_value = array(); |
| 319 | 319 | if ( ! empty( $value ) && is_array( $value ) ) { |
| 320 | - foreach( $setting['options'] as $key => $option ){ |
|
| 320 | + foreach ( $setting['options'] as $key => $option ) { |
|
| 321 | 321 | if ( in_array( $key, $value ) ) { |
| 322 | 322 | $save_value[] = $key; |
| 323 | 323 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | if ( ! empty( $value ) && is_array( $value ) ) { |
| 343 | 343 | if ( $setting['multiple'] ) { |
| 344 | 344 | foreach ( $value as $vid => $vname ) { |
| 345 | - foreach( $setting['options'] as $key => $option ){ |
|
| 345 | + foreach ( $setting['options'] as $key => $option ) { |
|
| 346 | 346 | if ( $key === $vname ) { |
| 347 | 347 | $save_value[] = $key; |
| 348 | 348 | break; |
@@ -350,11 +350,11 @@ discard block |
||
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | } else { |
| 353 | - foreach( $setting['options'] as $key => $option ){ |
|
| 353 | + foreach ( $setting['options'] as $key => $option ) { |
|
| 354 | 354 | if ( is_array( $value ) && in_array( $key, $value ) ) { |
| 355 | 355 | $save_value = $key; |
| 356 | 356 | break; |
| 357 | - } else if ( is_string( $value ) && $key === $value ){ |
|
| 357 | + } else if ( is_string( $value ) && $key === $value ) { |
|
| 358 | 358 | $save_value = $key; |
| 359 | 359 | break; |
| 360 | 360 | } |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | function monsterinsights_sanitize_radio_field( $value, $id, $setting, $previous_value ) { |
| 376 | 376 | $save_value = ''; |
| 377 | 377 | if ( ! empty( $value ) ) { |
| 378 | - foreach( $setting['options'] as $key => $option ){ |
|
| 378 | + foreach ( $setting['options'] as $key => $option ) { |
|
| 379 | 379 | if ( $key === $value ) { |
| 380 | 380 | $save_value = $key; |
| 381 | 381 | } |
@@ -492,14 +492,14 @@ discard block |
||
| 492 | 492 | */ |
| 493 | 493 | function monsterinsights_get_pages( $force = false ) { |
| 494 | 494 | $pages_options = array( '' => '' ); // Blank option |
| 495 | - if( ( ! isset( $_GET['page'] ) || 'monsterinsights_settings' != $_GET['page'] ) && ! $force ) { |
|
| 495 | + if ( ( ! isset( $_GET['page'] ) || 'monsterinsights_settings' != $_GET['page'] ) && ! $force ) { |
|
| 496 | 496 | return $pages_options; |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | $pages = get_pages(); |
| 500 | 500 | if ( $pages ) { |
| 501 | 501 | foreach ( $pages as $page ) { |
| 502 | - $pages_options[ $page->ID ] = $page->post_title; |
|
| 502 | + $pages_options[$page->ID] = $page->post_title; |
|
| 503 | 503 | } |
| 504 | 504 | } |
| 505 | 505 | |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | $html = '<input type="checkbox" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']"' . $name . ' value="1" ' . $checked . ' class="' . $class . '" ' . $disabled . ' />'; |
| 543 | - $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 543 | + $html .= '<p class="description">' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 544 | 544 | |
| 545 | 545 | return apply_filters( 'monsterinsights_after_setting_output', $html, $args ); |
| 546 | 546 | } |
@@ -562,9 +562,9 @@ discard block |
||
| 562 | 562 | |
| 563 | 563 | $html = ''; |
| 564 | 564 | if ( ! empty( $args['options'] ) ) { |
| 565 | - foreach( $args['options'] as $key => $option ): |
|
| 566 | - if( isset( $monsterinsights_option[ $key ] ) ) { $enabled = $option; } else { $enabled = NULL; } |
|
| 567 | - $html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="checkbox" value="' . esc_attr( $option ) . '" ' . checked($option, $enabled, false) . '/> '; |
|
| 565 | + foreach ( $args['options'] as $key => $option ): |
|
| 566 | + if ( isset( $monsterinsights_option[$key] ) ) { $enabled = $option; } else { $enabled = NULL; } |
|
| 567 | + $html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="checkbox" value="' . esc_attr( $option ) . '" ' . checked( $option, $enabled, false ) . '/> '; |
|
| 568 | 568 | $html .= '<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']">' . wp_kses_post( $option ) . '</label><br/>'; |
| 569 | 569 | endforeach; |
| 570 | 570 | $html .= '<p class="description">' . $args['desc'] . '</p>'; |
@@ -596,12 +596,12 @@ discard block |
||
| 596 | 596 | |
| 597 | 597 | if ( $monsterinsights_options && $monsterinsights_options == $key ) { |
| 598 | 598 | $checked = true; |
| 599 | - } else if( isset( $args['std'] ) && $args['std'] == $key && ! $monsterinsights_options ) { |
|
| 599 | + } else if ( isset( $args['std'] ) && $args['std'] == $key && ! $monsterinsights_options ) { |
|
| 600 | 600 | $checked = true; |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | $html .= '<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']">'; |
| 604 | - $html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="radio" value="' . monsterinsights_sanitize_key( $key ) . '" ' . checked(true, $checked, false) . '/> '; |
|
| 604 | + $html .= '<input name="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . '][' . monsterinsights_sanitize_key( $key ) . ']" class="' . $class . '" type="radio" value="' . monsterinsights_sanitize_key( $key ) . '" ' . checked( true, $checked, false ) . '/> '; |
|
| 605 | 605 | $html .= esc_html( $option ) . '</label>'; |
| 606 | 606 | endforeach; |
| 607 | 607 | |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | |
| 626 | 626 | if ( $monsterinsights_option ) { |
| 627 | 627 | $value = $monsterinsights_option; |
| 628 | - } elseif( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) { |
|
| 628 | + } elseif ( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) { |
|
| 629 | 629 | $value = ''; |
| 630 | 630 | } else { |
| 631 | 631 | $value = isset( $args['std'] ) ? $args['std'] : ''; |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | $readonly = $args['readonly'] === true ? ' readonly="readonly"' : ''; |
| 646 | 646 | $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular'; |
| 647 | 647 | $html = '<input type="text" class="' . $class . ' ' . sanitize_html_class( $size ) . '-text" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" ' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"' . $readonly . $disabled . ' placeholder="' . esc_attr( $args['placeholder'] ) . '"/>'; |
| 648 | - $html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 648 | + $html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 649 | 649 | |
| 650 | 650 | return apply_filters( 'monsterinsights_after_setting_output', $html, $args ); |
| 651 | 651 | } |
@@ -679,13 +679,13 @@ discard block |
||
| 679 | 679 | |
| 680 | 680 | $class = monsterinsights_sanitize_html_class( $args['field_class'] ); |
| 681 | 681 | |
| 682 | - $max = isset( $args['max'] ) ? $args['max'] : 999999; |
|
| 683 | - $min = isset( $args['min'] ) ? $args['min'] : 0; |
|
| 682 | + $max = isset( $args['max'] ) ? $args['max'] : 999999; |
|
| 683 | + $min = isset( $args['min'] ) ? $args['min'] : 0; |
|
| 684 | 684 | $step = isset( $args['step'] ) ? $args['step'] : 1; |
| 685 | 685 | |
| 686 | 686 | $size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular'; |
| 687 | 687 | $html = '<input type="number" step="' . esc_attr( $step ) . '" max="' . esc_attr( $max ) . '" min="' . esc_attr( $min ) . '" class="' . $class . ' ' . sanitize_html_class( $size ) . '-text" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" ' . $name . ' value="' . esc_attr( stripslashes( $value ) ) . '"/>'; |
| 688 | - $html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 688 | + $html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 689 | 689 | |
| 690 | 690 | return apply_filters( 'monsterinsights_after_setting_output', $html, $args ); |
| 691 | 691 | } |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | $class = monsterinsights_sanitize_html_class( $args['field_class'] ); |
| 713 | 713 | |
| 714 | 714 | $html = '<textarea class="' . $class . ' large-text" cols="50" rows="5" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']">' . esc_textarea( stripslashes( $value ) ) . '</textarea>'; |
| 715 | - $html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 715 | + $html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 716 | 716 | |
| 717 | 717 | return apply_filters( 'monsterinsights_after_setting_output', $html, $args ); |
| 718 | 718 | } |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | $class = monsterinsights_sanitize_html_class( $args['field_class'] ); |
| 743 | 743 | |
| 744 | 744 | $html = '<textarea class="' . $class . ' large-text" cols="50" rows="5" id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']">' . stripslashes( $value ) . '</textarea>'; |
| 745 | - $html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 745 | + $html .= '<p class="description"> ' . wp_kses_post( $args['desc'] ) . '</p>'; |
|
| 746 | 746 | } else { |
| 747 | 747 | $html .= sprintf( esc_html__( 'You must have the %s capability to view/edit this setting', 'google-analytics-for-wordpress' ), '"unfiltered_html"' ); |
| 748 | 748 | } |
@@ -788,7 +788,7 @@ discard block |
||
| 788 | 788 | * |
| 789 | 789 | * @return void |
| 790 | 790 | */ |
| 791 | -function monsterinsights_select_callback($args) { |
|
| 791 | +function monsterinsights_select_callback( $args ) { |
|
| 792 | 792 | $monsterinsights_option = monsterinsights_get_option( $args['id'] ); |
| 793 | 793 | |
| 794 | 794 | if ( $monsterinsights_option ) { |
@@ -810,14 +810,14 @@ discard block |
||
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | $allowclear = isset( $args['allowclear'] ) ? (bool) $args['allowclear'] : false; |
| 813 | - $multiple = isset( $args['multiple'] ) ? (bool) $args['multiple'] : false; |
|
| 813 | + $multiple = isset( $args['multiple'] ) ? (bool) $args['multiple'] : false; |
|
| 814 | 814 | $multiple = $multiple ? 'multiple="multiple"' : ''; |
| 815 | 815 | $multiple_arg = $multiple ? '[]' : ''; |
| 816 | 816 | |
| 817 | - $html = '<select id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']' . $multiple_arg .'" class="' . $class . '" data-placeholder="' . esc_html( $placeholder ) . '" data-allow-clear="' . $allowclear . '" ' . $multiple . ' />'; |
|
| 817 | + $html = '<select id="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']" name="monsterinsights_settings[' . esc_attr( $args['id'] ) . ']' . $multiple_arg . '" class="' . $class . '" data-placeholder="' . esc_html( $placeholder ) . '" data-allow-clear="' . $allowclear . '" ' . $multiple . ' />'; |
|
| 818 | 818 | |
| 819 | 819 | foreach ( $args['options'] as $option => $name ) { |
| 820 | - $selected = ! empty( $value ) && is_array( $value ) ? in_array( $option, $value ) : $value === $option; |
|
| 820 | + $selected = ! empty( $value ) && is_array( $value ) ? in_array( $option, $value ) : $value === $option; |
|
| 821 | 821 | $selected = selected( true, $selected, false ); |
| 822 | 822 | $html .= '<option value="' . esc_attr( $option ) . '" ' . $selected . '>' . esc_html( $name ) . '</option>'; |
| 823 | 823 | } |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | if ( $monsterinsights_option ) { |
| 843 | 843 | $value = $monsterinsights_option; |
| 844 | 844 | } else { |
| 845 | - if( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) { |
|
| 845 | + if ( ! empty( $args['allow_blank'] ) && empty( $monsterinsights_option ) ) { |
|
| 846 | 846 | $value = ''; |
| 847 | 847 | } else { |
| 848 | 848 | $value = isset( $args['std'] ) ? $args['std'] : ''; |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | * @return void |
| 903 | 903 | */ |
| 904 | 904 | function monsterinsights_upgrade_notice_callback( $args ) { |
| 905 | - $html = '<div class="monsterinsights-upsell-box"><h2>' . esc_html( $args['name' ] ) . '</h2>' |
|
| 905 | + $html = '<div class="monsterinsights-upsell-box"><h2>' . esc_html( $args['name'] ) . '</h2>' |
|
| 906 | 906 | . '<p class="monsterinsights-upsell-lite-text">' . $args['desc'] . '</p>' |
| 907 | 907 | . '<p class="monsterinsights-upsell-button-par"><a href="https://www.monsterinsights.com/lite/" class="monsterinsights-upsell-box-button button button-primary">' . __( 'Click here to Upgrade', 'google-analytics-for-wordpress' ) . '</a></p>' |
| 908 | 908 | . '</div>'; |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | * @param array $args Arguments passed by the setting |
| 933 | 933 | * @return void |
| 934 | 934 | */ |
| 935 | -function monsterinsights_missing_callback($args) { |
|
| 935 | +function monsterinsights_missing_callback( $args ) { |
|
| 936 | 936 | return sprintf( |
| 937 | 937 | __( 'The callback function used for the %s setting is missing.', 'google-analytics-for-wordpress' ), |
| 938 | 938 | '<strong>' . $args['id'] . '</strong>' |
@@ -963,12 +963,12 @@ discard block |
||
| 963 | 963 | } |
| 964 | 964 | } |
| 965 | 965 | if ( $submit_button ) { |
| 966 | - $html .= '<input type="hidden" name="monsterinsights_settings_tab" value="' . esc_attr( $page ). '"/>'; |
|
| 967 | - $html .= '<input type="hidden" name="monsterinsights_settings_sub_tab" value="' . esc_attr( $section ) . '"/>'; |
|
| 966 | + $html .= '<input type="hidden" name="monsterinsights_settings_tab" value="' . esc_attr( $page ) . '"/>'; |
|
| 967 | + $html .= '<input type="hidden" name="monsterinsights_settings_sub_tab" value="' . esc_attr( $section ) . '"/>'; |
|
| 968 | 968 | $html .= wp_nonce_field( 'monsterinsights-settings-nonce', 'monsterinsights-settings-nonce', true, false ); |
| 969 | 969 | $html .= get_submit_button( esc_html__( 'Save Changes', 'google-analytics-for-wordpress' ), 'primary', 'monsterinsights-settings-submit', false ); |
| 970 | 970 | } |
| 971 | - $html = apply_filters( 'monsterinsights_html_after_submit_field', $html, $page, $section ); |
|
| 971 | + $html = apply_filters( 'monsterinsights_html_after_submit_field', $html, $page, $section ); |
|
| 972 | 972 | } |
| 973 | 973 | return $html; |
| 974 | 974 | } |
@@ -978,10 +978,10 @@ discard block |
||
| 978 | 978 | */ |
| 979 | 979 | function monsterinsights_render_field( $args ) { |
| 980 | 980 | $output = ''; |
| 981 | - $output .='<tr id="monsterinsights-input-' . monsterinsights_sanitize_key( $args['id'] ) .'">'; |
|
| 981 | + $output .= '<tr id="monsterinsights-input-' . monsterinsights_sanitize_key( $args['id'] ) . '">'; |
|
| 982 | 982 | if ( ! empty( $args['name'] ) && empty( $args['no_label'] ) ) { |
| 983 | 983 | $output .= '<th scope="row">'; |
| 984 | - $output .='<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']">' . esc_html( $args["name"] ) . '</label>'; |
|
| 984 | + $output .= '<label for="monsterinsights_settings[' . monsterinsights_sanitize_key( $args['id'] ) . ']">' . esc_html( $args["name"] ) . '</label>'; |
|
| 985 | 985 | $output .= '</th>'; |
| 986 | 986 | } |
| 987 | 987 | $output .= '<td>'; |
@@ -1024,9 +1024,9 @@ discard block |
||
| 1024 | 1024 | $notices = get_transient( 'monsterinsights_settings_notices' ); |
| 1025 | 1025 | if ( empty( $notices ) ) { |
| 1026 | 1026 | $notices = array(); |
| 1027 | - $notices[ $name ] = array( "type" => $type, "message" => $message ); |
|
| 1027 | + $notices[$name] = array( "type" => $type, "message" => $message ); |
|
| 1028 | 1028 | } else { |
| 1029 | - $notices[ $name ] = array( "type" => $type, "message" => $message ); |
|
| 1029 | + $notices[$name] = array( "type" => $type, "message" => $message ); |
|
| 1030 | 1030 | } |
| 1031 | 1031 | set_transient( 'monsterinsights_settings_notices', $notices ); |
| 1032 | 1032 | } |
@@ -1038,8 +1038,8 @@ discard block |
||
| 1038 | 1038 | $notices = get_transient( 'monsterinsights_settings_notices' ); |
| 1039 | 1039 | $found = false; |
| 1040 | 1040 | if ( ! empty( $notices ) ) { |
| 1041 | - if ( isset( $notices[ $name] ) ) { |
|
| 1042 | - unset( $notices[ $name] ); |
|
| 1041 | + if ( isset( $notices[$name] ) ) { |
|
| 1042 | + unset( $notices[$name] ); |
|
| 1043 | 1043 | set_transient( 'monsterinsights_settings_notices', $notices ); |
| 1044 | 1044 | $found = true; |
| 1045 | 1045 | } else { |
@@ -1052,6 +1052,6 @@ discard block |
||
| 1052 | 1052 | /** |
| 1053 | 1053 | * @todo docbloc |
| 1054 | 1054 | */ |
| 1055 | -function monsterinsights_get_non_setting_types(){ |
|
| 1056 | - return apply_filters( 'monsterinsights_non_setting_types', array( 'descriptive_text', 'hook', 'upgrade_notice', 'install_notice', 'notice' ) ); |
|
| 1055 | +function monsterinsights_get_non_setting_types() { |
|
| 1056 | + return apply_filters( 'monsterinsights_non_setting_types', array( 'descriptive_text', 'hook', 'upgrade_notice', 'install_notice', 'notice' ) ); |
|
| 1057 | 1057 | } |
| 1058 | 1058 | \ No newline at end of file |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | |
| 57 | 57 | public function is_dismissed( $notice ) { |
| 58 | - if ( ! isset( $this->notices[ $notice ] ) ) { |
|
| 58 | + if ( ! isset( $this->notices[$notice] ) ) { |
|
| 59 | 59 | return false; |
| 60 | 60 | } |
| 61 | 61 | return true; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * @return null |
| 73 | 73 | */ |
| 74 | 74 | public function dismiss( $notice ) { |
| 75 | - $this->notices[ $notice ] = true; |
|
| 75 | + $this->notices[$notice] = true; |
|
| 76 | 76 | update_option( 'monsterinsights_notices', $this->notices ); |
| 77 | 77 | |
| 78 | 78 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * @return null |
| 89 | 89 | */ |
| 90 | 90 | public function undismiss( $notice ) { |
| 91 | - unset( $this->notices[ $notice ] ); |
|
| 91 | + unset( $this->notices[$notice] ); |
|
| 92 | 92 | update_option( 'monsterinsights_notices', $this->notices ); |
| 93 | 93 | |
| 94 | 94 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | return ''; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - $dismissible = ( $is_dismissible ) ? ' is-dismissible': ''; |
|
| 136 | + $dismissible = ( $is_dismissible ) ? ' is-dismissible' : ''; |
|
| 137 | 137 | |
| 138 | 138 | // Display inline notice |
| 139 | 139 | ob_start(); |
@@ -177,16 +177,16 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | $target = ''; |
| 180 | - if ( ! empty( $args['primary']['target'] ) && $args['primary']['target'] === 'blank') { |
|
| 180 | + if ( ! empty( $args['primary']['target'] ) && $args['primary']['target'] === 'blank' ) { |
|
| 181 | 181 | $target = ' target="_blank" rel="noopener noreferrer"'; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | $class = 'button button-primary'; |
| 185 | 185 | if ( ! empty( $args['primary']['class'] ) ) { |
| 186 | - $class = ' class="'. $args['primary']['class'] . '"'; |
|
| 186 | + $class = ' class="' . $args['primary']['class'] . '"'; |
|
| 187 | 187 | } |
| 188 | 188 | ?> |
| 189 | - <a href="<?php echo esc_attr( $url ); ?>"<?php echo $target; ?><?php echo $class;?>><?php echo esc_html( $text ); ?></a> |
|
| 189 | + <a href="<?php echo esc_attr( $url ); ?>"<?php echo $target; ?><?php echo $class; ?>><?php echo esc_html( $text ); ?></a> |
|
| 190 | 190 | <?php |
| 191 | 191 | } |
| 192 | 192 | |
@@ -204,16 +204,16 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | $target = ''; |
| 207 | - if ( ! empty( $args['secondary']['target'] ) && $args['secondary']['target'] === 'blank') { |
|
| 207 | + if ( ! empty( $args['secondary']['target'] ) && $args['secondary']['target'] === 'blank' ) { |
|
| 208 | 208 | $target = ' target="_blank" rel="noopener noreferrer"'; |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | $class = 'button button-secondary'; |
| 212 | 212 | if ( ! empty( $args['secondary']['class'] ) ) { |
| 213 | - $class = ' class="'. $args['secondary']['class'] . '"'; |
|
| 213 | + $class = ' class="' . $args['secondary']['class'] . '"'; |
|
| 214 | 214 | } |
| 215 | 215 | ?> |
| 216 | - <a href="<?php echo esc_attr( $url ); ?>"<?php echo $target; ?><?php echo $class;?>><?php echo esc_html( $text ); ?></a> |
|
| 216 | + <a href="<?php echo esc_attr( $url ); ?>"<?php echo $target; ?><?php echo $class; ?>><?php echo esc_html( $text ); ?></a> |
|
| 217 | 217 | <?php |
| 218 | 218 | } |
| 219 | 219 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | public function set_upgrader( &$upgrader ) { |
| 40 | 40 | |
| 41 | 41 | if ( is_object( $upgrader ) ) { |
| 42 | - $this->upgrader =& $upgrader; |
|
| 42 | + $this->upgrader = & $upgrader; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | } |
@@ -253,18 +253,18 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | // Create a new stdClass object and populate it with our plugin information. |
| 255 | 255 | $api = new stdClass; |
| 256 | - $api->name = isset( $this->info->name ) ? $this->info->name : ''; |
|
| 257 | - $api->slug = isset( $this->info->slug ) ? $this->info->slug : ''; |
|
| 258 | - $api->version = isset( $this->info->version ) ? $this->info->version : ''; |
|
| 259 | - $api->author = isset( $this->info->author ) ? $this->info->author : ''; |
|
| 256 | + $api->name = isset( $this->info->name ) ? $this->info->name : ''; |
|
| 257 | + $api->slug = isset( $this->info->slug ) ? $this->info->slug : ''; |
|
| 258 | + $api->version = isset( $this->info->version ) ? $this->info->version : ''; |
|
| 259 | + $api->author = isset( $this->info->author ) ? $this->info->author : ''; |
|
| 260 | 260 | $api->author_profile = isset( $this->info->author_profile ) ? $this->info->author_profile : ''; |
| 261 | - $api->requires = isset( $this->info->requires ) ? $this->info->requires : ''; |
|
| 262 | - $api->tested = isset( $this->info->tested ) ? $this->info->tested : ''; |
|
| 263 | - $api->last_updated = isset( $this->info->last_updated ) ? $this->info->last_updated : ''; |
|
| 264 | - $api->homepage = isset( $this->info->homepage ) ? $this->info->homepage : ''; |
|
| 261 | + $api->requires = isset( $this->info->requires ) ? $this->info->requires : ''; |
|
| 262 | + $api->tested = isset( $this->info->tested ) ? $this->info->tested : ''; |
|
| 263 | + $api->last_updated = isset( $this->info->last_updated ) ? $this->info->last_updated : ''; |
|
| 264 | + $api->homepage = isset( $this->info->homepage ) ? $this->info->homepage : ''; |
|
| 265 | 265 | |
| 266 | - $changelog = isset( $this->info->changelog ) ? $this->info->changelog : ''; |
|
| 267 | - $description = isset( $this->info->description ) ? $this->info->description : ''; |
|
| 266 | + $changelog = isset( $this->info->changelog ) ? $this->info->changelog : ''; |
|
| 267 | + $description = isset( $this->info->description ) ? $this->info->description : ''; |
|
| 268 | 268 | |
| 269 | 269 | if ( ! empty( $changelog ) ) { |
| 270 | 270 | if ( ! empty( $description ) ) { |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $api->sections = array(); |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | - $api->download_link = isset( $this->info->download_link ) ? $this->info->download_link : ''; |
|
| 282 | + $api->download_link = isset( $this->info->download_link ) ? $this->info->download_link : ''; |
|
| 283 | 283 | |
| 284 | 284 | // Return the new API object with our custom data. |
| 285 | 285 | return $api; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // Activate the addon. |
| 133 | 133 | if ( isset( $_POST['plugin'] ) ) { |
| 134 | - if ( isset( $_POST['isnetwork'] ) && $_POST['isnetwork'] ) { |
|
| 134 | + if ( isset( $_POST['isnetwork'] ) && $_POST['isnetwork'] ) { |
|
| 135 | 135 | $activate = activate_plugin( $_POST['plugin'], NULL, true ); |
| 136 | 136 | } else { |
| 137 | 137 | $activate = activate_plugin( $_POST['plugin'] ); |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | wp_die(); |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - $url = 'https://www.googleapis.com/urlshortener/v1/url'; |
|
| 222 | + $url = 'https://www.googleapis.com/urlshortener/v1/url'; |
|
| 223 | 223 | |
| 224 | 224 | // If no url passed die |
| 225 | 225 | if ( ! $shorten ) { |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | // if the url is already shortened, don't re-run |
| 231 | - if ( strpos( $shorten, 'goo.g') !== false ) { |
|
| 231 | + if ( strpos( $shorten, 'goo.g' ) !== false ) { |
|
| 232 | 232 | echo $shorten; |
| 233 | 233 | wp_die(); |
| 234 | 234 | } |
@@ -240,8 +240,8 @@ discard block |
||
| 240 | 240 | 'https://www.googleapis.com/urlshortener/v1/url' |
| 241 | 241 | ), |
| 242 | 242 | array( |
| 243 | - 'body' => json_encode( array('longUrl' => esc_url_raw( $shorten ) ) ), |
|
| 244 | - 'headers' => array( 'Content-Type' => 'application/json') |
|
| 243 | + 'body' => json_encode( array( 'longUrl' => esc_url_raw( $shorten ) ) ), |
|
| 244 | + 'headers' => array( 'Content-Type' => 'application/json' ) |
|
| 245 | 245 | ) |
| 246 | 246 | ); |
| 247 | 247 | |
@@ -51,13 +51,13 @@ 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 | |
| 58 | 58 | function monsterinsights_tools_settings_tab() { |
| 59 | - ob_start();?> |
|
| 60 | - <h2><?php echo esc_html__( 'Setting Tools', 'google-analytics-for-wordpress' );?></h2> |
|
| 59 | + ob_start(); ?> |
|
| 60 | + <h2><?php echo esc_html__( 'Setting Tools', 'google-analytics-for-wordpress' ); ?></h2> |
|
| 61 | 61 | <p><?php echo esc_html__( 'You can use the below tools to import settings from other MonsterInsights websites or export settings to import into another MonsterInsights install.', 'google-analytics-for-wordpress' ); ?> </p> |
| 62 | 62 | <br /> |
| 63 | 63 | <table class="form-table"> |
@@ -65,13 +65,13 @@ discard block |
||
| 65 | 65 | <tr> |
| 66 | 66 | <th scope="row"> |
| 67 | 67 | <label for="monsterinsights-import-settings"> |
| 68 | - <?php echo esc_html__( 'Import Settings', 'google-analytics-for-wordpress' );?> |
|
| 68 | + <?php echo esc_html__( 'Import Settings', 'google-analytics-for-wordpress' ); ?> |
|
| 69 | 69 | </label> |
| 70 | 70 | </th> |
| 71 | 71 | <td> |
| 72 | 72 | <?php |
| 73 | - if ( ! empty( $_REQUEST['action'] ) && ! empty( $_REQUEST['result'] ) && $_REQUEST['action'] === 'import' && $_REQUEST['result'] === 'success' ){ |
|
| 74 | - echo MonsterInsights()->notices->display_inline_notice( 'monsterinsights_standard_notice', '', __( 'Successfully imported settings!','google-analytics-for-wordpress'), 'success', false, array() ); |
|
| 73 | + if ( ! empty( $_REQUEST['action'] ) && ! empty( $_REQUEST['result'] ) && $_REQUEST['action'] === 'import' && $_REQUEST['result'] === 'success' ) { |
|
| 74 | + echo MonsterInsights()->notices->display_inline_notice( 'monsterinsights_standard_notice', '', __( 'Successfully imported settings!', 'google-analytics-for-wordpress' ), 'success', false, array() ); |
|
| 75 | 75 | } |
| 76 | 76 | ?> |
| 77 | 77 | <form method="post" enctype="multipart/form-data"> |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | <input type="file" name="import_file"/> |
| 80 | 80 | <input type="hidden" name="monsterinsights_action" value="monsterinsights_import_settings" /> |
| 81 | 81 | </p> |
| 82 | - <p class="description"><?php echo esc_html__( 'Paste the import field content from another MonsterInsights site in above.', 'google-analytics-for-wordpress' );?></p> |
|
| 82 | + <p class="description"><?php echo esc_html__( 'Paste the import field content from another MonsterInsights site in above.', 'google-analytics-for-wordpress' ); ?></p> |
|
| 83 | 83 | <p> |
| 84 | 84 | <?php wp_nonce_field( 'monsterinsights_import_settings', 'monsterinsights_import_settings' ); ?> |
| 85 | 85 | </p> |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | <tr> |
| 93 | 93 | <th scope="row"> |
| 94 | 94 | <label for="monsterinsights-export-settings"> |
| 95 | - <?php echo esc_html__( 'Export Settings:', 'google-analytics-for-wordpress' );?> |
|
| 95 | + <?php echo esc_html__( 'Export Settings:', 'google-analytics-for-wordpress' ); ?> |
|
| 96 | 96 | </label> |
| 97 | 97 | </th> |
| 98 | 98 | <td> |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * @return void |
| 126 | 126 | */ |
| 127 | 127 | function monsterinsights_process_export_settings() { |
| 128 | - if ( !isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) { |
|
| 128 | + if ( ! isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) { |
|
| 129 | 129 | return; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -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 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | function monsterinsights_import_settings() { |
| 158 | 158 | |
| 159 | - if ( !isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) { |
|
| 159 | + if ( ! isset( $_POST['monsterinsights_action'] ) || empty( $_POST['monsterinsights_action'] ) ) { |
|
| 160 | 160 | return; |
| 161 | 161 | } |
| 162 | 162 | |
@@ -164,11 +164,11 @@ 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 | |
| 171 | - if ( !wp_verify_nonce( $_POST['monsterinsights_import_settings'], 'monsterinsights_import_settings' ) ) { |
|
| 171 | + if ( ! wp_verify_nonce( $_POST['monsterinsights_import_settings'], 'monsterinsights_import_settings' ) ) { |
|
| 172 | 172 | return; |
| 173 | 173 | } |
| 174 | 174 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | wp_die( __( 'Please upload a file to import', 'google-analytics-for-wordpress' ) ); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - $file = file_get_contents( $import_file ); |
|
| 188 | + $file = file_get_contents( $import_file ); |
|
| 189 | 189 | if ( empty( $file ) ) { |
| 190 | 190 | wp_die( __( 'Please upload a real settings export file to import', 'google-analytics-for-wordpress' ) ); |
| 191 | 191 | } |
@@ -203,20 +203,20 @@ discard block |
||
| 203 | 203 | ); |
| 204 | 204 | |
| 205 | 205 | foreach ( $exclude as $e ) { |
| 206 | - if ( ! empty( $new_settings[ $e ] ) ) { |
|
| 207 | - unset( $new_settings[ $e ] ); |
|
| 206 | + if ( ! empty( $new_settings[$e] ) ) { |
|
| 207 | + unset( $new_settings[$e] ); |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | if ( ! is_super_admin() ) { |
| 212 | - if ( ! empty( $new_settings[ 'custom_code' ] ) ) { |
|
| 213 | - unset( $new_settings[ 'custom_code' ] ); |
|
| 212 | + if ( ! empty( $new_settings['custom_code'] ) ) { |
|
| 213 | + unset( $new_settings['custom_code'] ); |
|
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | foreach ( $exclude as $e ) { |
| 218 | - if ( ! empty( $settings[ $e ] ) ) { |
|
| 219 | - $new_settings = $settings[ $e ]; |
|
| 218 | + if ( ! empty( $settings[$e] ) ) { |
|
| 219 | + $new_settings = $settings[$e]; |
|
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * not be used by other developers. This hook's behavior may be modified |
| 77 | 77 | * or the hook may be removed at any time, without warning. |
| 78 | 78 | */ |
| 79 | - do_action('monsterinsights_head'); |
|
| 79 | + do_action( 'monsterinsights_head' ); |
|
| 80 | 80 | ?> |
| 81 | 81 | <?php echo monsterinsights_ublock_notice(); ?> |
| 82 | 82 | <div id="monsterinsights-addon-heading" class="monsterinsights-addons-subheading monsterinsights-clearfix-after"> |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | <div id="monsterinsights-addons"> |
| 155 | 155 | <?php |
| 156 | 156 | // Output Addons the User is licensed to use. |
| 157 | - if ( count( $addons['licensed'] )> 0 ) { |
|
| 157 | + if ( count( $addons['licensed'] ) > 0 ) { |
|
| 158 | 158 | ?> |
| 159 | 159 | <div class="monsterinsights-addons-area licensed" class="monsterinsights-clear"> |
| 160 | 160 | <h3><?php esc_html_e( 'Available Addons:', 'google-analytics-for-wordpress' ); ?></h3> |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | ?> |
| 179 | 179 | <div class="monsterinsights-addons-area unlicensed" class="monsterinsights-clear"> |
| 180 | 180 | <h3><?php esc_html_e( 'Unlock More Addons', 'google-analytics-for-wordpress' ); ?></h3> |
| 181 | - <p><?php echo sprintf( esc_html__( '%1$sWant even more addons?%2$sUpgrade your MonsterInsights account%3$s and unlock the following addons:', 'google-analytics-for-wordpress' ), '<strong>', '</strong> <a href="' . $upgrade_url. '">', '</a>' ); ?></p> |
|
| 181 | + <p><?php echo sprintf( esc_html__( '%1$sWant even more addons?%2$sUpgrade your MonsterInsights account%3$s and unlock the following addons:', 'google-analytics-for-wordpress' ), '<strong>', '</strong> <a href="' . $upgrade_url . '">', '</a>' ); ?></p> |
|
| 182 | 182 | |
| 183 | 183 | <div id="monsterinsights-addons-unlicensed" class="monsterinsights-addons"> |
| 184 | 184 | <!-- list container class required for list.js --> |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $slug = 'ga-ecommerce'; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | - $plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug ); |
|
| 358 | + $plugin_basename = monsterinsights_get_plugin_basename_from_slug( $slug ); |
|
| 359 | 359 | $categories = implode( ',', $addon->categories ); |
| 360 | 360 | if ( ! $installed_plugins ) { |
| 361 | 361 | $installed_plugins = get_plugins(); |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | // Link user to doc to install MI pro to install addons |
| 371 | - if ( ! monsterinsights_is_pro_version() && $is_licensed && ! isset( $installed_plugins[ $plugin_basename ] ) ) { |
|
| 371 | + if ( ! monsterinsights_is_pro_version() && $is_licensed && ! isset( $installed_plugins[$plugin_basename] ) ) { |
|
| 372 | 372 | $addon->url = 'https://www.monsterinsights.com/docs/install-monsterinsights-pro-to-use-addons'; |
| 373 | 373 | } |
| 374 | 374 | |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | // Addon is licensed |
| 406 | 406 | |
| 407 | 407 | // If the plugin is not installed, display an install message and button. |
| 408 | - if ( ! isset( $installed_plugins[ $plugin_basename ] ) ) { |
|
| 408 | + if ( ! isset( $installed_plugins[$plugin_basename] ) ) { |
|
| 409 | 409 | if ( empty( $addon->url ) ) { |
| 410 | 410 | $addon->url = ''; |
| 411 | 411 | } |
@@ -451,17 +451,17 @@ discard block |
||
| 451 | 451 | <div class="monsterinsights-addon-active monsterinsights-addon-message"> |
| 452 | 452 | <div class="interior"> |
| 453 | 453 | <?php if ( $ms_active ) { ?> |
| 454 | - <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sNetwork Active%2$s', 'google-analytics-for-wordpress'), '<span>', '</span>' ); ?></span> |
|
| 454 | + <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sNetwork Active%2$s', 'google-analytics-for-wordpress' ), '<span>', '</span>' ); ?></span> |
|
| 455 | 455 | <?php } else { ?> |
| 456 | - <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sActive%2$s', 'google-analytics-for-wordpress'), '<span>', '</span>' ); ?></span> |
|
| 456 | + <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sActive%2$s', 'google-analytics-for-wordpress' ), '<span>', '</span>' ); ?></span> |
|
| 457 | 457 | <?php } ?> |
| 458 | - <?php if ( ( is_multisite() && is_network_admin() && $ms_active ) || ! is_multisite() || ( is_multisite() && !is_network_admin() && !$ms_active && $ss_active ) ) { ?> |
|
| 458 | + <?php if ( ( is_multisite() && is_network_admin() && $ms_active ) || ! is_multisite() || ( is_multisite() && ! is_network_admin() && ! $ms_active && $ss_active ) ) { ?> |
|
| 459 | 459 | <div class="monsterinsights-addon-action"> |
| 460 | 460 | <a class="button button-primary monsterinsights-addon-action-button monsterinsights-deactivate-addon" href="#" rel="<?php echo esc_attr( $plugin_basename ); ?>"> |
| 461 | 461 | <i class="monsterinsights-toggle-on"></i> |
| 462 | 462 | <?php if ( is_multisite() && is_network_admin() && $ms_active ) { ?> |
| 463 | 463 | <?php esc_html_e( 'Network deactivate', 'google-analytics-for-wordpress' ); ?> |
| 464 | - <?php } else if ( is_multisite() && !is_network_admin() && !$ms_active && $ss_active ) { ?> |
|
| 464 | + <?php } else if ( is_multisite() && ! is_network_admin() && ! $ms_active && $ss_active ) { ?> |
|
| 465 | 465 | <?php esc_html_e( 'Deactivate', 'google-analytics-for-wordpress' ); ?> |
| 466 | 466 | <?php } else { ?> |
| 467 | 467 | <?php esc_html_e( 'Deactivate', 'google-analytics-for-wordpress' ); ?> |
@@ -479,9 +479,9 @@ discard block |
||
| 479 | 479 | <div class="monsterinsights-addon-inactive monsterinsights-addon-message"> |
| 480 | 480 | <div class="interior"> |
| 481 | 481 | <?php if ( $ms_active ) { ?> |
| 482 | - <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sNetwork Inactive%2$s', 'google-analytics-for-wordpress'), '<span>', '</span>' ); ?></span> |
|
| 482 | + <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sNetwork Inactive%2$s', 'google-analytics-for-wordpress' ), '<span>', '</span>' ); ?></span> |
|
| 483 | 483 | <?php } else { ?> |
| 484 | - <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sInactive%2$s', 'google-analytics-for-wordpress'), '<span>', '</span>' ); ?></span> |
|
| 484 | + <span class="addon-status"><?php echo sprintf( esc_html__( 'Status: %1$sInactive%2$s', 'google-analytics-for-wordpress' ), '<span>', '</span>' ); ?></span> |
|
| 485 | 485 | <?php } ?> |
| 486 | 486 | <div class="monsterinsights-addon-action"> |
| 487 | 487 | <a class="button button-primary monsterinsights-addon-action-button monsterinsights-activate-addon" href="#" rel="<?php echo esc_attr( $plugin_basename ); ?>"> |
@@ -84,9 +84,9 @@ |
||
| 84 | 84 | * @return string Javascript to output. |
| 85 | 85 | */ |
| 86 | 86 | public function frontend_output( ) { |
| 87 | - $output = '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->'; |
|
| 88 | - $output .= '<!-- ' . esc_html__( "You are currently in a preview window. MonsterInsights doesn't track preview window traffic to avoid false visit reports.", 'google-analytics-for-wordpress' ) . ' -->'; |
|
| 89 | - $output .= '<!-- / Google Analytics by MonsterInsights -->'; |
|
| 87 | + $output = '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION . ' - https://www.monsterinsights.com/ -->'; |
|
| 88 | + $output .= '<!-- ' . esc_html__( "You are currently in a preview window. MonsterInsights doesn't track preview window traffic to avoid false visit reports.", 'google-analytics-for-wordpress' ) . ' -->'; |
|
| 89 | + $output .= '<!-- / Google Analytics by MonsterInsights -->'; |
|
| 90 | 90 | return $output; |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | \ No newline at end of file |