PluginProbe
Polylang / 3.1
Polylang v3.1
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | include/license.php +65 -9 2.93.1 View file →
@@ -8,10 +8,62 @@
8 8 *
9 9 * @since 1.9
10 10 */
11 11 class PLL_License {
12 - public $id, $name, $license_key, $license_data;
13 - private $file, $version, $author;
12 + /**
13 + * Sanitized plugin name.
14 + *
15 + * @var string
16 + */
17 + public $id;
18 +
19 + /**
20 + * Plugin name.
21 + *
22 + * @var string
23 + */
24 + public $name;
25 +
26 + /**
27 + * License key.
28 + *
29 + * @var string
30 + */
31 + public $license_key;
32 +
33 + /**
34 + * License data, obtained from the API request.
35 + *
36 + * @var stdClass
37 + */
38 + public $license_data;
39 +
40 + /**
41 + * Main plugin file.
42 + *
43 + * @var string
44 + */
45 + private $file;
46 +
47 + /**
48 + * Current plugin version.
49 + *
50 + * @var string
51 + */
52 + private $version;
53 +
54 + /**
55 + * Plugin author.
56 + *
57 + * @var string
58 + */
59 + private $author;
60 +
61 + /**
62 + * API url.
63 + *
64 + * @var string.
65 + */
14 66 private $api_url = 'https://polylang.pro';
15 67
16 68 /**
17 69 * Constructor
@@ -56,8 +108,10 @@
56 108 /**
57 109 * Auto updater
58 110 *
59 111 * @since 1.9
112 + *
113 + * @return void
60 114 */
61 115 public function auto_updater() {
62 116 $args = array(
63 117 'version' => $this->version,
@@ -131,8 +185,9 @@
131 185 *
132 186 * @since 1.9
133 187 *
134 188 * @param string $request check_license | activate_license | deactivate_license
189 + * @return void
135 190 */
136 191 private function api_request( $request ) {
137 192 $licenses = get_option( 'polylang_licenses' );
138 193
@@ -190,13 +245,14 @@
190 245 if ( ! empty( $this->license_data ) ) {
191 246 $license = $this->license_data;
192 247 }
193 248
194 - $class = 'license-null';
249 + $class = 'license-null';
250 + $message = '';
195 251
196 252 $out = sprintf(
197 253 '<td><label for="pll-licenses[%1$s]">%2$s</label></td>' .
198 - '<td><input name="licenses[%1$s]" id="pll-licenses[%1$s]" type="text" value="%3$s" class="regular-text code" />',
254 + '<td><input name="licenses[%1$s]" id="pll-licenses[%1$s]" type="password" value="%3$s" class="regular-text code" />',
199 255 esc_attr( $this->id ),
200 256 esc_attr( $this->name ),
201 257 esc_html( $this->license_key )
202 258 );
@@ -219,9 +275,9 @@
219 275 $message = sprintf(
220 276 /* translators: %1$s is a date, %2$s is link start tag, %3$s is link end tag. */
221 277 esc_html__( 'Your license key expired on %1$s. Please %2$srenew your license key%3$s.', 'polylang' ),
222 278 esc_html( date_i18n( get_option( 'date_format' ), $expiration ) ),
223 - sprintf( '<a href="%s" target="_blank">', esc_url( 'https://polylang.pro/checkout/?edd_license_key=' . $this->license_key ) ),
279 + sprintf( '<a href="%s" target="_blank">', 'https://polylang.pro/account/' ),
224 280 '</a>'
225 281 );
226 282 break;
227 283
@@ -233,9 +289,9 @@
233 289 case 'missing':
234 290 $message = sprintf(
235 291 /* translators: %1$s is link start tag, %2$s is link end tag. */
236 292 esc_html__( 'Invalid license. Please %1$svisit your account page%2$s and verify it.', 'polylang' ),
237 - sprintf( '<a href="%s" target="_blank">', 'https://polylang.pro/account' ),
293 + sprintf( '<a href="%s" target="_blank">', 'https://polylang.pro/account/' ),
238 294 '</a>'
239 295 );
240 296 break;
241 297
@@ -244,9 +300,9 @@
244 300 $message = sprintf(
245 301 /* translators: %1$s is a product name, %2$s is link start tag, %3$s is link end tag. */
246 302 esc_html__( 'Your %1$s license key is not active for this URL. Please %2$svisit your account page%3$s to manage your license key URLs.', 'polylang' ),
247 303 esc_html( $this->name ),
248 - sprintf( '<a href="%s" target="_blank">', 'https://polylang.pro/account' ),
304 + sprintf( '<a href="%s" target="_blank">', 'https://polylang.pro/account/' ),
249 305 '</a>'
250 306 );
251 307 break;
252 308
@@ -258,9 +314,9 @@
258 314 case 'no_activations_left':
259 315 $message = sprintf(
260 316 /* translators: %1$s is link start tag, %2$s is link end tag */
261 317 esc_html__( 'Your license key has reached its activation limit. %1$sView possible upgrades%2$s now.', 'polylang' ),
262 - sprintf( '<a href="%s" target="_blank">', 'https://polylang.pro/account' ),
318 + sprintf( '<a href="%s" target="_blank">', 'https://polylang.pro/account/' ),
263 319 '</a>'
264 320 );
265 321 break;
266 322 }
@@ -276,9 +332,9 @@
276 332 $message = sprintf(
277 333 /* translators: %1$s is a date, %2$s is link start tag, %3$s is link end tag. */
278 334 esc_html__( 'Your license key will expire soon! Precisely, it will expire on %1$s. %2$sRenew your license key today!%3$s.', 'polylang' ),
279 335 esc_html( date_i18n( get_option( 'date_format' ), $expiration ) ),
280 - sprintf( '<a href="%s" target="_blank">', esc_url( 'https://polylang.pro/checkout/?edd_license_key=' . $this->license_key ) ),
336 + sprintf( '<a href="%s" target="_blank">', 'https://polylang.pro/account/' ),
281 337 '</a>'
282 338 );
283 339 } else {
284 340 $message = sprintf(