PluginProbe ʕ •ᴥ•ʔ
Royal Addons for Elementor – Addons and Templates Kit for Elementor / 1.7.1064
Royal Addons for Elementor – Addons and Templates Kit for Elementor v1.7.1064
1.7.1064 1.7.1063 1.7.1062 1.7.1061 1.7.1060 1.7.1059 1.7.1058 trunk 1.0.0 1.1.0 1.2 1.3 1.3.1 1.3.2 1.3.21 1.3.22 1.3.23 1.3.24 1.3.25 1.3.26 1.3.27 1.3.28 1.3.29 1.3.30 1.3.31 1.3.32 1.3.33 1.3.34 1.3.35 1.3.36 1.3.37 1.3.38 1.3.39 1.3.40 1.3.41 1.3.42 1.3.43 1.3.44 1.3.45 1.3.46 1.3.47 1.3.48 1.3.49 1.3.50 1.3.51 1.3.52 1.3.53 1.3.54 1.3.55 1.3.56 1.3.57 1.3.58 1.3.59 1.3.60 1.3.61 1.3.62 1.3.63 1.3.64 1.3.65 1.3.66 1.3.67 1.3.68 1.3.69 1.3.70 1.3.71 1.3.72 1.3.73 1.3.74 1.3.75 1.3.76 1.3.77 1.3.78 1.3.79 1.3.80 1.3.81 1.3.82 1.3.83 1.3.84 1.3.85 1.3.86 1.3.87 1.3.88 1.3.89 1.3.90 1.3.91 1.3.92 1.3.93 1.3.94 1.3.95 1.3.96 1.3.97 1.3.971 1.3.972 1.3.973 1.3.974 1.3.975 1.3.976 1.3.977 1.3.978 1.3.979 1.3.980 1.3.981 1.3.982 1.3.983 1.3.984 1.3.985 1.3.986 1.3.987 1.7.1 1.7.1001 1.7.1002 1.7.1003 1.7.1004 1.7.1005 1.7.1006 1.7.1007 1.7.1008 1.7.1009 1.7.1010 1.7.1011 1.7.1012 1.7.1013 1.7.1014 1.7.1015 1.7.1016 1.7.1017 1.7.1018 1.7.1019 1.7.1020 1.7.1021 1.7.1022 1.7.1023 1.7.1024 1.7.1025 1.7.1026 1.7.1027 1.7.1028 1.7.1029 1.7.1030 1.7.1031 1.7.1032 1.7.1033 1.7.1034 1.7.1035 1.7.1036 1.7.1037 1.7.1038 1.7.1039 1.7.1040 1.7.1041 1.7.1042 1.7.1043 1.7.1044 1.7.1045 1.7.1046 1.7.1047 1.7.1048 1.7.1049 1.7.1050 1.7.1051 1.7.1052 1.7.1053 1.7.1054 1.7.1055 1.7.1056 1.7.1057
royal-elementor-addons / freemius / templates / forms / trial-start.php
royal-elementor-addons / freemius / templates / forms Last commit date
deactivation 5 days ago affiliation.php 5 days ago data-debug-mode.php 5 days ago email-address-update.php 5 days ago index.php 5 days ago license-activation.php 5 days ago optout.php 5 days ago premium-versions-upgrade-handler.php 5 days ago premium-versions-upgrade-metadata.php 5 days ago resend-key.php 5 days ago subscription-cancellation.php 5 days ago trial-start.php 5 days ago user-change.php 5 days ago
trial-start.php
182 lines
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.2.0
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * @var array $VARS
15 * @var Freemius $fs
16 */
17 $fs = freemius( $VARS['id'] );
18 $slug = $fs->get_slug();
19
20 $message_header = sprintf(
21 /* translators: %1$s: Number of trial days; %2$s: Plan name; */
22 fs_text_inline( 'You are 1-click away from starting your %1$s-day free trial of the %2$s plan.', 'start-trial-prompt-header', $slug ),
23 '<span class="var-trial_period"></span>',
24 '<span class="var-plan_title"></span>'
25 );
26 $message_content = sprintf(
27 /* translators: %s: Link to freemius.com */
28 fs_text_inline( 'For compliance with the WordPress.org guidelines, before we start the trial we ask that you opt in with your user and non-sensitive site information, allowing the %s to periodically send data to %s to check for version updates and to validate your trial.', 'start-trial-prompt-message', $slug ),
29 $fs->get_module_type(),
30 sprintf(
31 '<a href="%s" target="_blank" rel="noopener">%s</a>',
32 'https://freemius.com',
33 'freemius.com'
34 )
35 );
36
37 $modal_content_html = <<< HTML
38 <div class="notice notice-error inline"><p></p></div>
39 <h3>{$message_header}</h3>
40 <p>{$message_content}</p>
41 HTML;
42
43 fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
44 ?>
45 <script type="text/javascript">
46 (function ($) {
47 $(document).ready(function () {
48 var modalContentHtml = <?php echo json_encode( $modal_content_html ); ?>,
49 modalHtml =
50 '<div class="fs-modal fs-modal-license-key-resend">'
51 + ' <div class="fs-modal-dialog">'
52 + ' <div class="fs-modal-header">'
53 + ' <h4><?php echo esc_js( fs_text_x_inline( 'Start free trial', 'call to action', 'start-free-trial', $slug ) ) ?></h4>'
54 + ' </div>'
55 + ' <div class="fs-modal-body">' + modalContentHtml + '</div>'
56 + ' <div class="fs-modal-footer">'
57 + ' <button class="button button-secondary button-close">' + <?php fs_json_encode_echo_inline( 'Cancel', 'cancel', $slug ) ?> +'</button>'
58 + ' <button class="button button-primary button-connect">' + <?php fs_json_encode_echo_inline( 'Approve & Start Trial', 'approve-start-trial', $slug ) ?> +'</button>'
59 + ' </div>'
60 + ' </div>'
61 + '</div>',
62 $modal = $( modalHtml ),
63 trialData;
64
65 $modal.appendTo($('body'));
66
67 var $errorNotice = $modal.find('.notice-error');
68
69 registerEventHandlers();
70
71 function registerEventHandlers() {
72 $modal.on('click', '.button-close', function () {
73 closeModal();
74 return false;
75 });
76
77 $modal.on('click', '.button-connect', function (evt) {
78 evt.preventDefault();
79
80 var $button = $(this);
81
82 $.ajax({
83 url : <?php echo Freemius::ajax_url() ?>,
84 method : 'POST',
85 data : {
86 action : '<?php echo $fs->get_ajax_action( 'start_trial' ) ?>',
87 security : '<?php echo $fs->get_ajax_security( 'start_trial' ) ?>',
88 module_id: '<?php echo $fs->get_id() ?>',
89 trial : trialData
90 },
91 beforeSend: function () {
92 // Disable all buttons during trial activation.
93 $modal.find('.button').prop('disabled', true);
94
95 $button.text(<?php fs_json_encode_echo_inline( 'Starting trial', 'starting-trial', $slug ) ?> + '...');
96
97 setLoadingMode();
98 },
99 success : function (resultObj) {
100 if (resultObj.success) {
101 $button.text(<?php fs_json_encode_echo_inline( 'Please wait', 'please-wait', $slug ) ?> + '...');
102
103 // Redirect to the "Account" page and sync the license.
104 window.location.href = resultObj.data.next_page;
105 } else {
106 $button.text(<?php fs_json_encode_echo( 'approve-start-trial', $slug ) ?>);
107
108 resetLoadingMode();
109 showError(resultObj.error);
110 }
111 }
112 });
113 });
114 }
115
116 window.openTrialConfirmationModal = function showModal(data) {
117 resetModal();
118
119 // Display the dialog box.
120 $modal.addClass('active');
121
122 trialData = data;
123
124 var $modalBody = $modal.find('.fs-modal-body'),
125 $var;
126
127 for (var key in data) {
128 if (data.hasOwnProperty(key)) {
129 $var = $modalBody.find('.var-' + key);
130
131 if ($var.length > 0)
132 $var.html(data[key]);
133 }
134 }
135
136 $('body').addClass('has-fs-modal');
137 };
138
139 function closeModal() {
140 $modal.removeClass('active');
141
142 $('body').removeClass('has-fs-modal');
143 }
144
145 function resetModal() {
146 hideError();
147 }
148
149 function hideError() {
150 $errorNotice.hide();
151 }
152
153 function setLoadingMode() {
154 $modal.find('.button')
155 // Re-enable all buttons.
156 .prop('disabled', trialData)
157 // Stop loading cursor.
158 .css({'cursor': 'wait'});
159
160 // Stop loading cursor.
161 $(document.body).css({'cursor': 'wait'});
162 }
163
164 function resetLoadingMode() {
165 $modal.find('.button')
166 // Re-enable all buttons.
167 .prop('disabled', false)
168 // Stop loading cursor.
169 .css({'cursor': 'initial'});
170
171 // Stop loading cursor.
172 $(document.body).css({'cursor': 'initial'});
173 }
174
175 function showError(msg) {
176 $errorNotice.find(' > p').html(msg);
177 $errorNotice.show();
178 }
179 });
180 })(jQuery);
181 </script>
182