Passed
Push — master ( 562556...f9cab4 )
by Chris
03:06
created
includes/admin/pages/addons.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 ); ?>">
Please login to merge, or discard this patch.
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -18,20 +18,20 @@  discard block
 block discarded – undo
18 18
     global $admin_page_hooks;
19 19
    
20 20
     if ( ! is_object( $current_screen ) || empty( $current_screen->id ) || empty( $admin_page_hooks ) ) {
21
-        return false;
21
+	return false;
22 22
     }
23 23
 
24 24
     $settings_page = false;
25 25
     if ( ! empty( $admin_page_hooks['monsterinsights_dashboard'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_dashboard'] . '_page_monsterinsights_addons' ) {
26
-        $settings_page = true;
26
+	$settings_page = true;
27 27
     }
28 28
 
29 29
     if ( ! empty( $admin_page_hooks['monsterinsights_settings'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_settings'] . '_page_monsterinsights_addons' ) {
30
-        $settings_page = true;
30
+	$settings_page = true;
31 31
     }
32 32
 
33 33
     if ( ! empty( $admin_page_hooks['monsterinsights_network'] ) && $current_screen->id === $admin_page_hooks['monsterinsights_network'] . '_page_monsterinsights_addons-network' ) {
34
-        $settings_page = true;
34
+	$settings_page = true;
35 35
     }
36 36
 
37 37
     return $settings_page;
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
46 46
  */
47 47
 function monsterinsights_maybe_refresh_addons() {
48 48
     if ( ! monsterinsights_is_addons_page() ) {
49
-        return;
49
+	return;
50 50
     }
51 51
 
52 52
 
53 53
     if ( empty( $_POST['google-analytics-for-wordpress-refresh-addons-submit'] ) ) {
54
-        return;
54
+	return;
55 55
     }
56 56
 
57 57
     if ( ! wp_verify_nonce( $_POST['google-analytics-for-wordpress-refresh-addons'], 'google-analytics-for-wordpress-refresh-addons' ) ) {
58
-        return;
58
+	return;
59 59
     }
60 60
 
61 61
     monsterinsights_get_addons_data( MonsterInsights()->license->get_valid_license_key() );
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
     <div id="monsterinsights-addons" class="wrap">
94 94
         <div class="monsterinsights-clear">
95 95
             <?php
96
-            /** 
97
-             * Developer Alert:
98
-             *
99
-             * Per the README, this is considered an internal hook and should
100
-             * not be used by other developers. This hook's behavior may be modified
101
-             * or the hook may be removed at any time, without warning.
102
-             */
103
-            ?>
96
+	    /** 
97
+	     * Developer Alert:
98
+	     *
99
+	     * Per the README, this is considered an internal hook and should
100
+	     * not be used by other developers. This hook's behavior may be modified
101
+	     * or the hook may be removed at any time, without warning.
102
+	     */
103
+	    ?>
104 104
             <?php do_action( 'monsterinsights_addons_section' ); ?>
105 105
         </div>
106 106
     </div>
@@ -117,14 +117,14 @@  discard block
 block discarded – undo
117 117
 
118 118
     // If error(s) occurred during license key verification, display them and exit now.
119 119
     if ( ! MonsterInsights()->license->get_valid_license_key() ) {
120
-        ?>
120
+	?>
121 121
         <div class="error below-h2">
122 122
             <p>
123 123
                 <?php esc_html_e( 'In order to get access to Addons, you need to resolve your license key errors.', 'google-analytics-for-wordpress' ); ?>
124 124
             </p>
125 125
         </div>
126 126
         <?php
127
-        return;
127
+	return;
128 128
     }
129 129
 
130 130
     // Get Addons
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
     // If no Addon(s) were returned, our API call returned an error.
134 134
     // Show an error message with a button to reload the page, which will trigger another API call.
135 135
     if ( ! $addons ) {
136
-        ?>
136
+	?>
137 137
         <form id="monsterinsights-addons-refresh-addons-form" method="post">
138 138
             <p>
139 139
                 <?php esc_html_e( 'There was an issue retrieving the addons for this site. Please click on the button below the refresh the addons data.', 'google-analytics-for-wordpress' ); ?>
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             </p>
144 144
         </form>
145 145
         <?php
146
-        return;
146
+	return;
147 147
     }
148 148
 
149 149
     // If here, we have Addons to display, so let's output them now.
@@ -153,9 +153,9 @@  discard block
 block discarded – undo
153 153
     ?>
154 154
     <div id="monsterinsights-addons">
155 155
         <?php
156
-        // Output Addons the User is licensed to use.
157
-        if ( count( $addons['licensed'] )> 0 ) {
158
-            ?>
156
+	// Output Addons the User is licensed to use.
157
+	if ( count( $addons['licensed'] )> 0 ) {
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>
161 161
                 
@@ -163,19 +163,19 @@  discard block
 block discarded – undo
163 163
                     <!-- list container class required for list.js -->
164 164
                     <div class="list">
165 165
                         <?php
166
-                        foreach ( (array) $addons['licensed'] as $i => $addon ) {
167
-                            monsterinsights_get_addon_card( $addon, $i, true, $installed_plugins );
168
-                        }
169
-                        ?>
166
+			foreach ( (array) $addons['licensed'] as $i => $addon ) {
167
+			    monsterinsights_get_addon_card( $addon, $i, true, $installed_plugins );
168
+			}
169
+			?>
170 170
                     </div>
171 171
                 </div>
172 172
             </div>
173 173
             <?php
174
-        } // Close licensed addons
174
+	} // Close licensed addons
175 175
 
176
-        // Output Addons the User isn't licensed to use.
177
-        if ( count( $addons['unlicensed'] ) > 0 ) {
178
-            ?>
176
+	// Output Addons the User isn't licensed to use.
177
+	if ( count( $addons['unlicensed'] ) > 0 ) {
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 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>
@@ -184,16 +184,16 @@  discard block
 block discarded – undo
184 184
                     <!-- list container class required for list.js -->
185 185
                     <div class="list">
186 186
                         <?php
187
-                        foreach ( (array) $addons['unlicensed'] as $i => $addon ) {
188
-                            monsterinsights_get_addon_card( $addon, $i, false, $installed_plugins );
189
-                        }
190
-                        ?>
187
+			foreach ( (array) $addons['unlicensed'] as $i => $addon ) {
188
+			    monsterinsights_get_addon_card( $addon, $i, false, $installed_plugins );
189
+			}
190
+			?>
191 191
                     </div>
192 192
                 </div>
193 193
             </div>
194 194
             <?php
195
-        } // Close unlicensed addons
196
-        ?>
195
+	} // Close unlicensed addons
196
+	?>
197 197
     </div>
198 198
     <?php
199 199
 
@@ -215,37 +215,37 @@  discard block
 block discarded – undo
215 215
     
216 216
     // Get addons data from transient or perform API query if no transient.
217 217
     if ( false === ( $addons = get_transient( '_monsterinsights_addons' ) ) ) {
218
-        $addons = monsterinsights_get_addons_data( $key );
218
+	$addons = monsterinsights_get_addons_data( $key );
219 219
     }
220 220
 
221 221
     // If no Addons exist, return false
222 222
     if ( ! $addons ) {
223
-        return false;
223
+	return false;
224 224
     }
225 225
 
226 226
     // Iterate through Addons, to build two arrays: 
227 227
     // - Addons the user is licensed to use,
228 228
     // - Addons the user isn't licensed to use.
229 229
     $results = array(
230
-        'licensed'  => array(),
231
-        'unlicensed'=> array(),
230
+	'licensed'  => array(),
231
+	'unlicensed'=> array(),
232 232
     );
233 233
     foreach ( (array) $addons as $i => $addon ) {
234 234
 
235
-        // Determine whether the user is licensed to use this Addon or not.
236
-        if ( 
237
-            empty( $type ) ||
238
-            ( in_array( 'Pro', $addon->categories ) && ( $type != 'pro' && $type != 'master' ) ) ||
239
-            ( in_array( 'Plus', $addon->categories ) && $type != 'plus' && $type != 'pro' && $type != 'master' ) ||
240
-            ( in_array( 'Basic', $addon->categories ) && ( $type != 'basic' && $type != 'plus' && $type != 'pro' && $type != 'master' ) )
241
-        ) {
242
-            // Unlicensed
243
-            $results['unlicensed'][] = $addon;
244
-            continue;
245
-        }
246
-
247
-        // Licensed
248
-        $results['licensed'][] = $addon;
235
+	// Determine whether the user is licensed to use this Addon or not.
236
+	if ( 
237
+	    empty( $type ) ||
238
+	    ( in_array( 'Pro', $addon->categories ) && ( $type != 'pro' && $type != 'master' ) ) ||
239
+	    ( in_array( 'Plus', $addon->categories ) && $type != 'plus' && $type != 'pro' && $type != 'master' ) ||
240
+	    ( in_array( 'Basic', $addon->categories ) && ( $type != 'basic' && $type != 'plus' && $type != 'pro' && $type != 'master' ) )
241
+	) {
242
+	    // Unlicensed
243
+	    $results['unlicensed'][] = $addon;
244
+	    continue;
245
+	}
246
+
247
+	// Licensed
248
+	$results['licensed'][] = $addon;
249 249
 
250 250
     }
251 251
 
@@ -268,21 +268,21 @@  discard block
 block discarded – undo
268 268
     // Get Addons
269 269
     // If the key is valid, we'll get personalised upgrade URLs for each Addon (if necessary) and plugin update information.
270 270
     if ( $key ) {
271
-        $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-addons-data-v600', array( 'tgm-updater-key' => $key ) ); 
271
+	$addons = MonsterInsights()->license_actions->perform_remote_request( 'get-addons-data-v600', array( 'tgm-updater-key' => $key ) ); 
272 272
     } else {
273
-        $addons = MonsterInsights()->license_actions->perform_remote_request( 'get-all-addons-data', array() ); 
273
+	$addons = MonsterInsights()->license_actions->perform_remote_request( 'get-all-addons-data', array() ); 
274 274
     }
275 275
     
276 276
     // If there was an API error, set transient for only 10 minutes.
277 277
     if ( ! $addons ) {
278
-        set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS );
279
-        return false;
278
+	set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS );
279
+	return false;
280 280
     }
281 281
 
282 282
     // If there was an error retrieving the addons, set the error.
283 283
     if ( isset( $addons->error ) ) {
284
-        set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS );
285
-        return false;
284
+	set_transient( '_monsterinsights_addons', false, 10 * MINUTE_IN_SECONDS );
285
+	return false;
286 286
     }
287 287
 
288 288
     // Otherwise, our request worked. Save the data and return it.
@@ -303,9 +303,9 @@  discard block
 block discarded – undo
303 303
     $keys = array_keys( get_plugins() );
304 304
 
305 305
     foreach ( $keys as $key ) {
306
-        if ( preg_match( '|^' . $slug . '|', $key ) ) {
307
-            return $key;
308
-        }
306
+	if ( preg_match( '|^' . $slug . '|', $key ) ) {
307
+	    return $key;
308
+	}
309 309
     }
310 310
 
311 311
     return $slug;
@@ -328,24 +328,24 @@  discard block
 block discarded – undo
328 328
     $slug = str_replace( 'monsterinsights-', '', $addon->slug );
329 329
     $slug = 'monsterinsights-' . $addon->slug;
330 330
     if ( $slug === 'monsterinsights-ecommerce' ) {
331
-        $slug = 'ga-ecommerce';
331
+	$slug = 'ga-ecommerce';
332 332
     } 
333 333
 
334 334
     $plugin_basename   = monsterinsights_get_plugin_basename_from_slug( $slug );
335 335
     $categories = implode( ',', $addon->categories );
336 336
     if ( ! $installed_plugins ) {
337
-        $installed_plugins = get_plugins();
337
+	$installed_plugins = get_plugins();
338 338
     }
339 339
    
340 340
     // If the Addon doesn't supply an upgrade_url key, it's because the user hasn't provided a license
341 341
     // get_upgrade_link() will return the Lite or Pro link as necessary for us.
342 342
     if ( ! isset( $addon->upgrade_url ) ) {
343
-        $addon->upgrade_url = monsterinsights_get_upgrade_link();
343
+	$addon->upgrade_url = monsterinsights_get_upgrade_link();
344 344
     }
345 345
 
346 346
     // Link user to doc to install MI pro to install addons
347 347
     if ( ! monsterinsights_is_pro_version() && $is_licensed && ! isset( $installed_plugins[ $plugin_basename ] ) ) {
348
-        $addon->url = 'https://www.monsterinsights.com/docs/install-monsterinsights-pro-to-use-addons';
348
+	$addon->url = 'https://www.monsterinsights.com/docs/install-monsterinsights-pro-to-use-addons';
349 349
     }
350 350
 
351 351
     // Output the card
@@ -353,19 +353,19 @@  discard block
 block discarded – undo
353 353
     <div class="monsterinsights-addon">
354 354
         <h3 class="monsterinsights-addon-title"><?php echo esc_html( $addon->title ); ?></h3>
355 355
         <?php
356
-        if ( ! empty( $addon->image ) ) {
357
-            ?>
356
+	if ( ! empty( $addon->image ) ) {
357
+	    ?>
358 358
             <img class="monsterinsights-addon-thumb" src="<?php echo esc_attr( esc_url( $addon->image ) ); ?>" alt="<?php echo esc_attr( $addon->title ); ?>" />
359 359
             <?php
360
-        }
361
-        ?>
360
+	}
361
+	?>
362 362
 
363 363
         <p class="monsterinsights-addon-excerpt"><?php echo esc_html( $addon->excerpt ); ?></p>
364 364
 
365 365
         <?php
366
-        // If the Addon is unlicensed, show the upgrade button 
367
-        if ( ! $is_licensed ) {
368
-            ?>
366
+	// If the Addon is unlicensed, show the upgrade button 
367
+	if ( ! $is_licensed ) {
368
+	    ?>
369 369
             <div class="monsterinsights-addon-active monsterinsights-addon-message">
370 370
                 <div class="interior">
371 371
                     <div class="monsterinsights-addon-upgrade">
@@ -377,15 +377,15 @@  discard block
 block discarded – undo
377 377
                 </div>
378 378
             </div>
379 379
             <?php
380
-        } else {
381
-            // Addon is licensed
382
-
383
-            // If the plugin is not installed, display an install message and button.
384
-            if ( ! isset( $installed_plugins[ $plugin_basename ] ) ) {
385
-                if ( empty( $addon->url ) ) {
386
-                    $addon->url = '';
387
-                }
388
-                ?>
380
+	} else {
381
+	    // Addon is licensed
382
+
383
+	    // If the plugin is not installed, display an install message and button.
384
+	    if ( ! isset( $installed_plugins[ $plugin_basename ] ) ) {
385
+		if ( empty( $addon->url ) ) {
386
+		    $addon->url = '';
387
+		}
388
+		?>
389 389
                 <div class="monsterinsights-addon-not-installed monsterinsights-addon-message">
390 390
                     <div class="interior">
391 391
                          <?php if ( monsterinsights_is_pro_version() ) { ?>
@@ -408,22 +408,22 @@  discard block
 block discarded – undo
408 408
                     </div>
409 409
                 </div>
410 410
                 <?php
411
-            } else {
412
-                // Plugin is installed.
411
+	    } else {
412
+		// Plugin is installed.
413 413
                 
414
-                $active = false;
415
-                $ms_active = is_plugin_active_for_network( $plugin_basename );
416
-                $ss_active = is_plugin_active( $plugin_basename );
417
-
418
-                if ( is_multisite() && is_network_admin() ) {
419
-                    $active = is_plugin_active_for_network( $plugin_basename );
420
-                } else {
421
-                    $active = is_plugin_active( $plugin_basename );
422
-                }
423
-
424
-                if ( $active ) {
425
-                    // Plugin is active. Display the active message and deactivate button.
426
-                    ?>
414
+		$active = false;
415
+		$ms_active = is_plugin_active_for_network( $plugin_basename );
416
+		$ss_active = is_plugin_active( $plugin_basename );
417
+
418
+		if ( is_multisite() && is_network_admin() ) {
419
+		    $active = is_plugin_active_for_network( $plugin_basename );
420
+		} else {
421
+		    $active = is_plugin_active( $plugin_basename );
422
+		}
423
+
424
+		if ( $active ) {
425
+		    // Plugin is active. Display the active message and deactivate button.
426
+		    ?>
427 427
                     <div class="monsterinsights-addon-active monsterinsights-addon-message">
428 428
                         <div class="interior">
429 429
                             <?php if ( $ms_active ) { ?>
@@ -449,9 +449,9 @@  discard block
 block discarded – undo
449 449
                         </div>
450 450
                     </div>
451 451
                     <?php
452
-                } else {
453
-                    // Plugin is inactivate. Display the inactivate mesage and activate button.
454
-                    ?>
452
+		} else {
453
+		    // Plugin is inactivate. Display the inactivate mesage and activate button.
454
+		    ?>
455 455
                     <div class="monsterinsights-addon-inactive monsterinsights-addon-message">
456 456
                         <div class="interior">
457 457
                             <?php if ( $ms_active ) { ?>
@@ -474,10 +474,10 @@  discard block
 block discarded – undo
474 474
                         </div>
475 475
                     </div>
476 476
                     <?php
477
-                }
478
-            }
479
-        }
480
-        ?>
477
+		}
478
+	    }
479
+	}
480
+	?>
481 481
     </div>
482 482
     <?php
483 483
 }
484 484
\ No newline at end of file
Please login to merge, or discard this patch.
includes/helpers.php 3 patches
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 	function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) {
868 868
 		global $wp_filter;
869 869
 		// Check that filter actually exists first
870
-		if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE;
870
+		if ( ! isset( $wp_filter[ $tag ] ) ) return false;
871 871
 		/**
872 872
 		 * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer
873 873
 		 * a simple array, rather it is an object that implements the ArrayAccess interface.
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
 			$callbacks = &$wp_filter[ $tag ];
883 883
 		}
884 884
 		// Exit if there aren't any callbacks for specified priority
885
-		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE;
885
+		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return false;
886 886
 		// Loop through each filter for the specified priority, looking for our class & method
887 887
 		foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) {
888 888
 			// Filter should always be an array - array( $this, 'method' ), if not goto next
@@ -904,10 +904,10 @@  discard block
 block discarded – undo
904 904
 					// Remove this filter from merged_filters, which specifies if filters have been sorted
905 905
 					unset( $GLOBALS[ 'merged_filters' ][ $tag ] );
906 906
 				}
907
-				return TRUE;
907
+				return true;
908 908
 			}
909 909
 		}
910
-		return FALSE;
910
+		return false;
911 911
 	}
912 912
 } // End function exists
913 913
 
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 function monsterinsights_track_user() {
33 33
 	$user        = wp_get_current_user();
34 34
 	$track_user  = true;
35
-	$roles     = monsterinsights_get_option( 'ignore_users', array() );
35
+	$roles = monsterinsights_get_option( 'ignore_users', array() );
36 36
 
37 37
 	if ( ! empty( $roles ) && is_array( $roles ) ) {
38 38
 		foreach ( $roles as $role ) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 
100 100
 	$ga_cookie    = $_COOKIE['_ga'];
101
-	$cookie_parts = explode('.', $ga_cookie );
101
+	$cookie_parts = explode( '.', $ga_cookie );
102 102
 	if ( is_array( $cookie_parts ) && ! empty( $cookie_parts[2] ) && ! empty( $cookie_parts[3] ) ) {
103 103
 		$uuid = (string) $cookie_parts[2] . '.' . (string) $cookie_parts[3];
104 104
 		if ( is_string( $uuid ) ) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 	}
158 158
 	
159 159
 	$ga_cookie    = $_COOKIE['_ga'];
160
-	$cookie_parts = explode('.', $ga_cookie );
160
+	$cookie_parts = explode( '.', $ga_cookie );
161 161
 	if ( is_array( $cookie_parts ) && ! empty( $cookie_parts[2] ) && ! empty( $cookie_parts[3] ) ) {
162 162
 		$uuid = (string) $cookie_parts[2] . '.' . (string) $cookie_parts[3];
163 163
 		if ( is_string( $uuid ) ) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
 
174 174
 function monsterinsights_generate_ga_client_id() {
175
-	return rand(100000000,999999999) . '.' . time();
175
+	return rand( 100000000, 999999999 ) . '.' . time();
176 176
 }
177 177
  
178 178
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		$stop = time();
193 193
 	}
194 194
 
195
-	$diff = (int) abs( $stop -  $start );
195
+	$diff = (int) abs( $stop - $start );
196 196
 	$hours = round( $diff / HOUR_IN_SECONDS );
197 197
 	return $hours;
198 198
 }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 	$editable_roles = apply_filters( 'editable_roles', $all_roles );
251 251
 
252 252
 	foreach ( $editable_roles as $id => $name ) {
253
-		$roles[ $id ] = translate_user_role( $name['name'] );
253
+		$roles[$id] = translate_user_role( $name['name'] );
254 254
 	}
255 255
 
256 256
 	return $roles;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 			
296 296
 		}
297 297
 		if ( substr_count( $host, '.' ) > 1 ) {
298
-			$subdomains_to_check =  array( 'dev.', '*.staging.', 'beta.', 'test.' );
298
+			$subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' );
299 299
 			foreach ( $subdomains_to_check as $subdomain ) {
300 300
 				$subdomain = str_replace( '.', '(.)', $subdomain );
301 301
 				$subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain );
@@ -311,16 +311,16 @@  discard block
 block discarded – undo
311 311
 
312 312
 // Set cookie to expire in 2 years
313 313
 function monsterinsights_get_cookie_expiration_date( $time ) {
314
-	return date('D, j F Y H:i:s', time() + $time );
314
+	return date( 'D, j F Y H:i:s', time() + $time );
315 315
 }
316 316
 
317 317
 function monsterinsights_string_ends_with( $string, $ending ) {
318
-	$strlen = strlen($string);
319
-	$endinglen = strlen($ending);
318
+	$strlen = strlen( $string );
319
+	$endinglen = strlen( $ending );
320 320
 	if ( $endinglen > $strlen ) {
321 321
 		return false;
322 322
 	}
323
-	return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen) === 0;
323
+	return substr_compare( $string, $ending, $strlen - $endinglen, $endinglen ) === 0;
324 324
 }
325 325
 
326 326
 function monsterinsights_string_starts_with( $string, $start ) {
@@ -844,11 +844,11 @@  discard block
 block discarded – undo
844 844
 	return $countries;
845 845
 }
846 846
 
847
-function monsterinsights_get_api_url(){
847
+function monsterinsights_get_api_url() {
848 848
 	return apply_filters( 'monsterinsights_get_api_url', 'www.monsterinsights.com/v1/' );
849 849
 }
850 850
 
851
-function monsterinsights_get_licensing_url(){
851
+function monsterinsights_get_licensing_url() {
852 852
 	return apply_filters( 'monsterinsights_get_licensing_url', 'https://www.monsterinsights.com' );
853 853
 }
854 854
 
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 	}
897 897
 }
898 898
 
899
-if ( ! function_exists ( 'remove_class_filter' ) ) {
899
+if ( ! function_exists( 'remove_class_filter' ) ) {
900 900
 	/**
901 901
 	 * Remove Class Filter Without Access to Class Object
902 902
 	 *
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 	function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) {
918 918
 		global $wp_filter;
919 919
 		// Check that filter actually exists first
920
-		if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE;
920
+		if ( ! isset( $wp_filter[$tag] ) ) return FALSE;
921 921
 		/**
922 922
 		 * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer
923 923
 		 * a simple array, rather it is an object that implements the ArrayAccess interface.
@@ -926,33 +926,33 @@  discard block
 block discarded – undo
926 926
 		 *
927 927
 		 * @see https://make.wordpress.org/core/2016/09/08/wp_hook-next-generation-actions-and-filters/
928 928
 		 */
929
-		if ( is_object( $wp_filter[ $tag ] ) && isset( $wp_filter[ $tag ]->callbacks ) ) {
930
-			$callbacks = &$wp_filter[ $tag ]->callbacks;
929
+		if ( is_object( $wp_filter[$tag] ) && isset( $wp_filter[$tag]->callbacks ) ) {
930
+			$callbacks = &$wp_filter[$tag]->callbacks;
931 931
 		} else {
932
-			$callbacks = &$wp_filter[ $tag ];
932
+			$callbacks = &$wp_filter[$tag];
933 933
 		}
934 934
 		// Exit if there aren't any callbacks for specified priority
935
-		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE;
935
+		if ( ! isset( $callbacks[$priority] ) || empty( $callbacks[$priority] ) ) return FALSE;
936 936
 		// Loop through each filter for the specified priority, looking for our class & method
937
-		foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) {
937
+		foreach ( (array) $callbacks[$priority] as $filter_id => $filter ) {
938 938
 			// Filter should always be an array - array( $this, 'method' ), if not goto next
939
-			if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) continue;
939
+			if ( ! isset( $filter['function'] ) || ! is_array( $filter['function'] ) ) continue;
940 940
 			// If first value in array is not an object, it can't be a class
941
-			if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) continue;
941
+			if ( ! is_object( $filter['function'][0] ) ) continue;
942 942
 			// Method doesn't match the one we're looking for, goto next
943
-			if ( $filter[ 'function' ][ 1 ] !== $method_name ) continue;
943
+			if ( $filter['function'][1] !== $method_name ) continue;
944 944
 			// Method matched, now let's check the Class
945
-			if ( get_class( $filter[ 'function' ][ 0 ] ) === $class_name ) {
945
+			if ( get_class( $filter['function'][0] ) === $class_name ) {
946 946
 				// Now let's remove it from the array
947
-				unset( $callbacks[ $priority ][ $filter_id ] );
947
+				unset( $callbacks[$priority][$filter_id] );
948 948
 				// and if it was the only filter in that priority, unset that priority
949
-				if ( empty( $callbacks[ $priority ] ) ) unset( $callbacks[ $priority ] );
949
+				if ( empty( $callbacks[$priority] ) ) unset( $callbacks[$priority] );
950 950
 				// and if the only filter for that tag, set the tag to an empty array
951 951
 				if ( empty( $callbacks ) ) $callbacks = array();
952 952
 				// If using WordPress older than 4.7
953
-				if ( ! is_object( $wp_filter[ $tag ] ) ) {
953
+				if ( ! is_object( $wp_filter[$tag] ) ) {
954 954
 					// Remove this filter from merged_filters, which specifies if filters have been sorted
955
-					unset( $GLOBALS[ 'merged_filters' ][ $tag ] );
955
+					unset( $GLOBALS['merged_filters'][$tag] );
956 956
 				}
957 957
 				return TRUE;
958 958
 			}
@@ -961,7 +961,7 @@  discard block
 block discarded – undo
961 961
 	}
962 962
 } // End function exists
963 963
 
964
-if ( ! function_exists ( 'remove_class_action' ) ) {
964
+if ( ! function_exists( 'remove_class_action' ) ) {
965 965
 	/**
966 966
 	 * Remove Class Action Without Access to Class Object
967 967
 	 *
Please login to merge, or discard this patch.
Braces   +23 added lines, -9 removed lines patch added patch discarded remove patch
@@ -844,11 +844,11 @@  discard block
 block discarded – undo
844 844
 	return $countries;
845 845
 }
846 846
 
847
-function monsterinsights_get_api_url(){
847
+function monsterinsights_get_api_url() {
848 848
 	return apply_filters( 'monsterinsights_get_api_url', 'www.monsterinsights.com/v1/' );
849 849
 }
850 850
 
851
-function monsterinsights_get_licensing_url(){
851
+function monsterinsights_get_licensing_url() {
852 852
 	return apply_filters( 'monsterinsights_get_licensing_url', 'https://www.monsterinsights.com' );
853 853
 }
854 854
 
@@ -917,7 +917,9 @@  discard block
 block discarded – undo
917 917
 	function remove_class_filter( $tag, $class_name = '', $method_name = '', $priority = 10 ) {
918 918
 		global $wp_filter;
919 919
 		// Check that filter actually exists first
920
-		if ( ! isset( $wp_filter[ $tag ] ) ) return FALSE;
920
+		if ( ! isset( $wp_filter[ $tag ] ) ) {
921
+			return FALSE;
922
+		}
921 923
 		/**
922 924
 		 * If filter config is an object, means we're using WordPress 4.7+ and the config is no longer
923 925
 		 * a simple array, rather it is an object that implements the ArrayAccess interface.
@@ -932,23 +934,35 @@  discard block
 block discarded – undo
932 934
 			$callbacks = &$wp_filter[ $tag ];
933 935
 		}
934 936
 		// Exit if there aren't any callbacks for specified priority
935
-		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) return FALSE;
937
+		if ( ! isset( $callbacks[ $priority ] ) || empty( $callbacks[ $priority ] ) ) {
938
+			return FALSE;
939
+		}
936 940
 		// Loop through each filter for the specified priority, looking for our class & method
937 941
 		foreach( (array) $callbacks[ $priority ] as $filter_id => $filter ) {
938 942
 			// Filter should always be an array - array( $this, 'method' ), if not goto next
939
-			if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) continue;
943
+			if ( ! isset( $filter[ 'function' ] ) || ! is_array( $filter[ 'function' ] ) ) {
944
+				continue;
945
+			}
940 946
 			// If first value in array is not an object, it can't be a class
941
-			if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) continue;
947
+			if ( ! is_object( $filter[ 'function' ][ 0 ] ) ) {
948
+				continue;
949
+			}
942 950
 			// Method doesn't match the one we're looking for, goto next
943
-			if ( $filter[ 'function' ][ 1 ] !== $method_name ) continue;
951
+			if ( $filter[ 'function' ][ 1 ] !== $method_name ) {
952
+				continue;
953
+			}
944 954
 			// Method matched, now let's check the Class
945 955
 			if ( get_class( $filter[ 'function' ][ 0 ] ) === $class_name ) {
946 956
 				// Now let's remove it from the array
947 957
 				unset( $callbacks[ $priority ][ $filter_id ] );
948 958
 				// and if it was the only filter in that priority, unset that priority
949
-				if ( empty( $callbacks[ $priority ] ) ) unset( $callbacks[ $priority ] );
959
+				if ( empty( $callbacks[ $priority ] ) ) {
960
+					unset( $callbacks[ $priority ] );
961
+				}
950 962
 				// and if the only filter for that tag, set the tag to an empty array
951
-				if ( empty( $callbacks ) ) $callbacks = array();
963
+				if ( empty( $callbacks ) ) {
964
+					$callbacks = array();
965
+				}
952 966
 				// If using WordPress older than 4.7
953 967
 				if ( ! is_object( $wp_filter[ $tag ] ) ) {
954 968
 					// Remove this filter from merged_filters, which specifies if filters have been sorted
Please login to merge, or discard this patch.
includes/frontend/tracking/class-tracking-preview.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -84,9 +84,9 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @return array Array of the options to use.
58 58
      */
59 59
     public function frontend_tracking_options( ) {
60
-        return array();
60
+	return array();
61 61
     }
62 62
 
63 63
     /**
@@ -73,9 +73,9 @@  discard block
 block discarded – undo
73 73
      * @return string Javascript to output.
74 74
      */
75 75
     public function frontend_output( ) {
76
-        $output  = '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->';
77
-        $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' ) . ' -->';
78
-        $output .=  '<!-- / Google Analytics by MonsterInsights -->';
79
-        return $output;
76
+	$output  = '<!-- This site uses the Google Analytics by MonsterInsights plugin v ' . MONSTERINSIGHTS_VERSION .' - https://www.monsterinsights.com/ -->';
77
+	$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' ) . ' -->';
78
+	$output .=  '<!-- / Google Analytics by MonsterInsights -->';
79
+	return $output;
80 80
     }
81 81
 }
82 82
\ No newline at end of file
Please login to merge, or discard this patch.
includes/frontend/frontend.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
126 126
 function monsterinsights_rss_link_tagger( $guid ) {
127 127
     global $post;
128 128
 
129
-    if ( monsterinsights_get_option( 'tag_links_in_rss', false ) ){
129
+    if ( monsterinsights_get_option( 'tag_links_in_rss', false ) ) {
130 130
         if ( is_feed() ) {
131 131
             if ( monsterinsights_get_option( 'allow_anchor', false ) ) {
132 132
                 $delimiter = '#';
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
126 126
 function monsterinsights_rss_link_tagger( $guid ) {
127 127
     global $post;
128 128
 
129
-    if ( monsterinsights_get_option( 'tag_links_in_rss', false ) ){
129
+    if ( monsterinsights_get_option( 'tag_links_in_rss', false ) ) {
130 130
         if ( is_feed() ) {
131 131
             if ( monsterinsights_get_option( 'allow_anchor', false ) ) {
132 132
                 $delimiter = '#';
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
     do_action( 'monsterinsights_tracking_before_' . $mode );
38 38
     do_action( 'monsterinsights_tracking_before', $mode );
39 39
     if ( $mode === 'preview' ) {
40
-        require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/tracking/class-tracking-preview.php';
41
-        $tracking = new MonsterInsights_Tracking_Preview();
42
-        echo $tracking->frontend_output();
40
+	require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/tracking/class-tracking-preview.php';
41
+	$tracking = new MonsterInsights_Tracking_Preview();
42
+	echo $tracking->frontend_output();
43 43
     } else {
44
-         require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/tracking/class-tracking-analytics.php';
45
-         $tracking = new MonsterInsights_Tracking_Analytics();
46
-         echo $tracking->frontend_output();
44
+	 require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/tracking/class-tracking-analytics.php';
45
+	 $tracking = new MonsterInsights_Tracking_Analytics();
46
+	 echo $tracking->frontend_output();
47 47
     }
48 48
 
49 49
     do_action( 'monsterinsights_tracking_after_' . $mode );
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
     $track_user    = monsterinsights_track_user();
70 70
 
71 71
     if ( $track_user && ( $events_mode === 'js' || $events_mode === 'php' ) ) {
72
-        require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php';
73
-        new MonsterInsights_Analytics_Events();
72
+	require_once plugin_dir_path( MONSTERINSIGHTS_PLUGIN_FILE ) . 'includes/frontend/events/class-analytics-events.php';
73
+	new MonsterInsights_Analytics_Events();
74 74
     } else {
75
-        // User is in the disabled group or events mode is off
75
+	// User is in the disabled group or events mode is off
76 76
     }
77 77
 }
78 78
 add_action( 'template_redirect', 'monsterinsights_events_tracking', 9 );
@@ -91,17 +91,17 @@  discard block
 block discarded – undo
91 91
     global $post;
92 92
 
93 93
     if ( monsterinsights_get_option( 'tag_links_in_rss', false ) ){
94
-        if ( is_feed() ) {
95
-            if ( monsterinsights_get_option( 'allow_anchor', false ) ) {
96
-                $delimiter = '#';
97
-            } else {
98
-                $delimiter = '?';
99
-                if ( strpos( $guid, $delimiter ) > 0 ) {
100
-                    $delimiter = '&amp;';
101
-                }
102
-            }
103
-            return $guid . $delimiter . 'utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=' . urlencode( $post->post_name );
104
-        }
94
+	if ( is_feed() ) {
95
+	    if ( monsterinsights_get_option( 'allow_anchor', false ) ) {
96
+		$delimiter = '#';
97
+	    } else {
98
+		$delimiter = '?';
99
+		if ( strpos( $guid, $delimiter ) > 0 ) {
100
+		    $delimiter = '&amp;';
101
+		}
102
+	    }
103
+	    return $guid . $delimiter . 'utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=' . urlencode( $post->post_name );
104
+	}
105 105
     }
106 106
     return $guid;
107 107
 }
Please login to merge, or discard this patch.
includes/install.php 2 patches
Braces   +12 added lines, -10 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly
16
-if ( ! defined( 'ABSPATH' ) ) { 
16
+if ( ! defined( 'ABSPATH' ) ) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -72,7 +72,8 @@  discard block
 block discarded – undo
72 72
 			// This is the version used for MI upgrade routines.
73 73
 			update_option( 'monsterinsights_db_version', '6.2.0' );
74 74
 			
75
-		} else if ( ! $version && $yoast ) { // if new install and has used Yoast previously
75
+		} else if ( ! $version && $yoast ) {
76
+// if new install and has used Yoast previously
76 77
 
77 78
 			$this->upgrade_from_yoast();
78 79
 			// This is the version used for MI upgrade routines.
@@ -83,7 +84,8 @@  discard block
 block discarded – undo
83 84
 				$cachec = true;
84 85
 			}
85 86
 			
86
-		} else { // if existing install
87
+		} else {
88
+// if existing install
87 89
 			if ( version_compare( $version, '6.0.2', '<' ) ) {
88 90
 				$this->v602_upgrades();
89 91
 			}
@@ -328,7 +330,7 @@  discard block
 block discarded – undo
328 330
 			$network = false;
329 331
 			// Try network active Premium
330 332
 			$is_key = get_site_option( 'google-analytics-by-yoast-premium_license', array() );
331
-			if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ){
333
+			if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ) {
332 334
 				$key    = $is_key['key'];
333 335
 				$found = true;
334 336
 				$network = true;
@@ -337,7 +339,7 @@  discard block
 block discarded – undo
337 339
 			// Try single site Premium
338 340
 			if ( ! $found ) {
339 341
 				$is_key = get_option( 'google-analytics-by-yoast-premium_license', array() );
340
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ){
342
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ) {
341 343
 					$key    = $is_key['key'];
342 344
 					$found = true;
343 345
 				}				
@@ -346,7 +348,7 @@  discard block
 block discarded – undo
346 348
 			// Try network active Premium
347 349
 			if ( ! $found ) {
348 350
 				$is_key = get_site_option( 'monsterinsights-pro_license', array() );
349
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ){
351
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ) {
350 352
 					$key    = $is_key['key'];
351 353
 					$found = true;
352 354
 					$network = true;
@@ -356,7 +358,7 @@  discard block
 block discarded – undo
356 358
 			// Try single site Premium
357 359
 			if ( ! $found ) {
358 360
 				$is_key = get_option( 'monsterinsights-pro_license', array() );
359
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ){
361
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ) {
360 362
 					$key    = $is_key['key'];
361 363
 					$found = true;
362 364
 				}				
@@ -365,7 +367,7 @@  discard block
 block discarded – undo
365 367
 			// Try network active ecommmerce
366 368
 			if ( ! $found ) {
367 369
 				$is_key = get_site_option( 'ecommerce-addon_license', array() );
368
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ){
370
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ) {
369 371
 					$key    = $is_key['key'];
370 372
 					$found = true;
371 373
 					$network = true;
@@ -374,7 +376,7 @@  discard block
 block discarded – undo
374 376
 			// Try single site ecommerce
375 377
 			if ( ! $found ) {
376 378
 				$is_key = get_option( 'ecommerce-addon_license', array() );
377
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ){
379
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ) {
378 380
 					$key    = $is_key['key'];
379 381
 					$found = true;
380 382
 				}				
@@ -516,7 +518,7 @@  discard block
 block discarded – undo
516 518
 						delete_option( 'yoast-ga-access_token' );
517 519
 						delete_option( 'yoast-ga-refresh_token' );
518 520
 						delete_option( 'yst_ga_api' );
519
-					}  else {
521
+					} else {
520 522
 					// if UA in profile profiles, remove others and use that
521 523
 						if ( ! empty( $options['analytics_profile' ] ) && ! empty( $profiles['ga_api_response_accounts'] ) && is_array( $profiles['ga_api_response_accounts'] ) ) {
522 524
 							foreach ( $profiles as $account ) {
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 		// Fallback to make sure every default option has a value
307 307
 		$defaults = $this->get_yoast_default_values();
308 308
 		if ( is_array( $defaults ) ) {
309
-			foreach ( $defaults[ 'ga_general' ] as $key => $value ) {
310
-				if ( ! isset( $options[ $key ] ) ) {
311
-					$options[ $key ] = $value;
309
+			foreach ( $defaults['ga_general'] as $key => $value ) {
310
+				if ( ! isset( $options[$key] ) ) {
311
+					$options[$key] = $value;
312 312
 				}
313 313
 			}
314 314
 		}
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 		// Set to the current version now that we've done all needed upgrades
317 317
 		$options['version'] = '5.5.3'; // Last Yoast codebase version
318 318
 		$saved_options = get_option( 'yst_ga' );
319
-		$saved_options[ 'ga_general' ] = $options;
319
+		$saved_options['ga_general'] = $options;
320 320
 		update_option( 'yst_ga', $saved_options );
321 321
 
322 322
 
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
 			$network = false;
327 327
 			// Try network active Premium
328 328
 			$is_key = get_site_option( 'google-analytics-by-yoast-premium_license', array() );
329
-			if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ){
330
-				$key    = $is_key['key'];
329
+			if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ) {
330
+				$key = $is_key['key'];
331 331
 				$found = true;
332 332
 				$network = true;
333 333
 			}
@@ -335,8 +335,8 @@  discard block
 block discarded – undo
335 335
 			// Try single site Premium
336 336
 			if ( ! $found ) {
337 337
 				$is_key = get_option( 'google-analytics-by-yoast-premium_license', array() );
338
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ){
339
-					$key    = $is_key['key'];
338
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ) {
339
+					$key = $is_key['key'];
340 340
 					$found = true;
341 341
 				}				
342 342
 			}
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
 			// Try network active Premium
345 345
 			if ( ! $found ) {
346 346
 				$is_key = get_site_option( 'monsterinsights-pro_license', array() );
347
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ){
348
-					$key    = $is_key['key'];
347
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ) {
348
+					$key = $is_key['key'];
349 349
 					$found = true;
350 350
 					$network = true;
351 351
 				}				
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
 			// Try single site Premium
355 355
 			if ( ! $found ) {
356 356
 				$is_key = get_option( 'monsterinsights-pro_license', array() );
357
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ){
358
-					$key    = $is_key['key'];
357
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ) {
358
+					$key = $is_key['key'];
359 359
 					$found = true;
360 360
 				}				
361 361
 			}
@@ -363,8 +363,8 @@  discard block
 block discarded – undo
363 363
 			// Try network active ecommmerce
364 364
 			if ( ! $found ) {
365 365
 				$is_key = get_site_option( 'ecommerce-addon_license', array() );
366
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ){
367
-					$key    = $is_key['key'];
366
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) && is_multisite() ) {
367
+					$key = $is_key['key'];
368 368
 					$found = true;
369 369
 					$network = true;
370 370
 				}
@@ -372,8 +372,8 @@  discard block
 block discarded – undo
372 372
 			// Try single site ecommerce
373 373
 			if ( ! $found ) {
374 374
 				$is_key = get_option( 'ecommerce-addon_license', array() );
375
-				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ){
376
-					$key    = $is_key['key'];
375
+				if ( $is_key && ! empty( $is_key ) && is_array( $is_key ) && ! empty( $is_key['key'] ) ) {
376
+					$key = $is_key['key'];
377 377
 					$found = true;
378 378
 				}				
379 379
 			}
@@ -488,10 +488,10 @@  discard block
 block discarded – undo
488 488
 							}
489 489
 						}
490 490
 					}
491
-					$options['cron_last_run'] = strtotime("-25 hours");
491
+					$options['cron_last_run'] = strtotime( "-25 hours" );
492 492
 				} else {
493 493
 					// if UA in manual code field, remove analytics profile fields if set
494
-					if ( ! empty( $options['manual_ua_code_field' ] ) ) {
494
+					if ( ! empty( $options['manual_ua_code_field'] ) ) {
495 495
 						if ( isset( $options['analytics_profile_code'] ) ) {
496 496
 							unset( $options['analytics_profile_code'] );
497 497
 						}
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 						delete_option( 'yoast-ga-access_token' );
503 503
 						delete_option( 'yoast-ga-refresh_token' );
504 504
 						delete_option( 'yst_ga_api' );
505
-					} else if ( ! empty( $options['analytics_profile_code' ] ) ) {
505
+					} else if ( ! empty( $options['analytics_profile_code'] ) ) {
506 506
 					// if UA in profile fields, remove others and use that
507 507
 						$options['manual_ua_code'] = $options['analytics_profile_code'];
508 508
 						if ( isset( $options['analytics_profile_code'] ) ) {
@@ -514,13 +514,13 @@  discard block
 block discarded – undo
514 514
 						delete_option( 'yoast-ga-access_token' );
515 515
 						delete_option( 'yoast-ga-refresh_token' );
516 516
 						delete_option( 'yst_ga_api' );
517
-					}  else {
517
+					} else {
518 518
 					// if UA in profile profiles, remove others and use that
519
-						if ( ! empty( $options['analytics_profile' ] ) && ! empty( $profiles['ga_api_response_accounts'] ) && is_array( $profiles['ga_api_response_accounts'] ) ) {
519
+						if ( ! empty( $options['analytics_profile'] ) && ! empty( $profiles['ga_api_response_accounts'] ) && is_array( $profiles['ga_api_response_accounts'] ) ) {
520 520
 							foreach ( $profiles as $account ) {
521 521
 								foreach ( $account['items'] as $profile ) {
522 522
 									foreach ( $profile['items'] as $subprofile ) {
523
-										if ( isset( $subprofile['id'] ) && $subprofile['id'] == $options['analytics_profile' ] ) {
523
+										if ( isset( $subprofile['id'] ) && $subprofile['id'] == $options['analytics_profile'] ) {
524 524
 											$options['manual_ua_code'] = $subprofile['ua_code'];
525 525
 											break 3;
526 526
 										}
@@ -640,8 +640,8 @@  discard block
 block discarded – undo
640 640
 	 */
641 641
 	public function v602_upgrades() {
642 642
 		$options = get_option( 'yst_ga', array() );
643
-		if ( ( empty( $this->new_settings[ 'manual_ua_code'] ) || $this->new_settings[ 'manual_ua_code']  === '1' )  &&  
644
-			 empty( $this->new_settings[ 'analytics_profile_code'] ) &&
643
+		if ( ( empty( $this->new_settings['manual_ua_code'] ) || $this->new_settings['manual_ua_code'] === '1' ) &&  
644
+			 empty( $this->new_settings['analytics_profile_code'] ) &&
645 645
 			 ! empty( $options ) &&
646 646
 			 is_array( $options ) &&
647 647
 			 ! empty( $options['ga_general']['manual_ua_code_field'] )
@@ -689,8 +689,8 @@  discard block
 block discarded – undo
689 689
 	 */
690 690
 	public function v620_upgrades() {
691 691
 		// Turns off debug mode if its on.
692
-		if ( empty( $this->new_settings['debug_mode' ] ) ) {
693
-			$this->new_settings['debug_mode' ] = 0;
692
+		if ( empty( $this->new_settings['debug_mode'] ) ) {
693
+			$this->new_settings['debug_mode'] = 0;
694 694
 		}
695 695
 	}
696 696
 
@@ -727,25 +727,25 @@  discard block
 block discarded – undo
727 727
 
728 728
 		// 3. Default all event tracking and tracking to GA + JS respectively
729 729
 			// 3a Set tracking_mode to use analytics.js
730
-			$this->new_settings['tracking_mode' ] = 'analytics';
730
+			$this->new_settings['tracking_mode'] = 'analytics';
731 731
 			
732 732
 
733 733
 			// 3b Set events mode to use JS if the events mode is not set explicitly to none
734
-			if ( empty( $this->new_settings['events_mode' ] ) || $this->new_settings['events_mode' ] !== 'none' ) {
735
-				$this->new_settings['events_mode' ] = 'js';
734
+			if ( empty( $this->new_settings['events_mode'] ) || $this->new_settings['events_mode'] !== 'none' ) {
735
+				$this->new_settings['events_mode'] = 'js';
736 736
 			}
737 737
 
738 738
 		// 4. Migrate manual UA codes
739 739
 			// 4a Manual UA has the lowest priority
740
-			if ( ! empty( $this->new_settings['manual_ua_code' ] ) ) {
740
+			if ( ! empty( $this->new_settings['manual_ua_code'] ) ) {
741 741
 				// Set as manual UA code
742
-				is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code' ] ) );
742
+				is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['manual_ua_code'] ) );
743 743
 			}
744 744
 
745 745
 			// 4b Then try the oAuth UA code
746
-			if ( ! empty( $this->new_settings['analytics_profile_code' ] ) ) {
746
+			if ( ! empty( $this->new_settings['analytics_profile_code'] ) ) {
747 747
 				// Set as manual UA code
748
-				is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code' ] ) );
748
+				is_network_admin() ? update_site_option( 'monsterinsights_network_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) ) : update_option( 'monsterinsights_site_profile', array( 'manual' => $this->new_settings['analytics_profile_code'] ) );
749 749
 			}
750 750
 
751 751
 		// 5. Migrate License keys
@@ -773,8 +773,8 @@  discard block
 block discarded – undo
773 773
 							'grids', 'icl_post_language', 'mlcf_email', 'mlcf_name', 'navigation-skins', 'page', 'punch-fonts', 'return_tab', 'skins',
774 774
 							'wpcf_email', 'wpcf_your_name' );
775 775
 		foreach ( $settings as $setting ) {
776
-			if ( ! empty( $this->new_settings[ $setting ] ) ) {
777
-				unset( $this->new_settings[ $setting ] );
776
+			if ( ! empty( $this->new_settings[$setting] ) ) {
777
+				unset( $this->new_settings[$setting] );
778 778
 			}
779 779
 		}
780 780
 
@@ -797,11 +797,11 @@  discard block
 block discarded – undo
797 797
 		// 5. Remove deprecated settings
798 798
 		$settings = array( '_repeated', 'ajax', 'asmselect0', 'bawac_force_nonce', 'cf_email', 'cf_message', 'cf_name', 'cf_number',
799 799
 							'cf_phone', 'cf_subject', 'credentials', 'cron_failed', 'cron_last_run', 'firebug_lite', 'global-css', 'google_auth_code', 
800
-							'grids', 'icl_post_language', 'mlcf_email', 'mlcf_name','navigation-skins', 'page', 'punch-fonts', 'return_tab', 'skins',
800
+							'grids', 'icl_post_language', 'mlcf_email', 'mlcf_name', 'navigation-skins', 'page', 'punch-fonts', 'return_tab', 'skins',
801 801
 							'wpcf_email', 'wpcf_your_name' );
802 802
 		foreach ( $settings as $setting ) {
803
-			if ( ! empty( $this->new_settings[ $setting ] ) ) {
804
-				unset( $this->new_settings[ $setting ] );
803
+			if ( ! empty( $this->new_settings[$setting] ) ) {
804
+				unset( $this->new_settings[$setting] );
805 805
 			}
806 806
 		}
807 807
 
Please login to merge, or discard this patch.
lite/includes/admin/tools.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 }
6 6
 
7 7
 function monsterinsights_tools_url_builder() {
8
-	ob_start();?>
8
+	ob_start(); ?>
9 9
 	<div class="monsterinsights-upsell-under-box">
10 10
 		<h2><?php esc_html_e( "Want even more fine tuned control over your website analytics?", 'google-analytics-for-wordpress' ); ?></h2>
11 11
 		<p class="monsterinsights-upsell-lite-text"><?php esc_html_e( "By upgrading to MonsterInsights Pro, you can unlock the MonsterInsights URL builder that helps you better track your advertising and email marketing campaigns.", 'google-analytics-for-wordpress' ); ?></p>
Please login to merge, or discard this patch.
lite/includes/admin/tab-support.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@
 block discarded – undo
24 24
     ?>
25 25
     <div id="monsterinsights-settings-general">
26 26
         <?php 
27
-        // Output any notices now
28
-        do_action( 'monsterinsights_settings_support_tab_notice' );
29
-        ?>
27
+	// Output any notices now
28
+	do_action( 'monsterinsights_settings_support_tab_notice' );
29
+	?>
30 30
         <?php //Status page coming soon. ?>
31 31
         <!-- <hr /> -->
32 32
     </div>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) exit;
13
+if ( ! defined( 'ABSPATH' ) ) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * Callback for displaying the UI for support tab.
Please login to merge, or discard this patch.
lite/includes/install.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
assets/lib/pandora/class-am-deactivation-survey.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 				return;
55 55
 			}
56 56
 
57
-			add_action( 'admin_print_scripts', array( $this, 'js'    ), 20 );
58
-			add_action( 'admin_print_scripts', array( $this, 'css'   )     );
59
-			add_action( 'admin_footer',        array( $this, 'modal' )     );
57
+			add_action( 'admin_print_scripts', array( $this, 'js' ), 20 );
58
+			add_action( 'admin_print_scripts', array( $this, 'css' ) );
59
+			add_action( 'admin_footer', array( $this, 'modal' ) );
60 60
 		}
61 61
 	
62 62
 		/**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 		 */
68 68
 		public function is_dev_url() {
69 69
 			// If it is an AM dev site, return false, so we can see them on our dev sites.
70
-			if ( defined ('AWESOMEMOTIVE_DEV_MODE' ) && AWESOMEMOTIVE_DEV_MODE ) {
70
+			if ( defined( 'AWESOMEMOTIVE_DEV_MODE' ) && AWESOMEMOTIVE_DEV_MODE ) {
71 71
 				return false;
72 72
 			}
73 73
 		
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
 				}
103 103
 				if ( substr_count( $host, '.' ) > 1 ) {
104
-					$subdomains_to_check =  array( 'dev.', '*.staging.', 'beta.', 'test.' );
104
+					$subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' );
105 105
 					foreach ( $subdomains_to_check as $subdomain ) {
106 106
 						$subdomain = str_replace( '.', '(.)', $subdomain );
107 107
 						$subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain );
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 				<div class="am-deactivate-survey-wrap">
314 314
 					<form class="am-deactivate-survey" method="post">
315 315
 						<span class="am-deactivate-survey-title"><span class="dashicons dashicons-testimonial"></span><?php echo ' ' . esc_html__( 'Quick Feedback', 'google-analytics-for-wordpress' ); ?></span>
316
-						<span class="am-deactivate-survey-desc"><?php echo sprintf( esc_html__('If you have a moment, please share why you are deactivating %s:', 'google-analytics-for-wordpress' ), $this->name ); ?></span>
316
+						<span class="am-deactivate-survey-desc"><?php echo sprintf( esc_html__( 'If you have a moment, please share why you are deactivating %s:', 'google-analytics-for-wordpress' ), $this->name ); ?></span>
317 317
 						<div class="am-deactivate-survey-options">
318 318
 							<?php foreach ( $options as $id => $option ) : ?>
319 319
 							<div class="am-deactivate-survey-option">
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 							<?php endforeach; ?>
329 329
 						</div>
330 330
 						<div class="am-deactivate-survey-footer">
331
-							<button type="submit" class="am-deactivate-survey-submit button button-primary button-large"><?php echo sprintf( esc_html__('Submit %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' ); ?></button>
332
-							<a href="#" class="am-deactivate-survey-deactivate"><?php echo sprintf( esc_html__('Skip %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' ); ?></a>
331
+							<button type="submit" class="am-deactivate-survey-submit button button-primary button-large"><?php echo sprintf( esc_html__( 'Submit %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' ); ?></button>
332
+							<a href="#" class="am-deactivate-survey-deactivate"><?php echo sprintf( esc_html__( 'Skip %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' ); ?></a>
333 333
 						</div>
334 334
 					</form>
335 335
 				</div>
Please login to merge, or discard this patch.