| @@ -46,30 +46,27 @@ | ||
| 46 | 46 | if ( false !== $protocol_pos ) { |
| 47 | 47 | $site_url = substr( $site_url, $protocol_pos + 3 ); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - $freemius_site_www = 'https://freemius.com'; | |
| 51 | - | |
| 52 | 50 | $freemius_usage_tracking_url = $fs->get_usage_tracking_terms_url(); |
| 53 | 51 | $freemius_plugin_terms_url = $fs->get_eula_url(); |
| 54 | 52 | |
| 55 | - $freemius_site_url = $fs->is_premium() ? | |
| 56 | - $freemius_site_www : | |
| 57 | - $freemius_usage_tracking_url; | |
| 53 | + $error = fs_request_get( 'error' ); | |
| 58 | 54 | |
| 59 | - if ( $fs->is_premium() ) { | |
| 60 | - $freemius_site_url .= '?' . http_build_query( array( | |
| 61 | - 'id' => $fs->get_id(), | |
| 62 | - 'slug' => $slug, | |
| 63 | - ) ); | |
| 64 | - } | |
| 55 | + $has_release_on_freemius = $fs->has_release_on_freemius(); | |
| 65 | 56 | |
| 66 | - $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank" rel="noopener" tabindex="1">freemius.com</a>'; | |
| 57 | + $require_license_key = $is_premium_only || | |
| 58 | + ( | |
| 59 | + $is_freemium && | |
| 60 | + ( $is_premium_code || ! $has_release_on_freemius ) && | |
| 61 | + fs_request_get_bool( 'require_license', ( $is_premium_code || $has_release_on_freemius ) ) | |
| 62 | + ); | |
| 67 | 63 | |
| 68 | - $error = fs_request_get( 'error' ); | |
| 64 | + $freemius_activation_terms_url = ($fs->is_premium() && $require_license_key) ? | |
| 65 | + $fs->get_license_activation_terms_url() : | |
| 66 | + $freemius_usage_tracking_url; | |
| 69 | 67 | |
| 70 | - $require_license_key = $is_premium_only || | |
| 71 | - ( $is_freemium && $is_premium_code && fs_request_get_bool( 'require_license', true ) ); | |
| 68 | + $freemius_activation_terms_html = '<a href="' . esc_url( $freemius_activation_terms_url ) . '" target="_blank" rel="noopener" tabindex="1">freemius.com</a>'; | |
| 72 | 69 | |
| 73 | 70 | if ( $is_pending_activation ) { |
| 74 | 71 | $require_license_key = false; |
| 75 | 72 | } |
| @@ -119,20 +116,12 @@ | ||
| 119 | 116 | |
| 120 | 117 | /* translators: %s: name (e.g. Hey John,) */ |
| 121 | 118 | $hey_x_text = esc_html( sprintf( fs_text_x_inline( 'Hey %s,', 'greeting', 'hey-x', $slug ), $first_name ) ); |
| 122 | 119 | |
| 123 | - $is_gdpr_required = ( ! $is_pending_activation && ! $require_license_key ) ? | |
| 124 | - FS_GDPR_Manager::instance()->is_required() : | |
| 125 | - false; | |
| 126 | - | |
| 127 | - if ( is_null( $is_gdpr_required ) ) { | |
| 128 | - $is_gdpr_required = $fs->fetch_and_store_current_user_gdpr_anonymously(); | |
| 129 | - } | |
| 130 | - | |
| 131 | 120 | $activation_state = array( |
| 132 | 121 | 'is_license_activation' => $require_license_key, |
| 133 | 122 | 'is_pending_activation' => $is_pending_activation, |
| 134 | - 'is_gdpr_required' => $is_gdpr_required, | |
| 123 | + 'is_gdpr_required' => true, | |
| 135 | 124 | 'is_network_level_activation' => $is_network_level_activation, |
| 136 | 125 | 'is_dialog' => $is_optin_dialog, |
| 137 | 126 | ); |
| 138 | 127 | ?> |
| @@ -178,9 +167,9 @@ | ||
| 178 | 167 | <div class="fs-content"> |
| 179 | 168 | <?php $fs->do_action( 'connect/before_message', $activation_state ) ?> |
| 180 | 169 | |
| 181 | 170 | <?php if ( ! empty( $error ) ) : ?> |
| 182 | - <p class="fs-error"><?php echo $fs->apply_filters( 'connect_error_esc_html', esc_html( $error ) ) ?></p> | |
| 171 | + <div class="fs-error"><?php echo $fs->apply_filters( 'connect_error_esc_html', esc_html( $error ) ) ?></div> | |
| 183 | 172 | <?php endif ?> |
| 184 | 173 | <?php |
| 185 | 174 | if ( ! $is_pending_activation && ! $require_license_key ) { |
| 186 | 175 | if ( ! $fs->is_plugin_update() ) { |
| @@ -231,13 +220,15 @@ | ||
| 231 | 220 | } else { |
| 232 | 221 | $filter = 'connect_message'; |
| 233 | 222 | |
| 234 | 223 | if ( ! $fs->is_plugin_update() ) { |
| 235 | - $default_optin_message = esc_html( sprintf( ( $is_gdpr_required ? | |
| 236 | - /* translators: %s: module type (plugin, theme, or add-on) */ | |
| 237 | - fs_text_inline( 'Opt in to get email notifications for security & feature updates, educational content, and occasional offers, and to share some basic WordPress environment info. This will help us make the %s more compatible with your site and better at doing what you need it to.', 'connect-message', $slug ) : | |
| 238 | - /* translators: %s: module type (plugin, theme, or add-on) */ | |
| 239 | - fs_text_inline( 'Opt in to get email notifications for security & feature updates, and to share some basic WordPress environment info. This will help us make the %s more compatible with your site and better at doing what you need it to.', 'connect-message', $slug ) ), $fs->get_module_label( true ) ) ); | |
| 224 | + $default_optin_message = esc_html( | |
| 225 | + sprintf( | |
| 226 | + /* translators: %s: module type (plugin, theme, or add-on) */ | |
| 227 | + fs_text_inline( 'Opt in to get email notifications for security & feature updates, educational content, and occasional offers, and to share some basic WordPress environment info. This will help us make the %s more compatible with your site and better at doing what you need it to.', 'connect-message', $slug ), | |
| 228 | + $fs->get_module_label( true ) | |
| 229 | + ) | |
| 230 | + ); | |
| 240 | 231 | } else { |
| 241 | 232 | // If Freemius was added on a plugin update, set different |
| 242 | 233 | // opt-in message. |
| 243 | 234 | |
| @@ -243,11 +234,9 @@ | ||
| 243 | 234 | |
| 244 | 235 | /* translators: %s: module type (plugin, theme, or add-on) */ |
| 245 | 236 | $default_optin_message = esc_html( sprintf( fs_text_inline( 'We have introduced this opt-in so you never miss an important update and help us make the %s more compatible with your site and better at doing what you need it to.', 'connect-message_on-update_why' ), $fs->get_module_label( true ) ) ); |
| 246 | 237 | |
| 247 | - $default_optin_message .= '<br><br>' . esc_html( $is_gdpr_required ? | |
| 248 | - fs_text_inline( 'Opt in to get email notifications for security & feature updates, educational content, and occasional offers, and to share some basic WordPress environment info.', 'connect-message_on-update', $slug ) : | |
| 249 | - fs_text_inline( 'Opt in to get email notifications for security & feature updates, and to share some basic WordPress environment info.', 'connect-message_on-update', $slug ) ); | |
| 238 | + $default_optin_message .= '<br><br>' . esc_html( fs_text_inline( 'Opt in to get email notifications for security & feature updates, educational content, and occasional offers, and to share some basic WordPress environment info.', 'connect-message_on-update', $slug ) ); | |
| 250 | 239 | |
| 251 | 240 | if ( $fs->is_enable_anonymous() ) { |
| 252 | 241 | $default_optin_message .= ' ' . esc_html( fs_text_inline( 'If you skip this, that\'s okay! %1$s will still work just fine.', 'connect-message_on-update_skip', $slug ) ); |
| 253 | 242 | } |
| @@ -266,16 +255,16 @@ | ||
| 266 | 255 | $default_optin_message, |
| 267 | 256 | '<b>' . esc_html( $fs->get_plugin_name() ) . '</b>', |
| 268 | 257 | '<b>' . $current_user->user_login . '</b>', |
| 269 | 258 | '<a href="' . $site_url . '" target="_blank" rel="noopener noreferrer">' . $site_url . '</a>', |
| 270 | - $freemius_link | |
| 259 | + $freemius_activation_terms_html | |
| 271 | 260 | ), |
| 272 | 261 | $first_name, |
| 273 | 262 | $fs->get_plugin_name(), |
| 274 | 263 | $current_user->user_login, |
| 275 | 264 | '<a href="' . $site_url . '" target="_blank" rel="noopener noreferrer">' . $site_url . '</a>', |
| 276 | - $freemius_link, | |
| 277 | - $is_gdpr_required | |
| 265 | + $freemius_activation_terms_html, | |
| 266 | + true | |
| 278 | 267 | ); |
| 279 | 268 | } |
| 280 | 269 | |
| 281 | 270 | if ( $is_network_upgrade_mode ) { |
| @@ -375,10 +364,10 @@ | ||
| 375 | 364 | <?php endif ?> |
| 376 | 365 | <?php if ( $activate_with_current_user ) : ?> |
| 377 | 366 | <form action="" method="POST"> |
| 378 | 367 | <input type="hidden" name="fs_action" |
| 379 | - value="<?php echo $fs->get_unique_affix() ?>_activate_existing"> | |
| 380 | - <?php wp_nonce_field( 'activate_existing_' . $fs->get_public_key() ) ?> | |
| 368 | + value="<?php echo esc_attr( $fs->get_unique_affix() . '_activate_existing' ) ?>"> | |
| 369 | + <?php wp_nonce_field( $fs->get_unique_affix() . '_activate_existing' ) ?> | |
| 381 | 370 | <input type="hidden" name="is_extensions_tracking_allowed" value="1"> |
| 382 | 371 | <input type="hidden" name="is_diagnostic_tracking_allowed" value="1"> |
| 383 | 372 | <button class="button button-primary" tabindex="1" |
| 384 | 373 | type="submit"><?php echo esc_html( $button_label ) ?></button> |
| @@ -386,9 +375,9 @@ | ||
| 386 | 375 | <?php else : ?> |
| 387 | 376 | <form method="post" action="<?php echo WP_FS__ADDRESS ?>/action/service/user/install/"> |
| 388 | 377 | <?php unset( $optin_params['sites']); ?> |
| 389 | 378 | <?php foreach ( $optin_params as $name => $value ) : ?> |
| 390 | - <input type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>"> | |
| 379 | + <input type="hidden" name="<?php echo esc_attr( $name ) ?>" value="<?php echo esc_attr( $value ) ?>"> | |
| 391 | 380 | <?php endforeach ?> |
| 392 | 381 | <input type="hidden" name="is_extensions_tracking_allowed" value="1"> |
| 393 | 382 | <input type="hidden" name="is_diagnostic_tracking_allowed" value="1"> |
| 394 | 383 | <button class="button button-primary" tabindex="1" |
| @@ -397,9 +386,11 @@ | ||
| 397 | 386 | } ?>><?php echo esc_html( $button_label ) ?></button> |
| 398 | 387 | </form> |
| 399 | 388 | <?php endif ?> |
| 400 | 389 | <?php if ( $require_license_key ) : ?> |
| 401 | - <a id="license_issues_link" href="<?php echo $fs->apply_filters( 'known_license_issues_url', 'https://freemius.com/help/documentation/wordpress-sdk/license-activation-issues/' ) ?>" target="_blank"><?php fs_esc_html_echo_inline( 'License issues?', 'license-issues', $slug ) ?></a> | |
| 390 | + <a id="license_issues_link" | |
| 391 | + href="<?php echo esc_url( $fs->apply_filters( 'known_license_issues_url', 'https://freemius.com/help/documentation/wordpress-sdk/license-activation-issues/' ) ) ?>" | |
| 392 | + target="_blank"><?php fs_esc_html_echo_inline( 'License issues?', 'license-issues', $slug ) ?></a> | |
| 402 | 393 | <?php endif ?> |
| 403 | 394 | |
| 404 | 395 | <?php $fs->do_action( 'connect/after_actions', $activation_state ) ?> |
| 405 | 396 | </div><?php |
| @@ -407,12 +398,12 @@ | ||
| 407 | 398 | |
| 408 | 399 | // Set core permission list items. |
| 409 | 400 | $permissions = array(); |
| 410 | 401 | |
| 411 | - // Add newsletter permissions if enabled. | |
| 412 | - if ( $is_gdpr_required || $fs->is_permission_requested( 'newsletter' ) ) { | |
| 413 | - $permissions[] = $permission_manager->get_newsletter_permission(); | |
| 414 | - } | |
| 402 | + // Add newsletter permissions if enabled. | |
| 403 | + if ( $fs->is_permission_requested( 'newsletter' ) ) { | |
| 404 | + $permissions[] = $permission_manager->get_newsletter_permission(); | |
| 405 | + } | |
| 415 | 406 | |
| 416 | 407 | $permissions = $permission_manager->get_permissions( |
| 417 | 408 | $require_license_key, |
| 418 | 409 | $permissions |
| @@ -422,14 +413,14 @@ | ||
| 422 | 413 | <div class="fs-permissions"> |
| 423 | 414 | <?php if ( $require_license_key ) : ?> |
| 424 | 415 | <a class="fs-trigger wp-core-ui" href="#" tabindex="1" style="color: inherit;"><?php echo sprintf( |
| 425 | 416 | fs_esc_html_inline( 'For delivery of security & feature updates, and license management, %s needs to', 'license-sync-disclaimer', $slug ) . '<b class="fs-arrow"></b>', |
| 426 | - sprintf( '<nobr class="button-link" style="color: inherit;">%s</nobr>', $fs->get_plugin_title() ) | |
| 417 | + sprintf( '<nobr class="button-link" style="color: inherit;">%s</nobr>', esc_html( $fs->get_plugin_title() ) ) | |
| 427 | 418 | ) ?></a> |
| 428 | 419 | <?php else : ?> |
| 429 | 420 | <a class="fs-trigger wp-core-ui" href="#" tabindex="1" style="color: inherit;"><?php printf( |
| 430 | 421 | fs_esc_html_inline( 'This will allow %s to', 'this-will-allow-x', $slug ) . '<b class="fs-arrow"></b>', |
| 431 | - sprintf( '<nobr class="button-link" style="color: inherit;">%s</nobr>', $fs->get_plugin_title() ) | |
| 422 | + sprintf( '<nobr class="button-link" style="color: inherit;">%s</nobr>', esc_html( $fs->get_plugin_title() ) ) | |
| 432 | 423 | ) ?></a> |
| 433 | 424 | <?php endif ?> |
| 434 | 425 | <ul><?php |
| 435 | 426 | foreach ( $permissions as $permission ) { |
| @@ -452,14 +443,18 @@ | ||
| 452 | 443 | </div> |
| 453 | 444 | <?php endif ?> |
| 454 | 445 | </div> |
| 455 | 446 | <div class="fs-terms"> |
| 456 | - <a class="fs-tooltip-trigger<?php echo is_rtl() ? ' rtl' : '' ?>" href="<?php echo $freemius_site_url ?>" target="_blank" rel="noopener" tabindex="1">Powered by Freemius<?php if ( $require_license_key ) : ?> <span class="fs-tooltip" style="width: 170px"><?php echo $fs->get_text_inline( 'Freemius is our licensing and software updates engine', 'permissions-extensions_desc' ) ?></span><?php endif ?></a> | |
| 447 | + <a class="fs-tooltip-trigger<?php echo is_rtl() ? ' rtl' : '' ?>" href="<?php echo esc_url( $freemius_activation_terms_url ) ?>" target="_blank" rel="noopener" tabindex="1">Powered by Freemius<?php if ( $require_license_key ) : ?> <span class="fs-tooltip" style="width: 170px"><?php echo esc_html( $fs->get_text_inline( 'Freemius is our licensing and software updates engine', 'permissions-extensions_desc' ) ) ?></span><?php endif ?></a> | |
| 457 | 448 | - |
| 458 | 449 | <a href="https://freemius.com/privacy/" target="_blank" rel="noopener" |
| 459 | 450 | tabindex="1"><?php fs_esc_html_echo_inline( 'Privacy Policy', 'privacy-policy', $slug ) ?></a> |
| 460 | 451 | - |
| 461 | - <a href="<?php echo $require_license_key ? $freemius_plugin_terms_url : $freemius_usage_tracking_url ?>" target="_blank" rel="noopener" tabindex="1"><?php $require_license_key ? fs_echo_inline( 'License Agreement', 'license-agreement', $slug ) : fs_echo_inline( 'Terms of Service', 'tos', $slug ) ?></a> | |
| 452 | + <?php if ($require_license_key) : ?> | |
| 453 | + <a href="<?php echo esc_url( $freemius_plugin_terms_url ) ?>" target="_blank" rel="noopener" tabindex="1"><?php fs_echo_inline( 'License Agreement', 'license-agreement', $slug ) ?></a> | |
| 454 | + <?php else : ?> | |
| 455 | + <a href="<?php echo esc_url( $freemius_usage_tracking_url ) ?>" target="_blank" rel="noopener" tabindex="1"><?php fs_echo_inline( 'Terms of Service', 'tos', $slug ) ?></a> | |
| 456 | + <?php endif; ?> | |
| 462 | 457 | </div> |
| 463 | 458 | </div> |
| 464 | 459 | <?php |
| 465 | 460 | /** |
| @@ -839,9 +834,9 @@ | ||
| 839 | 834 | } else { |
| 840 | 835 | resetLoadingMode(); |
| 841 | 836 | |
| 842 | 837 | // Show error. |
| 843 | - $('.fs-content').prepend('<p class="fs-error">' + (resultObj.error.message ? resultObj.error.message : resultObj.error) + '</p>'); | |
| 838 | + $('.fs-content').prepend('<div class="fs-error">' + (resultObj.error.message ? resultObj.error.message : resultObj.error) + '</div>'); | |
| 844 | 839 | } |
| 845 | 840 | }, |
| 846 | 841 | error: function () { |
| 847 | 842 | resetLoadingMode(); |
| @@ -1044,4 +1039,6 @@ | ||
| 1044 | 1039 | |
| 1045 | 1040 | //endregion |
| 1046 | 1041 | })(jQuery); |
| 1047 | 1042 | </script> |
| 1043 | +<?php | |
| 1044 | + fs_require_once_template( 'api-connectivity-message-js.php' ); | |