Skip to content

Commit 4d16723

Browse files
authored
Merge pull request #15 from TangibleInc/feature/cloud - Fix issue with the status
2 parents 56a8903 + a67e8c0 commit 4d16723

File tree

4 files changed

+16
-81
lines changed

4 files changed

+16
-81
lines changed

includes/license/notice.php

Lines changed: 0 additions & 69 deletions
This file was deleted.

includes/license/page.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,25 @@ function render_license_page( $plugin ) {
1717
$license_status = updater\get_license_status( $plugin );
1818

1919
$field_name = $settings_key . '[' . $subfield . ']';
20-
$field_value = $license_status !== updater\license_cleared_and_deactivated
21-
? updater\get_license_key( $plugin )
22-
: '';
20+
21+
$license_key = updater\get_license_key( $plugin );
22+
23+
$field_value = (
24+
$license_status !== updater\license_cleared_and_deactivated
25+
&& !empty($license_key)
26+
) ? $license_key : '';
2327

2428
// License status
25-
$is_valid = $license_status === 'active';
29+
$is_valid = $license_status === 'valid';
2630
$license_status = esc_html( ucfirst($license_status) );
2731
?>
2832
<h3>
29-
License Key &mdash;&nbsp;
33+
License Key
3034
<span class="license-status-indicator">
3135
<?php if ( $is_valid ) : ?>
32-
<span class="valid-license success"><b><?php echo $license_status; ?></b></span>
36+
<span class="valid-license success">&mdash;&nbsp;<b><?php echo $license_status; ?></b></span>
3337
<?php else : ?>
34-
<span class="invalid-license error"><b><?php echo $license_status; ?></b></span>
38+
<span class="invalid-license error">&mdash;&nbsp;<b><?php echo $license_status; ?></b></span>
3539
<?php endif; ?>
3640
</span>
3741
</h3>

includes/license/plugins-page-notice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
$activation_url = admin_url('options-general.php?page='.$name.'-settings&tab=license');
1616

1717
// Only show if license is missing or invalid
18-
if (!empty($license) && $license_status === 'valid') return;
18+
if ( !empty($license) && ($license_status === 'valid' || $license_status === 'active')) return;
1919

2020
$plugin->plugin_row_enqueued [] = $name . '/' . $name . '.php';
2121

2222
$message = empty($license)
2323
? __('License key is missing - please activate your license for plugin updates and support.', $name)
24-
: __('License key is invalid or expired - please renew your license for plugin updates and support.', $name);
24+
: __('License key is '.$license_status.' - please renew your license for plugin updates and support.', $name);
2525

2626
?>
2727
<tr class="active plugin-update-tr">

includes/plugin-update-checker/Puc/v4p11/Plugin/UpdateChecker.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ public function removeHooks() {
129129
* @return Puc_v4p11_Plugin_Info
130130
*/
131131
public function requestInfo($queryArgs = array()) {
132+
132133
list($pluginInfo, $result) = $this->requestMetadata('Puc_v4p11_Plugin_Info', 'request_info', $queryArgs);
133134

134135
try {
135136
// Set status using updater
136137
$responseBody = wp_remote_retrieve_body($result);
137138
$data = json_decode($responseBody, true);
138-
139-
if (!empty($data['status'] && $data['status'] === 'expired')) {
140-
updater\set_license_status($this->slug, $data['status']);
139+
if (!empty($data['status'])) {
140+
updater\set_license_status($this->slug, $data['status']);
141141
}
142142
} catch(Exception $e) {
143143
// Continue

0 commit comments

Comments
 (0)