@@ -29,26 +29,26 @@ discard block |
||
29 | 29 | <div id="monsterinsights-settings-general"> |
30 | 30 | <div class="monsterinsights-tab-settings-notices"> |
31 | 31 | <?php |
32 | - // Output any notices now |
|
33 | - /** |
|
34 | - * Developer Alert: |
|
35 | - * |
|
36 | - * Per the README, this is considered an internal hook and should |
|
37 | - * not be used by other developers. This hook's behavior may be modified |
|
38 | - * or the hook may be removed at any time, without warning. |
|
39 | - */ |
|
40 | - do_action( 'monsterinsights_settings_general_tab_notice' ); |
|
41 | - ?> |
|
32 | + // Output any notices now |
|
33 | + /** |
|
34 | + * Developer Alert: |
|
35 | + * |
|
36 | + * Per the README, this is considered an internal hook and should |
|
37 | + * not be used by other developers. This hook's behavior may be modified |
|
38 | + * or the hook may be removed at any time, without warning. |
|
39 | + */ |
|
40 | + do_action( 'monsterinsights_settings_general_tab_notice' ); |
|
41 | + ?> |
|
42 | 42 | </div> |
43 | 43 | <table class="form-table"> |
44 | 44 | <tbody> |
45 | 45 | <?php if ( monsterinsights_is_pro_version() ) { |
46 | - $license_key = MonsterInsights()->license->get_site_license_key(); |
|
47 | - $license_key = $license_key ? $license_key : MonsterInsights()->license->get_network_license_key(); |
|
48 | - $license_key = $license_key ? $license_key : MonsterInsights()->license->get_default_license_key(); |
|
46 | + $license_key = MonsterInsights()->license->get_site_license_key(); |
|
47 | + $license_key = $license_key ? $license_key : MonsterInsights()->license->get_network_license_key(); |
|
48 | + $license_key = $license_key ? $license_key : MonsterInsights()->license->get_default_license_key(); |
|
49 | 49 | |
50 | - $license_type = MonsterInsights()->license->get_site_license_type(); |
|
51 | - ?> |
|
50 | + $license_type = MonsterInsights()->license->get_site_license_type(); |
|
51 | + ?> |
|
52 | 52 | <tr id="monsterinsights-settings-key-box"> |
53 | 53 | <th scope="row"> |
54 | 54 | <label for="monsterinsights-settings-key"><?php esc_html_e( 'License Key', 'google-analytics-for-wordpress' ); ?></label> |
@@ -154,10 +154,10 @@ discard block |
||
154 | 154 | <?php } ?> |
155 | 155 | |
156 | 156 | <?php |
157 | - $manual_ua = MonsterInsights()->auth->get_manual_ua(); |
|
158 | - $auth_ua = MonsterInsights()->auth->get_ua(); |
|
157 | + $manual_ua = MonsterInsights()->auth->get_manual_ua(); |
|
158 | + $auth_ua = MonsterInsights()->auth->get_ua(); |
|
159 | 159 | |
160 | - if ( empty( $manual_ua ) && empty( $auth_ua ) && monsterinsights_get_network_ua() ) { ?> |
|
160 | + if ( empty( $manual_ua ) && empty( $auth_ua ) && monsterinsights_get_network_ua() ) { ?> |
|
161 | 161 | <!-- If we don't have a manual or auth UA but we have a valid default set (from network), explain that --> |
162 | 162 | <tr id="monsterinsights-default-google-authenticate-box"> |
163 | 163 | <th scope="row"> |
@@ -171,10 +171,10 @@ discard block |
||
171 | 171 | |
172 | 172 | <!-- Disable Dashboard --> |
173 | 173 | <?php |
174 | - $title = esc_html__( 'Disable Reports', 'google-analytics-for-wordpress' ); |
|
175 | - $description = esc_html__( 'Hide the reports page.', 'google-analytics-for-wordpress' ); |
|
176 | - echo monsterinsights_make_checkbox( 'dashboards_disabled', $title, $description ); |
|
177 | - ?> |
|
174 | + $title = esc_html__( 'Disable Reports', 'google-analytics-for-wordpress' ); |
|
175 | + $description = esc_html__( 'Hide the reports page.', 'google-analytics-for-wordpress' ); |
|
176 | + echo monsterinsights_make_checkbox( 'dashboards_disabled', $title, $description ); |
|
177 | + ?> |
|
178 | 178 | |
179 | 179 | <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ){ ?> |
180 | 180 | <?php $automatic_updates = $automatic_updates ? $automatic_updates : 'none'; ?> |
@@ -192,23 +192,23 @@ discard block |
||
192 | 192 | |
193 | 193 | <!-- Tracking --> |
194 | 194 | <?php |
195 | - $title = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' ); |
|
196 | - $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' ); |
|
197 | - if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ){ |
|
198 | - echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description ); |
|
199 | - } |
|
200 | - ?> |
|
195 | + $title = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' ); |
|
196 | + $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' ); |
|
197 | + if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ){ |
|
198 | + echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description ); |
|
199 | + } |
|
200 | + ?> |
|
201 | 201 | |
202 | 202 | <?php |
203 | - /** |
|
204 | - * Developer Alert: |
|
205 | - * |
|
206 | - * Per the README, this is considered an internal hook and should |
|
207 | - * not be used by other developers. This hook's behavior may be modified |
|
208 | - * or the hook may be removed at any time, without warning. |
|
209 | - */ |
|
210 | - do_action( 'monsterinsights_settings_general_box' ); |
|
211 | - ?> |
|
203 | + /** |
|
204 | + * Developer Alert: |
|
205 | + * |
|
206 | + * Per the README, this is considered an internal hook and should |
|
207 | + * not be used by other developers. This hook's behavior may be modified |
|
208 | + * or the hook may be removed at any time, without warning. |
|
209 | + */ |
|
210 | + do_action( 'monsterinsights_settings_general_box' ); |
|
211 | + ?> |
|
212 | 212 | </tbody> |
213 | 213 | </table> |
214 | 214 | <input type="hidden" name="monsterinsights_settings_tab" value="general"/> |
@@ -235,28 +235,28 @@ discard block |
||
235 | 235 | $manual_ua_code_old = MonsterInsights()->auth->get_manual_ua(); |
236 | 236 | |
237 | 237 | if ( $manual_ua_code && $manual_ua_code_old && $manual_ua_code_old === $manual_ua_code ) { |
238 | - // Same code we had before |
|
239 | - // Do nothing |
|
238 | + // Same code we had before |
|
239 | + // Do nothing |
|
240 | 240 | } else if ( $manual_ua_code && $manual_ua_code_old && $manual_ua_code_old !== $manual_ua_code ) { |
241 | - // Different UA code |
|
242 | - MonsterInsights()->auth->set_manual_ua( $manual_ua_code ); |
|
241 | + // Different UA code |
|
242 | + MonsterInsights()->auth->set_manual_ua( $manual_ua_code ); |
|
243 | 243 | } else if ( $manual_ua_code && empty( $manual_ua_code_old ) ) { |
244 | - // Move to manual |
|
245 | - MonsterInsights()->auth->set_manual_ua( $manual_ua_code ); |
|
244 | + // Move to manual |
|
245 | + MonsterInsights()->auth->set_manual_ua( $manual_ua_code ); |
|
246 | 246 | } else if ( empty( $manual_ua_code ) && $manual_ua_code_old ) { |
247 | - // Deleted manual |
|
248 | - MonsterInsights()->auth->delete_manual_ua(); |
|
247 | + // Deleted manual |
|
248 | + MonsterInsights()->auth->delete_manual_ua(); |
|
249 | 249 | } else if ( isset( $_POST['manual_ua_code'] ) && empty( $manual_ua_code ) ) { |
250 | - $throw_notice = true; |
|
250 | + $throw_notice = true; |
|
251 | 251 | } else { |
252 | - // Not UA before or after |
|
253 | - // Do nothing |
|
252 | + // Not UA before or after |
|
253 | + // Do nothing |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | $dashboards_disabled = isset( $_POST['dashboards_disabled'] ) ? 1 : 0; |
257 | 257 | $dashboards_disabled_old = monsterinsights_get_option( 'dashboards_disabled', false ); |
258 | 258 | if ( $dashboards_disabled && ! $dashboards_disabled_old ) { |
259 | - do_action( 'monsterinsights_reports_delete_aggregate_data' ); |
|
259 | + do_action( 'monsterinsights_reports_delete_aggregate_data' ); |
|
260 | 260 | } |
261 | 261 | monsterinsights_update_option( 'dashboards_disabled', $dashboards_disabled ); |
262 | 262 | |
@@ -264,16 +264,16 @@ discard block |
||
264 | 264 | |
265 | 265 | $automatic_updates = isset( $_POST['automatic_updates'] ) && in_array( $_POST['automatic_updates'], array( 'all', 'minor', 'none' ) ) ? $_POST['automatic_updates'] : false; |
266 | 266 | if ( $automatic_updates ) { |
267 | - monsterinsights_update_option( 'automatic_updates', $automatic_updates ); |
|
267 | + monsterinsights_update_option( 'automatic_updates', $automatic_updates ); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | $anonymous_data = isset( $_POST['anonymous_data'] ) ? 1 : 0; |
271 | 271 | if ( $anonymous_data ) { |
272 | - if ( monsterinsights_is_pro_version() ) { |
|
273 | - monsterinsights_update_option( 'anonymous_data', 1 ); |
|
274 | - } else { |
|
275 | - monsterinsights_update_option( 'anonymous_data', $anonymous_data ); |
|
276 | - } |
|
272 | + if ( monsterinsights_is_pro_version() ) { |
|
273 | + monsterinsights_update_option( 'anonymous_data', 1 ); |
|
274 | + } else { |
|
275 | + monsterinsights_update_option( 'anonymous_data', $anonymous_data ); |
|
276 | + } |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
@@ -287,9 +287,9 @@ discard block |
||
287 | 287 | |
288 | 288 | // Output an admin notice so the user knows what happened |
289 | 289 | if ( $throw_notice ) { |
290 | - add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_invalid_ua_code' ); |
|
290 | + add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_invalid_ua_code' ); |
|
291 | 291 | } else { |
292 | - add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_updated_settings' ); |
|
292 | + add_action( 'monsterinsights_settings_general_tab_notice', 'monsterinsights_updated_settings' ); |
|
293 | 293 | } |
294 | 294 | } |
295 | 295 | add_action( 'monsterinsights_settings_save_general', 'monsterinsights_settings_save_general', 11 ); |
296 | 296 | \ No newline at end of file |
@@ -194,7 +194,7 @@ |
||
194 | 194 | <?php |
195 | 195 | $title = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' ); |
196 | 196 | $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' ); |
197 | - if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ){ |
|
197 | + if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ) { |
|
198 | 198 | echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description ); |
199 | 199 | } |
200 | 200 | ?> |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | <form id="monsterinsights-google-authenticate" method="post"> |
110 | 110 | <?php if ( MonsterInsights()->auth->get_viewname() && MonsterInsights()->auth->get_ua() ) { ?> |
111 | 111 | <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_site_licensed() ) { ?> |
112 | - <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p> |
|
112 | + <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p> |
|
113 | 113 | <?php } else { ?> |
114 | 114 | <p><?php echo esc_html__( 'Profile Active: ', 'google-analytics-for-wordpress' ) . MonsterInsights()->auth->get_viewname(); ?></p> |
115 | 115 | <p><?php wp_nonce_field( 'monsterinsights-google-authenticated-nonce', 'monsterinsights-google-authenticated-nonce' ); ?> |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | <?php } ?> |
120 | 120 | <?php } else { ?> |
121 | 121 | <?php if ( monsterinsights_is_pro_version() && ! MonsterInsights()->license->is_site_licensed() ) { ?> |
122 | - <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.' , 'google-analytics-for-wordpress' ); ?></p> |
|
122 | + <p><?php echo esc_html__( 'Please activate MonsterInsights Pro with an active, valid license key in order to use MonsterInsights Pro.', 'google-analytics-for-wordpress' ); ?></p> |
|
123 | 123 | <?php } else { ?> |
124 | 124 | <?php wp_nonce_field( 'monsterinsights-google-authenticate-nonce', 'monsterinsights-google-authenticate-nonce' ); ?> |
125 | 125 | <?php submit_button( esc_html__( 'Authenticate with your Google account', 'google-analytics-for-wordpress' ), 'button-action', 'monsterinsights-google-authenticate-submit', false ); ?> |
126 | - <p class="description"><?php printf( esc_html__( 'Already have a Google Account, but don’t know if you’ve setup Google Analytics? %s Click here to login and find out%s.', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'settings-page', 'already-have-ga-account-doc-link', 'https://www.monsterinsights.com/docs/find-out-if-you-already-have-a-google-analytics-account/?utm_source=monsterinsights-settings' ) .'">', '</a>' ); ?> |
|
126 | + <p class="description"><?php printf( esc_html__( 'Already have a Google Account, but don’t know if you’ve setup Google Analytics? %s Click here to login and find out%s.', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'settings-page', 'already-have-ga-account-doc-link', 'https://www.monsterinsights.com/docs/find-out-if-you-already-have-a-google-analytics-account/?utm_source=monsterinsights-settings' ) . '">', '</a>' ); ?> |
|
127 | 127 | <br /> |
128 | 128 | <?php printf( esc_html__( 'Having issues automatically authenticating? %s Click here to authenticate manually%s.', 'google-analytics-for-wordpress' ), '<a href="javascript:monsterinsights_show_manual()" data-action="show-manual-ua-box">', '</a>' ); ?></p> |
129 | 129 | <?php } ?> |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | <tbody> |
143 | 143 | <?php if ( ! MonsterInsights()->auth->get_viewname() ) { ?> |
144 | 144 | <!-- Manual UA --> |
145 | - <tr id="monsterinsights-google-ua-box" <?php echo ( ! MonsterInsights()->auth->get_manual_ua() ? 'class="monsterinsights-hideme"' : ''); ?> > |
|
145 | + <tr id="monsterinsights-google-ua-box" <?php echo ( ! MonsterInsights()->auth->get_manual_ua() ? 'class="monsterinsights-hideme"' : '' ); ?> > |
|
146 | 146 | <th scope="row"> |
147 | 147 | <label for="monsterinsights-google-ua"><?php esc_html_e( 'Manually enter your UA code', 'google-analytics-for-wordpress' ); ?></label> |
148 | 148 | </th> |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | </th> |
178 | 178 | <td> |
179 | 179 | <p> |
180 | - <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="'. monsterinsights_get_url( 'settings-page', 'general-tab-upgrade-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) .'">', '</a>' ); ?> |
|
180 | + <?php echo sprintf( esc_html__( 'Already purchased an upgrade to MonsterInsights Pro? To unlock your Pro features and addons, %sfollow our upgrade guide%s to install MonsterInsights Pro.' ), '<a href="' . monsterinsights_get_url( 'settings-page', 'general-tab-upgrade-link', 'https://www.monsterinsights.com/docs/go-lite-pro/' ) . '">', '</a>' ); ?> |
|
181 | 181 | </p> |
182 | 182 | <p> |
183 | - <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="'. monsterinsights_get_upgrade_link( 'settings-page', 'general-tab-upgrade-link' ) .'">', '</a>' ); ?> |
|
183 | + <?php echo sprintf( esc_html__( "Don't yet have a Pro license? %sVisit our website%s to upgrade and learn more about all the amazing features, expanded report and powerful addons you unlock when you go Pro." ), '<a href="' . monsterinsights_get_upgrade_link( 'settings-page', 'general-tab-upgrade-link' ) . '">', '</a>' ); ?> |
|
184 | 184 | </p> |
185 | 185 | </td> |
186 | 186 | </tr> |
@@ -193,16 +193,16 @@ discard block |
||
193 | 193 | echo monsterinsights_make_checkbox( 'dashboards_disabled', $title, $description ); |
194 | 194 | ?> |
195 | 195 | |
196 | - <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ){ ?> |
|
196 | + <?php if ( $automatic_updates !== 'all' && $automatic_updates !== 'minor' ) { ?> |
|
197 | 197 | <?php $automatic_updates = $automatic_updates ? $automatic_updates : 'none'; ?> |
198 | 198 | <tr id="monsterinsights-automatic-updates-mode"> |
199 | 199 | <th scope="row"> |
200 | 200 | <label for="monsterinsights-automatic-updates-mode"><?php esc_html_e( 'Automatic Updates', 'google-analytics-for-wordpress' ); ?></label> |
201 | 201 | </th> |
202 | 202 | <td> |
203 | - <label><input type="radio" name="automatic_updates" value="all" <?php checked( $automatic_updates, 'all' ); ?> ><?php esc_html_e('Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress'); ?> </label> |
|
204 | - <label><input type="radio" name="automatic_updates" value="minor" <?php checked( $automatic_updates, 'minor' ); ?> ><?php esc_html_e( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress'); ?> </label> |
|
205 | - <label><input type="radio" name="automatic_updates" value="none" <?php checked( $automatic_updates, 'none' ); ?> ><?php esc_html_e( 'None - Manually update everything.', 'google-analytics-for-wordpress'); ?> </label> |
|
203 | + <label><input type="radio" name="automatic_updates" value="all" <?php checked( $automatic_updates, 'all' ); ?> ><?php esc_html_e( 'Yes (Recommended) - Get the latest features, bugfixes, and security updates as they are released.', 'google-analytics-for-wordpress' ); ?> </label> |
|
204 | + <label><input type="radio" name="automatic_updates" value="minor" <?php checked( $automatic_updates, 'minor' ); ?> ><?php esc_html_e( 'Minor Only - Only get bugfixes and security updates, but not major features.', 'google-analytics-for-wordpress' ); ?> </label> |
|
205 | + <label><input type="radio" name="automatic_updates" value="none" <?php checked( $automatic_updates, 'none' ); ?> ><?php esc_html_e( 'None - Manually update everything.', 'google-analytics-for-wordpress' ); ?> </label> |
|
206 | 206 | </td> |
207 | 207 | </tr> |
208 | 208 | <?php } ?> |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | <?php |
212 | 212 | $title = esc_html__( 'Allow Usage Tracking', 'google-analytics-for-wordpress' ); |
213 | 213 | $description = esc_html__( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' ); |
214 | - if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ){ |
|
214 | + if ( ( ! $anon_tracking || monsterinsights_is_debug_mode() ) && ! monsterinsights_is_pro_version() ) { |
|
215 | 215 | echo monsterinsights_make_checkbox( 'anonymous_data', $title, $description ); |
216 | 216 | } |
217 | 217 | ?> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | final class MonsterInsights_Auth { |
20 | 20 | |
21 | - private $profile = array(); |
|
21 | + private $profile = array(); |
|
22 | 22 | private $network = array(); |
23 | 23 | |
24 | 24 | /** |
@@ -67,17 +67,17 @@ discard block |
||
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - public function set_analytics_profile( $data = array() ){ |
|
70 | + public function set_analytics_profile( $data = array() ) { |
|
71 | 71 | update_option( 'monsterinsights_site_profile', $data ); |
72 | - $this->profile = $data; |
|
72 | + $this->profile = $data; |
|
73 | 73 | } |
74 | 74 | |
75 | - public function set_network_analytics_profile( $data = array() ){ |
|
75 | + public function set_network_analytics_profile( $data = array() ) { |
|
76 | 76 | update_site_option( 'monsterinsights_network_profile', $data ); |
77 | - $this->network = $data; |
|
77 | + $this->network = $data; |
|
78 | 78 | } |
79 | 79 | |
80 | - public function delete_analytics_profile( $migrate = true ){ |
|
80 | + public function delete_analytics_profile( $migrate = true ) { |
|
81 | 81 | if ( $migrate ) { |
82 | 82 | $newdata = array(); |
83 | 83 | if ( isset( $this->profile['ua'] ) ) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - public function delete_network_analytics_profile( $migrate = true ){ |
|
94 | + public function delete_network_analytics_profile( $migrate = true ) { |
|
95 | 95 | if ( $migrate ) { |
96 | 96 | $newdata = array(); |
97 | 97 | if ( isset( $this->network['ua'] ) ) { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | do_action( 'monsterinsights_reports_delete_aggregate_data' ); |
126 | 126 | |
127 | - $this->profile = $data; |
|
127 | + $this->profile = $data; |
|
128 | 128 | $this->set_analytics_profile( $data ); |
129 | 129 | } |
130 | 130 | |
@@ -181,55 +181,55 @@ discard block |
||
181 | 181 | return ! empty( $this->network['ua'] ) ? monsterinsights_is_valid_ua( $this->network['ua'] ) : ''; |
182 | 182 | } |
183 | 183 | |
184 | - public function get_viewname(){ |
|
184 | + public function get_viewname() { |
|
185 | 185 | return ! empty( $this->profile['viewname'] ) ? $this->profile['viewname'] : ''; |
186 | 186 | } |
187 | 187 | |
188 | - public function get_network_viewname(){ |
|
188 | + public function get_network_viewname() { |
|
189 | 189 | return ! empty( $this->network['viewname'] ) ? $this->network['viewname'] : ''; |
190 | 190 | } |
191 | 191 | |
192 | - public function get_accountid(){ |
|
192 | + public function get_accountid() { |
|
193 | 193 | return ! empty( $this->profile['a'] ) ? $this->profile['a'] : ''; |
194 | 194 | } |
195 | 195 | |
196 | - public function get_network_accountid(){ |
|
196 | + public function get_network_accountid() { |
|
197 | 197 | return ! empty( $this->network['a'] ) ? $this->network['a'] : ''; |
198 | 198 | } |
199 | 199 | |
200 | - public function get_propertyid(){ |
|
200 | + public function get_propertyid() { |
|
201 | 201 | return ! empty( $this->profile['w'] ) ? $this->profile['w'] : ''; |
202 | 202 | } |
203 | 203 | |
204 | - public function get_network_propertyid(){ |
|
204 | + public function get_network_propertyid() { |
|
205 | 205 | return ! empty( $this->network['w'] ) ? $this->network['w'] : ''; |
206 | 206 | } |
207 | 207 | |
208 | - public function get_viewid(){ // also known as profileID |
|
208 | + public function get_viewid() { // also known as profileID |
|
209 | 209 | return ! empty( $this->profile['p'] ) ? $this->profile['p'] : ''; |
210 | 210 | } |
211 | 211 | |
212 | - public function get_network_viewid(){ // also known as profileID |
|
212 | + public function get_network_viewid() { // also known as profileID |
|
213 | 213 | return ! empty( $this->network['p'] ) ? $this->network['p'] : ''; |
214 | 214 | } |
215 | 215 | |
216 | - public function get_key(){ |
|
216 | + public function get_key() { |
|
217 | 217 | return ! empty( $this->profile['key'] ) ? $this->profile['key'] : ''; |
218 | 218 | } |
219 | 219 | |
220 | - public function get_network_key(){ |
|
220 | + public function get_network_key() { |
|
221 | 221 | return ! empty( $this->network['key'] ) ? $this->network['key'] : ''; |
222 | 222 | } |
223 | 223 | |
224 | - public function get_token(){ |
|
224 | + public function get_token() { |
|
225 | 225 | return ! empty( $this->profile['token'] ) ? $this->profile['token'] : ''; |
226 | 226 | } |
227 | 227 | |
228 | - public function get_network_token(){ |
|
228 | + public function get_network_token() { |
|
229 | 229 | return ! empty( $this->network['token'] ) ? $this->network['token'] : ''; |
230 | 230 | } |
231 | 231 | |
232 | - public function get_referral_url(){ |
|
232 | + public function get_referral_url() { |
|
233 | 233 | $url = ''; |
234 | 234 | |
235 | 235 | if ( $this->is_authed() ) { |
@@ -67,17 +67,17 @@ discard block |
||
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - public function set_analytics_profile( $data = array() ){ |
|
70 | + public function set_analytics_profile( $data = array() ) { |
|
71 | 71 | update_option( 'monsterinsights_site_profile', $data ); |
72 | 72 | $this->profile = $data; |
73 | 73 | } |
74 | 74 | |
75 | - public function set_network_analytics_profile( $data = array() ){ |
|
75 | + public function set_network_analytics_profile( $data = array() ) { |
|
76 | 76 | update_site_option( 'monsterinsights_network_profile', $data ); |
77 | 77 | $this->network = $data; |
78 | 78 | } |
79 | 79 | |
80 | - public function delete_analytics_profile( $migrate = true ){ |
|
80 | + public function delete_analytics_profile( $migrate = true ) { |
|
81 | 81 | if ( $migrate ) { |
82 | 82 | $newdata = array(); |
83 | 83 | if ( isset( $this->profile['ua'] ) ) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - public function delete_network_analytics_profile( $migrate = true ){ |
|
94 | + public function delete_network_analytics_profile( $migrate = true ) { |
|
95 | 95 | if ( $migrate ) { |
96 | 96 | $newdata = array(); |
97 | 97 | if ( isset( $this->network['ua'] ) ) { |
@@ -181,55 +181,57 @@ discard block |
||
181 | 181 | return ! empty( $this->network['ua'] ) ? monsterinsights_is_valid_ua( $this->network['ua'] ) : ''; |
182 | 182 | } |
183 | 183 | |
184 | - public function get_viewname(){ |
|
184 | + public function get_viewname() { |
|
185 | 185 | return ! empty( $this->profile['viewname'] ) ? $this->profile['viewname'] : ''; |
186 | 186 | } |
187 | 187 | |
188 | - public function get_network_viewname(){ |
|
188 | + public function get_network_viewname() { |
|
189 | 189 | return ! empty( $this->network['viewname'] ) ? $this->network['viewname'] : ''; |
190 | 190 | } |
191 | 191 | |
192 | - public function get_accountid(){ |
|
192 | + public function get_accountid() { |
|
193 | 193 | return ! empty( $this->profile['a'] ) ? $this->profile['a'] : ''; |
194 | 194 | } |
195 | 195 | |
196 | - public function get_network_accountid(){ |
|
196 | + public function get_network_accountid() { |
|
197 | 197 | return ! empty( $this->network['a'] ) ? $this->network['a'] : ''; |
198 | 198 | } |
199 | 199 | |
200 | - public function get_propertyid(){ |
|
200 | + public function get_propertyid() { |
|
201 | 201 | return ! empty( $this->profile['w'] ) ? $this->profile['w'] : ''; |
202 | 202 | } |
203 | 203 | |
204 | - public function get_network_propertyid(){ |
|
204 | + public function get_network_propertyid() { |
|
205 | 205 | return ! empty( $this->network['w'] ) ? $this->network['w'] : ''; |
206 | 206 | } |
207 | 207 | |
208 | - public function get_viewid(){ // also known as profileID |
|
208 | + public function get_viewid() { |
|
209 | +// also known as profileID |
|
209 | 210 | return ! empty( $this->profile['p'] ) ? $this->profile['p'] : ''; |
210 | 211 | } |
211 | 212 | |
212 | - public function get_network_viewid(){ // also known as profileID |
|
213 | + public function get_network_viewid() { |
|
214 | +// also known as profileID |
|
213 | 215 | return ! empty( $this->network['p'] ) ? $this->network['p'] : ''; |
214 | 216 | } |
215 | 217 | |
216 | - public function get_key(){ |
|
218 | + public function get_key() { |
|
217 | 219 | return ! empty( $this->profile['key'] ) ? $this->profile['key'] : ''; |
218 | 220 | } |
219 | 221 | |
220 | - public function get_network_key(){ |
|
222 | + public function get_network_key() { |
|
221 | 223 | return ! empty( $this->network['key'] ) ? $this->network['key'] : ''; |
222 | 224 | } |
223 | 225 | |
224 | - public function get_token(){ |
|
226 | + public function get_token() { |
|
225 | 227 | return ! empty( $this->profile['token'] ) ? $this->profile['token'] : ''; |
226 | 228 | } |
227 | 229 | |
228 | - public function get_network_token(){ |
|
230 | + public function get_network_token() { |
|
229 | 231 | return ! empty( $this->network['token'] ) ? $this->network['token'] : ''; |
230 | 232 | } |
231 | 233 | |
232 | - public function get_referral_url(){ |
|
234 | + public function get_referral_url() { |
|
233 | 235 | $url = ''; |
234 | 236 | |
235 | 237 | if ( $this->is_authed() ) { |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Exit if accessed directly |
4 | -if ( ! defined( 'ABSPATH' ) ) { |
|
4 | +if ( ! defined( 'ABSPATH' ) ) { |
|
5 | 5 | exit; |
6 | 6 | } |
7 | 7 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $settings['social']['social_notice'] = array( |
12 | 12 | 'id' => 'social_notice', |
13 | 13 | 'no_label' => true, |
14 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
14 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
15 | 15 | 'type' => 'upgrade_notice', |
16 | 16 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Social tracking to see who's clicking on your social share links, so you can track and maximize your social sharing exposure.", 'google-analytics-for-wordpress' ) |
17 | 17 | ); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $settings['eucompliance']['eucompliance_notice'] = array( |
21 | 21 | 'id' => 'eucompliance_notice', |
22 | 22 | 'no_label' => true, |
23 | - 'name' => __( 'Google Analytics EU Compliance', 'google-analytics-for-wordpress'), |
|
23 | + 'name' => __( 'Google Analytics EU Compliance', 'google-analytics-for-wordpress' ), |
|
24 | 24 | 'type' => 'upgrade_notice', |
25 | 25 | 'desc' => esc_html__( "The MonsterInsights EU Compliance addon allows you to improve compliance with GDPR and other privacy regulations.", 'google-analytics-for-wordpress' ) |
26 | 26 | ); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $settings['ads']['ads_notice'] = array( |
30 | 30 | 'id' => 'ads_notice', |
31 | 31 | 'no_label' => true, |
32 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
32 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
33 | 33 | 'type' => 'upgrade_notice', |
34 | 34 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ads tracking to see who's clicking on your Google Ads, so you can increase your revenue.", 'google-analytics-for-wordpress' ) |
35 | 35 | ); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $settings['forms']['forms_notice'] = array( |
39 | 39 | 'id' => 'forms_notice', |
40 | 40 | 'no_label' => true, |
41 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
41 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
42 | 42 | 'type' => 'upgrade_notice', |
43 | 43 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Forms tracking to see who's seeing and submitting your forms, so you can increase your conversion rate.", 'google-analytics-for-wordpress' ) |
44 | 44 | ); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $settings['media']['media_notice'] = array( |
48 | 48 | 'id' => 'media_notice', |
49 | 49 | 'no_label' => true, |
50 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
50 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
51 | 51 | 'type' => 'upgrade_notice', |
52 | 52 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Media tracking to see who's interacting with the media on your site, so you know what your users are most interested in on your site. You can use this to tailor future content to meet your audience's interest to promote repeat visitors and expand your average user's time spent visiting your website on each visit.", 'google-analytics-for-wordpress' ) |
53 | 53 | ); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $settings['membership']['membership_notice'] = array( |
57 | 57 | 'id' => 'membership_notice', |
58 | 58 | 'no_label' => true, |
59 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
59 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
60 | 60 | 'type' => 'upgrade_notice', |
61 | 61 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Membership tracking.", 'google-analytics-for-wordpress' ) |
62 | 62 | ); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $settings['dimensions']['dimensions_notice'] = array( |
66 | 66 | 'id' => 'dimensions_notice', |
67 | 67 | 'no_label' => true, |
68 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
68 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
69 | 69 | 'type' => 'upgrade_notice', |
70 | 70 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Custom Dimensions and track who's the most popular author on your site, which post types get the most traffic, and more. Why not check it out?", 'google-analytics-for-wordpress' ) |
71 | 71 | ); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $settings['performance']['performance_notice'] = array( |
75 | 75 | 'id' => 'performance_notice', |
76 | 76 | 'no_label' => true, |
77 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
77 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
78 | 78 | 'type' => 'upgrade_notice', |
79 | 79 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust the sample rate so you don't exceed Google Analytics' processing limit. You can also use it to enable Google Optimize for A/B testing and personalization.", 'google-analytics-for-wordpress' ) |
80 | 80 | ); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $settings['reporting']['reporting_notice'] = array( |
84 | 84 | 'id' => 'reporting_notice', |
85 | 85 | 'no_label' => true, |
86 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
86 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
87 | 87 | 'type' => 'upgrade_notice', |
88 | 88 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable enhanced reporting.", 'google-analytics-for-wordpress' ) |
89 | 89 | ); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $settings['amp']['amp_notice'] = array( |
93 | 93 | 'id' => 'amp_notice', |
94 | 94 | 'no_label' => true, |
95 | - 'name' => __( 'Want to use track users visiting your AMP pages?', 'google-analytics-for-wordpress'), |
|
95 | + 'name' => __( 'Want to use track users visiting your AMP pages?', 'google-analytics-for-wordpress' ), |
|
96 | 96 | 'type' => 'upgrade_notice', |
97 | 97 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable AMP page tracking.", 'google-analytics-for-wordpress' ) |
98 | 98 | ); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $settings['goptimize']['goptimize_notice'] = array( |
102 | 102 | 'id' => 'goptimize_notice', |
103 | 103 | 'no_label' => true, |
104 | - 'name' => __( 'Want to use Google Optimize to retarget your website visitors and perform A/B split tests with ease?', 'google-analytics-for-wordpress'), |
|
104 | + 'name' => __( 'Want to use Google Optimize to retarget your website visitors and perform A/B split tests with ease?', 'google-analytics-for-wordpress' ), |
|
105 | 105 | 'type' => 'upgrade_notice', |
106 | 106 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable Google Optimize.", 'google-analytics-for-wordpress' ) |
107 | 107 | ); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $settings['fbia']['fbia_notice'] = array( |
111 | 111 | 'id' => 'fbia_notice', |
112 | 112 | 'no_label' => true, |
113 | - 'name' => __( 'Want to expand your website audience beyond your website with Facebook Instant Articles?', 'google-analytics-for-wordpress'), |
|
113 | + 'name' => __( 'Want to expand your website audience beyond your website with Facebook Instant Articles?', 'google-analytics-for-wordpress' ), |
|
114 | 114 | 'type' => 'upgrade_notice', |
115 | 115 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can track your Facebook Instant Article visitors with MonsterInsights.", 'google-analytics-for-wordpress' ) |
116 | 116 | ); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $settings['bounce']['bounce_notice'] = array( |
120 | 120 | 'id' => 'bounce_notice', |
121 | 121 | 'no_label' => true, |
122 | - 'name' => __( 'Want to adjust your website bounce rate?', 'google-analytics-for-wordpress'), |
|
122 | + 'name' => __( 'Want to adjust your website bounce rate?', 'google-analytics-for-wordpress' ), |
|
123 | 123 | 'type' => 'upgrade_notice', |
124 | 124 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can adjust your Google Analytics bounce rate with MonsterInsights.", 'google-analytics-for-wordpress' ) |
125 | 125 | ); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $settings['notifications']['notifications_notice'] = array( |
129 | 129 | 'id' => 'notifications_notice', |
130 | 130 | 'no_label' => true, |
131 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
131 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
132 | 132 | 'type' => 'upgrade_notice', |
133 | 133 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can enable notifications.", 'google-analytics-for-wordpress' ) |
134 | 134 | ); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $settings['ecommerce']['ecommerce_notice'] = array( |
138 | 138 | 'id' => 'ecommerce_notice', |
139 | 139 | 'no_label' => true, |
140 | - 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress'), |
|
140 | + 'name' => __( 'Want to increase your traffic, conversion, & engagement?', 'google-analytics-for-wordpress' ), |
|
141 | 141 | 'type' => 'upgrade_notice', |
142 | 142 | 'desc' => esc_html__( "By upgrading to MonsterInsights Pro, you can add Ecommerce tracking to see who's buying your product, what's the most popular item on your store, the average order value, and tons more.", 'google-analytics-for-wordpress' ) |
143 | 143 | ); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
23 | 23 | parent::__construct(); |
24 | 24 | } |
25 | 25 | |
26 | - protected function get_report_html( $data = array() ){ |
|
26 | + protected function get_report_html( $data = array() ) { |
|
27 | 27 | return $this->get_upsell_notice(); |
28 | 28 | } |
29 | 29 | } |
30 | 30 | \ No newline at end of file |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | $license_key = ! empty( $license_key ) ? $license_key : MonsterInsights()->license->get_default_license_key(); |
88 | 88 | return $license_key; |
89 | 89 | } |
90 | - public function get_site_license_key(){ |
|
90 | + public function get_site_license_key() { |
|
91 | 91 | return ( ! empty( $this->site['key'] ) && is_string( $this->site['key'] ) && strlen( $this->site['key'] ) > 10 ) ? $this->site['key'] : ''; |
92 | 92 | } |
93 | - public function get_network_license_key(){ |
|
93 | + public function get_network_license_key() { |
|
94 | 94 | return ( ! empty( $this->network['key'] ) && is_string( $this->network['key'] ) && strlen( $this->network['key'] ) > 10 ) ? $this->network['key'] : ''; |
95 | 95 | } |
96 | 96 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | return $this->licensed; |
99 | 99 | } |
100 | 100 | |
101 | - public function is_site_licensed(){ |
|
101 | + public function is_site_licensed() { |
|
102 | 102 | return ! empty( $this->site['key'] ) // has key |
103 | 103 | && $this->get_site_license_type() // has type |
104 | 104 | && ! $this->site_license_expired() // isn't expired |
@@ -117,28 +117,28 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | |
120 | - public function get_site_license_updates(){ |
|
120 | + public function get_site_license_updates() { |
|
121 | 121 | return get_option( 'monsterinsights_license_updates', '' ); |
122 | 122 | } |
123 | - public function get_network_license_updates(){ |
|
123 | + public function get_network_license_updates() { |
|
124 | 124 | return get_site_option( 'monsterinsights_network_license_updates', '' ); |
125 | 125 | } |
126 | 126 | |
127 | - public function set_site_license_updates(){ |
|
127 | + public function set_site_license_updates() { |
|
128 | 128 | update_option( 'monsterinsights_license_updates', strtotime( '+8 hours' ) ); |
129 | 129 | } |
130 | 130 | public function set_network_license_updates() { |
131 | 131 | update_site_option( 'monsterinsights_network_license_updates', strtotime( '+8 hours' ) ); |
132 | 132 | } |
133 | 133 | |
134 | - public function delete_site_license_updates(){ |
|
134 | + public function delete_site_license_updates() { |
|
135 | 135 | delete_option( 'monsterinsights_license_updates' ); |
136 | 136 | } |
137 | - public function delete_network_license_updates(){ |
|
137 | + public function delete_network_license_updates() { |
|
138 | 138 | delete_site_option( 'monsterinsights_license_updates' ); |
139 | 139 | } |
140 | 140 | |
141 | - public function time_to_check_site_license(){ |
|
141 | + public function time_to_check_site_license() { |
|
142 | 142 | $timestamp = get_option( 'monsterinsights_license_updates' ); |
143 | 143 | if ( ! $timestamp ) { |
144 | 144 | return true; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | } |
152 | 152 | } |
153 | 153 | } |
154 | - public function time_to_check_network_license(){ |
|
154 | + public function time_to_check_network_license() { |
|
155 | 155 | $timestamp = get_site_option( 'monsterinsights_network_license_updates' ); |
156 | 156 | if ( ! $timestamp ) { |
157 | 157 | return true; |
@@ -165,21 +165,21 @@ discard block |
||
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
168 | - public function set_site_license( $data = array() ){ |
|
168 | + public function set_site_license( $data = array() ) { |
|
169 | 169 | update_option( 'monsterinsights_license', $data ); |
170 | 170 | $this->set_site_license_updates(); |
171 | - $this->site = $data; |
|
171 | + $this->site = $data; |
|
172 | 172 | } |
173 | - public function set_network_license( $data = array() ){ |
|
173 | + public function set_network_license( $data = array() ) { |
|
174 | 174 | update_site_option( 'monsterinsights_network_license', $data ); |
175 | 175 | $this->set_network_license_updates(); |
176 | - $this->network = $data; |
|
176 | + $this->network = $data; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | public function delete_site_license() { |
180 | 180 | delete_option( 'monsterinsights_license' ); |
181 | 181 | $this->delete_site_license_updates(); |
182 | - $this->site = array(); |
|
182 | + $this->site = array(); |
|
183 | 183 | } |
184 | 184 | public function delete_network_license() { |
185 | 185 | delete_site_option( 'monsterinsights_network_license' ); |
@@ -187,21 +187,21 @@ discard block |
||
187 | 187 | $this->network = array(); |
188 | 188 | } |
189 | 189 | |
190 | - public function get_license_type(){ |
|
190 | + public function get_license_type() { |
|
191 | 191 | if ( ! $this->has_license() ) { |
192 | 192 | return false; |
193 | 193 | } |
194 | 194 | |
195 | 195 | return $this->using_network_license() ? $this->get_network_license_type() : $this->get_site_license_type(); |
196 | 196 | } |
197 | - public function get_site_license_type(){ |
|
197 | + public function get_site_license_type() { |
|
198 | 198 | return ( $this->get_site_license_key() && ! empty( $this->site['type'] ) && $this->is_valid_license_type( $this->site['type'] ) ) ? $this->site['type'] : ''; |
199 | 199 | } |
200 | - public function get_network_license_type(){ |
|
200 | + public function get_network_license_type() { |
|
201 | 201 | return ( $this->get_network_license_key() && ! empty( $this->network['type'] ) && $this->is_valid_license_type( $this->network['type'] ) ) ? $this->network['type'] : ''; |
202 | 202 | } |
203 | 203 | |
204 | - public function license_has_error(){ |
|
204 | + public function license_has_error() { |
|
205 | 205 | if ( ! $this->has_license() ) { |
206 | 206 | return false; |
207 | 207 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | || $this->site_license_invalid() // is invalid |
216 | 216 | ; |
217 | 217 | } |
218 | - public function network_license_has_error(){ |
|
218 | + public function network_license_has_error() { |
|
219 | 219 | return |
220 | 220 | $this->network_license_expired() // is expired |
221 | 221 | || $this->network_license_disabled() // is disabled |
@@ -223,21 +223,21 @@ discard block |
||
223 | 223 | ; |
224 | 224 | } |
225 | 225 | |
226 | - public function license_expired(){ |
|
226 | + public function license_expired() { |
|
227 | 227 | if ( ! $this->has_license() ) { |
228 | 228 | return false; |
229 | 229 | } |
230 | 230 | |
231 | 231 | return $this->using_network_license() ? $this->network_license_expired() : $this->site_license_expired(); |
232 | 232 | } |
233 | - public function site_license_expired(){ |
|
233 | + public function site_license_expired() { |
|
234 | 234 | return ! empty( $this->site['is_expired'] ); |
235 | 235 | } |
236 | - public function network_license_expired(){ |
|
236 | + public function network_license_expired() { |
|
237 | 237 | return ! empty( $this->network['is_expired'] ); |
238 | 238 | } |
239 | 239 | |
240 | - public function license_disabled(){ |
|
240 | + public function license_disabled() { |
|
241 | 241 | if ( ! $this->has_license() ) { |
242 | 242 | return false; |
243 | 243 | } |
@@ -247,11 +247,11 @@ discard block |
||
247 | 247 | public function site_license_disabled() { |
248 | 248 | return ! empty( $this->site['is_disabled'] ); |
249 | 249 | } |
250 | - public function network_license_disabled(){ |
|
250 | + public function network_license_disabled() { |
|
251 | 251 | return ! empty( $this->network['is_disabled'] ); |
252 | 252 | } |
253 | 253 | |
254 | - public function license_invalid(){ |
|
254 | + public function license_invalid() { |
|
255 | 255 | if ( ! $this->has_license() ) { |
256 | 256 | return false; |
257 | 257 | } |
@@ -261,21 +261,21 @@ discard block |
||
261 | 261 | public function site_license_invalid() { |
262 | 262 | return ! empty( $this->site['is_invalid'] ); |
263 | 263 | } |
264 | - public function network_license_invalid(){ |
|
264 | + public function network_license_invalid() { |
|
265 | 265 | return ! empty( $this->network['is_invalid'] ); |
266 | 266 | } |
267 | 267 | |
268 | 268 | |
269 | - public function get_license_error(){ |
|
269 | + public function get_license_error() { |
|
270 | 270 | if ( ! $this->has_license() ) { |
271 | 271 | return false; |
272 | 272 | } |
273 | 273 | |
274 | 274 | return $this->using_network_license() ? $this->get_network_license_error() : $this->get_site_license_error(); |
275 | 275 | } |
276 | - public function get_site_license_error(){ |
|
276 | + public function get_site_license_error() { |
|
277 | 277 | if ( $this->site_license_expired() ) { |
278 | - return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
278 | + return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
279 | 279 | } else if ( $this->site_license_disabled() ) { |
280 | 280 | return esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
281 | 281 | } else if ( $this->site_license_invalid() ) { |
@@ -284,9 +284,9 @@ discard block |
||
284 | 284 | return ''; |
285 | 285 | } |
286 | 286 | |
287 | - public function get_network_license_error(){ |
|
287 | + public function get_network_license_error() { |
|
288 | 288 | if ( $this->site_license_expired() ) { |
289 | - return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
289 | + return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="' . monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) . '" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
|
290 | 290 | } else if ( $this->site_license_disabled() ) { |
291 | 291 | return esc_html__( 'Your license key for MonsterInsights has been disabled. Please use a different key.', 'google-analytics-for-wordpress' ); |
292 | 292 | } else if ( $this->site_license_invalid() ) { |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | return $can_access; |
363 | 363 | } |
364 | 364 | |
365 | - public function get_default_license_key(){ |
|
365 | + public function get_default_license_key() { |
|
366 | 366 | if ( defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) { |
367 | 367 | return MONSTERINSIGHTS_LICENSE_KEY; |
368 | 368 | } |
@@ -87,18 +87,18 @@ discard block |
||
87 | 87 | $license_key = ! empty( $license_key ) ? $license_key : MonsterInsights()->license->get_default_license_key(); |
88 | 88 | return $license_key; |
89 | 89 | } |
90 | - public function get_site_license_key(){ |
|
90 | + public function get_site_license_key() { |
|
91 | 91 | return ( ! empty( $this->site['key'] ) && is_string( $this->site['key'] ) && strlen( $this->site['key'] ) > 10 ) ? $this->site['key'] : ''; |
92 | 92 | } |
93 | - public function get_network_license_key(){ |
|
93 | + public function get_network_license_key() { |
|
94 | 94 | return ( ! empty( $this->network['key'] ) && is_string( $this->network['key'] ) && strlen( $this->network['key'] ) > 10 ) ? $this->network['key'] : ''; |
95 | 95 | } |
96 | 96 | |
97 | - public function has_license() { |
|
97 | + public function has_license() { |
|
98 | 98 | return $this->licensed; |
99 | 99 | } |
100 | 100 | |
101 | - public function is_site_licensed(){ |
|
101 | + public function is_site_licensed() { |
|
102 | 102 | return ! empty( $this->site['key'] ) // has key |
103 | 103 | && $this->get_site_license_type() // has type |
104 | 104 | && ! $this->site_license_expired() // isn't expired |
@@ -117,28 +117,28 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | |
120 | - public function get_site_license_updates(){ |
|
120 | + public function get_site_license_updates() { |
|
121 | 121 | return get_option( 'monsterinsights_license_updates', '' ); |
122 | 122 | } |
123 | - public function get_network_license_updates(){ |
|
123 | + public function get_network_license_updates() { |
|
124 | 124 | return get_site_option( 'monsterinsights_network_license_updates', '' ); |
125 | 125 | } |
126 | 126 | |
127 | - public function set_site_license_updates(){ |
|
127 | + public function set_site_license_updates() { |
|
128 | 128 | update_option( 'monsterinsights_license_updates', strtotime( '+8 hours' ) ); |
129 | 129 | } |
130 | 130 | public function set_network_license_updates() { |
131 | 131 | update_site_option( 'monsterinsights_network_license_updates', strtotime( '+8 hours' ) ); |
132 | 132 | } |
133 | 133 | |
134 | - public function delete_site_license_updates(){ |
|
134 | + public function delete_site_license_updates() { |
|
135 | 135 | delete_option( 'monsterinsights_license_updates' ); |
136 | 136 | } |
137 | - public function delete_network_license_updates(){ |
|
137 | + public function delete_network_license_updates() { |
|
138 | 138 | delete_site_option( 'monsterinsights_license_updates' ); |
139 | 139 | } |
140 | 140 | |
141 | - public function time_to_check_site_license(){ |
|
141 | + public function time_to_check_site_license() { |
|
142 | 142 | $timestamp = get_option( 'monsterinsights_license_updates' ); |
143 | 143 | if ( ! $timestamp ) { |
144 | 144 | return true; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | } |
152 | 152 | } |
153 | 153 | } |
154 | - public function time_to_check_network_license(){ |
|
154 | + public function time_to_check_network_license() { |
|
155 | 155 | $timestamp = get_site_option( 'monsterinsights_network_license_updates' ); |
156 | 156 | if ( ! $timestamp ) { |
157 | 157 | return true; |
@@ -165,12 +165,12 @@ discard block |
||
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
168 | - public function set_site_license( $data = array() ){ |
|
168 | + public function set_site_license( $data = array() ) { |
|
169 | 169 | update_option( 'monsterinsights_license', $data ); |
170 | 170 | $this->set_site_license_updates(); |
171 | 171 | $this->site = $data; |
172 | 172 | } |
173 | - public function set_network_license( $data = array() ){ |
|
173 | + public function set_network_license( $data = array() ) { |
|
174 | 174 | update_site_option( 'monsterinsights_network_license', $data ); |
175 | 175 | $this->set_network_license_updates(); |
176 | 176 | $this->network = $data; |
@@ -187,21 +187,21 @@ discard block |
||
187 | 187 | $this->network = array(); |
188 | 188 | } |
189 | 189 | |
190 | - public function get_license_type(){ |
|
190 | + public function get_license_type() { |
|
191 | 191 | if ( ! $this->has_license() ) { |
192 | 192 | return false; |
193 | 193 | } |
194 | 194 | |
195 | 195 | return $this->using_network_license() ? $this->get_network_license_type() : $this->get_site_license_type(); |
196 | 196 | } |
197 | - public function get_site_license_type(){ |
|
197 | + public function get_site_license_type() { |
|
198 | 198 | return ( $this->get_site_license_key() && ! empty( $this->site['type'] ) && $this->is_valid_license_type( $this->site['type'] ) ) ? $this->site['type'] : ''; |
199 | 199 | } |
200 | - public function get_network_license_type(){ |
|
200 | + public function get_network_license_type() { |
|
201 | 201 | return ( $this->get_network_license_key() && ! empty( $this->network['type'] ) && $this->is_valid_license_type( $this->network['type'] ) ) ? $this->network['type'] : ''; |
202 | 202 | } |
203 | 203 | |
204 | - public function license_has_error(){ |
|
204 | + public function license_has_error() { |
|
205 | 205 | if ( ! $this->has_license() ) { |
206 | 206 | return false; |
207 | 207 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | || $this->site_license_invalid() // is invalid |
216 | 216 | ; |
217 | 217 | } |
218 | - public function network_license_has_error(){ |
|
218 | + public function network_license_has_error() { |
|
219 | 219 | return |
220 | 220 | $this->network_license_expired() // is expired |
221 | 221 | || $this->network_license_disabled() // is disabled |
@@ -223,21 +223,21 @@ discard block |
||
223 | 223 | ; |
224 | 224 | } |
225 | 225 | |
226 | - public function license_expired(){ |
|
226 | + public function license_expired() { |
|
227 | 227 | if ( ! $this->has_license() ) { |
228 | 228 | return false; |
229 | 229 | } |
230 | 230 | |
231 | 231 | return $this->using_network_license() ? $this->network_license_expired() : $this->site_license_expired(); |
232 | 232 | } |
233 | - public function site_license_expired(){ |
|
233 | + public function site_license_expired() { |
|
234 | 234 | return ! empty( $this->site['is_expired'] ); |
235 | 235 | } |
236 | - public function network_license_expired(){ |
|
236 | + public function network_license_expired() { |
|
237 | 237 | return ! empty( $this->network['is_expired'] ); |
238 | 238 | } |
239 | 239 | |
240 | - public function license_disabled(){ |
|
240 | + public function license_disabled() { |
|
241 | 241 | if ( ! $this->has_license() ) { |
242 | 242 | return false; |
243 | 243 | } |
@@ -247,11 +247,11 @@ discard block |
||
247 | 247 | public function site_license_disabled() { |
248 | 248 | return ! empty( $this->site['is_disabled'] ); |
249 | 249 | } |
250 | - public function network_license_disabled(){ |
|
250 | + public function network_license_disabled() { |
|
251 | 251 | return ! empty( $this->network['is_disabled'] ); |
252 | 252 | } |
253 | 253 | |
254 | - public function license_invalid(){ |
|
254 | + public function license_invalid() { |
|
255 | 255 | if ( ! $this->has_license() ) { |
256 | 256 | return false; |
257 | 257 | } |
@@ -261,19 +261,19 @@ discard block |
||
261 | 261 | public function site_license_invalid() { |
262 | 262 | return ! empty( $this->site['is_invalid'] ); |
263 | 263 | } |
264 | - public function network_license_invalid(){ |
|
264 | + public function network_license_invalid() { |
|
265 | 265 | return ! empty( $this->network['is_invalid'] ); |
266 | 266 | } |
267 | 267 | |
268 | 268 | |
269 | - public function get_license_error(){ |
|
269 | + public function get_license_error() { |
|
270 | 270 | if ( ! $this->has_license() ) { |
271 | 271 | return false; |
272 | 272 | } |
273 | 273 | |
274 | 274 | return $this->using_network_license() ? $this->get_network_license_error() : $this->get_site_license_error(); |
275 | 275 | } |
276 | - public function get_site_license_error(){ |
|
276 | + public function get_site_license_error() { |
|
277 | 277 | if ( $this->site_license_expired() ) { |
278 | 278 | return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
279 | 279 | } else if ( $this->site_license_disabled() ) { |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | return ''; |
285 | 285 | } |
286 | 286 | |
287 | - public function get_network_license_error(){ |
|
287 | + public function get_network_license_error() { |
|
288 | 288 | if ( $this->site_license_expired() ) { |
289 | 289 | return sprintf( esc_html__( 'Your license key for MonsterInsights has expired. %1$sPlease click here to renew your license key.%2$s', 'google-analytics-for-wordpress' ), '<a href="'. monsterinsights_get_url( 'license-error', 'expired-license', 'https://www.monsterinsights.com/login/' ) .'" target="_blank" rel="noopener noreferrer" referrer="no-referrer">', '</a>' ); |
290 | 290 | } else if ( $this->site_license_disabled() ) { |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | return ''; |
296 | 296 | } |
297 | 297 | |
298 | - public function license_can( $requires = 'lite' ) { |
|
298 | + public function license_can( $requires = 'lite' ) { |
|
299 | 299 | if ( ! monsterinsights_is_pro_version() || ! $this->has_license() ) { |
300 | 300 | return $requires === 'lite'; |
301 | 301 | } |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | return $can_access; |
363 | 363 | } |
364 | 364 | |
365 | - public function get_default_license_key(){ |
|
365 | + public function get_default_license_key() { |
|
366 | 366 | if ( defined( 'MONSTERINSIGHTS_LICENSE_KEY' ) && is_string( MONSTERINSIGHTS_LICENSE_KEY ) && strlen( MONSTERINSIGHTS_LICENSE_KEY ) > 10 ) { |
367 | 367 | return MONSTERINSIGHTS_LICENSE_KEY; |
368 | 368 | } |