Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions includes/license/notice.php

This file was deleted.

18 changes: 11 additions & 7 deletions includes/license/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,25 @@ function render_license_page( $plugin ) {
$license_status = updater\get_license_status( $plugin );

$field_name = $settings_key . '[' . $subfield . ']';
$field_value = $license_status !== updater\license_cleared_and_deactivated
? updater\get_license_key( $plugin )
: '';

$license_key = updater\get_license_key( $plugin );

$field_value = (
$license_status !== updater\license_cleared_and_deactivated
&& !empty($license_key)
) ? $license_key : '';

// License status
$is_valid = $license_status === 'active';
$is_valid = $license_status === 'valid';
$license_status = esc_html( ucfirst($license_status) );
?>
<h3>
License Key &mdash;&nbsp;
License Key
<span class="license-status-indicator">
<?php if ( $is_valid ) : ?>
<span class="valid-license success"><b><?php echo $license_status; ?></b></span>
<span class="valid-license success">&mdash;&nbsp;<b><?php echo $license_status; ?></b></span>
<?php else : ?>
<span class="invalid-license error"><b><?php echo $license_status; ?></b></span>
<span class="invalid-license error">&mdash;&nbsp;<b><?php echo $license_status; ?></b></span>
<?php endif; ?>
</span>
</h3>
Expand Down
4 changes: 2 additions & 2 deletions includes/license/plugins-page-notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
$activation_url = admin_url('options-general.php?page='.$name.'-settings&tab=license');

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

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

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

?>
<tr class="active plugin-update-tr">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ public function removeHooks() {
* @return Puc_v4p11_Plugin_Info
*/
public function requestInfo($queryArgs = array()) {

list($pluginInfo, $result) = $this->requestMetadata('Puc_v4p11_Plugin_Info', 'request_info', $queryArgs);

try {
// Set status using updater
$responseBody = wp_remote_retrieve_body($result);
$data = json_decode($responseBody, true);

if (!empty($data['status'] && $data['status'] === 'expired')) {
updater\set_license_status($this->slug, $data['status']);
if (!empty($data['status'])) {
updater\set_license_status($this->slug, $data['status']);
}
} catch(Exception $e) {
// Continue
Expand Down