PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.19.7
GiveWP – Donation Plugin and Fundraising Platform v2.19.7
4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / includes / admin / settings / class-settings-license.php
give / includes / admin / settings Last commit date
class-settings-addon.php 6 years ago class-settings-advanced.php 4 years ago class-settings-display.php 4 years ago class-settings-email.php 6 years ago class-settings-gateways.php 4 years ago class-settings-general.php 5 years ago class-settings-license.php 6 years ago class-settings-recurring.php 4 years ago
class-settings-license.php
279 lines
1 <?php
2 /**
3 * Give Settings Page/Tab
4 *
5 * @package Give
6 * @subpackage Classes/Give_Settings_License
7 * @copyright Copyright (c) 2016, GiveWP
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 1.8
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly.
14 }
15
16 if ( ! class_exists( 'Give_Settings_License' ) ) :
17
18 /**
19 * Give_Settings_License.
20 *
21 * @sine 1.8
22 */
23 class Give_Settings_License extends Give_Settings_Page {
24 protected $enable_save = false;
25
26 /**
27 * Constructor.
28 */
29 public function __construct() {
30 $this->id = 'licenses';
31 $this->label = esc_html__( 'Licenses', 'give' );
32
33 parent::__construct();
34
35 // Do not use main form for this tab.
36 if ( give_get_current_setting_tab() === $this->id ) {
37
38 // Remove default parent form.
39 add_action( 'give-settings_open_form', '__return_empty_string' );
40 add_action( 'give-settings_close_form', '__return_empty_string' );
41
42 // Refresh licenses when visit license setting page.
43 give_refresh_licenses();
44 }
45 }
46
47 /**
48 * Get settings array.
49 *
50 * @return array
51 * @since 1.8
52 */
53 public function get_settings() {
54 $settings = array();
55
56 /**
57 * Filter the licenses settings.
58 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
59 */
60 $settings = apply_filters( 'give_settings_licenses', $settings );
61
62 /**
63 * Filter the settings.
64 *
65 * @param array $settings
66 *
67 * @since 1.8
68 */
69 $settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
70
71 // Output.
72 return $settings;
73 }
74
75 /**
76 * Render license key field
77 *
78 * @since 2.5.0
79 */
80 public function output() {
81 ob_start();
82 ?>
83 <div class="give-license-settings-wrap">
84
85 <div class="give-grid-row">
86
87 <div class="give-grid-col-6">
88 <div id="give-license-activator-wrap" class="give-license-top-widget">
89 <div id="give-license-activator-inner">
90
91 <h2 class="give-license-widget-heading">
92 <span class="dashicons dashicons-plugins-checked"></span>
93 <?php _e( 'Activate an Add-on License', 'give' ); ?>
94 </h2>
95
96 <p class="give-field-description">
97 <?php
98 printf(
99 __( 'Enter your license key below to unlock your GiveWP add-ons. You can access your licenses anytime from the <a href="%1$s" target="_blank">My Account</a> section on the GiveWP website. ', 'give' ),
100 Give_License::get_account_url()
101 );
102 ?>
103 </p>
104
105 <form method="post" action="" class="give-license-activation-form">
106
107 <div class="give-license-notices"></div>
108
109 <?php wp_nonce_field( 'give-license-activator-nonce', 'give_license_activator_nonce' ); ?>
110
111 <label
112 for="give-license-activator"
113 class="screen-reader-text">
114 <?php _e( 'Activate License', 'give' ); ?>
115 </label>
116
117 <input
118 id="give-license-activator"
119 type="text"
120 name="give_license_key"
121 placeholder="<?php _e( 'Enter your license key', 'give' ); ?>"
122 />
123
124 <input
125 data-activate="<?php _e( 'Activate License', 'give' ); ?>"
126 data-activating="<?php _e( 'Verifying License...', 'give' ); ?>"
127 value="<?php _e( 'Activate License', 'give' ); ?>"
128 type="submit"
129 class="button button-primary"
130 />
131
132 </form>
133
134 </div>
135 </div>
136 </div><!-- /.give-grid-col-6 -->
137
138 <div class="give-grid-col-6">
139 <div id="give-addon-uploader-wrap" class="give-license-top-widget"
140 ondragover="event.preventDefault()">
141 <div id="give-addon-uploader-inner">
142 <h2 class="give-license-widget-heading">
143 <span class="dashicons dashicons-upload"></span>
144 <?php _e( 'Upload and Activate an Add-on', 'give' ); ?>
145 </h2>
146
147 <?php if ( ! is_multisite() ) : ?>
148
149 <p class="give-field-description">
150 <?php
151 printf(
152 __( 'Drag an add-on zip file below to upload and activate it. Access your downloads by activating a license or via the <a href="%1$s" target="_blank">My Downloads</a> section on the GiveWP website. ', 'give' ),
153 Give_License::get_downloads_url()
154 );
155 ?>
156 </p>
157
158 <?php if ( 'direct' !== get_filesystem_method() ) : ?>
159 <div class="give-notice notice notice-error inline">
160 <p>
161 <?php
162 echo sprintf(
163 __( 'Sorry, you can not upload plugin from here because we do not have direct access to file system. Please <a href="%1$s" target="_blank">click here</a> to upload GiveWP Add-on.', 'give' ),
164 admin_url( 'plugin-install.php?tab=upload' )
165 );
166 ?>
167 </p>
168 </div>
169 <?php else : ?>
170 <div class="give-upload-addon-form-wrap">
171 <form
172 method="post"
173 enctype="multipart/form-data"
174 class="give-upload-addon-form"
175 action="/">
176
177 <div class="give-addon-upload-notices"></div>
178
179 <div class="give-activate-addon-wrap">
180 <p><span
181 class="dashicons dashicons-yes"></span> <?php _e( 'Add-on succesfully uploaded.', 'give' ); ?>
182 </p>
183 <button
184 class="give-activate-addon-btn button-primary"
185 data-activate="<?php _e( 'Activate Add-on', 'give' ); ?>"
186 data-activating="<?php _e( 'Activating Add-on...', 'give' ); ?>"
187 ><?php _e( 'Activate Add-on', 'give' ); ?></button>
188 </div>
189
190 <?php wp_nonce_field( 'give-upload-addon', '_give_upload_addon' ); ?>
191
192 <p class="give-upload-addon-instructions">
193 <?php _e( 'Drag a plugin zip file here to upload', 'give' ); ?><br>
194 <span><?php _e( 'or', 'give' ); ?></span>
195 </p>
196
197 <label for="give-upload-addon-file-select" class="button button-small">
198 <?php _e( 'Select a File', 'give' ); ?>
199 </label>
200
201 <input
202 id="give-upload-addon-file-select"
203 type="file"
204 name="addon"
205 value="<?php _e( 'Select File', 'give' ); ?>"
206 />
207
208 </form>
209 </div>
210 <?php endif; ?>
211 <?php
212 else :
213 printf(
214 __( 'Because of security reasons you can not upload add-ons from here. Please <a href="%1$s" target="_blank">visit network plugin install page</a> to install add-ons.' ),
215 network_admin_url( 'plugin-install.php' )
216 );
217 ?>
218 <?php endif; ?>
219 </div>
220 </div>
221 </div>
222 </div>
223
224 <div class="give-grid-row<?php echo get_option( 'give_licenses', array() ) ? '' : ' give-hidden'; ?>">
225 <div class="give-grid-col-12">
226
227 <div class="give-licenses-list-header give-clearfix">
228 <h2><?php _e( 'Licenses and Add-ons', 'give' ); ?></h2>
229
230 <?php
231 $refresh_status = Give_License::refresh_license_status();
232 $is_allow_refresh = ( $refresh_status['compare'] === date( 'Ymd' ) && 5 > $refresh_status['count'] ) || ( $refresh_status['compare'] < date( 'Ymd' ) );
233 $button_title = __( 'Refresh limit reached. Licenses can only be refreshed 5 times per day.', 'give' );
234 $local_date = strtotime( get_date_from_gmt( date( 'Y-m-d H:i:s', $refresh_status['time'] ) ) );
235 ?>
236
237 <div id="give-refresh-button-wrap">
238 <button id="give-button__refresh-licenses"
239 class="button-secondary"
240 data-activate="<?php _e( 'Refresh All Licenses', 'give' ); ?>"
241 data-activating="<?php _e( 'Refreshing All Licenses...', 'give' ); ?>"
242 data-nonce="<?php echo wp_create_nonce( 'give-refresh-all-licenses' ); ?>"
243 <?php echo $is_allow_refresh ? '' : 'disabled'; ?>
244 <?php echo $is_allow_refresh ? '' : sprintf( 'title="%1$s"', $button_title ); ?>>
245 <?php _e( 'Refresh All Licenses', 'give' ); ?>
246 </button>
247 <span id="give-last-refresh-notice">
248 <?php
249 echo sprintf(
250 __( 'Last refreshed on %1$s at %2$s', 'give' ),
251 date( give_date_format(), $local_date ),
252 date( 'g:i a', $local_date )
253 );
254 ?>
255 </span>
256 </div>
257
258 <hr>
259 <p class="give-field-description"><?php _e( 'The following list displays your add-ons and their corresponding activation and license statuses.', 'give' ); ?></p>
260
261 </div>
262
263 <section id="give-licenses-container">
264 <?php echo Give_License::render_licenses_list(); ?>
265 </section>
266
267 </div>
268 </div>
269 </div>
270
271 <?php
272 echo ob_get_clean();
273 }
274 }
275
276 endif;
277
278 return new Give_Settings_License();
279