PluginProbe
Passster – Password Protect Pages and Content / 4.3.17
Passster – Password Protect Pages and Content v4.3.17
4.3.17 4.3.16 4.3.15 4.3.14 4.3.12 4.3.13 4.3.11 4.3.10 4.3.9 4.3.8 4.3.7 4.3.6 4.3.5 trunk 3.5.4 3.5.5.2 3.5.5.8 3.5.5.9 4.0 4.1.4 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 All 49 releases
← All changes | inc/freemius/templates/connect.php +52 -37 4.1.4 → 4.3.17 View file →
@@ -46,26 +46,11 @@
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;
58 -
59 - if ( $fs->is_premium() ) {
60 - $freemius_site_url .= '?' . http_build_query( array(
61 - 'id' => $fs->get_id(),
62 - 'slug' => $slug,
63 - ) );
64 - }
65 -
66 - $freemius_link = '<a href="' . $freemius_site_url . '" target="_blank" rel="noopener" tabindex="1">freemius.com</a>';
67 -
68 53 $error = fs_request_get( 'error' );
69 54
70 55 $has_release_on_freemius = $fs->has_release_on_freemius();
71 56
@@ -75,8 +60,14 @@
75 60 ( $is_premium_code || ! $has_release_on_freemius ) &&
76 61 fs_request_get_bool( 'require_license', ( $is_premium_code || $has_release_on_freemius ) )
77 62 );
78 63
64 + $freemius_activation_terms_url = ($fs->is_premium() && $require_license_key) ?
65 + $fs->get_license_activation_terms_url() :
66 + $freemius_usage_tracking_url;
67 +
68 + $freemius_activation_terms_html = '<a href="' . esc_url( $freemius_activation_terms_url ) . '" target="_blank" rel="noopener" tabindex="1">freemius.com</a>';
69 +
79 70 if ( $is_pending_activation ) {
80 71 $require_license_key = false;
81 72 }
82 73
@@ -169,9 +160,8 @@
169 160 );
170 161
171 162 fs_require_once_template( 'plugin-icon.php', $vars );
172 163 ?>
173 - <!-- <img class="fs-connect-logo" width="--><?php //echo $size ?><!--" height="--><?php //echo $size ?><!--" src="//img.freemius.com/logo/connect.svg"/>-->
174 164 </div>
175 165 <div class="fs-box-container">
176 166 <div class="fs-content">
177 167 <?php $fs->do_action( 'connect/before_message', $activation_state ) ?>
@@ -264,15 +254,15 @@
264 254 $default_optin_message,
265 255 '<b>' . esc_html( $fs->get_plugin_name() ) . '</b>',
266 256 '<b>' . $current_user->user_login . '</b>',
267 257 '<a href="' . $site_url . '" target="_blank" rel="noopener noreferrer">' . $site_url . '</a>',
268 - $freemius_link
258 + $freemius_activation_terms_html
269 259 ),
270 260 $first_name,
271 261 $fs->get_plugin_name(),
272 262 $current_user->user_login,
273 263 '<a href="' . $site_url . '" target="_blank" rel="noopener noreferrer">' . $site_url . '</a>',
274 - $freemius_link,
264 + $freemius_activation_terms_html,
275 265 true
276 266 );
277 267 }
278 268
@@ -345,8 +335,11 @@
345 335 <span class="fs-input-label"><?php echo $do_not_send_updates_text ?></span>
346 336 </label>
347 337 </div>
348 338 </div>
339 + <div id="fs_orphan_license_message">
340 + <span class="fs-message"><?php fs_echo_inline( "A user has not yet been associated with the license, which is necessary to prevent unauthorized activation. To assign the license to your user, you agree to share your WordPress user's full name and email address." ) ?></span>
341 + </div>
349 342 <?php endif ?>
350 343 <?php if ( $is_network_level_activation ) : ?>
351 344 <?php
352 345 $vars = array(
@@ -373,10 +366,10 @@
373 366 <?php endif ?>
374 367 <?php if ( $activate_with_current_user ) : ?>
375 368 <form action="" method="POST">
376 369 <input type="hidden" name="fs_action"
377 - value="<?php echo $fs->get_unique_affix() ?>_activate_existing">
378 - <?php wp_nonce_field( 'activate_existing_' . $fs->get_public_key() ) ?>
370 + value="<?php echo esc_attr( $fs->get_unique_affix() . '_activate_existing' ) ?>">
371 + <?php wp_nonce_field( $fs->get_unique_affix() . '_activate_existing' ) ?>
379 372 <input type="hidden" name="is_extensions_tracking_allowed" value="1">
380 373 <input type="hidden" name="is_diagnostic_tracking_allowed" value="1">
381 374 <button class="button button-primary" tabindex="1"
382 375 type="submit"><?php echo esc_html( $button_label ) ?></button>
@@ -384,9 +377,9 @@
384 377 <?php else : ?>
385 378 <form method="post" action="<?php echo WP_FS__ADDRESS ?>/action/service/user/install/">
386 379 <?php unset( $optin_params['sites']); ?>
387 380 <?php foreach ( $optin_params as $name => $value ) : ?>
388 - <input type="hidden" name="<?php echo $name ?>" value="<?php echo esc_attr( $value ) ?>">
381 + <input type="hidden" name="<?php echo esc_attr( $name ) ?>" value="<?php echo esc_attr( $value ) ?>">
389 382 <?php endforeach ?>
390 383 <input type="hidden" name="is_extensions_tracking_allowed" value="1">
391 384 <input type="hidden" name="is_diagnostic_tracking_allowed" value="1">
392 385 <button class="button button-primary" tabindex="1"
@@ -395,9 +388,11 @@
395 388 } ?>><?php echo esc_html( $button_label ) ?></button>
396 389 </form>
397 390 <?php endif ?>
398 391 <?php if ( $require_license_key ) : ?>
399 - <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>
392 + <a id="license_issues_link"
393 + href="<?php echo esc_url( $fs->apply_filters( 'known_license_issues_url', 'https://freemius.com/help/documentation/wordpress-sdk/license-activation-issues/' ) ) ?>"
394 + target="_blank"><?php fs_esc_html_echo_inline( 'License issues?', 'license-issues', $slug ) ?></a>
400 395 <?php endif ?>
401 396
402 397 <?php $fs->do_action( 'connect/after_actions', $activation_state ) ?>
403 398 </div><?php
@@ -420,14 +415,14 @@
420 415 <div class="fs-permissions">
421 416 <?php if ( $require_license_key ) : ?>
422 417 <a class="fs-trigger wp-core-ui" href="#" tabindex="1" style="color: inherit;"><?php echo sprintf(
423 418 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>',
424 - sprintf( '<nobr class="button-link" style="color: inherit;">%s</nobr>', $fs->get_plugin_title() )
419 + sprintf( '<nobr class="button-link" style="color: inherit;">%s</nobr>', esc_html( $fs->get_plugin_title() ) )
425 420 ) ?></a>
426 421 <?php else : ?>
427 422 <a class="fs-trigger wp-core-ui" href="#" tabindex="1" style="color: inherit;"><?php printf(
428 423 fs_esc_html_inline( 'This will allow %s to', 'this-will-allow-x', $slug ) . '<b class="fs-arrow"></b>',
429 - sprintf( '<nobr class="button-link" style="color: inherit;">%s</nobr>', $fs->get_plugin_title() )
424 + sprintf( '<nobr class="button-link" style="color: inherit;">%s</nobr>', esc_html( $fs->get_plugin_title() ) )
430 425 ) ?></a>
431 426 <?php endif ?>
432 427 <ul><?php
433 428 foreach ( $permissions as $permission ) {
@@ -450,14 +445,18 @@
450 445 </div>
451 446 <?php endif ?>
452 447 </div>
453 448 <div class="fs-terms">
454 - <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>
449 + <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>
455 450 &nbsp;&nbsp;-&nbsp;&nbsp;
456 451 <a href="https://freemius.com/privacy/" target="_blank" rel="noopener"
457 452 tabindex="1"><?php fs_esc_html_echo_inline( 'Privacy Policy', 'privacy-policy', $slug ) ?></a>
458 453 &nbsp;&nbsp;-&nbsp;&nbsp;
459 - <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>
454 + <?php if ($require_license_key) : ?>
455 + <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>
456 + <?php else : ?>
457 + <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>
458 + <?php endif; ?>
460 459 </div>
461 460 </div>
462 461 <?php
463 462 /**
@@ -742,12 +741,13 @@
742 741
743 742 var
744 743 licenseKey = $licenseKeyInput.val(),
745 744 data = {
746 - action : action,
747 - security : security,
748 - license_key: licenseKey,
749 - module_id : '<?php echo $fs->get_id() ?>'
745 + action : action,
746 + security : security,
747 + license_key : licenseKey,
748 + module_id : '<?php echo $fs->get_id() ?>',
749 + license_owner_id: licenseOwnerIDByLicense[ licenseKey ]
750 750 };
751 751
752 752 if (
753 753 requireLicenseKey &&
@@ -918,9 +918,9 @@
918 918 }
919 919
920 920 if ('' === key) {
921 921 $primaryCta.attr('disabled', 'disabled');
922 - $marketingOptin.hide();
922 + hideOptinAndLicenseMessage();
923 923 } else {
924 924 $primaryCta.prop('disabled', false);
925 925
926 926 if (32 <= key.length){
@@ -925,9 +925,9 @@
925 925
926 926 if (32 <= key.length){
927 927 fetchIsMarketingAllowedFlagAndToggleOptin();
928 928 } else {
929 - $marketingOptin.hide();
929 + hideOptinAndLicenseMessage();
930 930 }
931 931 }
932 932
933 933 previousLicenseKey = key;
@@ -961,10 +961,12 @@
961 961 //--------------------------------------------------------------------------------
962 962 //region GDPR
963 963 //--------------------------------------------------------------------------------
964 964 var isMarketingAllowedByLicense = {},
965 - $marketingOptin = $('#fs_marketing_optin'),
966 - previousLicenseKey = null;
965 + licenseOwnerIDByLicense = {},
966 + $marketingOptin = $( '#fs_marketing_optin' ),
967 + $orphanLicenseMessage = $( '#fs_orphan_license_message' ),
968 + previousLicenseKey = null;
967 969
968 970 if (requireLicenseKey) {
969 971
970 972 var
@@ -984,8 +986,16 @@
984 986 } else {
985 987 $marketingOptin.hide();
986 988 $primaryCta.focus();
987 989 }
990 +
991 + $orphanLicenseMessage.toggle( false === licenseOwnerIDByLicense[ licenseKey ] );
992 +
993 + if ( false !== licenseOwnerIDByLicense[ licenseKey ] ) {
994 + $( 'input[name=user_firstname]' ).remove();
995 + $( 'input[name=user_lastname]' ).remove();
996 + $( 'input[name=user_email]' ).remove();
997 + }
988 998 },
989 999 /**
990 1000 * @author Leo Fajardo (@leorw)
991 1001 * @since 2.1.0
@@ -993,9 +1003,10 @@
993 1003 fetchIsMarketingAllowedFlagAndToggleOptin = function () {
994 1004 var licenseKey = $licenseKeyInput.val();
995 1005
996 1006 if (licenseKey.length < 32) {
997 - $marketingOptin.hide();
1007 + hideOptinAndLicenseMessage();
1008 +
998 1009 return;
999 1010 }
1000 1011
1001 1012 if (isMarketingAllowedByLicense.hasOwnProperty(licenseKey)) {
@@ -1002,10 +1013,9 @@
1002 1013 afterMarketingFlagLoaded();
1003 1014 return;
1004 1015 }
1005 1016
1006 - $marketingOptin.hide();
1007 -
1017 + hideOptinAndLicenseMessage();
1008 1018 setLoadingMode();
1009 1019
1010 1020 $primaryCta.addClass('fs-loading');
1011 1021 $primaryCta.attr('disabled', 'disabled');
@@ -1027,13 +1037,18 @@
1027 1037 result = result.data;
1028 1038
1029 1039 // Cache result.
1030 1040 isMarketingAllowedByLicense[licenseKey] = result.is_marketing_allowed;
1041 + licenseOwnerIDByLicense[ licenseKey ] = result.license_owner_id;
1031 1042 }
1032 1043
1033 1044 afterMarketingFlagLoaded();
1034 1045 }
1035 1046 });
1047 + },
1048 + hideOptinAndLicenseMessage = function() {
1049 + $marketingOptin.hide();
1050 + $orphanLicenseMessage.hide();
1036 1051 };
1037 1052
1038 1053 $marketingOptin.find( 'input' ).click(function() {
1039 1054 $marketingOptin.removeClass( 'error' );