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 / data-debug-mode.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
data-debug-mode.php
213 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 2.3.1
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * @var array $VARS
15 *
16 * @var Freemius $fs
17 */
18 $fs = freemius( $VARS['id'] );
19 $slug = $fs->get_slug();
20 $unique_affix = $fs->get_unique_affix();
21 $last_license_user_id = $fs->get_last_license_user_id();
22 $has_last_license_user_id = FS_User::is_valid_id( $last_license_user_id );
23
24 $message_above_input_field = ( ! $has_last_license_user_id ) ?
25 fs_text_inline( 'Please enter the license key to enable the debug mode:', 'submit-developer-license-key-message', $slug ) :
26 sprintf(
27 fs_text_inline( 'To enter the debug mode, please enter the secret key of the license owner (UserID = %d), which you can find in your "My Profile" section of your User Dashboard:', 'submit-addon-developer-key-message', $slug ),
28 $last_license_user_id
29 );
30
31 $processing_text = ( fs_esc_js_inline( 'Processing', 'processing', $slug ) . '...' );
32 $submit_button_text = fs_text_inline( 'Submit', 'submit', $slug );
33 $debug_license_link_text = fs_esc_html_inline( 'Start Debug', 'start-debug-license', $slug );
34 $license_or_user_key_text = ( ! $has_last_license_user_id ) ?
35 fs_text_inline( 'License key', 'license-key' , $slug ) :
36 fs_text_inline( 'User key', 'user-key' , $slug );
37 $input_html = "<input class='fs-license-or-user-key' type='password' placeholder='{$license_or_user_key_text}' tabindex='1' />";
38
39 $modal_content_html = <<< HTML
40 <div class="notice notice-error inline license-or-user-key-submission-message"><p></p></div>
41 <p>{$message_above_input_field}</p>
42 {$input_html}
43 HTML;
44
45 fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
46 ?>
47 <script type="text/javascript">
48 ( function( $ ) {
49 $( document ).ready( function() {
50 var modalContentHtml = <?php echo json_encode( $modal_content_html ) ?>,
51 modalHtml =
52 '<div class="fs-modal fs-modal-developer-license-debug-mode fs-modal-developer-license-debug-mode-<?php echo $unique_affix ?>">'
53 + ' <div class="fs-modal-dialog">'
54 + ' <div class="fs-modal-body">'
55 + ' <div class="fs-modal-panel active">' + modalContentHtml + '</div>'
56 + ' </div>'
57 + ' <div class="fs-modal-footer">'
58 + ' <button class="button button-secondary button-close" tabindex="4"><?php fs_esc_js_echo_inline( 'Cancel', 'cancel', $slug ) ?></button>'
59 + ' <button class="button button-primary button-submit-license-or-user-key" tabindex="3"><?php echo esc_js( $submit_button_text ) ?></button>'
60 + ' </div>'
61 + ' </div>'
62 + '</div>',
63 $modal = $( modalHtml ),
64 $debugLicenseLink = $( '.debug-license-trigger' ),
65 $submitKeyButton = $modal.find( '.button-submit-license-or-user-key' ),
66 $licenseOrUserKeyInput = $modal.find( 'input.fs-license-or-user-key' ),
67 $licenseOrUserKeySubmissionMessage = $modal.find( '.license-or-user-key-submission-message' ),
68 isDebugMode = <?php echo $fs->is_data_debug_mode() ? 'true' : 'false' ?>;
69
70 $modal.appendTo( $( 'body' ) );
71
72 function registerEventHandlers() {
73 $debugLicenseLink.click(function (evt) {
74 evt.preventDefault();
75
76 if ( isDebugMode ) {
77 setDeveloperLicenseDebugMode();
78 return true;
79 }
80
81 showModal( evt );
82 });
83
84 $modal.on( 'input propertychange', 'input.fs-license-or-user-key', function () {
85 var licenseOrUserKey = $( this ).val().trim();
86
87 /**
88 * If license or user key is not empty, enable the submission button.
89 */
90 if ( licenseOrUserKey.length > 0 ) {
91 enableSubmitButton();
92 }
93 });
94
95 $modal.on( 'blur', 'input.fs-license-or-user-key', function () {
96 var licenseOrUserKey = $( this ).val().trim();
97
98 /**
99 * If license or user key is empty, disable the submission button.
100 */
101 if ( 0 === licenseOrUserKey.length ) {
102 disableSubmitButton();
103 }
104 });
105
106 $modal.on( 'click', '.button-submit-license-or-user-key', function ( evt ) {
107 evt.preventDefault();
108
109 if ( $( this ).hasClass( 'disabled' ) ) {
110 return;
111 }
112
113 var licenseOrUserKey = $licenseOrUserKeyInput.val().trim();
114
115 disableSubmitButton();
116
117 if ( 0 === licenseOrUserKey.length ) {
118 return;
119 }
120
121 setDeveloperLicenseDebugMode( licenseOrUserKey );
122 });
123
124 // If the user has clicked outside the window, close the modal.
125 $modal.on( 'click', '.fs-close, .button-secondary', function () {
126 closeModal();
127 return false;
128 } );
129 }
130
131 registerEventHandlers();
132
133 function setDeveloperLicenseDebugMode( licenseOrUserKey ) {
134 var data = {
135 action : '<?php echo $fs->get_ajax_action( 'set_data_debug_mode' ) ?>',
136 security : '<?php echo $fs->get_ajax_security( 'set_data_debug_mode' ) ?>',
137 license_or_user_key: licenseOrUserKey,
138 is_debug_mode : isDebugMode,
139 module_id : '<?php echo $fs->get_id() ?>'
140 };
141
142 $.ajax( {
143 url : <?php echo Freemius::ajax_url() ?>,
144 method : 'POST',
145 data : data,
146 beforeSend: function () {
147 $debugLicenseLink.find('span').text( '<?php echo $processing_text ?>' );
148 $submitKeyButton.text( '<?php echo $processing_text ?>' );
149 },
150 success : function ( result ) {
151 if ( result.success ) {
152 closeModal();
153
154 // Reload the "Account" page so that the pricing/upgrade link will be properly hidden/shown.
155 window.location.reload();
156 } else {
157 showError( result.error.message ? result.error.message : result.error );
158 resetButtons();
159 }
160 },
161 error : function () {
162 showError( <?php echo json_encode( fs_text_inline( 'An unknown error has occurred.', 'unknown-error', $slug ) ) ?> );
163 resetButtons();
164 }
165 });
166 }
167
168 function showModal( evt ) {
169 resetModal();
170
171 // Display the dialog box.
172 $modal.addClass( 'active' );
173 $( 'body' ).addClass( 'has-fs-modal' );
174
175 $licenseOrUserKeyInput.val( '' );
176 $licenseOrUserKeyInput.focus();
177 }
178
179 function closeModal() {
180 $modal.removeClass( 'active' );
181 $( 'body' ).removeClass( 'has-fs-modal' );
182 }
183
184 function resetButtons() {
185 enableSubmitButton();
186 $submitKeyButton.text( <?php echo json_encode( $submit_button_text ) ?> );
187 $debugLicenseLink.find('span').text( <?php echo json_encode( $debug_license_link_text ) ?> );
188 }
189
190 function resetModal() {
191 hideError();
192 resetButtons();
193 }
194
195 function enableSubmitButton() {
196 $submitKeyButton.removeClass( 'disabled' );
197 }
198
199 function disableSubmitButton() {
200 $submitKeyButton.addClass( 'disabled' );
201 }
202
203 function hideError() {
204 $licenseOrUserKeySubmissionMessage.hide();
205 }
206
207 function showError( msg ) {
208 $licenseOrUserKeySubmissionMessage.find( ' > p' ).html( msg );
209 $licenseOrUserKeySubmissionMessage.show();
210 }
211 } );
212 } )( jQuery );
213 </script>