@@ -214,9 +214,9 @@ |
||
214 | 214 | $schedule['minute'] = wp_rand( 0, 59 ); |
215 | 215 | $schedule['second'] = wp_rand( 0, 59 ); |
216 | 216 | $schedule['offset'] = ( $schedule['day'] * DAY_IN_SECONDS ) + |
217 | - ( $schedule['hour'] * HOUR_IN_SECONDS ) + |
|
218 | - ( $schedule['minute'] * MINUTE_IN_SECONDS ) + |
|
219 | - $schedule['second']; |
|
217 | + ( $schedule['hour'] * HOUR_IN_SECONDS ) + |
|
218 | + ( $schedule['minute'] * MINUTE_IN_SECONDS ) + |
|
219 | + $schedule['second']; |
|
220 | 220 | $date = strtotime( 'next saturday' ) + $schedule['offset']; |
221 | 221 | |
222 | 222 | return $date; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $options['email_summaries'] = $email_summaries; |
46 | 46 | $options['summaries_html_template'] = monsterinsights_get_option( 'summaries_html_template', 'yes' ); |
47 | 47 | $options['summaries_carbon_copy'] = 'no'; |
48 | - $options['summaries_email_addresses'] = array(get_option('admin_email')); |
|
48 | + $options['summaries_email_addresses'] = array( get_option( 'admin_email' ) ); |
|
49 | 49 | $options['summaries_header_image'] = false; |
50 | 50 | |
51 | 51 | $this->email_options = $options; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | ( $schedule['hour'] * HOUR_IN_SECONDS ) + |
218 | 218 | ( $schedule['minute'] * MINUTE_IN_SECONDS ) + |
219 | 219 | $schedule['second']; |
220 | - $date = strtotime( 'next saturday' ) + $schedule['offset']; |
|
220 | + $date = strtotime( 'next saturday' ) + $schedule['offset']; |
|
221 | 221 | |
222 | 222 | return $date; |
223 | 223 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | public function get_email_subject() { |
264 | 264 | |
265 | 265 | $site_url = get_site_url(); |
266 | - $site_url_parsed = parse_url( $site_url );// Can't use wp_parse_url as that was added in WP 4.4 and we still support 3.8. |
|
266 | + $site_url_parsed = parse_url( $site_url ); // Can't use wp_parse_url as that was added in WP 4.4 and we still support 3.8. |
|
267 | 267 | $site_url = isset( $site_url_parsed['host'] ) ? $site_url_parsed['host'] : $site_url; |
268 | 268 | |
269 | 269 | // Translators: The domain of the site is appended to the subject. |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * @since 8.19.0 |
279 | 279 | */ |
280 | 280 | public function get_email_addresses() { |
281 | - $emails = $this->email_options['summaries_email_addresses']; |
|
281 | + $emails = $this->email_options['summaries_email_addresses']; |
|
282 | 282 | return apply_filters( 'monsterinsights_email_addresses_to_send', $emails ); |
283 | 283 | } |
284 | 284 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | return; |
324 | 324 | } |
325 | 325 | |
326 | - if( !monsterinsights_is_authed() ){ |
|
326 | + if ( ! monsterinsights_is_authed() ) { |
|
327 | 327 | return; |
328 | 328 | } |
329 | 329 | |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $next_block = $info_blocks->get_next(); |
350 | 350 | |
351 | 351 | // Go. |
352 | - if( !empty( $email['address'] ) ){ |
|
352 | + if ( ! empty( $email['address'] ) ) { |
|
353 | 353 | foreach ( $email['address'] as $address ) { |
354 | 354 | $sent = $emails->send( trim( $address ), $email['subject'] ); |
355 | 355 | |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | } |
393 | 393 | |
394 | 394 | // Go. |
395 | - if(!empty($email['address'])){ |
|
395 | + if ( ! empty( $email['address'] ) ) { |
|
396 | 396 | foreach ( $email['address'] as $address ) { |
397 | 397 | if ( ! $emails->send( trim( $address ), $email['subject'] ) ) { |
398 | 398 | wp_send_json_error(); |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | $args['body']['settings_tab_url'] = esc_url( admin_url( 'admin.php?page=monsterinsights_settings#/advanced' ) ); |
429 | 429 | $args['footer']['settings_tab_url'] = esc_url( admin_url( 'admin.php?page=monsterinsights_settings#/advanced' ) ); |
430 | 430 | |
431 | - $args['body']['summaries']['data']['galinks']['topposts'] = admin_url( 'admin.php?page=monsterinsights_reports#/' ); |
|
431 | + $args['body']['summaries']['data']['galinks']['topposts'] = admin_url( 'admin.php?page=monsterinsights_reports#/' ); |
|
432 | 432 | |
433 | 433 | return apply_filters( 'monsterinsights_email_summaries_template_args', $args ); |
434 | 434 | } |
@@ -171,7 +171,8 @@ discard block |
||
171 | 171 | * |
172 | 172 | */ |
173 | 173 | public function is_preview() { |
174 | - if ( isset( $_GET['monsterinsights_email_preview'], $_GET['monsterinsights_email_template'] ) && 'summary' === $_GET['monsterinsights_email_template'] ) { // phpcs:ignore |
|
174 | + if ( isset( $_GET['monsterinsights_email_preview'], $_GET['monsterinsights_email_template'] ) && 'summary' === $_GET['monsterinsights_email_template'] ) { |
|
175 | +// phpcs:ignore |
|
175 | 176 | return true; |
176 | 177 | } |
177 | 178 | |
@@ -323,7 +324,7 @@ discard block |
||
323 | 324 | return; |
324 | 325 | } |
325 | 326 | |
326 | - if( !monsterinsights_is_authed() ){ |
|
327 | + if( !monsterinsights_is_authed() ) { |
|
327 | 328 | return; |
328 | 329 | } |
329 | 330 | |
@@ -349,7 +350,7 @@ discard block |
||
349 | 350 | $next_block = $info_blocks->get_next(); |
350 | 351 | |
351 | 352 | // Go. |
352 | - if( !empty( $email['address'] ) ){ |
|
353 | + if( !empty( $email['address'] ) ) { |
|
353 | 354 | foreach ( $email['address'] as $address ) { |
354 | 355 | $sent = $emails->send( trim( $address ), $email['subject'] ); |
355 | 356 | |
@@ -392,7 +393,7 @@ discard block |
||
392 | 393 | } |
393 | 394 | |
394 | 395 | // Go. |
395 | - if(!empty($email['address'])){ |
|
396 | + if(!empty($email['address'])) { |
|
396 | 397 | foreach ( $email['address'] as $address ) { |
397 | 398 | if ( ! $emails->send( trim( $address ), $email['subject'] ) ) { |
398 | 399 | wp_send_json_error(); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | $info['status'] = $fetched['status']; |
65 | 65 | $info['default'] = array(); |
66 | - $info['default'][ $fetched['default']['id'] ] = $fetched['default']; |
|
66 | + $info['default'][$fetched['default']['id']] = $fetched['default']; |
|
67 | 67 | $info['summaries'] = array(); |
68 | 68 | |
69 | 69 | foreach ( $fetched['summaries'] as $item ) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | continue; |
79 | 79 | } |
80 | 80 | |
81 | - $info['summaries'][ $id ] = $item; |
|
81 | + $info['summaries'][$id] = $item; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | return $info; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | continue; |
114 | 114 | } |
115 | 115 | |
116 | - $filtered[ $key ] = $item; |
|
116 | + $filtered[$key] = $item; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | return $filtered; |
@@ -139,15 +139,15 @@ discard block |
||
139 | 139 | $current_time = time(); |
140 | 140 | |
141 | 141 | if ( ! empty( $start ) && empty( $end ) && $current_time >= $start ) { |
142 | - $data_by_date[ $key ] = $item; |
|
142 | + $data_by_date[$key] = $item; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | if ( empty( $start ) && ! empty( $end ) && $current_time <= $end ) { |
146 | - $data_by_date[ $key ] = $item; |
|
146 | + $data_by_date[$key] = $item; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | if ( $current_time >= $start && $current_time <= $end ) { |
150 | - $data_by_date[ $key ] = $item; |
|
150 | + $data_by_date[$key] = $item; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | exit; |
14 | 14 | } |
15 | 15 | |
16 | -$top_pages = array( |
|
16 | +$top_pages = array( |
|
17 | 17 | array( |
18 | 18 | 'url' => 'https://example.com/test', |
19 | 19 | 'title' => 'Contact Page', |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'sessions' => '80', |
34 | 34 | ), |
35 | 35 | ); |
36 | -$top_referrals = array( |
|
36 | +$top_referrals = array( |
|
37 | 37 | array( |
38 | 38 | 'url' => 'https://facebook.com/', |
39 | 39 | 'sessions' => '100980', |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | |
74 | 74 | $i = 0; |
75 | 75 | while ( $i <= 2 ) { |
76 | - echo esc_html( $i + 1 . ". " . $top_pages[ $i ]['title'] . " - " . $top_pages[ $i ]['url'] ) . "\n\n"; |
|
77 | - $i ++; |
|
76 | + echo esc_html( $i + 1 . ". " . $top_pages[$i]['title'] . " - " . $top_pages[$i]['url'] ) . "\n\n"; |
|
77 | + $i++; |
|
78 | 78 | } |
79 | 79 | |
80 | -echo "View More - " . esc_url( $more_pages ) . "\n\n";; |
|
80 | +echo "View More - " . esc_url( $more_pages ) . "\n\n"; ; |
|
81 | 81 | |
82 | 82 | echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; |
83 | 83 | |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | |
86 | 86 | $i = 0; |
87 | 87 | while ( $i <= 2 ) { |
88 | - echo esc_html( $i + 1 . ". " . $top_referrals[ $i ]['url'] ) . "\n\n"; |
|
89 | - $i ++; |
|
88 | + echo esc_html( $i + 1 . ". " . $top_referrals[$i]['url'] ) . "\n\n"; |
|
89 | + $i++; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | echo "View More - " . esc_url( $more_referrals ) . "\n\n"; |
@@ -10,79 +10,79 @@ discard block |
||
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 | |
17 | -$icon_increase = plugins_url("lite/assets/img/emails/summaries/increase.png", MONSTERINSIGHTS_PLUGIN_FILE); |
|
18 | -$icon_increase_2x = plugins_url("lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE); |
|
19 | -$icon_decrease = plugins_url("lite/assets/img/emails/summaries/decrease.png", MONSTERINSIGHTS_PLUGIN_FILE); |
|
20 | -$icon_decrease_2x = plugins_url("lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE); |
|
21 | -$icon_top_pages = plugins_url("lite/assets/img/emails/summaries/icon-top-pages.png", MONSTERINSIGHTS_PLUGIN_FILE); |
|
22 | -$icon_top_pages_2x = plugins_url("lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE); |
|
23 | -$icon_sessions = plugins_url("lite/assets/img/emails/summaries/icon-sessions.png", MONSTERINSIGHTS_PLUGIN_FILE); |
|
24 | -$icon_sessions_2x = plugins_url("lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE); |
|
25 | -$icon_page_views = plugins_url("lite/assets/img/emails/summaries/icon-page-views.png", MONSTERINSIGHTS_PLUGIN_FILE); |
|
26 | -$icon_page_views_2x = plugins_url("lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE); |
|
27 | -$icon_engagement = plugins_url("lite/assets/img/emails/summaries/icon-engagement.png", MONSTERINSIGHTS_PLUGIN_FILE); |
|
28 | -$icon_engagement_2x = plugins_url("lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE); |
|
29 | -$icon_more_traffic = plugins_url("lite/assets/img/emails/summaries/icon-more-traffic.png", MONSTERINSIGHTS_PLUGIN_FILE); |
|
30 | -$icon_more_traffic_2x = plugins_url("lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE); |
|
31 | -$icon_button_arrow = plugins_url("lite/assets/img/emails/summaries/icon-button-arrow.png", MONSTERINSIGHTS_PLUGIN_FILE); |
|
32 | -$icon_button_arrow_2x = plugins_url("lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE); |
|
33 | -$icon_bulb = plugins_url("lite/assets/img/emails/summaries/icon-bulb.png", MONSTERINSIGHTS_PLUGIN_FILE); |
|
34 | -$icon_bulb_2x = plugins_url("lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE); |
|
17 | +$icon_increase = plugins_url( "lite/assets/img/emails/summaries/increase.png", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
18 | +$icon_increase_2x = plugins_url( "lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
19 | +$icon_decrease = plugins_url( "lite/assets/img/emails/summaries/decrease.png", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
20 | +$icon_decrease_2x = plugins_url( "lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
21 | +$icon_top_pages = plugins_url( "lite/assets/img/emails/summaries/icon-top-pages.png", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
22 | +$icon_top_pages_2x = plugins_url( "lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
23 | +$icon_sessions = plugins_url( "lite/assets/img/emails/summaries/icon-sessions.png", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
24 | +$icon_sessions_2x = plugins_url( "lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
25 | +$icon_page_views = plugins_url( "lite/assets/img/emails/summaries/icon-page-views.png", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
26 | +$icon_page_views_2x = plugins_url( "lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
27 | +$icon_engagement = plugins_url( "lite/assets/img/emails/summaries/icon-engagement.png", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
28 | +$icon_engagement_2x = plugins_url( "lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
29 | +$icon_more_traffic = plugins_url( "lite/assets/img/emails/summaries/icon-more-traffic.png", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
30 | +$icon_more_traffic_2x = plugins_url( "lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
31 | +$icon_button_arrow = plugins_url( "lite/assets/img/emails/summaries/icon-button-arrow.png", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
32 | +$icon_button_arrow_2x = plugins_url( "lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
33 | +$icon_bulb = plugins_url( "lite/assets/img/emails/summaries/icon-bulb.png", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
34 | +$icon_bulb_2x = plugins_url( "lite/assets/img/emails/summaries/[email protected]", MONSTERINSIGHTS_PLUGIN_FILE ); |
|
35 | 35 | |
36 | 36 | $site_url = get_site_url(); |
37 | -$start_date = isset($startDate) ? $startDate : date("Y-m-d", strtotime("-1 day, last month")); |
|
38 | -$start_date = date("F j, Y", strtotime($start_date)); |
|
39 | -$end_date = isset($endDate) ? $endDate : date("Y-m-d", strtotime("last saturday")); |
|
40 | -$end_date = date("F j, Y", strtotime($end_date)); |
|
37 | +$start_date = isset( $startDate ) ? $startDate : date( "Y-m-d", strtotime( "-1 day, last month" ) ); |
|
38 | +$start_date = date( "F j, Y", strtotime( $start_date ) ); |
|
39 | +$end_date = isset( $endDate ) ? $endDate : date( "Y-m-d", strtotime( "last saturday" ) ); |
|
40 | +$end_date = date( "F j, Y", strtotime( $end_date ) ); |
|
41 | 41 | |
42 | -$range = isset($summaries['data']['infobox']['range']) ? $summaries['data']['infobox']['range'] : 0; |
|
43 | -$total_sessions = isset($summaries['data']['infobox']['sessions']['value']) ? $summaries['data']['infobox']['sessions']['value'] : 0; |
|
44 | -$prev_sessions_percentage = isset($summaries['data']['infobox']['sessions']['prev']) ? $summaries['data']['infobox']['sessions']['prev'] : 0; |
|
42 | +$range = isset( $summaries['data']['infobox']['range'] ) ? $summaries['data']['infobox']['range'] : 0; |
|
43 | +$total_sessions = isset( $summaries['data']['infobox']['sessions']['value'] ) ? $summaries['data']['infobox']['sessions']['value'] : 0; |
|
44 | +$prev_sessions_percentage = isset( $summaries['data']['infobox']['sessions']['prev'] ) ? $summaries['data']['infobox']['sessions']['prev'] : 0; |
|
45 | 45 | $sessions_percentage_icon = $icon_decrease; |
46 | 46 | $sessions_percentage_icon_2x = $icon_decrease_2x; |
47 | 47 | $sessions_percentage_class = 'mcnTextDecrease'; |
48 | -$sessions_difference = __('Decrease sessions: ', 'google-analytics-for-wordpress'); |
|
49 | -if ((int) $prev_sessions_percentage === (int) $prev_sessions_percentage && (int) $prev_sessions_percentage >= 0) { |
|
48 | +$sessions_difference = __( 'Decrease sessions: ', 'google-analytics-for-wordpress' ); |
|
49 | +if ( (int) $prev_sessions_percentage === (int) $prev_sessions_percentage && (int) $prev_sessions_percentage >= 0 ) { |
|
50 | 50 | $sessions_percentage_icon = $icon_increase; |
51 | 51 | $sessions_percentage_icon_2x = $icon_increase_2x; |
52 | 52 | $sessions_percentage_class = 'mcnTextIncrease'; |
53 | - $sessions_difference = __('Increase sessions: ', 'google-analytics-for-wordpress'); |
|
53 | + $sessions_difference = __( 'Increase sessions: ', 'google-analytics-for-wordpress' ); |
|
54 | 54 | } |
55 | 55 | |
56 | -$total_pageviews = isset($summaries['data']['infobox']['pageviews']['value']) ? $summaries['data']['infobox']['pageviews']['value'] : 0; |
|
57 | -$prev_pageviews_percentage = isset($summaries['data']['infobox']['pageviews']['prev']) ? $summaries['data']['infobox']['pageviews']['prev'] : 0; |
|
56 | +$total_pageviews = isset( $summaries['data']['infobox']['pageviews']['value'] ) ? $summaries['data']['infobox']['pageviews']['value'] : 0; |
|
57 | +$prev_pageviews_percentage = isset( $summaries['data']['infobox']['pageviews']['prev'] ) ? $summaries['data']['infobox']['pageviews']['prev'] : 0; |
|
58 | 58 | $pageviews_percentage_icon = $icon_decrease; |
59 | 59 | $pageviews_percentage_icon_2x = $icon_decrease_2x; |
60 | 60 | $pageviews_percentage_class = 'mcnTextDecrease'; |
61 | -$pageviews_difference = __('Decrease pageviews: ', 'google-analytics-for-wordpress'); |
|
62 | -if ((int) $prev_pageviews_percentage === (int) $prev_pageviews_percentage && (int) $prev_pageviews_percentage >= 0) { |
|
61 | +$pageviews_difference = __( 'Decrease pageviews: ', 'google-analytics-for-wordpress' ); |
|
62 | +if ( (int) $prev_pageviews_percentage === (int) $prev_pageviews_percentage && (int) $prev_pageviews_percentage >= 0 ) { |
|
63 | 63 | $pageviews_percentage_icon = $icon_increase; |
64 | 64 | $pageviews_percentage_icon_2x = $icon_increase_2x; |
65 | 65 | $pageviews_percentage_class = 'mcnTextIncrease'; |
66 | - $pageviews_difference = __('Increase pageviews: ', 'google-analytics-for-wordpress'); |
|
66 | + $pageviews_difference = __( 'Increase pageviews: ', 'google-analytics-for-wordpress' ); |
|
67 | 67 | } |
68 | 68 | |
69 | -$top_pages = isset($summaries['data']['toppages']) ? $summaries['data']['toppages'] : ''; |
|
70 | -$top_referrals = isset($summaries['data']['referrals']) ? $summaries['data']['referrals'] : ''; |
|
71 | -$more_pages = isset($summaries['data']['galinks']['topposts']) ? $summaries['data']['galinks']['topposts'] : ''; |
|
72 | -$more_referrals = isset($summaries['data']['galinks']['referrals']) ? $summaries['data']['galinks']['referrals'] : ''; |
|
69 | +$top_pages = isset( $summaries['data']['toppages'] ) ? $summaries['data']['toppages'] : ''; |
|
70 | +$top_referrals = isset( $summaries['data']['referrals'] ) ? $summaries['data']['referrals'] : ''; |
|
71 | +$more_pages = isset( $summaries['data']['galinks']['topposts'] ) ? $summaries['data']['galinks']['topposts'] : ''; |
|
72 | +$more_referrals = isset( $summaries['data']['galinks']['referrals'] ) ? $summaries['data']['galinks']['referrals'] : ''; |
|
73 | 73 | |
74 | -$total_engagement = (isset($summaries['data']['infobox']['engagement']['value'])) ? $summaries['data']['infobox']['engagement']['value'] : 0; |
|
75 | -$prev_engagement_percentage = isset($summaries['data']['infobox']['engagement']['prev']) ? $summaries['data']['infobox']['engagement']['prev'] : 0; |
|
74 | +$total_engagement = ( isset( $summaries['data']['infobox']['engagement']['value'] ) ) ? $summaries['data']['infobox']['engagement']['value'] : 0; |
|
75 | +$prev_engagement_percentage = isset( $summaries['data']['infobox']['engagement']['prev'] ) ? $summaries['data']['infobox']['engagement']['prev'] : 0; |
|
76 | 76 | |
77 | 77 | $engagement_percentage_icon = $icon_decrease; |
78 | 78 | $engagement_percentage_icon_2x = $icon_decrease_2x; |
79 | 79 | $engagement_percentage_class = 'mcnTextDecrease'; |
80 | -$engagement_difference = __('Decrease engagement: ', 'google-analytics-for-wordpress'); |
|
81 | -if ((int) $prev_engagement_percentage === (int) $prev_engagement_percentage && (int) $prev_engagement_percentage >= 0) { |
|
80 | +$engagement_difference = __( 'Decrease engagement: ', 'google-analytics-for-wordpress' ); |
|
81 | +if ( (int) $prev_engagement_percentage === (int) $prev_engagement_percentage && (int) $prev_engagement_percentage >= 0 ) { |
|
82 | 82 | $engagement_percentage_icon = $icon_increase; |
83 | 83 | $engagement_percentage_icon_2x = $icon_increase_2x; |
84 | 84 | $engagement_percentage_class = 'mcnTextIncrease'; |
85 | - $engagement_difference = __('Increase engagement: ', 'google-analytics-for-wordpress'); |
|
85 | + $engagement_difference = __( 'Increase engagement: ', 'google-analytics-for-wordpress' ); |
|
86 | 86 | } |
87 | 87 | ?> |
88 | 88 | <tr> |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width: 100%;border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;" class="mcnTextContentContainer"> |
92 | 92 | <tbody> |
93 | 93 | <tr style="display:block;"> |
94 | - <td style="padding-right: 25px;padding-left: 25px;font-weight: bold;font-size: 24px;line-height: 28px;color: #393F4C;" class="mcnTextContent"><?php echo wp_kses_post($title); ?></td> |
|
94 | + <td style="padding-right: 25px;padding-left: 25px;font-weight: bold;font-size: 24px;line-height: 28px;color: #393F4C;" class="mcnTextContent"><?php echo wp_kses_post( $title ); ?></td> |
|
95 | 95 | </tr> |
96 | 96 | <tr style="display:block;"> |
97 | 97 | <td style="padding-right: 25px;padding-left: 25px;padding-top:8px;font-weight: normal;font-size: 14px;line-height: 16px;color: #7F899F;" class="mcnTextContent"> |
@@ -104,14 +104,14 @@ discard block |
||
104 | 104 | </tr> |
105 | 105 | <tr style="display:block;"> |
106 | 106 | <td style="padding-top:8px;padding-left: 25px;padding-right: 25px;font-weight: bold;font-size: 14px;line-height: 16px;color: #7F899F;text-align:left;" class="mcnTextContent"> |
107 | - <a href="<?php echo esc_url($site_url); ?>" style="font-weight: bold;font-size: 14px;line-height: 16px;color: #7F899F;text-decoration: underline;"><?php echo esc_url($site_url); ?></a> |
|
107 | + <a href="<?php echo esc_url( $site_url ); ?>" style="font-weight: bold;font-size: 14px;line-height: 16px;color: #7F899F;text-decoration: underline;"><?php echo esc_url( $site_url ); ?></a> |
|
108 | 108 | </td> |
109 | 109 | </tr> |
110 | 110 | <tr style="display:block;padding: 30px 25px 0 25px;"> |
111 | - <td style="font-weight: bold;font-size: 14px;line-height: 27px;color: #393F4C;" class="mcnTextContent"><?php _e('Hi there!', 'google-analytics-for-wordpress'); ?></td> |
|
111 | + <td style="font-weight: bold;font-size: 14px;line-height: 27px;color: #393F4C;" class="mcnTextContent"><?php _e( 'Hi there!', 'google-analytics-for-wordpress' ); ?></td> |
|
112 | 112 | </tr> |
113 | 113 | <tr style="display:block;padding:0 25px;"> |
114 | - <td style="font-weight: normal;font-size: 14px;line-height: 20px;color: #4F5769;" class="mcnTextContent"><?php echo wp_kses_post($description); ?></td> |
|
114 | + <td style="font-weight: normal;font-size: 14px;line-height: 20px;color: #4F5769;" class="mcnTextContent"><?php echo wp_kses_post( $description ); ?></td> |
|
115 | 115 | </tr> |
116 | 116 | </tbody> |
117 | 117 | </table> |
@@ -125,15 +125,15 @@ discard block |
||
125 | 125 | <tr> |
126 | 126 | <td style="padding-bottom:8px;"> |
127 | 127 | <?php |
128 | - if (!empty($icon_sessions)) { |
|
129 | - echo '<img src="' . esc_url($icon_sessions) . '" srcset="' . esc_url($icon_sessions_2x) . ' 2x" target="_blank" alt="' . esc_attr__('Sessions', 'google-analytics-for-wordpress') . '" />'; |
|
128 | + if ( ! empty( $icon_sessions ) ) { |
|
129 | + echo '<img src="' . esc_url( $icon_sessions ) . '" srcset="' . esc_url( $icon_sessions_2x ) . ' 2x" target="_blank" alt="' . esc_attr__( 'Sessions', 'google-analytics-for-wordpress' ) . '" />'; |
|
130 | 130 | } |
131 | 131 | ?> |
132 | 132 | </td> |
133 | 133 | </tr> |
134 | 134 | <tr> |
135 | 135 | <td style="padding-bottom:8px; font-size:12px;"> |
136 | - <?php _e('Total Sessions', 'google-analytics-for-wordpress'); ?> |
|
136 | + <?php _e( 'Total Sessions', 'google-analytics-for-wordpress' ); ?> |
|
137 | 137 | </td> |
138 | 138 | </tr> |
139 | 139 | <tr> |
@@ -150,13 +150,13 @@ discard block |
||
150 | 150 | <tr> |
151 | 151 | <td valign="middle" style="padding-right:1px; padding-top:1px;"> |
152 | 152 | <?php |
153 | - if (!empty($sessions_percentage_icon_2x)) { |
|
154 | - echo '<img src="' . esc_url($sessions_percentage_icon_2x) . '" target="_blank" alt="' . $sessions_difference . '" style="width: 8px; height: auto;" />'; |
|
153 | + if ( ! empty( $sessions_percentage_icon_2x ) ) { |
|
154 | + echo '<img src="' . esc_url( $sessions_percentage_icon_2x ) . '" target="_blank" alt="' . $sessions_difference . '" style="width: 8px; height: auto;" />'; |
|
155 | 155 | } |
156 | 156 | ?> |
157 | 157 | </td> |
158 | 158 | <td valign="middle" class="<?php echo $sessions_percentage_class; ?>"> |
159 | - <?php printf('%s%', $prev_sessions_percentage); ?> |
|
159 | + <?php printf( '%s%', $prev_sessions_percentage ); ?> |
|
160 | 160 | </td> |
161 | 161 | </tr> |
162 | 162 | </tbody> |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | <td style="padding-bottom:5px; font-size:10px; color: #9CA4B5;"> |
172 | 172 | <?php |
173 | 173 | /* translators: Placeholder adds a range of days. */ |
174 | - printf(__('vs previous %s days', 'google-analytics-for-wordpress'), $range); |
|
174 | + printf( __( 'vs previous %s days', 'google-analytics-for-wordpress' ), $range ); |
|
175 | 175 | ?> |
176 | 176 | </td> |
177 | 177 | </tr> |
@@ -185,15 +185,15 @@ discard block |
||
185 | 185 | <tr> |
186 | 186 | <td style="padding-bottom:8px;"> |
187 | 187 | <?php |
188 | - if (!empty($icon_page_views)) { |
|
189 | - echo '<img src="' . esc_url($icon_page_views) . '" srcset="' . esc_url($icon_page_views_2x) . ' 2x" target="_blank" alt="' . esc_attr__('Page Views', 'google-analytics-for-wordpress') . '" />'; |
|
188 | + if ( ! empty( $icon_page_views ) ) { |
|
189 | + echo '<img src="' . esc_url( $icon_page_views ) . '" srcset="' . esc_url( $icon_page_views_2x ) . ' 2x" target="_blank" alt="' . esc_attr__( 'Page Views', 'google-analytics-for-wordpress' ) . '" />'; |
|
190 | 190 | } |
191 | 191 | ?> |
192 | 192 | </td> |
193 | 193 | </tr> |
194 | 194 | <tr> |
195 | 195 | <td style="padding-bottom:8px; font-size:12px;"> |
196 | - <?php _e('Total Pageviews', 'google-analytics-for-wordpress'); ?> |
|
196 | + <?php _e( 'Total Pageviews', 'google-analytics-for-wordpress' ); ?> |
|
197 | 197 | </td> |
198 | 198 | </tr> |
199 | 199 | <tr> |
@@ -210,13 +210,13 @@ discard block |
||
210 | 210 | <tr> |
211 | 211 | <td valign="middle" style="padding-right:1px; padding-top:1px;"> |
212 | 212 | <?php |
213 | - if (!empty($pageviews_percentage_icon)) { |
|
214 | - echo '<img src="' . esc_url($pageviews_percentage_icon) . '" srcset="' . esc_url($pageviews_percentage_icon_2x) . ' 2x" target="_blank" alt="' . $pageviews_difference . '" />'; |
|
213 | + if ( ! empty( $pageviews_percentage_icon ) ) { |
|
214 | + echo '<img src="' . esc_url( $pageviews_percentage_icon ) . '" srcset="' . esc_url( $pageviews_percentage_icon_2x ) . ' 2x" target="_blank" alt="' . $pageviews_difference . '" />'; |
|
215 | 215 | } |
216 | 216 | ?> |
217 | 217 | </td> |
218 | 218 | <td valign="middle" class="<?php echo $pageviews_percentage_class; ?>"> |
219 | - <?php printf('%s%', $prev_pageviews_percentage); ?> |
|
219 | + <?php printf( '%s%', $prev_pageviews_percentage ); ?> |
|
220 | 220 | </td> |
221 | 221 | </tr> |
222 | 222 | </tbody> |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | </tr> |
230 | 230 | <tr> |
231 | 231 | <td style="padding-bottom:5px; font-size:10px; color: #9CA4B5;"> |
232 | - <?php printf(__('vs previous %s days', 'google-analytics-for-wordpress'), $range); ?> |
|
232 | + <?php printf( __( 'vs previous %s days', 'google-analytics-for-wordpress' ), $range ); ?> |
|
233 | 233 | </td> |
234 | 234 | </tr> |
235 | 235 | </tbody> |
@@ -242,15 +242,15 @@ discard block |
||
242 | 242 | <tr> |
243 | 243 | <td style="padding-bottom:8px;"> |
244 | 244 | <?php |
245 | - if (!empty($icon_engagement)) { |
|
246 | - echo '<img src="' . esc_url($icon_engagement) . '" srcset="' . esc_url($icon_engagement_2x) . ' 2x" target="_blank" alt="' . esc_attr__('engagement', 'google-analytics-for-wordpress') . '" />'; |
|
245 | + if ( ! empty( $icon_engagement ) ) { |
|
246 | + echo '<img src="' . esc_url( $icon_engagement ) . '" srcset="' . esc_url( $icon_engagement_2x ) . ' 2x" target="_blank" alt="' . esc_attr__( 'engagement', 'google-analytics-for-wordpress' ) . '" />'; |
|
247 | 247 | } |
248 | 248 | ?> |
249 | 249 | </td> |
250 | 250 | </tr> |
251 | 251 | <tr> |
252 | 252 | <td style="padding-bottom:8px; font-size:12px;"> |
253 | - <?php _e('Total Engagement', 'google-analytics-for-wordpress'); ?> |
|
253 | + <?php _e( 'Total Engagement', 'google-analytics-for-wordpress' ); ?> |
|
254 | 254 | </td> |
255 | 255 | </tr> |
256 | 256 | <tr> |
@@ -267,13 +267,13 @@ discard block |
||
267 | 267 | <tr> |
268 | 268 | <td valign="middle" style="padding-right:1px; padding-top:1px;"> |
269 | 269 | <?php |
270 | - if (!empty($engagement_percentage_icon)) { |
|
271 | - echo '<img src="' . esc_url($engagement_percentage_icon) . '" srcset="' . esc_url($engagement_percentage_icon_2x) . ' 2x" target="_blank" alt="' . $engagement_difference . '" />'; |
|
270 | + if ( ! empty( $engagement_percentage_icon ) ) { |
|
271 | + echo '<img src="' . esc_url( $engagement_percentage_icon ) . '" srcset="' . esc_url( $engagement_percentage_icon_2x ) . ' 2x" target="_blank" alt="' . $engagement_difference . '" />'; |
|
272 | 272 | } |
273 | 273 | ?> |
274 | 274 | </td> |
275 | 275 | <td valign="middle" class="<?php echo $pageviews_percentage_class; ?>"> |
276 | - <?php printf('%s%', $prev_engagement_percentage); ?> |
|
276 | + <?php printf( '%s%', $prev_engagement_percentage ); ?> |
|
277 | 277 | </td> |
278 | 278 | </tr> |
279 | 279 | </tbody> |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | </tr> |
287 | 287 | <tr> |
288 | 288 | <td style="padding-bottom:5px; font-size:10px; color: #9CA4B5;"> |
289 | - <?php printf(__('vs previous %s days', 'google-analytics-for-wordpress'), $range); ?> |
|
289 | + <?php printf( __( 'vs previous %s days', 'google-analytics-for-wordpress' ), $range ); ?> |
|
290 | 290 | </td> |
291 | 291 | </tr> |
292 | 292 | </tbody> |
@@ -296,18 +296,18 @@ discard block |
||
296 | 296 | </tbody> |
297 | 297 | </table> |
298 | 298 | |
299 | - <?php if (!empty($top_pages)) : ?> |
|
299 | + <?php if ( ! empty( $top_pages ) ) : ?> |
|
300 | 300 | <table style="margin:25px; font-family: Helvetica; width:400px; color: #393F4C;"> |
301 | 301 | <tbody> |
302 | 302 | <tr> |
303 | 303 | <td style="width: 24px; vertical-align:middle;"> |
304 | 304 | <?php |
305 | - if (!empty($icon_top_pages)) { |
|
306 | - echo '<img src="' . esc_url($icon_top_pages) . '" srcset="' . esc_url($icon_top_pages_2x) . ' 2x" target="_blank" alt="' . esc_attr__('Pages', 'google-analytics-for-wordpress') . '" />'; |
|
305 | + if ( ! empty( $icon_top_pages ) ) { |
|
306 | + echo '<img src="' . esc_url( $icon_top_pages ) . '" srcset="' . esc_url( $icon_top_pages_2x ) . ' 2x" target="_blank" alt="' . esc_attr__( 'Pages', 'google-analytics-for-wordpress' ) . '" />'; |
|
307 | 307 | } |
308 | 308 | ?> |
309 | 309 | </td> |
310 | - <td style="font-weight:bold; font-size: 14px; vertical-align:middle;"><?php _e('Top Pages', 'google-analytics-for-wordpress'); ?></td> |
|
310 | + <td style="font-weight:bold; font-size: 14px; vertical-align:middle;"><?php _e( 'Top Pages', 'google-analytics-for-wordpress' ); ?></td> |
|
311 | 311 | </tr> |
312 | 312 | </tbody> |
313 | 313 | </table> |
@@ -322,21 +322,21 @@ discard block |
||
322 | 322 | <table style="margin:0px 25px; font-family: Helvetica; width:400px; color: #9CA4B5; font-size: 12px; width:400px;"> |
323 | 323 | <tbody> |
324 | 324 | <?php $i = 0; ?> |
325 | - <?php while ($i <= 9) : ?> |
|
326 | - <?php if (isset($top_pages[$i])) : ?> |
|
325 | + <?php while ( $i <= 9 ) : ?> |
|
326 | + <?php if ( isset( $top_pages[$i] ) ) : ?> |
|
327 | 327 | <tr> |
328 | 328 | <td style="width:300px;padding-top:8px;padding-bottom:8px;text-align:left;font-weight: normal;font-size: 14px;line-height: 16px;color: #393F4C;overflow:hidden;" class="mcnTextContent"> |
329 | - <a href="<?php echo esc_url($top_pages[$i]['hostname'] . $top_pages[$i]['url']); ?>" target="_blank" style="text-decoration:none;color: #393F4C;"><?php echo esc_html($i + 1 . '. ' . monsterinsights_trim_text($top_pages[$i]['title'], 2)); ?></a> |
|
329 | + <a href="<?php echo esc_url( $top_pages[$i]['hostname'] . $top_pages[$i]['url'] ); ?>" target="_blank" style="text-decoration:none;color: #393F4C;"><?php echo esc_html( $i + 1 . '. ' . monsterinsights_trim_text( $top_pages[$i]['title'], 2 ) ); ?></a> |
|
330 | 330 | </td> |
331 | 331 | <td style="width:100px;padding-top:8px;padding-bottom:8px;text-align:right;font-weight: normal;font-size: 14px;line-height: 16px;color: #509FE2;overflow:hidden;text-overflow: ellipsis;" class="mcnTextContent"> |
332 | - <?php echo esc_html(number_format_i18n($top_pages[$i]['sessions'])); ?> |
|
332 | + <?php echo esc_html( number_format_i18n( $top_pages[$i]['sessions'] ) ); ?> |
|
333 | 333 | </td> |
334 | 334 | </tr> |
335 | 335 | <?php endif; ?> |
336 | 336 | <?php $i++; ?> |
337 | 337 | <?php endwhile; ?> |
338 | 338 | <tr style="display:flex;"> |
339 | - <td style="width:67%;float:left;padding-top:18px;text-align:left;font-weight: normal;font-size: 12px;line-height: 14px;color: #509FE2;text-decoration: underline;" class="mcnTextContent"><a href="<?php echo esc_url($more_pages); ?>" style="color: #509FE2;"><?php _e('View All Report', 'google-analytics-for-wordpress'); ?></a> |
|
339 | + <td style="width:67%;float:left;padding-top:18px;text-align:left;font-weight: normal;font-size: 12px;line-height: 14px;color: #509FE2;text-decoration: underline;" class="mcnTextContent"><a href="<?php echo esc_url( $more_pages ); ?>" style="color: #509FE2;"><?php _e( 'View All Report', 'google-analytics-for-wordpress' ); ?></a> |
|
340 | 340 | </td> |
341 | 341 | </tr> |
342 | 342 | </tbody> |
@@ -357,13 +357,13 @@ discard block |
||
357 | 357 | <tr> |
358 | 358 | <td style="width: 130px; text-align: right; padding-right: 5px;"> |
359 | 359 | <?php |
360 | - if (!empty($icon_more_traffic)) { |
|
361 | - echo '<img src="' . esc_url($icon_more_traffic) . '" srcset="' . esc_url($icon_more_traffic_2x) . ' 2x" target="_blank" alt="' . esc_attr__('More Traffic', 'google-analytics-for-wordpress') . '" />'; |
|
360 | + if ( ! empty( $icon_more_traffic ) ) { |
|
361 | + echo '<img src="' . esc_url( $icon_more_traffic ) . '" srcset="' . esc_url( $icon_more_traffic_2x ) . ' 2x" target="_blank" alt="' . esc_attr__( 'More Traffic', 'google-analytics-for-wordpress' ) . '" />'; |
|
362 | 362 | } |
363 | 363 | ?> |
364 | 364 | </td> |
365 | 365 | <td style="text-align: left; padding-left: 5px;"> |
366 | - <?php _e('Want to Grow?', 'google-analytics-for-wordpress') ?> |
|
366 | + <?php _e( 'Want to Grow?', 'google-analytics-for-wordpress' ) ?> |
|
367 | 367 | </td> |
368 | 368 | </tr> |
369 | 369 | </tbody> |
@@ -372,23 +372,23 @@ discard block |
||
372 | 372 | </tr> |
373 | 373 | <tr> |
374 | 374 | <td style="font-size:13px; line-height:18px; text-align:center;color: #777777; padding-bottom:10px;"> |
375 | - <?php _e('With MonsterInsights Pro, unlock all reports and integrations to help you see the stats that matter. Instantly track purchases, video plays, SEO reports, and much more.', 'google-analytics-for-wordpress') ?> |
|
375 | + <?php _e( 'With MonsterInsights Pro, unlock all reports and integrations to help you see the stats that matter. Instantly track purchases, video plays, SEO reports, and much more.', 'google-analytics-for-wordpress' ) ?> |
|
376 | 376 | </td> |
377 | 377 | </tr> |
378 | 378 | <tr> |
379 | 379 | <td style="text-align:center;"> |
380 | 380 | <div style="text-align:center; margin:0 auto;"> |
381 | 381 | <!--[if mso]> |
382 | - <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="<?php echo monsterinsights_get_upgrade_link('monthly-lite-email', 'monthly-lite-email', "https://www.monsterinsights.com/pricing/"); ?>" style="height:35px;v-text-anchor:middle;width:164px;" arcsize="9%" strokecolor="#338EEF" fillcolor="#338EEF"> |
|
382 | + <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="<?php echo monsterinsights_get_upgrade_link( 'monthly-lite-email', 'monthly-lite-email', "https://www.monsterinsights.com/pricing/" ); ?>" style="height:35px;v-text-anchor:middle;width:164px;" arcsize="9%" strokecolor="#338EEF" fillcolor="#338EEF"> |
|
383 | 383 | <w:anchorlock/> |
384 | - <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;"><?php _e('Upgrade to Pro', 'google-analytics-for-wordpress'); ?></center> |
|
384 | + <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;"><?php _e( 'Upgrade to Pro', 'google-analytics-for-wordpress' ); ?></center> |
|
385 | 385 | </v:roundrect> |
386 | 386 | <![endif]--> |
387 | - <a href="<?php echo monsterinsights_get_upgrade_link('monthly-lite-email', 'monthly-lite-email', "https://www.monsterinsights.com/pricing/"); ?>" target="_blank" style="background-color:#338EEF;border-width:1px 1px 2px 1px;border-color:#1177E3;border-style:solid;border-radius:3px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:35px;text-align:center;text-decoration:none;width:164px;-webkit-text-size-adjust:none;mso-hide:all;"> |
|
388 | - <?php _e('Upgrade to Pro', 'google-analytics-for-wordpress'); ?> |
|
387 | + <a href="<?php echo monsterinsights_get_upgrade_link( 'monthly-lite-email', 'monthly-lite-email', "https://www.monsterinsights.com/pricing/" ); ?>" target="_blank" style="background-color:#338EEF;border-width:1px 1px 2px 1px;border-color:#1177E3;border-style:solid;border-radius:3px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight:bold;line-height:35px;text-align:center;text-decoration:none;width:164px;-webkit-text-size-adjust:none;mso-hide:all;"> |
|
388 | + <?php _e( 'Upgrade to Pro', 'google-analytics-for-wordpress' ); ?> |
|
389 | 389 | <?php |
390 | - if (!empty($icon_button_arrow)) { |
|
391 | - echo '<img src="' . esc_url($icon_button_arrow) . '" srcset="' . esc_url($icon_button_arrow_2x) . ' 2x" target="_blank" alt="' . esc_attr__('Upgrade To Pro', 'google-analytics-for-wordpress') . '" style="padding-left: 3px;" />'; |
|
390 | + if ( ! empty( $icon_button_arrow ) ) { |
|
391 | + echo '<img src="' . esc_url( $icon_button_arrow ) . '" srcset="' . esc_url( $icon_button_arrow_2x ) . ' 2x" target="_blank" alt="' . esc_attr__( 'Upgrade To Pro', 'google-analytics-for-wordpress' ) . '" style="padding-left: 3px;" />'; |
|
392 | 392 | } |
393 | 393 | ?> |
394 | 394 | </a> |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | </tr> |
402 | 402 | </tbody> |
403 | 403 | </table> |
404 | - <?php if (isset($info_block['title']) && !empty($info_block['title'])) : ?> |
|
404 | + <?php if ( isset( $info_block['title'] ) && ! empty( $info_block['title'] ) ) : ?> |
|
405 | 405 | |
406 | 406 | |
407 | 407 | <br> |
@@ -410,24 +410,24 @@ discard block |
||
410 | 410 | <tr> |
411 | 411 | <td valign="top" style="padding: 20px 5px 0px 20px; text-align:center;"> |
412 | 412 | <?php |
413 | - if (!empty($icon_bulb)) { |
|
414 | - echo '<img src="' . esc_url($icon_bulb) . '" srcset="' . esc_url($icon_bulb_2x) . ' 2x" target="_blank" alt="' . esc_attr__('', 'google-analytics-for-wordpress') . '" style="padding-left: 3px;" />'; |
|
413 | + if ( ! empty( $icon_bulb ) ) { |
|
414 | + echo '<img src="' . esc_url( $icon_bulb ) . '" srcset="' . esc_url( $icon_bulb_2x ) . ' 2x" target="_blank" alt="' . esc_attr__( '', 'google-analytics-for-wordpress' ) . '" style="padding-left: 3px;" />'; |
|
415 | 415 | } |
416 | 416 | ?> |
417 | 417 | </td> |
418 | 418 | <td style="padding: 20px 15px 20px 5px;"> |
419 | 419 | <div style="font-weight: normal; padding: 3px 0 10px 0;"> |
420 | - <?php _e('Pro Tip from our experts', 'google-analytics-for-wordpress'); ?> |
|
420 | + <?php _e( 'Pro Tip from our experts', 'google-analytics-for-wordpress' ); ?> |
|
421 | 421 | </div> |
422 | 422 | <div style="font-weight: 700; color: #393F4C; padding-bottom:10px;"> |
423 | - <?php echo esc_html($info_block['title']); ?> |
|
423 | + <?php echo esc_html( $info_block['title'] ); ?> |
|
424 | 424 | </div> |
425 | 425 | <div> |
426 | - <?php echo wp_kses_post($info_block['html']); ?> |
|
426 | + <?php echo wp_kses_post( $info_block['html'] ); ?> |
|
427 | 427 | </div> |
428 | 428 | <div style="padding: 10px 0;"> |
429 | - <a href="<?php echo esc_url($info_block['link_url']); ?>" target="_blank" style="color: #338EEF;"> |
|
430 | - <?php echo esc_html($info_block['link_text']); ?> |
|
429 | + <a href="<?php echo esc_url( $info_block['link_url'] ); ?>" target="_blank" style="color: #338EEF;"> |
|
430 | + <?php echo esc_html( $info_block['link_text'] ); ?> |
|
431 | 431 | </a> |
432 | 432 | </div> |
433 | 433 | </td> |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | |
66 | 66 | $i = 0; |
67 | 67 | while ( $i <= 2 ) { |
68 | - if ( isset( $top_pages[ $i ] ) ) { |
|
69 | - echo esc_html( $i + 1 . ". " . $top_pages[ $i ]['title'] . " - " . $top_pages[ $i ]['hostname'] . $top_pages[ $i ]['url'] ) . "\n\n"; |
|
68 | + if ( isset( $top_pages[$i] ) ) { |
|
69 | + echo esc_html( $i + 1 . ". " . $top_pages[$i]['title'] . " - " . $top_pages[$i]['hostname'] . $top_pages[$i]['url'] ) . "\n\n"; |
|
70 | 70 | } |
71 | - $i ++; |
|
71 | + $i++; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | echo "View More - " . esc_html( $more_pages ) . "\n\n"; |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | |
83 | 83 | $i = 0; |
84 | 84 | while ( $i <= 2 ) { |
85 | - if ( isset( $top_referrals[ $i ] ) ) { |
|
86 | - echo esc_html( $i + 1 . ". " . $top_referrals[ $i ]['url'] ) . "\n\n"; |
|
85 | + if ( isset( $top_referrals[$i] ) ) { |
|
86 | + echo esc_html( $i + 1 . ". " . $top_referrals[$i]['url'] ) . "\n\n"; |
|
87 | 87 | } |
88 | - $i ++; |
|
88 | + $i++; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | echo "View More - " . esc_html( $more_referrals ) . "\n\n"; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $pageviews_difference = __( 'Increase pageviews: ', 'google-analytics-for-wordpress' ); |
59 | 59 | } |
60 | 60 | |
61 | -$top_pages = array( |
|
61 | +$top_pages = array( |
|
62 | 62 | array( |
63 | 63 | 'url' => '/contact', |
64 | 64 | 'title' => 'Contact Page Your Website', |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'sessions' => '80', |
85 | 85 | ), |
86 | 86 | ); |
87 | -$top_referrals = array( |
|
87 | +$top_referrals = array( |
|
88 | 88 | array( |
89 | 89 | 'url' => 'https://facebook.com/', |
90 | 90 | 'sessions' => '100980', |
@@ -254,14 +254,14 @@ discard block |
||
254 | 254 | <tr style="display:flex;"> |
255 | 255 | <td style="width:67%;float:left;padding-top:8px;padding-bottom:8px;border-bottom:1px solid #F0F2F4;text-align:left;font-weight: normal;font-size: 14px;line-height: 16px;color: #393F4C;overflow:hidden;" |
256 | 256 | class="mcnTextContent"><a |
257 | - href="<?php echo esc_url( $top_pages[ $i ]['hostname'] . $top_pages[ $i ]['url'] ); ?>" |
|
257 | + href="<?php echo esc_url( $top_pages[$i]['hostname'] . $top_pages[$i]['url'] ); ?>" |
|
258 | 258 | target="_blank" |
259 | - style="text-decoration:none;color: #393F4C;"><?php echo esc_html( $i + 1 . '. ' . monsterinsights_trim_text( $top_pages[ $i ]['title'], 2 ) ); ?></a> |
|
259 | + style="text-decoration:none;color: #393F4C;"><?php echo esc_html( $i + 1 . '. ' . monsterinsights_trim_text( $top_pages[$i]['title'], 2 ) ); ?></a> |
|
260 | 260 | </td> |
261 | 261 | <td style="width:33%;float:left;padding-top:8px;padding-bottom:8px;border-bottom:1px solid #F0F2F4;text-align:right;font-weight: normal;font-size: 14px;line-height: 16px;color: #338EEF;overflow:hidden;text-overflow: ellipsis;" |
262 | - class="mcnTextContent"><?php echo esc_html( number_format_i18n( $top_pages[ $i ]['sessions'] ) ); ?></td> |
|
262 | + class="mcnTextContent"><?php echo esc_html( number_format_i18n( $top_pages[$i]['sessions'] ) ); ?></td> |
|
263 | 263 | </tr> |
264 | - <?php $i ++; ?> |
|
264 | + <?php $i++; ?> |
|
265 | 265 | <?php endwhile; ?> |
266 | 266 | |
267 | 267 | <tr style="display:flex;"> |
@@ -320,14 +320,14 @@ discard block |
||
320 | 320 | <?php while ( $i <= 2 ) : ?> |
321 | 321 | <tr style="display:flex;"> |
322 | 322 | <td style="width:67%;float:left;padding-top:8px;padding-bottom:8px;border-bottom:1px solid #F0F2F4;text-align:left;font-weight: normal;font-size: 14px;line-height: 16px;color: #393F4C;overflow:hidden;" |
323 | - class="mcnTextContent"><a href="<?php echo esc_url( $top_referrals[ $i ]['url'] ); ?>" |
|
323 | + class="mcnTextContent"><a href="<?php echo esc_url( $top_referrals[$i]['url'] ); ?>" |
|
324 | 324 | target="_blank" |
325 | - style="text-decoration:none;color: #393F4C;"><?php echo intval( $i + 1 ) . '. '; ?><?php echo esc_url( $top_referrals[ $i ]['url'] ); ?></a> |
|
325 | + style="text-decoration:none;color: #393F4C;"><?php echo intval( $i + 1 ) . '. '; ?><?php echo esc_url( $top_referrals[$i]['url'] ); ?></a> |
|
326 | 326 | </td> |
327 | 327 | <td style="width:33%;float:left;padding-top:8px;padding-bottom:8px;border-bottom:1px solid #F0F2F4;text-align:right;font-weight: normal;font-size: 14px;line-height: 16px;color: #338EEF;overflow:hidden;text-overflow: ellipsis;" |
328 | - class="mcnTextContent"><?php echo esc_html( number_format_i18n( $top_referrals[ $i ]['sessions'] ) ); ?></td> |
|
328 | + class="mcnTextContent"><?php echo esc_html( number_format_i18n( $top_referrals[$i]['sessions'] ) ); ?></td> |
|
329 | 329 | </tr> |
330 | - <?php $i ++; ?> |
|
330 | + <?php $i++; ?> |
|
331 | 331 | <?php endwhile; ?> |
332 | 332 | |
333 | 333 | <tr style="display:flex;"> |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | $label_text = ''; |
92 | 92 | if ( isset( $theme_styles['styles']['label'] ) ) { |
93 | - $label_text = isset( $atts['label_text'] ) ? esc_html($atts['label_text']) : esc_html($theme_styles['styles']['label']['text']); |
|
93 | + $label_text = isset( $atts['label_text'] ) ? esc_html( $atts['label_text'] ) : esc_html( $theme_styles['styles']['label']['text'] ); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | if ( isset( $atts['widget_title'] ) ) { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $title_text = $this->title_text; |
102 | 102 | } |
103 | 103 | |
104 | - $html = '<div class="' . esc_attr($this->get_wrapper_class( $atts )) . '">'; |
|
104 | + $html = '<div class="' . esc_attr( $this->get_wrapper_class( $atts ) ) . '">'; |
|
105 | 105 | if ( $show_title ) { |
106 | 106 | $html .= '<h2 class="monsterinsights-widget-popular-posts-widget-title">' . esc_html( $title_text ) . '</h2>'; |
107 | 107 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | $display_count = 0; |
112 | 112 | foreach ( $posts as $post ) { |
113 | - $display_count ++; |
|
113 | + $display_count++; |
|
114 | 114 | if ( $display_count > $limit ) { |
115 | 115 | break; |
116 | 116 | } |
@@ -118,10 +118,10 @@ discard block |
||
118 | 118 | $html .= '<li '; |
119 | 119 | $html .= ! empty( $this->get_element_style( $theme, 'background', $atts ) ) ? 'style="' . esc_attr( $this->get_element_style( $theme, 'background', $atts ) ) . '"' : ''; |
120 | 120 | $html .= '>'; |
121 | - $html .= '<a href="' . esc_url($post['link']) . '">'; |
|
121 | + $html .= '<a href="' . esc_url( $post['link'] ) . '">'; |
|
122 | 122 | if ( ! empty( $theme_styles['image'] ) && ! empty( $post['image'] ) ) { |
123 | 123 | $html .= '<div class="monsterinsights-widget-popular-posts-image">'; |
124 | - $html .= '<img src="' . esc_url($post['image']) . '" srcset=" ' . esc_attr($post['srcset']) . ' " alt="' . esc_attr( $post['title'] ) . '" />'; |
|
124 | + $html .= '<img src="' . esc_url( $post['image'] ) . '" srcset=" ' . esc_attr( $post['srcset'] ) . ' " alt="' . esc_attr( $post['title'] ) . '" />'; |
|
125 | 125 | $html .= '</div>'; |
126 | 126 | } |
127 | 127 | $html .= '<div class="monsterinsights-widget-popular-posts-text">'; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $html .= '</li>'; |
139 | 139 | } |
140 | 140 | |
141 | - $html .= '</ul></div><p></p>';// Main div. |
|
141 | + $html .= '</ul></div><p></p>'; // Main div. |
|
142 | 142 | |
143 | 143 | return $html; |
144 | 144 | |
@@ -155,50 +155,50 @@ discard block |
||
155 | 155 | foreach ( $themes as $theme_key => $theme_styles ) { |
156 | 156 | |
157 | 157 | if ( ! empty( $theme_styles['background'] ) ) { |
158 | - $styles .= '.monsterinsights-popular-posts-styled.monsterinsights-widget-popular-posts.monsterinsights-widget-popular-posts-' . esc_attr($theme_key) . ' .monsterinsights-widget-popular-posts-list li {'; |
|
158 | + $styles .= '.monsterinsights-popular-posts-styled.monsterinsights-widget-popular-posts.monsterinsights-widget-popular-posts-' . esc_attr( $theme_key ) . ' .monsterinsights-widget-popular-posts-list li {'; |
|
159 | 159 | |
160 | 160 | if ( ! empty( $theme_styles['background']['color'] ) ) { |
161 | - $styles .= 'background-color:' . esc_attr($theme_styles['background']['color']) . ';'; |
|
161 | + $styles .= 'background-color:' . esc_attr( $theme_styles['background']['color'] ) . ';'; |
|
162 | 162 | } |
163 | 163 | if ( ! empty( $theme_styles['background']['border'] ) ) { |
164 | - $styles .= 'border-color:' . esc_attr($theme_styles['background']['border']) . ';'; |
|
164 | + $styles .= 'border-color:' . esc_attr( $theme_styles['background']['border'] ) . ';'; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | $styles .= '}'; |
168 | 168 | } |
169 | 169 | |
170 | 170 | if ( ! empty( $theme_styles['label'] ) ) { |
171 | - $styles .= '.monsterinsights-popular-posts-styled.monsterinsights-widget-popular-posts.monsterinsights-widget-popular-posts-' . esc_attr($theme_key) . ' .monsterinsights-widget-popular-posts-label {'; |
|
171 | + $styles .= '.monsterinsights-popular-posts-styled.monsterinsights-widget-popular-posts.monsterinsights-widget-popular-posts-' . esc_attr( $theme_key ) . ' .monsterinsights-widget-popular-posts-label {'; |
|
172 | 172 | |
173 | 173 | if ( ! empty( $theme_styles['label']['color'] ) ) { |
174 | - $styles .= 'color:' . esc_attr($theme_styles['label']['color']) . ';'; |
|
174 | + $styles .= 'color:' . esc_attr( $theme_styles['label']['color'] ) . ';'; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | if ( ! empty( $theme_styles['label']['background'] ) ) { |
178 | - $styles .= 'background-color:' . esc_attr($theme_styles['label']['background']) . ';'; |
|
178 | + $styles .= 'background-color:' . esc_attr( $theme_styles['label']['background'] ) . ';'; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | $styles .= '}'; |
182 | 182 | } |
183 | 183 | |
184 | 184 | if ( ! empty( $theme_styles['title'] ) ) { |
185 | - $styles .= '.monsterinsights-popular-posts-styled.monsterinsights-widget-popular-posts.monsterinsights-widget-popular-posts-' . esc_attr($theme_key) . ' .monsterinsights-widget-popular-posts-list li .monsterinsights-widget-popular-posts-title {'; |
|
185 | + $styles .= '.monsterinsights-popular-posts-styled.monsterinsights-widget-popular-posts.monsterinsights-widget-popular-posts-' . esc_attr( $theme_key ) . ' .monsterinsights-widget-popular-posts-list li .monsterinsights-widget-popular-posts-title {'; |
|
186 | 186 | |
187 | 187 | if ( ! empty( $theme_styles['title']['color'] ) ) { |
188 | - $styles .= 'color:' . esc_attr($theme_styles['title']['color']) . ';'; |
|
188 | + $styles .= 'color:' . esc_attr( $theme_styles['title']['color'] ) . ';'; |
|
189 | 189 | } |
190 | 190 | if ( ! empty( $theme_styles['title']['size'] ) ) { |
191 | - $styles .= 'font-size:' . esc_attr($theme_styles['title']['size']) . 'px;'; |
|
191 | + $styles .= 'font-size:' . esc_attr( $theme_styles['title']['size'] ) . 'px;'; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | $styles .= '}'; |
195 | 195 | } |
196 | 196 | |
197 | 197 | if ( ! empty( $theme_styles['border'] ) ) { |
198 | - $styles .= '.monsterinsights-popular-posts-styled.monsterinsights-widget-popular-posts-' . esc_attr($theme_key) . ' .monsterinsights-inline-popular-posts-border {'; |
|
198 | + $styles .= '.monsterinsights-popular-posts-styled.monsterinsights-widget-popular-posts-' . esc_attr( $theme_key ) . ' .monsterinsights-inline-popular-posts-border {'; |
|
199 | 199 | |
200 | 200 | if ( ! empty( $theme_styles['border']['color'] ) ) { |
201 | - $styles .= 'border-color:' . esc_attr($theme_styles['border']['color']) . ';'; |
|
201 | + $styles .= 'border-color:' . esc_attr( $theme_styles['border']['color'] ) . ';'; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | $styles .= '}'; |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | // Wrap in a P tag to keep the same spacing. |
78 | - $html = '<div class="' . esc_attr($this->get_wrapper_class( $atts )) . '" '; |
|
78 | + $html = '<div class="' . esc_attr( $this->get_wrapper_class( $atts ) ) . '" '; |
|
79 | 79 | $html .= ! empty( $this->get_element_style( $theme, 'background', $atts ) ) ? 'style="' . esc_attr( $this->get_element_style( $theme, 'background', $atts ) ) . '"' : ''; |
80 | 80 | $html .= '>'; |
81 | 81 | |
82 | 82 | if ( ! empty( $theme_styles['image'] ) && ! empty( $posts[0]['image'] ) ) { |
83 | 83 | $html .= '<div class="monsterinsights-inline-popular-posts-image">'; |
84 | - $html .= '<img src="' . esc_url($posts[0]['image']) . '" srcset=" ' . esc_attr($posts[0]['srcset']) . ' " alt="' . esc_attr( $posts[0]['title'] ) . '" />'; |
|
84 | + $html .= '<img src="' . esc_url( $posts[0]['image'] ) . '" srcset=" ' . esc_attr( $posts[0]['srcset'] ) . ' " alt="' . esc_attr( $posts[0]['title'] ) . '" />'; |
|
85 | 85 | $html .= '</div>'; |
86 | 86 | } |
87 | 87 | $html .= '<div class="monsterinsights-inline-popular-posts-text">'; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $display_count = 0; |
108 | 108 | foreach ( $posts as $post ) { |
109 | - $display_count ++; |
|
109 | + $display_count++; |
|
110 | 110 | if ( $display_count > $limit ) { |
111 | 111 | break; |
112 | 112 | } |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | $html .= '</div>'; |
120 | 120 | } |
121 | 121 | |
122 | - $html .= '</div>';// Text div. |
|
123 | - $html .= '</div><p></p>';// Main div. |
|
122 | + $html .= '</div>'; // Text div. |
|
123 | + $html .= '</div><p></p>'; // Main div. |
|
124 | 124 | |
125 | 125 | return $html; |
126 | 126 | |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | $styles .= '.monsterinsights-inline-popular-posts.monsterinsights-popular-posts-styled.monsterinsights-inline-popular-posts-' . $theme_key . ' {'; |
142 | 142 | |
143 | 143 | if ( ! empty( $theme_styles['background']['color'] ) ) { |
144 | - $styles .= 'background-color:' . esc_attr($theme_styles['background']['color']) . ';'; |
|
144 | + $styles .= 'background-color:' . esc_attr( $theme_styles['background']['color'] ) . ';'; |
|
145 | 145 | } |
146 | 146 | if ( ! empty( $theme_styles['background']['border'] ) ) { |
147 | - $styles .= 'border-color:' . esc_attr($theme_styles['background']['border']) . ';'; |
|
147 | + $styles .= 'border-color:' . esc_attr( $theme_styles['background']['border'] ) . ';'; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | $styles .= '}'; |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | $styles .= '.monsterinsights-inline-popular-posts.monsterinsights-popular-posts-styled.monsterinsights-inline-popular-posts-' . $theme_key . ' .monsterinsights-inline-popular-posts-label {'; |
155 | 155 | |
156 | 156 | if ( ! empty( $theme_styles['label']['color'] ) ) { |
157 | - $styles .= 'color:' . esc_attr($theme_styles['label']['color']) . ';'; |
|
157 | + $styles .= 'color:' . esc_attr( $theme_styles['label']['color'] ) . ';'; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | if ( ! empty( $theme_styles['label']['background'] ) ) { |
161 | - $styles .= 'background-color:' . esc_attr($theme_styles['label']['background']) . ';'; |
|
161 | + $styles .= 'background-color:' . esc_attr( $theme_styles['label']['background'] ) . ';'; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | $styles .= '}'; |
@@ -168,10 +168,10 @@ discard block |
||
168 | 168 | $styles .= '.monsterinsights-inline-popular-posts.monsterinsights-popular-posts-styled.monsterinsights-inline-popular-posts-' . $theme_key . ' .monsterinsights-inline-popular-posts-title {'; |
169 | 169 | |
170 | 170 | if ( ! empty( $theme_styles['title']['color'] ) ) { |
171 | - $styles .= 'color:' . esc_attr($theme_styles['title']['color']) . ';'; |
|
171 | + $styles .= 'color:' . esc_attr( $theme_styles['title']['color'] ) . ';'; |
|
172 | 172 | } |
173 | 173 | if ( ! empty( $theme_styles['title']['size'] ) ) { |
174 | - $styles .= 'font-size:' . esc_attr($theme_styles['title']['size']) . 'px;'; |
|
174 | + $styles .= 'font-size:' . esc_attr( $theme_styles['title']['size'] ) . 'px;'; |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | $styles .= '}'; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $styles .= '.monsterinsights-inline-popular-posts.monsterinsights-popular-posts-styled.monsterinsights-inline-popular-posts-' . $theme_key . ' .monsterinsights-inline-popular-posts-border {'; |
182 | 182 | |
183 | 183 | if ( ! empty( $theme_styles['border']['color'] ) ) { |
184 | - $styles .= 'border-color:' . esc_attr($theme_styles['border']['color']) . ';'; |
|
184 | + $styles .= 'border-color:' . esc_attr( $theme_styles['border']['color'] ) . ';'; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | $styles .= '}'; |
@@ -228,12 +228,12 @@ discard block |
||
228 | 228 | $count = 0; |
229 | 229 | |
230 | 230 | foreach ( $words as $index => $word ) { |
231 | - $count ++; |
|
231 | + $count++; |
|
232 | 232 | if ( $count > $after_count ) { |
233 | 233 | $p_index = strpos( $word, '</p>' ); |
234 | 234 | // Make sure the paragraph tag is not wrapped in another element like a blockquote. |
235 | 235 | if ( false !== $p_index && false === strpos( $word, '</p></' ) ) { |
236 | - $words[ $index ] = substr_replace( $word, $this->shortcode_output( array() ), $p_index + 4, 0 ); |
|
236 | + $words[$index] = substr_replace( $word, $this->shortcode_output( array() ), $p_index + 4, 0 ); |
|
237 | 237 | $this->posts = array(); |
238 | 238 | break; |
239 | 239 | } |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | ); |
119 | 119 | |
120 | 120 | foreach ( $this->conditional_options as $key => $default ) { |
121 | - if ( ! empty( $instance[ $key ] ) ) { |
|
122 | - $atts[ $key ] = $instance[ $key ]; |
|
121 | + if ( ! empty( $instance[$key] ) ) { |
|
122 | + $atts[$key] = $instance[$key]; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $theme = $themes->get_theme(); |
153 | 153 | |
154 | 154 | foreach ( $this->conditional_options as $key => $obj ) { |
155 | - $new_instance = $this->maybe_remove_option( ! empty( $theme['styles'][ $obj[0] ][ $obj[1] ] ), $key, $new_instance ); |
|
155 | + $new_instance = $this->maybe_remove_option( ! empty( $theme['styles'][$obj[0]][$obj[1]] ), $key, $new_instance ); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | return $new_instance; |
@@ -175,12 +175,12 @@ discard block |
||
175 | 175 | 'meta_comments', |
176 | 176 | ); |
177 | 177 | |
178 | - if ( $is_used && ! isset( $instance[ $key ] ) && in_array( $key, $checkboxes ) ) { |
|
179 | - $instance[ $key ] = 'off'; |
|
180 | - } elseif ( ! $is_used && isset( $instance[ $key ] ) ) { |
|
181 | - unset( $instance[ $key ] ); |
|
182 | - } elseif ( $is_used && isset( $instance[ $key ] ) ) { |
|
183 | - $instance[ $key ] = wp_strip_all_tags( $instance[ $key ] ); |
|
178 | + if ( $is_used && ! isset( $instance[$key] ) && in_array( $key, $checkboxes ) ) { |
|
179 | + $instance[$key] = 'off'; |
|
180 | + } elseif ( ! $is_used && isset( $instance[$key] ) ) { |
|
181 | + unset( $instance[$key] ); |
|
182 | + } elseif ( $is_used && isset( $instance[$key] ) ) { |
|
183 | + $instance[$key] = wp_strip_all_tags( $instance[$key] ); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | return $instance; |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | <input type="text" |
330 | 330 | id="<?php echo esc_attr( $this->get_field_id( $name ) ); ?>" |
331 | 331 | name="<?php echo esc_attr( $this->get_field_name( $name ) ); ?>" |
332 | - value="<?php echo esc_attr( $instance[ $name ] ); ?>" |
|
332 | + value="<?php echo esc_attr( $instance[$name] ); ?>" |
|
333 | 333 | class="widefat monsterinsights-color-field"/> |
334 | 334 | </p> |
335 | 335 | <?php |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | <input type="text" |
352 | 352 | id="<?php echo esc_attr( $this->get_field_id( $name ) ); ?>" |
353 | 353 | name="<?php echo esc_attr( $this->get_field_name( $name ) ); ?>" |
354 | - value="<?php echo esc_attr( $instance[ $name ] ); ?>" class="widefat"/> |
|
354 | + value="<?php echo esc_attr( $instance[$name] ); ?>" class="widefat"/> |
|
355 | 355 | </p> |
356 | 356 | <?php |
357 | 357 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | <select id="<?php echo esc_attr( $this->get_field_id( $name ) ); ?>" |
374 | 374 | name="<?php echo esc_attr( $this->get_field_name( $name ) ); ?>" class="widefat"> |
375 | 375 | <?php foreach ( $range as $font_size ) { ?> |
376 | - <option value="<?php echo absint( $font_size ); ?>" <?php selected( $instance[ $name ], $font_size ); ?>> |
|
376 | + <option value="<?php echo absint( $font_size ); ?>" <?php selected( $instance[$name], $font_size ); ?>> |
|
377 | 377 | <?php printf( esc_html_x( '%dpx', 'google-analytics-for-wordpress' ), $font_size ); // phpcs:ignore ?> |
378 | 378 | </option> |
379 | 379 | <?php } ?> |
@@ -389,8 +389,8 @@ discard block |
||
389 | 389 | */ |
390 | 390 | public function prepare_defaults_from_theme( $theme ) { |
391 | 391 | foreach ( $this->conditional_options as $key => $obj ) { |
392 | - if ( ! empty( $theme['styles'][ $obj[0] ][ $obj[1] ] ) ) { |
|
393 | - $this->defaults[ $key ] = $theme['styles'][ $obj[0] ][ $obj[1] ]; |
|
392 | + if ( ! empty( $theme['styles'][$obj[0]][$obj[1]] ) ) { |
|
393 | + $this->defaults[$key] = $theme['styles'][$obj[0]][$obj[1]]; |
|
394 | 394 | } |
395 | 395 | } |
396 | 396 | } |