PluginProbe
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs / 2.7.3
BlockSpare – Gutenberg Blocks, AI Content Generator & Site Builder for News, Magazine & Blogs v2.7.3
5.0.1 4.1.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.1.2 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 2.1.2 2.5.0 2.5.3 All 39 releases
← All changes | freemius/templates/forms/affiliation.php +40 -11 1.2.3 → 2.7.3 View file →
@@ -12,10 +12,12 @@
12 12
13 13 /**
14 14 * @var array $VARS
15 15 * @var Freemius $fs
16 + * @var string $plugin_title
16 17 */
17 - $fs = freemius( $VARS['id'] );
18 + $fs = freemius( $VARS['id'] );
19 + $plugin_title = $VARS['plugin_title'];
18 20
19 21 $slug = $fs->get_slug();
20 22
21 23 $user = $fs->get_user();
@@ -21,9 +23,8 @@
21 23 $user = $fs->get_user();
22 24 $affiliate = $fs->get_affiliate();
23 25 $affiliate_terms = $fs->get_affiliate_terms();
24 26
25 - $plugin_title = $fs->get_plugin_title();
26 27 $module_type = $fs->is_plugin() ?
27 28 WP_FS__MODULE_TYPE_PLUGIN :
28 29 WP_FS__MODULE_TYPE_THEME;
29 30
@@ -44,9 +45,9 @@
44 45 $promotion_method_social_media = false;
45 46 $promotion_method_mobile_apps = false;
46 47 $statistics_information = false;
47 48 $promotion_method_description = false;
48 - $members_dashboard_login_url = 'https://members.freemius.com/login/';
49 + $members_dashboard_login_url = 'https://users.freemius.com/login';
49 50
50 51 $affiliate_application_data = $fs->get_affiliate_application_data();
51 52
52 53 if ( $is_affiliate && $affiliate->is_pending() ) {
@@ -70,9 +71,9 @@
70 71 } else {
71 72 $current_user = Freemius::_get_current_wp_user();
72 73 $full_name = trim( $current_user->user_firstname . ' ' . $current_user->user_lastname );
73 74 $email_address = $current_user->user_email;
74 - $domain = fs_strip_url_protocol( get_site_url() );
75 + $domain = Freemius::get_unfiltered_site_url( null, true );
75 76 }
76 77
77 78 $affiliate_tracking = 30;
78 79
@@ -82,8 +83,13 @@
82 83 fs_text_inline( 'Non-expiring', 'non-expiring', $slug ) );
83 84 }
84 85
85 86 $apply_to_become_affiliate_text = fs_text_inline( 'Apply to become an affiliate', 'apply-to-become-an-affiliate', $slug );
87 +
88 + $module_id = $fs->get_id();
89 + $affiliate_program_terms_url = "https://freemius.com/plugin/{$module_id}/{$slug}/legal/affiliate-program/";
90 +
91 + $has_tabs = $fs->_add_tabs_before_content();
86 92 ?>
87 93 <div id="fs_affiliation_content_wrapper" class="wrap">
88 94 <form method="post" action="">
89 95 <div id="poststuff">
@@ -103,9 +109,9 @@
103 109 echo sprintf(
104 110 fs_esc_html_inline( "Your affiliate application for %s has been accepted! Log in to your affiliate area at: %s.", 'affiliate-application-accepted', $slug ),
105 111 $plugin_title,
106 112 sprintf(
107 - '<a href="%s" target="_blank">%s</a>',
113 + '<a href="%s" target="_blank" rel="noopener">%s</a>',
108 114 $members_dashboard_login_url,
109 115 $members_dashboard_login_url
110 116 )
111 117 );
@@ -216,13 +222,19 @@
216 222 <?php if ( ! $is_affiliate ) : ?>
217 223 <p class="description"><?php echo esc_html( sprintf( fs_text_inline( 'Please provide details on how you intend to promote %s (please be as specific as possible).', 'promotion-method-desc-field-desc', $slug ), $plugin_title ) ) ?></p>
218 224 <?php endif ?>
219 225 </div>
226 + <?php if ( ! $is_affiliate ) : ?>
227 + <div>
228 + <input type="checkbox" id="legal_consent_checkbox">
229 + <label for="legal_consent_checkbox">I agree to the <a href="<?php echo $affiliate_program_terms_url ?>" target="_blank" rel="noopener">Referrer Program</a>'s terms & conditions.</label>
230 + </div>
231 + <?php endif ?>
220 232 </form>
221 233 </div>
222 234 <?php if ( ! $is_affiliate ) : ?>
223 235 <a id="cancel_button" href="#" class="button button-secondary button-cancel" style="display: none"><?php fs_esc_html_echo_inline( 'Cancel', 'cancel', $slug ) ?></a>
224 - <a id="submit_button" class="button button-primary" href="#" style="display: none"><?php echo esc_html( $apply_to_become_affiliate_text ) ?></a>
236 + <a id="submit_button" class="button button-primary disabled" href="#" style="display: none"><?php echo esc_html( $apply_to_become_affiliate_text ) ?></a>
225 237 <a id="apply_button" class="button button-primary" href="#"><?php fs_esc_html_echo_inline( 'Become an affiliate', 'become-an-affiliate', $slug ) ?></a>
226 238 <?php endif ?>
227 239 </div>
228 240 </div>
@@ -241,9 +253,10 @@
241 253 $applicationFormContainer = $('#application_form_container'),
242 254 $errorMessageContainer = $('#error_message'),
243 255 $domain = $('#domain'),
244 256 $addDomain = $('#add_domain'),
245 - $extraDomainsContainer = $('#extra_domains_container');
257 + $extraDomainsContainer = $('#extra_domains_container'),
258 + $legalConsentCheckbox = $( '#legal_consent_checkbox' );
246 259
247 260 $applyButton.click(function (evt) {
248 261 evt.preventDefault();
249 262
@@ -354,14 +367,14 @@
354 367 affiliate.promotion_methods = promotionMethods.join(',');
355 368 }
356 369
357 370 $.ajax({
358 - url : ajaxurl,
371 + url : <?php echo Freemius::ajax_url() ?>,
359 372 method : 'POST',
360 373 data : {
361 374 action : '<?php echo $fs->get_ajax_action( 'submit_affiliate_application' ) ?>',
362 375 security : '<?php echo $fs->get_ajax_security( 'submit_affiliate_application' ) ?>',
363 - module_id: '<?php echo $fs->get_id() ?>',
376 + module_id: '<?php echo $module_id ?>',
364 377 affiliate: affiliate
365 378 },
366 379 beforeSend: function () {
367 380 $cancelButton.addClass('disabled');
@@ -471,16 +484,32 @@
471 484 $errorMessageContainer.show();
472 485
473 486 window.scrollTo(0, 0);
474 487 }
488 +
489 + /**
490 + * @author Xiaheng Chen (@xhchen)
491 + *
492 + * @since 2.4.0
493 + */
494 + $legalConsentCheckbox.click( function () {
495 + if ( $( this ).prop( 'checked' ) ) {
496 + $submitButton.removeClass( 'disabled' );
497 + } else {
498 + $submitButton.addClass( 'disabled' );
499 + }
500 + } );
475 501 });
476 502 </script>
477 503 </div>
478 504 <?php
505 + if ( $has_tabs ) {
506 + $fs->_add_tabs_after_content();
507 + }
508 +
479 509 $params = array(
480 510 'page' => 'affiliation',
481 - 'module_id' => $fs->get_id(),
511 + 'module_id' => $module_id,
482 512 'module_slug' => $slug,
483 513 'module_version' => $fs->get_plugin_version(),
484 514 );
485 515 fs_require_template( 'powered-by.php', $params );
486 -?>