mirror of
https://ghproxy.net/https://github.com/michelve/software-license-manager.git
synced 2025-10-04 02:06:37 +08:00
6.1.0
This commit is contained in:
parent
c6e05d556b
commit
cd2212eccf
37 changed files with 3324 additions and 4495 deletions
|
@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
|
|||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
Software License Manager Copyright (C) 2020 Michel Velis
|
||||
SLM Plus Copyright (C) 2020 Michel Velis
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
|
18
README.md
18
README.md
|
@ -2,7 +2,7 @@
|
|||
|
||||
|
||||
|
||||
# Welcome to software license manager 👋
|
||||
# Welcome to SLM Plus 👋
|
||||
|
||||

|
||||
[](https://documenter.getpostman.com/view/307939/6tjU1FL?version=latest)
|
||||
|
@ -78,23 +78,23 @@ Changelog: [View changelog](https://github.com/michelve/software-license-manager
|
|||
|
||||
## 🎑 Screenshots
|
||||
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/dashboard.png?raw=true" width="800" alt="Software License Manager" />
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/dashboard.png?raw=true" width="800" alt="SLM Plus" />
|
||||
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/overview-filters.png?raw=true" width="800" alt="Software License Manager" />
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/overview-filters.png?raw=true" width="800" alt="SLM Plus" />
|
||||
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/overview.png?raw=true" width="800" alt="Software License Manager" />
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/overview.png?raw=true" width="800" alt="SLM Plus" />
|
||||
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/screen%20options.png?raw=true" width="800" alt="Software License Manager" />
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/screen%20options.png?raw=true" width="800" alt="SLM Plus" />
|
||||
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/subscribers-results.png?raw=true" width="800" alt="Software License Manager" />
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/subscribers-results.png?raw=true" width="800" alt="SLM Plus" />
|
||||
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/subscribers.png?raw=true" width="800"/>
|
||||
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/add-key.png?raw=true" width="800" alt="Software License Manager" />
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/add-key.png?raw=true" width="800" alt="SLM Plus" />
|
||||
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/export.png?raw=true" width="800" alt="Software License Manager" />
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/master/public/assets/images/previews/export.png?raw=true" width="800" alt="SLM Plus" />
|
||||
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/1bf014b84300ba58e7ce614c25f9976c7fab6cb1/public/assets/images/previews/my-account-lics-opened.png" alt="Software License Manager" width="800" />
|
||||
<img src="https://raw.githubusercontent.com/michelve/software-license-manager/1bf014b84300ba58e7ce614c25f9976c7fab6cb1/public/assets/images/previews/my-account-lics-opened.png" alt="SLM Plus" width="800" />
|
||||
|
||||
## 📝 License
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="info"> <span class="badge"> <?php echo SLM_Utility::get_total_licenses(); ?></span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Total licenses', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Total licenses', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
|||
<div class="info"> <span class="badge"> <?php echo SLM_Utility::getstats_licenses('date_created', 7); ?></span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Licenses this week', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Licenses this week', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
|||
<div class="info"> <span class="badge"> <?php echo SLM_Utility::getstats_licenses('date_created', 31); ?></span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Licenses this month', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Licenses this month', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
|||
<div class="info"> <span class="badge"><?php echo SLM_Utility::count_licenses('active'); ?> </span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Active licenses', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Active licenses', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
|||
<div class="info"> <span class="badge"><?php echo SLM_Utility::count_licenses('pending '); ?></span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Pending licenses', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Pending licenses', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -55,7 +55,7 @@
|
|||
<div class="info"> <span class="badge"><?php echo SLM_Utility::count_licenses('blocked '); ?></span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Blocked licenses', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Blocked licenses', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
|||
<div class="info"> <span class="badge"><?php echo SLM_Utility::count_logrequest(); ?></span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Logs saved', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Logs saved', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
|||
<div class="info"> <span class="badge"><?php echo SLM_Utility::count_emailsent(); ?></span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Reminders sent', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Reminders sent', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -85,7 +85,7 @@
|
|||
<div class="info"> <span class="badge"><?php echo SLM_Utility::count_licenses('expired'); ?></span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Expired licenses', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Expired licenses', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
@ -95,7 +95,7 @@
|
|||
<div class="info"> <span class="badge"> <?php echo SLM_Utility::get_lic_expiringsoon(); ?></span></div>
|
||||
</div>
|
||||
<div class="description">
|
||||
<span><?php _e('Licenses about to expire', 'softwarelicensemanager');?></span>
|
||||
<span><?php _e('Licenses about to expire', 'slmplus');?></span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -188,7 +188,7 @@ function slm_estore_product_configuration_html($product_config_html, $prod_id)
|
|||
}
|
||||
}
|
||||
|
||||
$product_config_html .= '<div class="msg_head">Software License Manager Plugin (Click to Expand)</div><div class="msg_body"><table class="form-table">';
|
||||
$product_config_html .= '<div class="msg_head">SLM Plus Plugin (Click to Expand)</div><div class="msg_body"><table class="form-table">';
|
||||
|
||||
$product_config_html .= '<tr valign="top"><th scope="row">Maximum Allowed Domains</th><td>';
|
||||
$product_config_html .= '<input name="slm_max_allowed_domains" type="text" id="slm_max_allowed_domains" value="' . $slm_max_allowed_domains . '" size="10" />';
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -6,18 +6,18 @@ if (!defined('WPINC')) {
|
|||
|
||||
function slm_admin_tools_menu()
|
||||
{
|
||||
if (isset($_POST['slm_backup_db'])) {
|
||||
slm_save_backup_to_uploads();
|
||||
}
|
||||
|
||||
echo '<div class="wrap">';
|
||||
echo '<h2 class="imgh2"><img src="' . SLM_ASSETS_URL . 'images/slm_logo.svg" alt="slm logo">'. __('Admin Tools', 'softwarelicensemanager').'</h2>';
|
||||
echo '<h2 class="imgh2">'. __('Admin Tools', 'slmplus') . '</h2>';
|
||||
echo '<div id="poststuff"><div id="post-body">';
|
||||
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
|
||||
if (isset($_POST['send_deactivation_request'])) {
|
||||
$postURL = $_POST['slm_deactivation_req_url'];
|
||||
$secretKeyForVerification = $slm_options['lic_verification_secret'];
|
||||
$data = array();
|
||||
$data['secret_key'] = $secretKeyForVerification;
|
||||
$postURL = esc_url_raw($_POST['slm_deactivation_req_url']);
|
||||
$secretKeyForVerification = slm_get_option('lic_verification_secret');
|
||||
$data = array('secret_key' => $secretKeyForVerification);
|
||||
|
||||
$ch = curl_init($postURL);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
|
@ -27,51 +27,170 @@ function slm_admin_tools_menu()
|
|||
|
||||
$msg = "";
|
||||
if ($returnValue == "Success") {
|
||||
$msg .= "Success message returned from the remote host.";
|
||||
$msg .= __('Success message returned from the remote host.', 'slmplus');
|
||||
}
|
||||
echo '<div id="message" class="updated fade"><p>';
|
||||
echo 'Request sent to the specified URL!';
|
||||
echo '<br />' . $msg;
|
||||
echo __('Request sent to the specified URL!', 'slmplus');
|
||||
echo '<br />' . esc_html($msg);
|
||||
echo '</p></div>';
|
||||
}
|
||||
|
||||
if (isset($_POST['slm_clear_log'])) {
|
||||
global $wpdb, $slm_debug_logger;
|
||||
$table = SLM_TBL_LIC_LOG;
|
||||
$slm_log_clean = $wpdb->query("TRUNCATE TABLE $table");
|
||||
$slm_logger = new SLM_Debug_Logger();
|
||||
$wpdb->query("TRUNCATE TABLE $table");
|
||||
$slm_debug_logger->reset_log_file("log.txt");
|
||||
$slm_debug_logger->reset_log_file("log-cron-job.txt");
|
||||
echo '<div id="message" class="updated fade"><p> Log was cleared succesfully!</p></div>';
|
||||
|
||||
echo '<div id="message" class="updated fade"><p>' . esc_html__('Log was cleared successfully!', 'slmplus') . '</p></div>';
|
||||
}
|
||||
?>
|
||||
|
||||
?>
|
||||
<br />
|
||||
<div class="postbox">
|
||||
<h3 class="hndle"><label for="title"><?php _e('Send Deactivation Message for a License', 'softwarelicensemanager'); ?></label></h3>
|
||||
<h3 class="hndle"><label for="title"><?php _e('Send Deactivation Message for a License', 'slmplus'); ?></label></h3>
|
||||
<div class="inside">
|
||||
<br /><strong><?php _e('Enter the URL where the license deactivation message will be sent to', 'softwarelicensemanager'); ?></strong>
|
||||
<br /><br />
|
||||
<form method="post" action="">
|
||||
|
||||
<input name="slm_deactivation_req_url" type="text" size="100" value="<?php isset($_POST['slm_deactivation_req_url']) ? $_POST['slm_deactivation_req_url'] : ''; ?>" />
|
||||
<input name="slm_deactivation_req_url" type="text" size="100" value="<?php echo esc_attr($_POST['slm_deactivation_req_url'] ?? ''); ?>" />
|
||||
<div class="submit">
|
||||
<input type="submit" name="send_deactivation_request" value="Send Request" class="button" />
|
||||
<input type="submit" name="send_deactivation_request" value="<?php _e('Send Request', 'slmplus'); ?>" class="button" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="postbox">
|
||||
<h3 class="hndle"><label for="title"><?php _e('Clean activity log', 'softwarelicensemanager'); ?></label></h3>
|
||||
<h3 class="hndle"><label for="title"><?php _e('Clean Activity Log', 'slmplus'); ?></label></h3>
|
||||
<div class="inside">
|
||||
<p><?php _e('This will clear/reset license keys activities', 'softwarelicensemanager'); ?></p>
|
||||
<p><?php _e('This will clear/reset license keys activities', 'slmplus'); ?></p>
|
||||
<form method="post" action="">
|
||||
<div class="submit">
|
||||
<input type="submit" name="slm_clear_log" value="Clear Log" class="button" />
|
||||
<input type="submit" name="slm_clear_log" value="<?php _e('Clear Log', 'slmplus'); ?>" class="button" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
<div class="postbox">
|
||||
<h3 class="hndle"><label for="title"><?php _e('Backup Database', 'slmplus'); ?></label></h3>
|
||||
<div class="inside">
|
||||
<p><?php _e('This will create a backup of the database tables related to this plugin and save it to the uploads directory.', 'slmplus'); ?></p>
|
||||
<form method="post" action="">
|
||||
<div class="submit">
|
||||
<input type="submit" name="slm_backup_db" value="<?php _e('Create Backup', 'slmplus'); ?>" class="button" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
// Display latest backup link if available
|
||||
$backup_info = slm_get_option('slm_last_backup_info');
|
||||
if (!empty($backup_info)) {
|
||||
$backup_url = esc_url($backup_info['url']);
|
||||
$backup_date = esc_html($backup_info['date']);
|
||||
echo '<p>' . __('Last backup created on: ', 'slmplus') . $backup_date . ' - <a href="' . $backup_url . '">' . __('Download Backup', 'slmplus') . '</a></p>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
echo '</div></div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates or retrieves a unique hash for the backup directory.
|
||||
*/
|
||||
function slm_get_unique_hash()
|
||||
{
|
||||
$hash = slm_get_option('slm_backup_dir_hash');
|
||||
|
||||
if (!$hash) {
|
||||
$hash = wp_generate_password(8, false, false); // Generate random 8-character hash
|
||||
slm_update_option('slm_backup_dir_hash', $hash);
|
||||
}
|
||||
|
||||
return $hash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a backup of the plugin's database tables in a secure folder.
|
||||
*/
|
||||
function slm_save_backup_to_uploads()
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
// Get the upload directory
|
||||
$upload_dir = wp_upload_dir();
|
||||
$unique_hash = slm_get_unique_hash(); // Generate or retrieve the unique hash
|
||||
$slm_backup_dir = $upload_dir['basedir'] . $unique_hash;
|
||||
|
||||
// Create the slm-plus folder with hash if it doesn't exist
|
||||
if (!file_exists($slm_backup_dir)) {
|
||||
wp_mkdir_p($slm_backup_dir);
|
||||
}
|
||||
|
||||
// Set backup file name and path
|
||||
$backup_file = $slm_backup_dir . '/slm_plugin_backup_' . date('Y-m-d_H-i-s') . '.sql';
|
||||
|
||||
// Get plugin tables
|
||||
$backup_tables = [
|
||||
SLM_TBL_LICENSE_KEYS,
|
||||
SLM_TBL_LIC_DOMAIN,
|
||||
SLM_TBL_LIC_DEVICES,
|
||||
SLM_TBL_LIC_LOG,
|
||||
SLM_TBL_EMAILS,
|
||||
SLM_TBL_LICENSE_STATUS
|
||||
];
|
||||
|
||||
$sql = "";
|
||||
foreach ($backup_tables as $table) {
|
||||
// Get table structure
|
||||
$create_table_query = $wpdb->get_results("SHOW CREATE TABLE $table", ARRAY_N);
|
||||
$sql .= "\n\n" . $create_table_query[0][1] . ";\n\n";
|
||||
|
||||
// Get table data
|
||||
$rows = $wpdb->get_results("SELECT * FROM $table", ARRAY_A);
|
||||
foreach ($rows as $row) {
|
||||
$values = array_map('esc_sql', array_values($row)); // Use esc_sql to escape the values
|
||||
$values = "'" . implode("','", $values) . "'";
|
||||
$sql .= "INSERT INTO $table VALUES ($values);\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Save the SQL to a file in the slm-plus folder
|
||||
if (file_put_contents($backup_file, $sql)) {
|
||||
$backup_url = $upload_dir['baseurl'] . $unique_hash . '/' . basename($backup_file);
|
||||
|
||||
// Save backup info in plugin options
|
||||
$backup_info = [
|
||||
'url' => $backup_url,
|
||||
'date' => date('Y-m-d H:i:s')
|
||||
];
|
||||
slm_update_option('slm_last_backup_info', $backup_info);
|
||||
|
||||
echo '<div class="notice notice-success"><p>' . __('Backup created successfully! Download from: ', 'slmplus') . '<a href="' . esc_url($backup_url) . '">' . esc_html(basename($backup_file)) . '</a></p></div>';
|
||||
} else {
|
||||
echo '<div class="notice notice-error"><p>' . __('Error: Failed to create the backup file.', 'slmplus') . '</p></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves an option from the slm_plugin_options.
|
||||
*/
|
||||
function slm_get_option($key)
|
||||
{
|
||||
$options = get_option('slm_plugin_options', []);
|
||||
return $options[$key] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates or adds an option to the slm_plugin_options.
|
||||
*/
|
||||
function slm_update_option($key, $value)
|
||||
{
|
||||
$options = get_option('slm_plugin_options', []);
|
||||
$options[$key] = $value;
|
||||
update_option('slm_plugin_options', $options);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ function slm_add_dashboard_widgets()
|
|||
|
||||
wp_add_dashboard_widget(
|
||||
'slm_dashboard_widget', // Widget slug.
|
||||
'Software license manager', // Title.
|
||||
'SLM Plus', // Title.
|
||||
'slm_dashboard_widget_function' // Display function.
|
||||
);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ function slm_add_dashboard_widgets()
|
|||
function add_toolbar_items($admin_bar){
|
||||
$admin_bar->add_menu(array(
|
||||
'id' => 'slm-menu',
|
||||
'title' => '<span class="ab-icon"></span>' . __('SLM', 'softwarelicensemanager'),
|
||||
'title' => '<span class="ab-icon"></span>' . __('SLM', 'slmplus'),
|
||||
'href' => admin_url('admin.php?page=slm_overview'),
|
||||
'meta' => array(
|
||||
'title' => __('SLM'),
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
|
||||
if (!defined('WPINC')) {
|
||||
die;
|
||||
die; // Security measure to prevent direct access
|
||||
}
|
||||
|
||||
function slm_integration_help_menu()
|
||||
{
|
||||
?>
|
||||
|
||||
<h2>License Manager Integration Help v <?php SLM_VERSION; ?></h2>
|
||||
<h2><?php echo esc_html__('License Manager Integration Help', 'slmplus'); ?> v <?php echo esc_html(SLM_VERSION); ?></h2>
|
||||
|
||||
<style>
|
||||
pre {
|
||||
|
@ -28,144 +28,151 @@ function slm_integration_help_menu()
|
|||
color: #212529;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="slm-postbox set-pd">
|
||||
<h3>API Settings</h3>
|
||||
<h3><?php echo esc_html__('API Settings', 'slmplus'); ?></h3>
|
||||
<div class="inside">
|
||||
<?php
|
||||
$options = get_option('slm_plugin_options');
|
||||
$creation_secret_key = $options['lic_creation_secret'];
|
||||
$secret_verification_key = $options['lic_verification_secret'];
|
||||
$api_query_post_url = SLM_SITE_HOME_URL;
|
||||
echo "<br><strong>The License API Query POST URL For Your Installation</strong>";
|
||||
echo '<br><div class="slm_code"> <input style="width: 500px" type="text" value="' . $api_query_post_url . '"></div>';
|
||||
echo "<br><strong>The License Activation or Deactivation API secret key</strong>";
|
||||
echo '<br><div class="slm_code"><input style="width: 500px" type="text" value="' . $secret_verification_key . '"></div>';
|
||||
echo "<br><strong>The License Creation API secret key</strong>";
|
||||
echo '<br><div class="slm_code"><input style="width: 500px" type="text" value="' . $creation_secret_key . '"></div>';
|
||||
?>
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
$slm_creation_secret_key = esc_attr($slm_options['lic_creation_secret']);
|
||||
$slm_secret_verification_key = esc_attr($slm_options['lic_verification_secret']);
|
||||
$slm_api_query_post_url = esc_url(SLM_SITE_HOME_URL);
|
||||
|
||||
echo "<br><strong>" . esc_html__('The License API Query POST URL For Your Installation', 'slmplus') . "</strong>";
|
||||
echo '<br><div class="slm_code"> <input style="width: 500px" type="text" value="' . $slm_api_query_post_url . '" readonly /></div>';
|
||||
|
||||
echo "<br><strong>" . esc_html__('The License Activation or Deactivation API Secret Key', 'slmplus') . "</strong>";
|
||||
echo '<br><div class="slm_code"><input style="width: 500px" type="text" value="' . $slm_secret_verification_key . '" readonly /></div>';
|
||||
|
||||
echo "<br><strong>" . esc_html__('The License Creation API Secret Key', 'slmplus') . "</strong>";
|
||||
echo '<br><div class="slm_code"><input style="width: 500px" type="text" value="' . $slm_creation_secret_key . '" readonly /></div>';
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>Documentation and guides: <a href="https://documenter.getpostman.com/view/307939/6tjU1FL?version=latest">check out postman demos</a></p>
|
||||
<p><?php echo esc_html__('Documentation and guides:', 'slmplus'); ?>
|
||||
<a href="https://documenter.getpostman.com/view/307939/6tjU1FL?version=latest" target="_blank"><?php echo esc_html__('Check out Postman demos', 'slmplus'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="error_codes">
|
||||
<h3>Error codes and constants</h3>
|
||||
<h3><?php echo esc_html__('Error Codes and Descriptions', 'slmplus'); ?></h3>
|
||||
|
||||
<table class="slm-lic-erro-code">
|
||||
<table class="slm-lic-error-code">
|
||||
<thead>
|
||||
<td><strong>Constant</strong></td>
|
||||
<td><strong>Error code</strong></td>
|
||||
<tr>
|
||||
<td><strong><?php echo esc_html__('Constant', 'slmplus'); ?></strong></td>
|
||||
<td><strong><?php echo esc_html__('Error Code', 'slmplus'); ?></strong></td>
|
||||
<td><strong><?php echo esc_html__('Description', 'slmplus'); ?></strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tr>
|
||||
<td>CREATE_FAILED</td>
|
||||
<td>10</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CREATE_KEY_INVALID</td>
|
||||
<td>100</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DOMAIN_ALREADY_INACTIVE </td>
|
||||
<td>80</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DOMAIN_MISSING </td>
|
||||
<td>70</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_CANCELED </td>
|
||||
<td>130</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_CANCELED_FAILED </td>
|
||||
<td>140</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DEACTIVATE_DOMAIN_SUCCESS </td>
|
||||
<td>360</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DEACTIVATE_SUCCESS </td>
|
||||
<td>340</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DELETE_FAILED </td>
|
||||
<td>300</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DELETE_SUCCESS</td>
|
||||
<td>320</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DELETED </td>
|
||||
<td>130</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_UPDATE_FAILED </td>
|
||||
<td>220</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_UPDATE_SUCCESS</td>
|
||||
<td>240</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_ACTIVATED </td>
|
||||
<td>380</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_BLOCKED</td>
|
||||
<td>20</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_CREATED</td>
|
||||
<td>400</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_EXIST</td>
|
||||
<td>200</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_EXPIRED</td>
|
||||
<td>30</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_IN_USE </td>
|
||||
<td>40</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_INVALID</td>
|
||||
<td>60</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MISSING_KEY_DELETE_FAILED </td>
|
||||
<td>280</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MISSING_KEY_UPDATE_FAILED </td>
|
||||
<td>260</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>REACHED_MAX_DEVICES </td>
|
||||
<td>120</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>REACHED_MAX_DOMAINS </td>
|
||||
<td>50</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>VERIFY_KEY_INVALID</td>
|
||||
<td>90</td>
|
||||
</tr>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>CREATE_FAILED</td><td>10</td>
|
||||
<td><?php echo esc_html__('The license creation failed due to an unknown error.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CREATE_KEY_INVALID</td><td>100</td>
|
||||
<td><?php echo esc_html__('The license key provided during creation is invalid.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DOMAIN_ALREADY_INACTIVE</td><td>80</td>
|
||||
<td><?php echo esc_html__('The domain associated with this license is already inactive.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DOMAIN_MISSING</td><td>70</td>
|
||||
<td><?php echo esc_html__('The domain information is missing in the request.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_CANCELED</td><td>130</td>
|
||||
<td><?php echo esc_html__('The license key has been canceled.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_CANCELED_FAILED</td><td>140</td>
|
||||
<td><?php echo esc_html__('Failed to cancel the license key.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DEACTIVATE_DOMAIN_SUCCESS</td><td>360</td>
|
||||
<td><?php echo esc_html__('Successfully deactivated the license key for the specified domain.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DEACTIVATE_SUCCESS</td><td>340</td>
|
||||
<td><?php echo esc_html__('The license key was successfully deactivated.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DELETE_FAILED</td><td>300</td>
|
||||
<td><?php echo esc_html__('Failed to delete the license key.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DELETE_SUCCESS</td><td>320</td>
|
||||
<td><?php echo esc_html__('The license key was successfully deleted.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_DELETED</td><td>130</td>
|
||||
<td><?php echo esc_html__('The license key has been deleted.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_UPDATE_FAILED</td><td>220</td>
|
||||
<td><?php echo esc_html__('Failed to update the license key details.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KEY_UPDATE_SUCCESS</td><td>240</td>
|
||||
<td><?php echo esc_html__('The license key was successfully updated.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_ACTIVATED</td><td>380</td>
|
||||
<td><?php echo esc_html__('The license key was successfully activated.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_BLOCKED</td><td>20</td>
|
||||
<td><?php echo esc_html__('The license key has been blocked from further use.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_CREATED</td><td>400</td>
|
||||
<td><?php echo esc_html__('The license key was successfully created.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_EXIST</td><td>200</td>
|
||||
<td><?php echo esc_html__('The license key already exists in the system.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_EXPIRED</td><td>30</td>
|
||||
<td><?php echo esc_html__('The license key has expired.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_IN_USE</td><td>40</td>
|
||||
<td><?php echo esc_html__('The license key is already in use on another domain or device.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LICENSE_INVALID</td><td>60</td>
|
||||
<td><?php echo esc_html__('The license key is invalid.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MISSING_KEY_DELETE_FAILED</td><td>280</td>
|
||||
<td><?php echo esc_html__('Failed to delete the license key because it was not found.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MISSING_KEY_UPDATE_FAILED</td><td>260</td>
|
||||
<td><?php echo esc_html__('Failed to update the license key because it was not found.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>REACHED_MAX_DEVICES</td><td>120</td>
|
||||
<td><?php echo esc_html__('The license key has reached its maximum allowable devices.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>REACHED_MAX_DOMAINS</td><td>50</td>
|
||||
<td><?php echo esc_html__('The license key has reached its maximum allowable domains.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>VERIFY_KEY_INVALID</td><td>90</td>
|
||||
<td><?php echo esc_html__('The key verification failed due to an invalid key.', 'slmplus'); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
|
|
@ -15,94 +15,71 @@ function slm_general_settings()
|
|||
<?php
|
||||
|
||||
if (isset($_REQUEST['slm_reset_log'])) {
|
||||
$slm_logger = new SLM_Debug_Logger();
|
||||
global $slm_debug_logger;
|
||||
$slm_debug_logger->reset_log_file("log.txt");
|
||||
$slm_debug_logger->reset_log_file("log-cron-job.txt");
|
||||
echo '<div id="message" class="updated fade"><p>
|
||||
' . __('Debug log files have been reset!', 'softwarelicensemanager') . '
|
||||
</p></div>';
|
||||
|
||||
echo '<div id="message" class="updated fade"><p>' . __('Debug log files have been reset!', 'slmplus') . '</p></div>';
|
||||
}
|
||||
|
||||
if (isset($_POST['slm_save_settings'])) {
|
||||
|
||||
if (!is_numeric($_POST["default_max_domains"])) {
|
||||
//Set it to one by default if incorrect value is entered
|
||||
$_POST["default_max_domains"] = '2';
|
||||
}
|
||||
if (!is_numeric($_POST["default_max_devices"])) {
|
||||
//Set it to one by default if incorrect value is entered
|
||||
$_POST["default_max_devices"] = '2';
|
||||
}
|
||||
// Sanitize and validate numeric values for default max domains and devices
|
||||
$default_max_domains = max((int) $_POST['default_max_domains'], 2);
|
||||
$default_max_devices = max((int) $_POST['default_max_devices'], 2);
|
||||
|
||||
$options = array(
|
||||
'lic_creation_secret' => trim($_POST["lic_creation_secret"]),
|
||||
'lic_prefix' => trim($_POST["lic_prefix"]),
|
||||
'default_max_domains' => trim($_POST["default_max_domains"]),
|
||||
'default_max_devices' => trim($_POST["default_max_devices"]),
|
||||
'lic_verification_secret' => trim($_POST["lic_verification_secret"]),
|
||||
'enable_auto_key_expiration' => isset($_POST['enable_auto_key_expiration']) ? '1' : '',
|
||||
'enable_debug' => isset($_POST['enable_debug']) ? '1' : '',
|
||||
'slm_woo' => isset($_POST['slm_woo']) ? '1' : '',
|
||||
'slm_woo_downloads' => isset($_POST['slm_woo_downloads']) ? '1' : '',
|
||||
'slm_woo_affect_downloads' => isset($_POST['slm_woo_affect_downloads']) ? '1' : '',
|
||||
'slm_stats' => isset($_POST['slm_stats']) ? '1' : '',
|
||||
'slm_adminbar' => isset($_POST['slm_adminbar']) ? '1' : '',
|
||||
'slm_conflictmode' => isset($_POST['slm_conflictmode']) ? '1' : '',
|
||||
'slm_front_conflictmode' => isset($_POST['slm_front_conflictmode']) ? '1' : '',
|
||||
'slm_wpestores' => isset($_POST['slm_wpestores']) ? '1' : '',
|
||||
'slm_dl_manager' => isset($_POST['slm_dl_manager']) ? '1' : '',
|
||||
'slm_multiple_items' => isset($_POST['slm_multiple_items']) ? '1' : '',
|
||||
'allow_user_activation_removal' => isset($_POST['allow_user_activation_removal']) ? '1' : '',
|
||||
'expiration_reminder_text' => sanitize_text_field($_POST['expiration_reminder_text'])
|
||||
'lic_creation_secret' => trim($_POST['lic_creation_secret']),
|
||||
'lic_prefix' => trim($_POST['lic_prefix']),
|
||||
'default_max_domains' => $default_max_domains,
|
||||
'default_max_devices' => $default_max_devices,
|
||||
'lic_verification_secret' => trim($_POST['lic_verification_secret']),
|
||||
'enable_auto_key_expiration' => isset($_POST['enable_auto_key_expiration']),
|
||||
'enable_debug' => isset($_POST['enable_debug']),
|
||||
'slm_woo' => isset($_POST['slm_woo']),
|
||||
'slm_woo_downloads' => isset($_POST['slm_woo_downloads']),
|
||||
'slm_woo_affect_downloads' => isset($_POST['slm_woo_affect_downloads']),
|
||||
'slm_stats' => isset($_POST['slm_stats']),
|
||||
'slm_adminbar' => isset($_POST['slm_adminbar']),
|
||||
'slm_conflictmode' => isset($_POST['slm_conflictmode']),
|
||||
'slm_front_conflictmode' => isset($_POST['slm_front_conflictmode']),
|
||||
'slm_wpestores' => isset($_POST['slm_wpestores']),
|
||||
'slm_dl_manager' => isset($_POST['slm_dl_manager']),
|
||||
'slm_multiple_items' => isset($_POST['slm_multiple_items']),
|
||||
'allow_user_activation_removal' => isset($_POST['allow_user_activation_removal']),
|
||||
'expiration_reminder_text' => sanitize_text_field($_POST['expiration_reminder_text']),
|
||||
);
|
||||
|
||||
update_option('slm_plugin_options', $options);
|
||||
|
||||
echo ' <div id="message" class="updated fade"> <p>' . __('Options updated!', 'softwarelicensemanager') . '</p> </div>';
|
||||
echo '<div id="message" class="updated fade"> <p>' . __('Options updated!', 'slmplus') . '</p> </div>';
|
||||
}
|
||||
|
||||
$options = get_option('slm_plugin_options');
|
||||
$secret_key = $options['lic_creation_secret'];
|
||||
|
||||
if (empty($secret_key)) {
|
||||
//$secret_key = md5(uniqid('', true));
|
||||
$secret_key = SLM_Utility::create_secret_keys();
|
||||
}
|
||||
|
||||
$secret_verification_key = $options['lic_verification_secret'];
|
||||
if (empty($secret_verification_key)) {
|
||||
//$secret_verification_key = md5(uniqid('', true));
|
||||
$secret_verification_key = SLM_Utility::create_secret_keys();
|
||||
}
|
||||
$tab = ""; //Initialization value;
|
||||
if (isset($_REQUEST['tab'])) {
|
||||
$tab = $_REQUEST['tab'];
|
||||
} else {
|
||||
$tab = 'general_settings';
|
||||
}
|
||||
$options = get_option('slm_plugin_options');
|
||||
$secret_key = !empty($options['lic_creation_secret']) ? $options['lic_creation_secret'] : SLM_Utility::create_secret_keys();
|
||||
$secret_verification_key = !empty($options['lic_verification_secret']) ? $options['lic_verification_secret'] : SLM_Utility::create_secret_keys();
|
||||
$tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'general_settings';
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h1><?php _e('Settings - Software License Manager', 'softwarelicensemanager'); ?> </h1>
|
||||
<h1><?php _e('Settings - SLM Plus', 'slmplus'); ?> </h1>
|
||||
|
||||
<div id="icon-options-general" class="icon32"></div>
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a href="<?php echo admin_url('admin.php?page=' . 'slm_settings') ?>" class="nav-tab <?php echo ($tab == 'general_settings') ? 'nav-tab-active' : '' ?>">
|
||||
<?php echo __('General Settings', 'softwarelicensemanager'); ?>
|
||||
<?php $base_url = admin_url('admin.php?page=slm_settings'); ?>
|
||||
<a href="<?php echo $base_url ?>" class="nav-tab <?php echo $tab === 'general_settings' ? 'nav-tab-active' : '' ?>">
|
||||
<?php _e('General Settings', 'slmplus'); ?>
|
||||
</a>
|
||||
|
||||
<a href="<?php echo admin_url('admin.php?page=' . 'slm_settings' . '&tab=integrations') ?>" class="nav-tab <?php echo ($tab == 'integrations') ? 'nav-tab-active' : '' ?>">
|
||||
<?php echo __('Integrations', 'softwarelicensemanager'); ?>
|
||||
<a href="<?php echo add_query_arg('tab', 'integrations', $base_url); ?>" class="nav-tab <?php echo $tab === 'integrations' ? 'nav-tab-active' : '' ?>">
|
||||
<?php _e('Integrations', 'slmplus'); ?>
|
||||
</a>
|
||||
|
||||
<a href="<?php echo admin_url('admin.php?page=' . 'slm_settings' . '&tab=debug') ?>" class="nav-tab <?php echo ($tab == 'debug') ? 'nav-tab-active' : '' ?>">
|
||||
<?php echo __('Debugging settings', 'softwarelicensemanager'); ?>
|
||||
<a href="<?php echo add_query_arg('tab', 'debug', $base_url); ?>" class="nav-tab <?php echo $tab === 'debug' ? 'nav-tab-active' : '' ?>">
|
||||
<?php _e('Debugging settings', 'slmplus'); ?>
|
||||
</a>
|
||||
|
||||
<a href="<?php echo admin_url('admin.php?page=' . 'slm_settings' . '&tab=emails') ?>" class="nav-tab <?php echo ($tab == 'emails') ? 'nav-tab-active' : '' ?>">
|
||||
<?php echo __('Emails', 'softwarelicensemanager'); ?>
|
||||
<a href="<?php echo add_query_arg('tab', 'emails', $base_url); ?>" class="nav-tab <?php echo $tab === 'emails' ? 'nav-tab-active' : '' ?>">
|
||||
<?php _e('Emails', 'slmplus'); ?>
|
||||
</a>
|
||||
|
||||
</h2>
|
||||
|
||||
<style>
|
||||
|
@ -127,86 +104,90 @@ function slm_general_settings()
|
|||
<div class="slm-postbox wrap general_settings hidepanel <?php echo ($tab == 'general_settings') ? 'showpanel' : '' ?>">
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Secret Key for License Creation', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('Secret Key for License Creation', 'slmplus'); ?></th>
|
||||
<td><textarea name="lic_creation_secret" rows="2" cols="50" readonly><?php echo $secret_key; ?>
|
||||
</textarea>
|
||||
<p class=" description"><?php _e('This secret key will be used to authenticate any license creation request. You can change it with something random.', 'softwarelicensemanager'); ?></p>
|
||||
<p class=" description"><?php _e('This secret key will be used to authenticate any license creation request. You can change it with something random.', 'slmplus'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Secret Key for License Verification Requests', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('Secret Key for License Verification Requests', 'slmplus'); ?></th>
|
||||
<td><textarea name="lic_verification_secret" rows="2" cols="50" readonly><?php echo $secret_verification_key; ?></textarea>
|
||||
<p class="description"><?php _e('This secret key will be used to authenticate any license verification request from customer\'s site. Important! Do not change this value once your customers start to use your product(s)!', 'softwarelicensemanager'); ?></p>
|
||||
<p class="description"><?php _e('This secret key will be used to authenticate any license verification request from customer\'s site. Important! Do not change this value once your customers start to use your product(s)!', 'slmplus'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('License Key Prefix', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('License Key Prefix', 'slmplus'); ?></th>
|
||||
<td><input type="text" name="lic_prefix" value="<?php echo $options['lic_prefix']; ?>" size="6" />
|
||||
<p class="description"><?php _e('You can optionaly specify a prefix for the license keys. This prefix will be added to the uniquely generated license keys.', 'softwarelicensemanager'); ?></p>
|
||||
<p class="description"><?php _e('You can optionaly specify a prefix for the license keys. This prefix will be added to the uniquely generated license keys.', 'slmplus'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Maximum Allowed Domains', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('Maximum Allowed Domains', 'slmplus'); ?></th>
|
||||
<td><input type="text" name="default_max_domains" value="<?php echo $options['default_max_domains']; ?>" size="6" />
|
||||
<p class="description"><?php _e('Maximum number of domains/installs which each license is valid for (default value).', 'softwarelicensemanager'); ?></p>
|
||||
<p class="description"><?php _e('Maximum number of domains/installs which each license is valid for (default value).', 'slmplus'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Maximum Allowed Devices', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('Maximum Allowed Devices', 'slmplus'); ?></th>
|
||||
<td><input type="text" name="default_max_devices" value="<?php echo $options['default_max_devices']; ?>" size="6" />
|
||||
<p class="description"><?php _e('Maximum number of devices which each license is valid for (default value).', 'softwarelicensemanager'); ?></p>
|
||||
<p class="description"><?php _e('Maximum number of devices which each license is valid for (default value).', 'slmplus'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row"><?php _e('Auto Expire License Keys', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('Auto Expire License Keys', 'slmplus'); ?></th>
|
||||
<td><input name="enable_auto_key_expiration" type="checkbox" <?php if (isset($options['enable_auto_key_expiration']) && $options['enable_auto_key_expiration'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Enable auto expiration ', 'softwarelicensemanager '); ?>
|
||||
<p class="description"><?php _e(' When enabled, it will automatically set the status of a license key to "Expired" when the expiry date value of the key is reached. It doesn\'t remotely deactivate a key. It simply changes the status of the key in your database to expired.', 'softwarelicensemanager'); ?></p>
|
||||
<?php _e('Enable auto expiration ', 'slmplus '); ?>
|
||||
<p class="description"><?php _e(' When enabled, it will automatically set the status of a license key to "Expired" when the expiry date value of the key is reached. It doesn\'t remotely deactivate a key. It simply changes the status of the key in your database to expired.', 'slmplus'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('General settings', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('General settings', 'slmplus'); ?></th>
|
||||
<td>
|
||||
<input name="slm_stats" type="checkbox" <?php if ($options['slm_stats'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Enable stats in licenses overview page.', 'softwarelicensemanager'); ?></td>
|
||||
<?php _e('Enable stats in licenses overview page.', 'slmplus'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td>
|
||||
<input name="slm_adminbar" type="checkbox" <?php if ($options['slm_adminbar'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Enable admin bar shortcut link', 'softwarelicensemanager'); ?></td>
|
||||
<?php _e('Enable admin bar shortcut link', 'slmplus'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><?php _e('Multiple items validation', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('Multiple items validation', 'slmplus'); ?></th>
|
||||
<td>
|
||||
<input name="slm_multiple_items" type="checkbox" <?php if ($options['slm_multiple_items'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Enable verification of Item reference.', 'softwarelicensemanager'); ?>
|
||||
<p class="description"><?php _e("When enabled, there will be another field in Licenced product - Item reference. This field should correspond to the API parameter item_reference of your software.", 'softwarelicensemanager'); ?></p>
|
||||
<?php _e('Enable verification of Item reference.', 'slmplus'); ?>
|
||||
<p class="description"><?php _e("When enabled, there will be another field in Licenced product - Item reference. This field should correspond to the API parameter item_reference of your software.", 'slmplus'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><?php _e('User permissions', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('User permissions', 'slmplus'); ?></th>
|
||||
<td>
|
||||
<input name="allow_user_activation_removal" type="checkbox" <?php if ($options['allow_user_activation_removal'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Allow users to remove domains/devices in My account.', 'softwarelicensemanager'); ?>
|
||||
<p class="description"><?php _e("When enabled, users will be able to remove registered domains or devices in their account.", 'softwarelicensemanager'); ?></p>
|
||||
<?php _e('Allow users to remove domains/devices in My account.', 'slmplus'); ?>
|
||||
<p class="description"><?php _e("When enabled, users will be able to remove registered domains or devices in their account.", 'slmplus'); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><?php _e('Bootstrap library', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"><?php _e('Bootstrap library', 'slmplus'); ?></th>
|
||||
<td>
|
||||
<input name="slm_conflictmode" type="checkbox" <?php if ($options['slm_conflictmode'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Enable Bootstrap javascript libray.', 'softwarelicensemanager'); ?></td>
|
||||
<?php _e('Enable Bootstrap javascript libray.', 'slmplus'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td>
|
||||
<input name="slm_front_conflictmode" type="checkbox" <?php if ($options['slm_front_conflictmode'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Enable Bootstrap javascript libray in front-end (woocommerce pages, etc).', 'softwarelicensemanager'); ?></td>
|
||||
<?php _e('Enable Bootstrap javascript libray in front-end (woocommerce pages, etc).', 'slmplus'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
@ -218,36 +199,38 @@ function slm_general_settings()
|
|||
<div class="inside">
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th scope="row"> <?php _e('Woocommerce Support', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"> <?php _e('Woocommerce Support', 'slmplus'); ?></th>
|
||||
<td>
|
||||
<input name="slm_woo" type="checkbox" <?php if ($options['slm_woo'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('A fully customizable, open source eCommerce platform built for WordPress.', 'softwarelicensemanager'); ?></td>
|
||||
<?php _e('A fully customizable, open source eCommerce platform built for WordPress.', 'slmplus'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td>
|
||||
<input name="slm_woo_downloads" type="checkbox" <?php if ($options['slm_woo_downloads'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Disable woocommerce download page. Process downloads though license order info page.', 'softwarelicensemanager'); ?></td>
|
||||
<?php _e('Disable woocommerce download page. Process downloads though license order info page.', 'slmplus'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td>
|
||||
<input name="slm_woo_affect_downloads" type="checkbox" <?php if ($options['slm_woo_affect_downloads'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Expire WooCommerce downloads. Downloads will expire together with corresponding license.', 'softwarelicensemanager'); ?>
|
||||
<?php _e('Expire WooCommerce downloads. Downloads will expire together with corresponding license.', 'slmplus'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr valign="top">
|
||||
<th scope="row"> <?php _e('Download Manager Support', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"> <?php _e('Download Manager Support', 'slmplus'); ?></th>
|
||||
<td>
|
||||
<input name="slm_dl_manager" type="checkbox" <?php if ($options['slm_dl_manager'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('Download Manager Plugin – Adds a simple download manager to your WordPress blog.', 'softwarelicensemanager'); ?>
|
||||
<?php _e('Download Manager Plugin – Adds a simple download manager to your WordPress blog.', 'slmplus'); ?>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr valign="top">
|
||||
<th scope="row"> <?php _e('WP eStores Support', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"> <?php _e('WP eStores Support', 'slmplus'); ?></th>
|
||||
<td>
|
||||
<input name="slm_wpestores" type="checkbox" <?php if ($options['slm_wpestores'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php _e('WordPress eStore Plugin – Complete Solution to Sell Digital Products from Your WordPress Blog Securely', 'softwarelicensemanager'); ?>
|
||||
<?php _e('WordPress eStore Plugin – Complete Solution to Sell Digital Products from Your WordPress Blog Securely', 'slmplus'); ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -259,10 +242,10 @@ function slm_general_settings()
|
|||
<div class=" inside">
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th scope="row"> <?php echo __('Enable Debug Logging', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"> <?php echo __('Enable Debug Logging', 'slmplus'); ?></th>
|
||||
<td>
|
||||
<p class="description"><input name="enable_debug" type="checkbox" <?php if ($options['enable_debug'] != '') echo ' checked="checked"'; ?> value="1" />
|
||||
<?php echo __('If checked, debug output will be written to log files.', ' softwarelicensemanager '); ?></p>
|
||||
<?php echo __('If checked, debug output will be written to log files.', ' slmplus '); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -273,7 +256,7 @@ function slm_general_settings()
|
|||
<div class=" inside">
|
||||
<table class="form-table">
|
||||
<tr valign="top">
|
||||
<th scope="row"> <?php _e('Expiration reminder', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="row"> <?php _e('Expiration reminder', 'slmplus'); ?></th>
|
||||
<td>
|
||||
<textarea name="expiration_reminder_text" id="expiration_reminder_text" cols="80" rows="20"> <?php echo esc_html($options['expiration_reminder_text']); ?> </textarea>
|
||||
</td>
|
||||
|
@ -283,7 +266,7 @@ function slm_general_settings()
|
|||
</div>
|
||||
|
||||
<div class="submit">
|
||||
<input type="submit" class="button-primary" name="slm_save_settings" value=" <?php _e('Update Options', 'softwarelicensemanager'); ?>" />
|
||||
<input type="submit" class="button-primary" name="slm_save_settings" value=" <?php _e('Update Options', 'slmplus'); ?>" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@ class SLM_List_Licenses extends WP_List_Table
|
|||
|
||||
public function no_items()
|
||||
{
|
||||
_e('No licenses avaliable.', 'softwarelicensemanager');
|
||||
_e('No licenses avaliable.', 'slmplus');
|
||||
}
|
||||
|
||||
function get_views()
|
||||
|
@ -40,35 +40,35 @@ class SLM_List_Licenses extends WP_List_Table
|
|||
$link_html,
|
||||
esc_url(remove_query_arg('view', $base)),
|
||||
$current === 'all' || $current == '' ? ' class="current"' : '',
|
||||
esc_html__('All', 'softwarelicensemanager'),
|
||||
esc_html__('All', 'slmplus'),
|
||||
SLM_Utility::get_total_licenses()
|
||||
),
|
||||
'active' => sprintf(
|
||||
$link_html,
|
||||
esc_url(add_query_arg('view', 'active', $base . '&s=active')),
|
||||
$current === 'active' ? ' class="current"' : '',
|
||||
esc_html__('active', 'softwarelicensemanager'),
|
||||
esc_html__('active', 'slmplus'),
|
||||
SLM_Utility::count_licenses('active')
|
||||
),
|
||||
'pending' => sprintf(
|
||||
$link_html,
|
||||
esc_url(add_query_arg('view', 'pending', $base . '&s=pending')),
|
||||
$current === 'pending' ? ' class="current"' : '',
|
||||
esc_html__('pending', 'softwarelicensemanager'),
|
||||
esc_html__('pending', 'slmplus'),
|
||||
SLM_Utility::count_licenses('pending')
|
||||
),
|
||||
'expired' => sprintf(
|
||||
$link_html,
|
||||
esc_url(add_query_arg('view', 'expired', $base . '&s=expired')),
|
||||
$current === 'expired' ? ' class="current"' : '',
|
||||
esc_html__('expired', 'softwarelicensemanager'),
|
||||
esc_html__('expired', 'slmplus'),
|
||||
SLM_Utility::count_licenses('expired')
|
||||
),
|
||||
'blocked' => sprintf(
|
||||
$link_html,
|
||||
esc_url(add_query_arg('view', 'blocked', $base . '&s=blocked')),
|
||||
$current === 'blocked' ? ' class="current"' : '',
|
||||
esc_html__('blocked', 'softwarelicensemanager'),
|
||||
esc_html__('blocked', 'slmplus'),
|
||||
SLM_Utility::count_licenses('blocked')
|
||||
)
|
||||
);
|
||||
|
@ -81,21 +81,21 @@ class SLM_List_Licenses extends WP_List_Table
|
|||
{
|
||||
$columns = array(
|
||||
'cb' => '<input type="checkbox" />', //Render a checkbox
|
||||
'id' => __('ID', 'softwarelicensemanager'),
|
||||
'lic_status' => __('Status', 'softwarelicensemanager'),
|
||||
'license_key' => __('Key', 'softwarelicensemanager'),
|
||||
'item_reference' => __('Item reference', 'softwarelicensemanager'),
|
||||
'lic_type' => __('License type', 'softwarelicensemanager'),
|
||||
'email' => __('Email', 'softwarelicensemanager'),
|
||||
'max_allowed_domains' => __('Domains', 'softwarelicensemanager'),
|
||||
'max_allowed_devices' => __('Devices', 'softwarelicensemanager'),
|
||||
'purchase_id_' => __('Order #', 'softwarelicensemanager'),
|
||||
'date_created' => __('Created on', 'softwarelicensemanager'),
|
||||
'date_renewed' => __('Renewed on', 'softwarelicensemanager'),
|
||||
'date_activated' => __('Activated on', 'softwarelicensemanager'),
|
||||
'date_expiry' => __('Expiration', 'softwarelicensemanager'),
|
||||
'until' => __('Until Ver.', 'softwarelicensemanager'),
|
||||
'current_ver' => __('Current Ver.', 'softwarelicensemanager')
|
||||
'id' => __('ID', 'slmplus'),
|
||||
'lic_status' => __('Status', 'slmplus'),
|
||||
'license_key' => __('Key', 'slmplus'),
|
||||
'item_reference' => __('Item reference', 'slmplus'),
|
||||
'lic_type' => __('License type', 'slmplus'),
|
||||
'email' => __('Email', 'slmplus'),
|
||||
'max_allowed_domains' => __('Domains', 'slmplus'),
|
||||
'max_allowed_devices' => __('Devices', 'slmplus'),
|
||||
'purchase_id_' => __('Order #', 'slmplus'),
|
||||
'date_created' => __('Created on', 'slmplus'),
|
||||
'date_renewed' => __('Renewed on', 'slmplus'),
|
||||
'date_activated' => __('Activated on', 'slmplus'),
|
||||
'date_expiry' => __('Expiration', 'slmplus'),
|
||||
'until' => __('Until Ver.', 'slmplus'),
|
||||
'current_ver' => __('Current Ver.', 'slmplus')
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ class SLM_List_Licenses extends WP_List_Table
|
|||
$date_today = time();
|
||||
|
||||
if ($expiration == '0000-00-00') {
|
||||
return '<span class="tag license-date-valid">'. __(' Lifetime ','softwarelicensemanager'). '</span>' . '<span class="days-left"> </span>';
|
||||
return '<span class="tag license-date-valid">'. __(' Lifetime ','slmplus'). '</span>' . '<span class="days-left"> </span>';
|
||||
}
|
||||
|
||||
|
||||
|
@ -199,84 +199,162 @@ class SLM_List_Licenses extends WP_List_Table
|
|||
'blocked' => 'Block',
|
||||
'expired' => 'Expire',
|
||||
'active' => 'Activate',
|
||||
'reminder' => 'Send Reminder'
|
||||
'reminder' => 'Send Reminder',
|
||||
'export' => 'Export',
|
||||
);
|
||||
return $actions;
|
||||
}
|
||||
|
||||
|
||||
function process_bulk_action()
|
||||
{
|
||||
if ('delete' === $this->current_action()) {
|
||||
//Process delete bulk actions
|
||||
if (!isset($_REQUEST['item'])) {
|
||||
$error_msg = '<p>' . __('Error - Please select some records using the checkboxes', 'softwarelicensemanager') . '</p>';
|
||||
$error_msg = '<p>' . __('Error - Please select some records using the checkboxes', 'slmplus') . '</p>';
|
||||
echo '<div id="message" class="error fade">' . $error_msg . '</div>';
|
||||
return;
|
||||
} else {
|
||||
$nvp_key = $this->_args['singular'];
|
||||
$records_to_delete = $_GET[$nvp_key];
|
||||
|
||||
|
||||
foreach ($records_to_delete as $row) {
|
||||
SLM_Utility::delete_license_key_by_row_id($row);
|
||||
}
|
||||
|
||||
|
||||
echo '<div id="message" class="updated fade"><p>Selected records deleted successfully!</p></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if ('blocked' === $this->current_action()) {
|
||||
//Process blocked bulk actions
|
||||
if (!isset($_REQUEST['item'])) {
|
||||
$error_msg = '<p>' . __('Error - Please select some records using the checkboxes', 'softwarelicensemanager') . '</p>';
|
||||
$error_msg = '<p>' . __('Error - Please select some records using the checkboxes', 'slmplus') . '</p>';
|
||||
echo '<div id="message" class="error fade">' . $error_msg . '</div>';
|
||||
return;
|
||||
} else {
|
||||
$nvp_key = $this->_args['singular'];
|
||||
$licenses_to_block = $_GET[$nvp_key];
|
||||
|
||||
|
||||
foreach ($licenses_to_block as $row) {
|
||||
SLM_Utility::block_license_key_by_row_id($row);
|
||||
}
|
||||
|
||||
|
||||
echo '<div id="message" class="updated fade"><p> ' . $row . ' Selected records blocked successfully!</p></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if ('expired' === $this->current_action()) {
|
||||
//Process blocked bulk actions
|
||||
//Process expired bulk actions
|
||||
if (!isset($_REQUEST['item'])) {
|
||||
$error_msg = '<p>' . __('Error - Please select some records using the checkboxes', 'softwarelicensemanager') . '</p>';
|
||||
$error_msg = '<p>' . __('Error - Please select some records using the checkboxes', 'slmplus') . '</p>';
|
||||
echo '<div id="message" class="error fade">' . $error_msg . '</div>';
|
||||
return;
|
||||
} else {
|
||||
$nvp_key = $this->_args['singular'];
|
||||
$licenses_to_expire = $_GET[$nvp_key];
|
||||
|
||||
|
||||
foreach ($licenses_to_expire as $row) {
|
||||
SLM_Utility::expire_license_key_by_row_id($row);
|
||||
}
|
||||
|
||||
|
||||
echo '<div id="message" class="updated fade"><p> ' . $row . ' Selected records expired successfully!</p></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if ('active' === $this->current_action()) {
|
||||
//Process blocked bulk actions
|
||||
//Process activate bulk actions
|
||||
if (!isset($_REQUEST['item'])) {
|
||||
$error_msg = '<p>' . __('Error - Please select some records using the checkboxes', 'softwarelicensemanager') . '</p>';
|
||||
$error_msg = '<p>' . __('Error - Please select some records using the checkboxes', 'slmplus') . '</p>';
|
||||
echo '<div id="message" class="error fade">' . $error_msg . '</div>';
|
||||
return;
|
||||
} else {
|
||||
$nvp_key = $this->_args['singular'];
|
||||
$liceses_to_activate = $_GET[$nvp_key];
|
||||
|
||||
// var_dump( $liceses_to_activate);
|
||||
|
||||
|
||||
foreach ($liceses_to_activate as $row) {
|
||||
SLM_Utility::active_license_key_by_row_id($row);
|
||||
}
|
||||
|
||||
|
||||
echo '<div id="message" class="updated fade"><p> ' . $row . ' Selected records activated successfully!</p></div>';
|
||||
}
|
||||
}
|
||||
|
||||
// Export license data
|
||||
if ('export' === $this->current_action()) {
|
||||
if (!isset($_REQUEST['item'])) {
|
||||
$error_msg = '<p>' . __('Error - Please select some records using the checkboxes', 'slmplus') . '</p>';
|
||||
echo '<div id="message" class="error fade">' . $error_msg . '</div>';
|
||||
return;
|
||||
} else {
|
||||
$nvp_key = $this->_args['singular'];
|
||||
$licenses_to_export = $_GET[$nvp_key];
|
||||
|
||||
// Call the export function
|
||||
$file_urls = self::export_license_data($licenses_to_export);
|
||||
|
||||
// Display success message with download links for each license
|
||||
echo '<div id="message" class="updated fade">';
|
||||
echo '<p>Export successful! Download the CSV files:</p>';
|
||||
foreach ($file_urls as $file_url) {
|
||||
echo '<p><a href="' . esc_url($file_url) . '" target="_blank">Download CSV File</a></p>';
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Export function
|
||||
public static function export_license_data($license_ids)
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
// Fetch the custom directory path from options (saved with hash)
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
$custom_dir_hash = isset($slm_options['slm_backup_dir_hash']) ? $slm_options['slm_backup_dir_hash'] : '';
|
||||
|
||||
// Prepare file URLs array
|
||||
$file_urls = [];
|
||||
|
||||
// Get the WordPress upload directory
|
||||
$upload_dir = wp_upload_dir();
|
||||
$custom_dir = $upload_dir['basedir'] . $custom_dir_hash;
|
||||
|
||||
// Ensure the directory exists
|
||||
if (!file_exists($custom_dir)) {
|
||||
mkdir($custom_dir, 0755, true); // Create the directory if it doesn't exist
|
||||
}
|
||||
|
||||
// Fetch license data for each selected ID
|
||||
foreach ($license_ids as $license_id) {
|
||||
$data = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . SLM_TBL_LICENSE_KEYS . " WHERE id = %d", $license_id), ARRAY_A);
|
||||
if ($data) {
|
||||
$license_key = $data['license_key'];
|
||||
|
||||
// Prepare file name as "license_key.csv"
|
||||
$file_name = sanitize_file_name($license_key) . '.csv';
|
||||
$file_path = $custom_dir . '/' . $file_name;
|
||||
|
||||
// Open file handle
|
||||
$output = fopen($file_path, 'w');
|
||||
|
||||
// Write CSV headers
|
||||
fputcsv($output, array_keys($data));
|
||||
|
||||
// Write license data to CSV file
|
||||
fputcsv($output, $data);
|
||||
|
||||
// Close the file handle
|
||||
fclose($output);
|
||||
|
||||
// Store the file URL for download
|
||||
$file_urls[] = $upload_dir['baseurl'] . $custom_dir_hash . '/' . $file_name;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the array of file URLs
|
||||
return $file_urls;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This function will delete the selected license key entries from the DB.
|
||||
|
@ -398,16 +476,16 @@ class SLM_Plugin
|
|||
{
|
||||
$icon_svg = SLM_ASSETS_URL . 'images/slm_logo_small.svg';
|
||||
|
||||
add_menu_page(__( 'SLM', 'softwarelicensemanager'), __( 'SLM', 'softwarelicensemanager'), SLM_MANAGEMENT_PERMISSION, SLM_MAIN_MENU_SLUG, "slm_manage_licenses_menu", $icon_svg);
|
||||
$hook = add_submenu_page(SLM_MAIN_MENU_SLUG, __('Manage Licenses', 'softwarelicensemanager'), __('Manage Licenses', 'softwarelicensemanager'), SLM_MANAGEMENT_PERMISSION, SLM_MAIN_MENU_SLUG, "slm_manage_licenses_menu");
|
||||
add_menu_page(__( 'SLM', 'slmplus'), __( 'SLM', 'slmplus'), SLM_MANAGEMENT_PERMISSION, SLM_MAIN_MENU_SLUG, "slm_manage_licenses_menu", $icon_svg);
|
||||
$hook = add_submenu_page(SLM_MAIN_MENU_SLUG, __('Manage Licenses', 'slmplus'), __('Manage Licenses', 'slmplus'), SLM_MANAGEMENT_PERMISSION, SLM_MAIN_MENU_SLUG, "slm_manage_licenses_menu");
|
||||
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Create license', 'softwarelicensemanager'), __( 'Create license', 'softwarelicensemanager') , SLM_MANAGEMENT_PERMISSION, 'slm_manage_license', "slm_add_licenses_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Subscribers', 'softwarelicensemanager'), __( 'Subscribers', 'softwarelicensemanager'), SLM_MANAGEMENT_PERMISSION, 'slm_subscribers', "slm_subscribers_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Tools', 'softwarelicensemanager'), __( 'Tools', 'softwarelicensemanager'), SLM_MANAGEMENT_PERMISSION, 'slm_admin_tools', "slm_admin_tools_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Settings', 'softwarelicensemanager'), __( 'Settings', 'softwarelicensemanager'), SLM_MANAGEMENT_PERMISSION, 'slm_settings', "slm_settings_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Help', 'softwarelicensemanager'), __( 'Help', 'softwarelicensemanager'), SLM_MANAGEMENT_PERMISSION, 'slm_help', "slm_integration_help_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Create license', 'slmplus'), __( 'Create license', 'slmplus') , SLM_MANAGEMENT_PERMISSION, 'slm_manage_license', "slm_add_licenses_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Subscribers', 'slmplus'), __( 'Subscribers', 'slmplus'), SLM_MANAGEMENT_PERMISSION, 'slm_subscribers', "slm_subscribers_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Tools', 'slmplus'), __( 'Tools', 'slmplus'), SLM_MANAGEMENT_PERMISSION, 'slm_admin_tools', "slm_admin_tools_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Settings', 'slmplus'), __( 'Settings', 'slmplus'), SLM_MANAGEMENT_PERMISSION, 'slm_settings', "slm_settings_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'Help', 'slmplus'), __( 'Help', 'slmplus'), SLM_MANAGEMENT_PERMISSION, 'slm_help', "slm_integration_help_menu");
|
||||
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'About', 'softwarelicensemanager'),__( 'About', 'softwarelicensemanager'), SLM_MANAGEMENT_PERMISSION, 'slm_about', "slm_about_menu");
|
||||
add_submenu_page(SLM_MAIN_MENU_SLUG, __( 'About', 'slmplus'),__( 'About', 'slmplus'), SLM_MANAGEMENT_PERMISSION, 'slm_about', "slm_about_menu");
|
||||
|
||||
add_action("load-" . $hook, [$this, 'screen_option']);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ function get_user_info()
|
|||
if (!current_user_can('manage_licenses')) {
|
||||
$response = array(
|
||||
'success' => false,
|
||||
'message' => _e('You do not have permission to manage this license.', 'softwarelicensemanager'),
|
||||
'message' => _e('You do not have permission to manage this license.', 'slmplus'),
|
||||
);
|
||||
echo json_encode($response);
|
||||
die();
|
||||
|
@ -33,9 +33,9 @@ function slm_manage_licenses_menu()
|
|||
<div class="stats">
|
||||
</div>
|
||||
<div class="wrap">
|
||||
<h1><?php _e('Overview - Manage licenses', 'softwarelicensemanager'); ?></h1>
|
||||
<h1><?php _e('Overview - Manage licenses', 'slmplus'); ?></h1>
|
||||
<br>
|
||||
<a href="<?php echo admin_url('admin.php?page=slm_manage_license') ?>" class="page-title-action aria-button-if-js" role="button" aria-expanded="false"><?php _e('Add New', 'softwarelicensemanager'); ?></a>
|
||||
<a href="<?php echo admin_url('admin.php?page=slm_manage_license') ?>" class="page-title-action aria-button-if-js" role="button" aria-expanded="false"><?php _e('Add New', 'slmplus'); ?></a>
|
||||
|
||||
<hr class="wp-header-end">
|
||||
|
||||
|
|
|
@ -82,10 +82,10 @@ class Subscribers_List_Table extends WP_List_Table
|
|||
{
|
||||
$columns = array(
|
||||
'cb' => '<input type="checkbox" />', //Render a checkbox
|
||||
'id' => __('ID', 'softwarelicensemanager'),
|
||||
'first_name' => __('First Name', 'softwarelicensemanager'),
|
||||
'last_name' => __('Last Name', 'softwarelicensemanager'),
|
||||
'email' => __('Email Address', 'softwarelicensemanager')
|
||||
'id' => __('ID', 'slmplus'),
|
||||
'first_name' => __('First Name', 'slmplus'),
|
||||
'last_name' => __('Last Name', 'slmplus'),
|
||||
'email' => __('Email Address', 'slmplus')
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
|
@ -173,9 +173,9 @@ function slm_subscribers_menu()
|
|||
if (isset($_REQUEST['slm_subscriber_edit']) && $_REQUEST['slm_subscriber_edit'] == 'true') : ?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1><?php _e('Overview - Manage Subscribers', 'softwarelicensemanager'); ?></h1>
|
||||
<h1><?php _e('Overview - Manage Subscribers', 'slmplus'); ?></h1>
|
||||
<br>
|
||||
<a href="<?php echo admin_url('admin.php?page=slm_subscribers') ?>" class="page-title-action aria-button-if-js" role="button" aria-expanded="false"><?php _e('View all', 'softwarelicensemanager'); ?></a>
|
||||
<a href="<?php echo admin_url('admin.php?page=slm_subscribers') ?>" class="page-title-action aria-button-if-js" role="button" aria-expanded="false"><?php _e('View all', 'slmplus'); ?></a>
|
||||
<hr class="wp-header-end">
|
||||
|
||||
<div id="poststuff">
|
||||
|
@ -184,9 +184,9 @@ function slm_subscribers_menu()
|
|||
<div class="manage-user">
|
||||
<table class="wp-list-table widefat fixed striped items">
|
||||
<tr>
|
||||
<th scope="col" style="width: 32px"><?php _e('ID', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="col"><?php _e('License key', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="col"><?php _e('Status', 'softwarelicensemanager'); ?></th>
|
||||
<th scope="col" style="width: 32px"><?php _e('ID', 'slmplus'); ?></th>
|
||||
<th scope="col"><?php _e('License key', 'slmplus'); ?></th>
|
||||
<th scope="col"><?php _e('Status', 'slmplus'); ?></th>
|
||||
<th scope="col"> </th>
|
||||
</tr>
|
||||
|
||||
|
@ -203,7 +203,7 @@ function slm_subscribers_menu()
|
|||
<?php else : ?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1><?php _e('Overview - All Subscribers', 'softwarelicensemanager'); ?></h1>
|
||||
<h1><?php _e('Overview - All Subscribers', 'slmplus'); ?></h1>
|
||||
<br>
|
||||
<hr class="wp-header-end">
|
||||
<div id="poststuff">
|
||||
|
@ -214,7 +214,7 @@ function slm_subscribers_menu()
|
|||
<input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" />
|
||||
<?php
|
||||
$subscribers_list->prepare_items();
|
||||
$subscribers_list->search_box(__('Search', 'softwarelicensemanager'), 'search-box-id');
|
||||
$subscribers_list->search_box(__('Search', 'slmplus'), 'search-box-id');
|
||||
$subscribers_list->views();
|
||||
$subscribers_list->display(); ?>
|
||||
</form>
|
||||
|
|
|
@ -1,57 +1,71 @@
|
|||
<?php
|
||||
|
||||
// Prevent direct access to the file
|
||||
if (!defined('WPINC')) {
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display the About menu for SLM
|
||||
*/
|
||||
function slm_about_menu()
|
||||
{
|
||||
|
||||
// Output the wrapper div and heading
|
||||
echo '<div class="wrap">';
|
||||
echo '<h2 class="imgh2"><img src="' . SLM_ASSETS_URL . 'images/slm_logo.svg" alt="slm logo">' . __('SLM - About', 'softwarelicensemanager') . '</h2>';
|
||||
echo '<h2 class="imgh2"><img src="' . esc_url(SLM_ASSETS_URL . 'images/slm_logo.svg') . '" alt="' . esc_attr__('SLM Logo', 'slmplus') . '">' . esc_html__('SLM - About', 'slmplus') . '</h2>';
|
||||
echo '<div id="poststuff"><div id="post-body">';
|
||||
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
// Retrieve plugin options with caching for performance
|
||||
$slm_options = get_option('slm_plugin_options', []);
|
||||
|
||||
// Display content inside a postbox
|
||||
?>
|
||||
<br/>
|
||||
|
||||
<div class="postbox">
|
||||
<h3 class="hndle"><label for="title"><?php _e('Credits and authors', 'softwarelicensemanager'); ?></label></h3>
|
||||
<h3 class="hndle"><label for="title"><?php esc_html_e('Credits and authors', 'slmplus'); ?></label></h3>
|
||||
<div class="inside">
|
||||
<br>
|
||||
<p><?php _e('Software license management solution for your web applications (WordPress plugins, Themes, Applications, PHP based membership script etc.). Supports WooCommerce.', 'softwarelicensemanager'); ?></p>
|
||||
<br>
|
||||
<p><?php esc_html_e('Software license management solution for your web applications (WordPress plugins, Themes, Applications, PHP based membership script, etc.). Supports WooCommerce.', 'slmplus'); ?></p>
|
||||
|
||||
<table>
|
||||
<table class="slm-about-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td></td>
|
||||
<th><?php esc_html_e('Information', 'slmplus'); ?></th>
|
||||
<th><?php esc_html_e('Details', 'slmplus'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php _e('Authors', 'softwarelicensemanager'); ?></td>
|
||||
<td><a href="https://github.com/michelve/software-license-manager">Michel Velis</a> and <a
|
||||
href="https://github.com/Arsenal21/software-license-manager">tipsandtricks</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Help and Support', 'softwarelicensemanager'); ?></td>
|
||||
<td><a href="https://github.com/michelve/software-license-manager/issues"><?php _e('Submmit a request', 'softwarelicensemanager'); ?></a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><?php _e('API demos', 'softwarelicensemanager'); ?></td>
|
||||
<td>Postman <a
|
||||
href="https://documenter.getpostman.com/view/307939/6tjU1FL?version=latest"><?php _e('demos', 'softwarelicensemanager'); ?></a>
|
||||
<td><?php esc_html_e('Authors', 'slmplus'); ?></td>
|
||||
<td>
|
||||
<a href="https://github.com/michelve/software-license-manager" target="_blank" rel="noopener noreferrer">Michel Velis</a>
|
||||
<?php esc_html_e('and', 'slmplus'); ?>
|
||||
<a href="https://github.com/Arsenal21/software-license-manager" target="_blank" rel="noopener noreferrer">tipsandtricks</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e('Help and Support', 'slmplus'); ?></td>
|
||||
<td>
|
||||
<a href="https://github.com/michelve/software-license-manager/issues" target="_blank" rel="noopener noreferrer">
|
||||
<?php esc_html_e('Submit a request', 'slmplus'); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php esc_html_e('API Demos', 'slmplus'); ?></td>
|
||||
<td>
|
||||
<a href="https://documenter.getpostman.com/view/307939/6tjU1FL?version=latest" target="_blank" rel="noopener noreferrer">
|
||||
<?php esc_html_e('Postman Demos', 'slmplus'); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
// Close wrapping divs
|
||||
echo '</div></div>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
||||
"Project-Id-Version: Software License Manager\n"
|
||||
"Project-Id-Version: SLM Plus\n"
|
||||
"POT-Creation-Date: 2020-09-02 10:10-0400\n"
|
||||
"PO-Revision-Date: 2020-09-02 10:10-0400\n"
|
||||
"Last-Translator: Michel Velis <mvelis90@gmail.com>\n"
|
||||
|
@ -43,7 +43,7 @@ msgstr ""
|
|||
|
||||
#. Plugin Name of the plugin/theme
|
||||
#: admin/slm-add-licenses.php:200
|
||||
msgid "Software License Manager"
|
||||
msgid "SLM Plus"
|
||||
msgstr ""
|
||||
|
||||
#: admin/slm-add-licenses.php:203
|
Binary file not shown.
|
@ -1,821 +0,0 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Software License Manager\n"
|
||||
"POT-Creation-Date: 2020-09-02 10:07-0400\n"
|
||||
"PO-Revision-Date: 2020-09-02 10:08-0400\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: en_US\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.4.1\n"
|
||||
"X-Poedit-Basepath: ../..\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
|
||||
"X-Poedit-WPHeader: software-license-manager.php\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
||||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
||||
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
|
||||
|
||||
#: admin/includes/cronjobs/slm-tasks.php:10
|
||||
msgid "Every day"
|
||||
msgstr "Every day"
|
||||
|
||||
#: admin/includes/wpestores/slm-wpestores.php:70
|
||||
msgid "Item Name: "
|
||||
msgstr "Item Name: "
|
||||
|
||||
#: admin/includes/wpestores/slm-wpestores.php:70
|
||||
msgid "License Key: "
|
||||
msgstr "License Key: "
|
||||
|
||||
#: admin/slm-add-licenses.php:165
|
||||
msgid "Record could not be inserted into the database!"
|
||||
msgstr "Record could not be inserted into the database!"
|
||||
|
||||
#: admin/slm-add-licenses.php:173
|
||||
msgid "Update of the license key table failed!"
|
||||
msgstr "Update of the license key table failed!"
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
#: admin/slm-add-licenses.php:200
|
||||
msgid "Software License Manager"
|
||||
msgstr "Software License Manager"
|
||||
|
||||
#: admin/slm-add-licenses.php:203
|
||||
msgid "You can add a new license or edit an existing one from this interface."
|
||||
msgstr "You can add a new license or edit an existing one from this interface."
|
||||
|
||||
#: admin/slm-add-licenses.php:249 admin/slm-add-licenses.php:313
|
||||
msgid "License key and status"
|
||||
msgstr "License key and status"
|
||||
|
||||
#: admin/slm-add-licenses.php:253
|
||||
msgid "User information"
|
||||
msgstr "User information"
|
||||
|
||||
#: admin/slm-add-licenses.php:259
|
||||
msgid "Devices & Domains"
|
||||
msgstr "Devices & Domains"
|
||||
|
||||
#: admin/slm-add-licenses.php:264
|
||||
msgid "Subscription and Renewal"
|
||||
msgstr "Subscription and Renewal"
|
||||
|
||||
#: admin/slm-add-licenses.php:268
|
||||
#: woocommerce/includes/wc_licenses_class.php:107
|
||||
#: woocommerce/includes/wc_licenses_class.php:125
|
||||
msgid "Product"
|
||||
msgstr "Product"
|
||||
|
||||
#: admin/slm-add-licenses.php:274
|
||||
msgid "Activity log "
|
||||
msgstr "Activity log "
|
||||
|
||||
#: admin/slm-add-licenses.php:281
|
||||
msgid "Export "
|
||||
msgstr "Export "
|
||||
|
||||
#: admin/slm-add-licenses.php:318
|
||||
#: woocommerce/includes/wc_licenses_class.php:136
|
||||
msgid "License Key"
|
||||
msgstr "License Key"
|
||||
|
||||
#: admin/slm-add-licenses.php:320
|
||||
msgid "The unique license key."
|
||||
msgstr "The unique license key."
|
||||
|
||||
#: admin/slm-add-licenses.php:325
|
||||
msgid "License Status"
|
||||
msgstr "License Status"
|
||||
|
||||
#: admin/slm-add-licenses.php:351
|
||||
msgid "Subscription"
|
||||
msgstr "Subscription"
|
||||
|
||||
#: admin/slm-add-licenses.php:354
|
||||
msgid "Life-time"
|
||||
msgstr "Life-time"
|
||||
|
||||
#: admin/slm-add-licenses.php:356 woocommerce/includes/slm-meta-boxes.php:153
|
||||
msgid "type of license: subscription base or lifetime"
|
||||
msgstr "type of license: subscription base or lifetime"
|
||||
|
||||
#: admin/slm-add-licenses.php:370
|
||||
msgid "User Information"
|
||||
msgstr "User Information"
|
||||
|
||||
#: admin/slm-add-licenses.php:376
|
||||
msgid "First Name"
|
||||
msgstr "First Name"
|
||||
|
||||
#: admin/slm-add-licenses.php:378
|
||||
msgid "License user's first name"
|
||||
msgstr "License user's first name"
|
||||
|
||||
#: admin/slm-add-licenses.php:382
|
||||
msgid " Last Name"
|
||||
msgstr " Last Name"
|
||||
|
||||
#: admin/slm-add-licenses.php:384
|
||||
msgid "License user's last name"
|
||||
msgstr "License user's last name"
|
||||
|
||||
#: admin/slm-add-licenses.php:391
|
||||
msgid "Subscriber ID"
|
||||
msgstr "Subscriber ID"
|
||||
|
||||
#: admin/slm-add-licenses.php:393
|
||||
msgid ""
|
||||
"The Subscriber ID (if any). Can be useful if you are using the license key "
|
||||
"with a recurring payment plan."
|
||||
msgstr ""
|
||||
"The Subscriber ID (if any). Can be useful if you are using the license key "
|
||||
"with a recurring payment plan."
|
||||
|
||||
#: admin/slm-add-licenses.php:398
|
||||
msgid "Email Address"
|
||||
msgstr "Email Address"
|
||||
|
||||
#: admin/slm-add-licenses.php:425
|
||||
msgid "Allowed Activations"
|
||||
msgstr "Allowed Activations"
|
||||
|
||||
#: admin/slm-add-licenses.php:431 admin/slm-lic-settings.php:149
|
||||
msgid "Maximum Allowed Domains"
|
||||
msgstr "Maximum Allowed Domains"
|
||||
|
||||
#: admin/slm-add-licenses.php:433
|
||||
msgid "Number of domains/installs in which this license can be used"
|
||||
msgstr "Number of domains/installs in which this license can be used"
|
||||
|
||||
#: admin/slm-add-licenses.php:455
|
||||
msgid "Advanced Details"
|
||||
msgstr "Advanced Details"
|
||||
|
||||
#: admin/slm-add-licenses.php:491
|
||||
msgid "Days"
|
||||
msgstr "Days"
|
||||
|
||||
#: admin/slm-add-licenses.php:498
|
||||
msgid "Months"
|
||||
msgstr "Months"
|
||||
|
||||
#: admin/slm-add-licenses.php:505
|
||||
msgid "Years"
|
||||
msgstr "Years"
|
||||
|
||||
#: admin/slm-add-licenses.php:560
|
||||
msgid "Product Informations"
|
||||
msgstr "Product Informations"
|
||||
|
||||
#: admin/slm-add-licenses.php:629
|
||||
msgid "Item reference of your software"
|
||||
msgstr "Item reference of your software"
|
||||
|
||||
#: admin/slm-add-licenses.php:644
|
||||
msgid "Export License"
|
||||
msgstr "Export License"
|
||||
|
||||
#: admin/slm-add-licenses.php:664
|
||||
msgid "Activity Log"
|
||||
msgstr "Activity Log"
|
||||
|
||||
#: admin/slm-admin-functions.php:41
|
||||
msgid "Send Deactivation Message for a License"
|
||||
msgstr "Send Deactivation Message for a License"
|
||||
|
||||
#: admin/slm-admin-functions.php:43
|
||||
msgid "Enter the URL where the license deactivation message will be sent to"
|
||||
msgstr "Enter the URL where the license deactivation message will be sent to"
|
||||
|
||||
#: admin/slm-dashboard-widgets.php:30 admin/slm-dashboard-widgets.php:33
|
||||
msgid "SLM"
|
||||
msgstr "SLM"
|
||||
|
||||
#: admin/slm-dashboard-widgets.php:42
|
||||
msgid "Overview"
|
||||
msgstr "Overview"
|
||||
|
||||
#: admin/slm-dashboard-widgets.php:52
|
||||
msgid "Add new license"
|
||||
msgstr "Add new license"
|
||||
|
||||
#: admin/slm-dashboard-widgets.php:62 includes/slm-plugin-core.php:55
|
||||
msgid "Settings"
|
||||
msgstr "Settings"
|
||||
|
||||
#: admin/slm-lic-settings.php:23
|
||||
msgid "Debug log files have been reset!"
|
||||
msgstr "Debug log files have been reset!"
|
||||
|
||||
#: admin/slm-lic-settings.php:61
|
||||
msgid "Options updated!"
|
||||
msgstr "Options updated!"
|
||||
|
||||
#: admin/slm-lic-settings.php:91
|
||||
msgid "General Settings"
|
||||
msgstr "General Settings"
|
||||
|
||||
#: admin/slm-lic-settings.php:95
|
||||
msgid "Integrations"
|
||||
msgstr "Integrations"
|
||||
|
||||
#: admin/slm-lic-settings.php:99
|
||||
msgid "Debugging settings"
|
||||
msgstr "Debugging settings"
|
||||
|
||||
#: admin/slm-lic-settings.php:103
|
||||
msgid "Emails"
|
||||
msgstr "Emails"
|
||||
|
||||
#: admin/slm-lic-settings.php:130
|
||||
msgid "Secret Key for License Creation"
|
||||
msgstr "Secret Key for License Creation"
|
||||
|
||||
#: admin/slm-lic-settings.php:133
|
||||
msgid ""
|
||||
"This secret key will be used to authenticate any license creation request. "
|
||||
"You can change it with something random."
|
||||
msgstr ""
|
||||
"This secret key will be used to authenticate any license creation request. "
|
||||
"You can change it with something random."
|
||||
|
||||
#: admin/slm-lic-settings.php:137
|
||||
msgid "Secret Key for License Verification Requests"
|
||||
msgstr "Secret Key for License Verification Requests"
|
||||
|
||||
#: admin/slm-lic-settings.php:139
|
||||
msgid ""
|
||||
"This secret key will be used to authenticate any license verification "
|
||||
"request from customer's site. Important! Do not change this value once your "
|
||||
"customers start to use your product(s)!"
|
||||
msgstr ""
|
||||
"This secret key will be used to authenticate any license verification "
|
||||
"request from customer's site. Important! Do not change this value once your "
|
||||
"customers start to use your product(s)!"
|
||||
|
||||
#: admin/slm-lic-settings.php:143
|
||||
msgid "License Key Prefix"
|
||||
msgstr "License Key Prefix"
|
||||
|
||||
#: admin/slm-lic-settings.php:145
|
||||
msgid ""
|
||||
"You can optionaly specify a prefix for the license keys. This prefix will be "
|
||||
"added to the uniquely generated license keys."
|
||||
msgstr ""
|
||||
"You can optionaly specify a prefix for the license keys. This prefix will be "
|
||||
"added to the uniquely generated license keys."
|
||||
|
||||
#: admin/slm-lic-settings.php:151
|
||||
msgid ""
|
||||
"Maximum number of domains/installs which each license is valid for (default "
|
||||
"value)."
|
||||
msgstr ""
|
||||
"Maximum number of domains/installs which each license is valid for (default "
|
||||
"value)."
|
||||
|
||||
#: admin/slm-lic-settings.php:155
|
||||
msgid "Maximum Allowed Devices"
|
||||
msgstr "Maximum Allowed Devices"
|
||||
|
||||
#: admin/slm-lic-settings.php:157
|
||||
msgid ""
|
||||
"Maximum number of devices which each license is valid for (default value)."
|
||||
msgstr ""
|
||||
"Maximum number of devices which each license is valid for (default value)."
|
||||
|
||||
#: admin/slm-lic-settings.php:161
|
||||
msgid "Auto Expire License Keys"
|
||||
msgstr "Auto Expire License Keys"
|
||||
|
||||
#: admin/slm-lic-settings.php:163
|
||||
msgid "Enable auto expiration "
|
||||
msgstr "Enable auto expiration "
|
||||
|
||||
#: admin/slm-lic-settings.php:164
|
||||
msgid ""
|
||||
" When enabled, it will automatically set the status of a license key to "
|
||||
"\"Expired\" when the expiry date value of the key is reached. It doesn't "
|
||||
"remotely deactivate a key. It simply changes the status of the key in your "
|
||||
"database to expired."
|
||||
msgstr ""
|
||||
" When enabled, it will automatically set the status of a license key to "
|
||||
"\"Expired\" when the expiry date value of the key is reached. It doesn't "
|
||||
"remotely deactivate a key. It simply changes the status of the key in your "
|
||||
"database to expired."
|
||||
|
||||
#: admin/slm-lic-settings.php:168
|
||||
msgid "General settings"
|
||||
msgstr "General settings"
|
||||
|
||||
#: admin/slm-lic-settings.php:171
|
||||
msgid "Enable stats in licenses overview page."
|
||||
msgstr "Enable stats in licenses overview page."
|
||||
|
||||
#: admin/slm-lic-settings.php:178
|
||||
msgid "Enable admin bar shortcut link"
|
||||
msgstr "Enable admin bar shortcut link"
|
||||
|
||||
#: admin/slm-lic-settings.php:182
|
||||
msgid "Multiple items validation"
|
||||
msgstr "Multiple items validation"
|
||||
|
||||
#: admin/slm-lic-settings.php:185
|
||||
msgid "Enable verification of Item reference."
|
||||
msgstr "Enable verification of Item reference."
|
||||
|
||||
#: admin/slm-lic-settings.php:186
|
||||
msgid ""
|
||||
"When enabled, there will be another field in Licenced product - Item "
|
||||
"reference. This field should correspond to the API parameter item_reference "
|
||||
"of your software."
|
||||
msgstr ""
|
||||
"When enabled, there will be another field in Licenced product - Item "
|
||||
"reference. This field should correspond to the API parameter item_reference "
|
||||
"of your software."
|
||||
|
||||
#: admin/slm-lic-settings.php:191
|
||||
msgid "User permissions"
|
||||
msgstr "User permissions"
|
||||
|
||||
#: admin/slm-lic-settings.php:194
|
||||
msgid "Allow users to remove domains/devices in My account."
|
||||
msgstr "Allow users to remove domains/devices in My account."
|
||||
|
||||
#: admin/slm-lic-settings.php:195
|
||||
msgid ""
|
||||
"When enabled, users will be able to remove registered domains or devices in "
|
||||
"their account."
|
||||
msgstr ""
|
||||
"When enabled, users will be able to remove registered domains or devices in "
|
||||
"their account."
|
||||
|
||||
#: admin/slm-lic-settings.php:203
|
||||
msgid "Enable Bootstrap javascript libray."
|
||||
msgstr "Enable Bootstrap javascript libray."
|
||||
|
||||
#: admin/slm-lic-settings.php:209
|
||||
msgid ""
|
||||
"Enable Bootstrap javascript libray in front-end (woocommerce pages, etc)."
|
||||
msgstr ""
|
||||
"Enable Bootstrap javascript libray in front-end (woocommerce pages, etc)."
|
||||
|
||||
#: admin/slm-lic-settings.php:221
|
||||
msgid "Woocommerce Support"
|
||||
msgstr "Woocommerce Support"
|
||||
|
||||
#: admin/slm-lic-settings.php:224
|
||||
msgid ""
|
||||
"A fully customizable, open source eCommerce platform built for WordPress."
|
||||
msgstr ""
|
||||
"A fully customizable, open source eCommerce platform built for WordPress."
|
||||
|
||||
#: admin/slm-lic-settings.php:230
|
||||
msgid ""
|
||||
"Disable woocommerce download page. Process downloads though license order "
|
||||
"info page."
|
||||
msgstr ""
|
||||
"Disable woocommerce download page. Process downloads though license order "
|
||||
"info page."
|
||||
|
||||
#: admin/slm-lic-settings.php:236
|
||||
msgid ""
|
||||
"Expire WooCommerce downloads. Downloads will expire together with "
|
||||
"corresponding license."
|
||||
msgstr ""
|
||||
"Expire WooCommerce downloads. Downloads will expire together with "
|
||||
"corresponding license."
|
||||
|
||||
#: admin/slm-lic-settings.php:240
|
||||
msgid "Download Manager Support"
|
||||
msgstr "Download Manager Support"
|
||||
|
||||
#: admin/slm-lic-settings.php:243
|
||||
msgid ""
|
||||
"Download Manager Plugin – Adds a simple download manager to your WordPress "
|
||||
"blog."
|
||||
msgstr ""
|
||||
"Download Manager Plugin – Adds a simple download manager to your WordPress "
|
||||
"blog."
|
||||
|
||||
#: admin/slm-lic-settings.php:247
|
||||
msgid "WP eStores Support"
|
||||
msgstr "WP eStores Support"
|
||||
|
||||
#: admin/slm-lic-settings.php:250
|
||||
msgid ""
|
||||
"WordPress eStore Plugin – Complete Solution to Sell Digital Products from "
|
||||
"Your WordPress Blog Securely"
|
||||
msgstr ""
|
||||
"WordPress eStore Plugin – Complete Solution to Sell Digital Products from "
|
||||
"Your WordPress Blog Securely"
|
||||
|
||||
#: admin/slm-lic-settings.php:262
|
||||
msgid "Enable Debug Logging"
|
||||
msgstr "Enable Debug Logging"
|
||||
|
||||
#: admin/slm-lic-settings.php:265
|
||||
msgid "If checked, debug output will be written to log files."
|
||||
msgstr "If checked, debug output will be written to log files."
|
||||
|
||||
#: admin/slm-lic-settings.php:276
|
||||
msgid "Expiration reminder"
|
||||
msgstr "Expiration reminder"
|
||||
|
||||
#: admin/slm-lic-settings.php:286
|
||||
msgid "Update Options"
|
||||
msgstr "Update Options"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:27
|
||||
msgid "No licenses avaliable."
|
||||
msgstr "No licenses avaliable."
|
||||
|
||||
#: admin/slm-list-licenses-class.php:43
|
||||
msgid "All"
|
||||
msgstr "All"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:50
|
||||
msgid "active"
|
||||
msgstr "active"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:57
|
||||
msgid "pending"
|
||||
msgstr "pending"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:64
|
||||
msgid "expired"
|
||||
msgstr "expired"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:71
|
||||
msgid "blocked"
|
||||
msgstr "blocked"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:212 admin/slm-list-licenses-class.php:229
|
||||
#: admin/slm-list-licenses-class.php:246 admin/slm-list-licenses-class.php:263
|
||||
msgid "Error - Please select some records using the checkboxes"
|
||||
msgstr "Error - Please select some records using the checkboxes"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:404
|
||||
msgid "Create license"
|
||||
msgstr "Create license"
|
||||
|
||||
#: admin/slm-manage-licenses.php:15
|
||||
msgid "You do not have permission to manage this license."
|
||||
msgstr "You do not have permission to manage this license."
|
||||
|
||||
#: admin/slm-manage-licenses.php:36
|
||||
msgid "Overview - Manage licenses"
|
||||
msgstr "Overview - Manage licenses"
|
||||
|
||||
#: admin/slm-manage-licenses.php:38
|
||||
msgid "Add New"
|
||||
msgstr "Add New"
|
||||
|
||||
#: admin/slm-manage-licenses.php:62 admin/slm-subscribers.php:219
|
||||
msgid "Search"
|
||||
msgstr "Search"
|
||||
|
||||
#: admin/slm-subscribers.php:178
|
||||
msgid "Overview - Manage Subscribers"
|
||||
msgstr "Overview - Manage Subscribers"
|
||||
|
||||
#: admin/slm-subscribers.php:180
|
||||
msgid "View all"
|
||||
msgstr "View all"
|
||||
|
||||
#: admin/slm-subscribers.php:189
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#: admin/slm-subscribers.php:190 woocommerce/includes/purchase.php:500
|
||||
#: woocommerce/includes/purchase.php:539
|
||||
#: woocommerce/includes/wc_licenses_class.php:108
|
||||
msgid "License key"
|
||||
msgstr "License key"
|
||||
|
||||
#: admin/slm-subscribers.php:191 woocommerce/includes/wc_licenses_class.php:106
|
||||
#: woocommerce/includes/wc_licenses_class.php:119
|
||||
msgid "Status"
|
||||
msgstr "Status"
|
||||
|
||||
#: admin/slm-subscribers.php:208
|
||||
msgid "Overview - All Subscribers"
|
||||
msgstr "Overview - All Subscribers"
|
||||
|
||||
#: admin/slm_about_menu.php:21
|
||||
msgid "Credits and authors"
|
||||
msgstr "Credits and authors"
|
||||
|
||||
#: includes/slm-plugin-core.php:56
|
||||
msgid "GitHub"
|
||||
msgstr "GitHub"
|
||||
|
||||
#: includes/slm-utility.php:571
|
||||
msgid "License information"
|
||||
msgstr "License information"
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:54
|
||||
msgid "View details"
|
||||
msgstr "View details"
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:77
|
||||
#, php-format
|
||||
msgid "More information about %s"
|
||||
msgstr "More information about %s"
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:128
|
||||
msgid "Check for updates"
|
||||
msgstr "Check for updates"
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:213
|
||||
#, php-format
|
||||
msgctxt "the plugin title"
|
||||
msgid "The %s plugin is up to date."
|
||||
msgstr "The %s plugin is up to date."
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:215
|
||||
#, php-format
|
||||
msgctxt "the plugin title"
|
||||
msgid "A new version of the %s plugin is available."
|
||||
msgstr "A new version of the %s plugin is available."
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:217
|
||||
#, php-format
|
||||
msgctxt "the plugin title"
|
||||
msgid "Could not determine if updates are available for %s."
|
||||
msgstr "Could not determine if updates are available for %s."
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:223
|
||||
#, php-format
|
||||
msgid "Unknown update checker status \"%s\""
|
||||
msgstr "Unknown update checker status \"%s\""
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Vcs/PluginUpdateChecker.php:98
|
||||
msgid "There is no changelog available."
|
||||
msgstr "There is no changelog available."
|
||||
|
||||
#: woocommerce/includes/purchase.php:152
|
||||
msgid "License could not be created: Invalid sites allowed number."
|
||||
msgstr "License could not be created: Invalid sites allowed number."
|
||||
|
||||
#: woocommerce/includes/purchase.php:268
|
||||
msgid "License Key(s) generated"
|
||||
msgstr "License Key(s) generated"
|
||||
|
||||
#: woocommerce/includes/purchase.php:288
|
||||
msgid "License Key(s) could not be created."
|
||||
msgstr "License Key(s) could not be created."
|
||||
|
||||
#: woocommerce/includes/purchase.php:437
|
||||
msgid "Order confirmation email sent to: <a href='mailto:"
|
||||
msgstr "Order confirmation email sent to: <a href='mailto:"
|
||||
|
||||
#: woocommerce/includes/purchase.php:461
|
||||
msgid "My subscriptions"
|
||||
msgstr "My subscriptions"
|
||||
|
||||
#: woocommerce/includes/purchase.php:461
|
||||
msgid "My Account"
|
||||
msgstr "My Account"
|
||||
|
||||
#: woocommerce/includes/purchase.php:461
|
||||
msgid "You can see and manage your licenses inside your account"
|
||||
msgstr "You can see and manage your licenses inside your account"
|
||||
|
||||
#: woocommerce/includes/purchase.php:461
|
||||
msgid "Manage Licenses"
|
||||
msgstr "Manage Licenses"
|
||||
|
||||
#: woocommerce/includes/purchase.php:501
|
||||
msgid "License expiration"
|
||||
msgstr "License expiration"
|
||||
|
||||
#: woocommerce/includes/purchase.php:502
|
||||
#: woocommerce/includes/wc_licenses_class.php:171
|
||||
msgid "License type"
|
||||
msgstr "License type"
|
||||
|
||||
#: woocommerce/includes/purchase.php:503
|
||||
msgid "License item reference"
|
||||
msgstr "License item reference"
|
||||
|
||||
#: woocommerce/includes/purchase.php:504
|
||||
msgid "License status"
|
||||
msgstr "License status"
|
||||
|
||||
#: woocommerce/includes/purchase.php:505
|
||||
msgid "License current version"
|
||||
msgstr "License current version"
|
||||
|
||||
#: woocommerce/includes/purchase.php:506
|
||||
msgid "Supported until version"
|
||||
msgstr "Supported until version"
|
||||
|
||||
#: woocommerce/includes/purchase.php:535
|
||||
msgid "License details"
|
||||
msgstr "License details"
|
||||
|
||||
#: woocommerce/includes/purchase.php:540
|
||||
msgid "Type"
|
||||
msgstr "Type"
|
||||
|
||||
#: woocommerce/includes/purchase.php:549
|
||||
msgid "view my licenses"
|
||||
msgstr "view my licenses"
|
||||
|
||||
#: woocommerce/includes/purchase.php:593
|
||||
msgid "License keys"
|
||||
msgstr "License keys"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:24
|
||||
msgid "License Manager"
|
||||
msgstr "License Manager"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:26
|
||||
msgid "Enables the license creation api."
|
||||
msgstr "Enables the license creation api."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:82
|
||||
msgid "Licensing"
|
||||
msgstr "Licensing"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:105
|
||||
msgid "Domain Licenses"
|
||||
msgstr "Domain Licenses"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:114
|
||||
msgid "Enter the allowed amount of domains this license can have (websites)."
|
||||
msgstr "Enter the allowed amount of domains this license can have (websites)."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:124
|
||||
msgid "Devices Licenses"
|
||||
msgstr "Devices Licenses"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:133
|
||||
msgid ""
|
||||
"Enter the allowed amount of devices this license can have (computers, "
|
||||
"mobile, etc)."
|
||||
msgstr ""
|
||||
"Enter the allowed amount of devices this license can have (computers, "
|
||||
"mobile, etc)."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:140
|
||||
msgid "Item reference"
|
||||
msgstr "Item reference"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:143
|
||||
msgid ""
|
||||
"Enter the item reference of your application, theme, or plug-in. The licence "
|
||||
"will be then bound to this exact software."
|
||||
msgstr ""
|
||||
"Enter the item reference of your application, theme, or plug-in. The licence "
|
||||
"will be then bound to this exact software."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:150
|
||||
msgid "License Type"
|
||||
msgstr "License Type"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:155
|
||||
msgid "Select one"
|
||||
msgstr "Select one"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:156
|
||||
msgid "subscription"
|
||||
msgstr "subscription"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:157
|
||||
msgid "lifetime"
|
||||
msgstr "lifetime"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:166
|
||||
msgid "Renewal period lenght "
|
||||
msgstr "Renewal period lenght "
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:168
|
||||
msgid "Amount of days or months or years"
|
||||
msgstr "Amount of days or months or years"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:175
|
||||
msgid "Expiration term"
|
||||
msgstr "Expiration term"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:177
|
||||
msgid "Choose between days or months or years"
|
||||
msgstr "Choose between days or months or years"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:179
|
||||
msgid "Day(s)"
|
||||
msgstr "Day(s)"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:180
|
||||
msgid "Month(s)"
|
||||
msgstr "Month(s)"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:181
|
||||
msgid "Year(s)"
|
||||
msgstr "Year(s)"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:182
|
||||
msgid "One Time"
|
||||
msgstr "One Time"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:191
|
||||
msgid "Current Version"
|
||||
msgstr "Current Version"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:194
|
||||
msgid "Enter the current version of your application, theme, or plug-in"
|
||||
msgstr "Enter the current version of your application, theme, or plug-in"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:201
|
||||
msgid "Until Version"
|
||||
msgstr "Until Version"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:204
|
||||
msgid "Enter the version until support expires."
|
||||
msgstr "Enter the version until support expires."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:283
|
||||
msgid "License product"
|
||||
msgstr "License product"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:53
|
||||
#: woocommerce/includes/wc_licenses_class.php:65
|
||||
msgid "My Licenses"
|
||||
msgstr "My Licenses"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:105
|
||||
msgid "Order"
|
||||
msgstr "Order"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:109
|
||||
#: woocommerce/includes/wc_licenses_class.php:138
|
||||
msgid "Renews on"
|
||||
msgstr "Renews on"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:110
|
||||
msgid "Info"
|
||||
msgstr "Info"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:145
|
||||
msgid "Expired"
|
||||
msgstr "Expired"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:150
|
||||
msgid "Lifetime"
|
||||
msgstr "Lifetime"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:154
|
||||
msgid "view"
|
||||
msgstr "view"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:168
|
||||
msgid "Expiration"
|
||||
msgstr "Expiration"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:169
|
||||
msgid "Allowed devices"
|
||||
msgstr "Allowed devices"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:170
|
||||
msgid "Allowed Domains"
|
||||
msgstr "Allowed Domains"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:172
|
||||
msgid "Date renewwed"
|
||||
msgstr "Date renewwed"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:173
|
||||
msgid "Activation Date"
|
||||
msgstr "Activation Date"
|
||||
|
||||
#: woocommerce/includes/wc_licenses_class.php:203
|
||||
msgid "Export license"
|
||||
msgstr "Export license"
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
msgid "https://github.com/michelve/software-license-manager/"
|
||||
msgstr "https://github.com/michelve/software-license-manager/"
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid ""
|
||||
"Software license management solution for your web applications (WordPress "
|
||||
"plugins, Themes, Applications, PHP based membership script etc.). Supports "
|
||||
"WooCommerce."
|
||||
msgstr ""
|
||||
"Software license management solution for your web applications (WordPress "
|
||||
"plugins, Themes, Applications, PHP based membership script etc.). Supports "
|
||||
"WooCommerce."
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Michel Velis"
|
||||
msgstr "Michel Velis"
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "https://www.epikly.com/"
|
||||
msgstr "https://www.epikly.com/"
|
Binary file not shown.
|
@ -1,700 +0,0 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Software License Manager\n"
|
||||
"POT-Creation-Date: 2020-04-29 13:47-0400\n"
|
||||
"PO-Revision-Date: 2020-04-29 13:47-0400\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: es_ES\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.3\n"
|
||||
"X-Poedit-Basepath: ../..\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
|
||||
"X-Poedit-WPHeader: software-license-manager.php\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
||||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
||||
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
|
||||
"X-Poedit-SearchPathExcluded-1: node_modules\n"
|
||||
|
||||
#: admin/includes/cronjobs/slm-tasks.php:10
|
||||
msgid "Every day"
|
||||
msgstr "Cada día"
|
||||
|
||||
#: admin/includes/wpestores/slm-wpestores.php:70
|
||||
msgid "Item Name: "
|
||||
msgstr "Nombre del artículo"
|
||||
|
||||
#: admin/includes/wpestores/slm-wpestores.php:70
|
||||
msgid "License Key: "
|
||||
msgstr "Clave de licencia"
|
||||
|
||||
#: admin/slm-add-licenses.php:149
|
||||
msgid "Record could not be inserted into the database!"
|
||||
msgstr "¡No se pudo insertar un registro en la base de datos!"
|
||||
|
||||
#: admin/slm-add-licenses.php:157
|
||||
msgid "Update of the license key table failed!"
|
||||
msgstr "¡Error al actualizar la tabla de claves de licencia!"
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
#: admin/slm-add-licenses.php:190
|
||||
msgid "Software License Manager"
|
||||
msgstr "Administrador de licencias de software"
|
||||
|
||||
#: admin/slm-add-licenses.php:193
|
||||
msgid "You can add a new license or edit an existing one from this interface."
|
||||
msgstr ""
|
||||
"Puede agregar una nueva licencia o editar una existente desde esta interfaz."
|
||||
|
||||
#: admin/slm-add-licenses.php:239 admin/slm-add-licenses.php:304
|
||||
msgid "License key and status"
|
||||
msgstr "Clave de licencia y estado"
|
||||
|
||||
#: admin/slm-add-licenses.php:243
|
||||
msgid "User information"
|
||||
msgstr "Información de usuario"
|
||||
|
||||
#: admin/slm-add-licenses.php:249
|
||||
msgid "Devices & Domains"
|
||||
msgstr "Dispositivos y Dominios"
|
||||
|
||||
#: admin/slm-add-licenses.php:254
|
||||
msgid "Transaction"
|
||||
msgstr "Transacción"
|
||||
|
||||
#: admin/slm-add-licenses.php:258
|
||||
msgid "Product"
|
||||
msgstr "Producto"
|
||||
|
||||
#: admin/slm-add-licenses.php:264
|
||||
msgid "Activity log "
|
||||
msgstr "Registro de actividad"
|
||||
|
||||
#: admin/slm-add-licenses.php:271
|
||||
msgid "Export "
|
||||
msgstr "Esportar "
|
||||
|
||||
#: admin/slm-add-licenses.php:309
|
||||
msgid "License Key"
|
||||
msgstr "Clave de licencia"
|
||||
|
||||
#: admin/slm-add-licenses.php:311
|
||||
msgid "The unique license key."
|
||||
msgstr "La clave de licencia única."
|
||||
|
||||
#: admin/slm-add-licenses.php:316
|
||||
msgid "License Status"
|
||||
msgstr "Estado de la licencia"
|
||||
|
||||
#: admin/slm-add-licenses.php:342
|
||||
msgid "Subscription"
|
||||
msgstr "Suscripción"
|
||||
|
||||
#: admin/slm-add-licenses.php:345
|
||||
msgid "Life-time"
|
||||
msgstr "Vida útil"
|
||||
|
||||
#: admin/slm-add-licenses.php:347 woocommerce/includes/slm-meta-boxes.php:143
|
||||
msgid "type of license: subscription base or lifetime"
|
||||
msgstr "tipo de licencia: base de suscripción o duración"
|
||||
|
||||
#: admin/slm-add-licenses.php:361
|
||||
msgid "User Information"
|
||||
msgstr "Información del usuario"
|
||||
|
||||
#: admin/slm-add-licenses.php:367
|
||||
msgid "First Name"
|
||||
msgstr "Primer Nombre"
|
||||
|
||||
#: admin/slm-add-licenses.php:369
|
||||
msgid "License user's first name"
|
||||
msgstr "Nombre del usuario de la licencia"
|
||||
|
||||
#: admin/slm-add-licenses.php:373
|
||||
msgid " Last Name"
|
||||
msgstr " Apellido"
|
||||
|
||||
#: admin/slm-add-licenses.php:375
|
||||
msgid "License user's last name"
|
||||
msgstr "Apellido del usuario de la licencia"
|
||||
|
||||
#: admin/slm-add-licenses.php:382
|
||||
msgid "Subscriber ID"
|
||||
msgstr "Suscriptor ID"
|
||||
|
||||
#: admin/slm-add-licenses.php:384
|
||||
msgid ""
|
||||
"The Subscriber ID (if any). Can be useful if you are using the license key "
|
||||
"with a recurring payment plan."
|
||||
msgstr ""
|
||||
"El ID del suscriptor (si existe). Puede ser útil si está utilizando la clave "
|
||||
"de licencia con un plan de pago recurrente."
|
||||
|
||||
#: admin/slm-add-licenses.php:389
|
||||
msgid "Email Address"
|
||||
msgstr "Correo electrónico"
|
||||
|
||||
#: admin/slm-add-licenses.php:416
|
||||
msgid "Allowed Activations"
|
||||
msgstr "Activaciones permitidas"
|
||||
|
||||
#: admin/slm-add-licenses.php:422 admin/slm-lic-settings.php:144
|
||||
msgid "Maximum Allowed Domains"
|
||||
msgstr "Máximo de dominios permitidos"
|
||||
|
||||
#: admin/slm-add-licenses.php:424
|
||||
msgid "Number of domains/installs in which this license can be used"
|
||||
msgstr ""
|
||||
"Número de dominios/instalaciones en los que se puede utilizar esta licencia"
|
||||
|
||||
#: admin/slm-add-licenses.php:506
|
||||
msgid "Advanced Details"
|
||||
msgstr "Detalles avanzados"
|
||||
|
||||
#: admin/slm-add-licenses.php:566
|
||||
msgid "Product Informations"
|
||||
msgstr "Información del producto"
|
||||
|
||||
#: admin/slm-add-licenses.php:634
|
||||
msgid "Item reference of your software"
|
||||
msgstr "Referencia de artículos de su software"
|
||||
|
||||
#: admin/slm-add-licenses.php:652
|
||||
msgid "Export License"
|
||||
msgstr "Licencia de exportación"
|
||||
|
||||
#: admin/slm-add-licenses.php:672
|
||||
msgid "Activity Log"
|
||||
msgstr "Registro de actividades"
|
||||
|
||||
#: admin/slm-admin-functions.php:41
|
||||
msgid "Send Deactivation Message for a License"
|
||||
msgstr "Enviar mensaje de desactivación para una licencia"
|
||||
|
||||
#: admin/slm-admin-functions.php:43
|
||||
msgid "Enter the URL where the license deactivation message will be sent to"
|
||||
msgstr ""
|
||||
"Introduzca la URL a la que se enviará el mensaje de desactivación de la "
|
||||
"licencia"
|
||||
|
||||
#: admin/slm-dashboard-widgets.php:30 admin/slm-dashboard-widgets.php:33
|
||||
msgid "SLM"
|
||||
msgstr "Slm"
|
||||
|
||||
#: admin/slm-dashboard-widgets.php:42
|
||||
msgid "Overview"
|
||||
msgstr "Resumen"
|
||||
|
||||
#: admin/slm-dashboard-widgets.php:52
|
||||
msgid "Add new license"
|
||||
msgstr "Añadir nueva licencia"
|
||||
|
||||
#: admin/slm-dashboard-widgets.php:62 includes/slm-plugin-core.php:55
|
||||
msgid "Settings"
|
||||
msgstr "Parámetros"
|
||||
|
||||
#: admin/slm-lic-settings.php:21
|
||||
msgid "Debug log files have been reset!"
|
||||
msgstr ""
|
||||
|
||||
#: admin/slm-lic-settings.php:56
|
||||
msgid "Options updated!"
|
||||
msgstr ""
|
||||
|
||||
#: admin/slm-lic-settings.php:86
|
||||
msgid "General Settings"
|
||||
msgstr "Configuración general"
|
||||
|
||||
#: admin/slm-lic-settings.php:90
|
||||
msgid "Integrations"
|
||||
msgstr "Integraciones"
|
||||
|
||||
#: admin/slm-lic-settings.php:94
|
||||
msgid "Debugging settings"
|
||||
msgstr "Parámetros"
|
||||
|
||||
#: admin/slm-lic-settings.php:98
|
||||
msgid "Emails"
|
||||
msgstr "Emails"
|
||||
|
||||
#: admin/slm-lic-settings.php:125
|
||||
msgid "Secret Key for License Creation"
|
||||
msgstr "Clave secreta para la creación de licencias"
|
||||
|
||||
#: admin/slm-lic-settings.php:128
|
||||
msgid ""
|
||||
"This secret key will be used to authenticate any license creation request. "
|
||||
"You can change it with something random."
|
||||
msgstr ""
|
||||
"Esta clave secreta se utilizará para autenticar cualquier solicitud de "
|
||||
"creación de licencia. Puedes cambiarlo con algo aleatorio."
|
||||
|
||||
#: admin/slm-lic-settings.php:132
|
||||
msgid "Secret Key for License Verification Requests"
|
||||
msgstr "Clave secreta para las solicitudes de verificación de licencias"
|
||||
|
||||
#: admin/slm-lic-settings.php:134
|
||||
msgid ""
|
||||
"This secret key will be used to authenticate any license verification "
|
||||
"request from customer's site. Important! Do not change this value once your "
|
||||
"customers start to use your product(s)!"
|
||||
msgstr ""
|
||||
"Esta clave secreta se usará para autenticar cualquier solicitud de "
|
||||
"verificación de licencia desde el sitio del cliente. ¡Importante! ¡No cambie "
|
||||
"este valor una vez que sus clientes comiencen a usar su(s) producto(s)!"
|
||||
|
||||
#: admin/slm-lic-settings.php:138
|
||||
msgid "License Key Prefix"
|
||||
msgstr "Prefijo de clave de licencia"
|
||||
|
||||
#: admin/slm-lic-settings.php:140
|
||||
msgid ""
|
||||
"You can optionaly specify a prefix for the license keys. This prefix will be "
|
||||
"added to the uniquely generated license keys."
|
||||
msgstr ""
|
||||
"Opcionalmente, puede especificar un prefijo para las claves de licencia. "
|
||||
"Este prefijo se agregará a las claves de licencia generadas de forma única."
|
||||
|
||||
#: admin/slm-lic-settings.php:146
|
||||
msgid ""
|
||||
"Maximum number of domains/installs which each license is valid for (default "
|
||||
"value)."
|
||||
msgstr ""
|
||||
"Número máximo de dominios/instalaciones para los que cada licencia es válida "
|
||||
"(valor predeterminado)."
|
||||
|
||||
#: admin/slm-lic-settings.php:150
|
||||
msgid "Maximum Allowed Devices"
|
||||
msgstr "Máximo de dispositivos permitidos"
|
||||
|
||||
#: admin/slm-lic-settings.php:152
|
||||
msgid ""
|
||||
"Maximum number of devices which each license is valid for (default value)."
|
||||
msgstr ""
|
||||
"Número máximo de dispositivos para los que cada licencia es válida (valor "
|
||||
"predeterminado)."
|
||||
|
||||
#: admin/slm-lic-settings.php:156
|
||||
msgid "Auto Expire License Keys"
|
||||
msgstr "Claves de licencia de expiración automática"
|
||||
|
||||
#: admin/slm-lic-settings.php:158
|
||||
msgid "Enable auto expiration "
|
||||
msgstr "Habilitar la expiración automática"
|
||||
|
||||
#: admin/slm-lic-settings.php:159
|
||||
msgid ""
|
||||
" When enabled, it will automatically set the status of a license key to "
|
||||
"\"Expired\" when the expiry date value of the key is reached. It doesn't "
|
||||
"remotely deactivate a key. It simply changes the status of the key in your "
|
||||
"database to expired."
|
||||
msgstr ""
|
||||
"Cuando está habilitado, establecerá automáticamente el estado de una clave "
|
||||
"de licencia en \"Expirado\" cuando se alcance el valor de fecha de caducidad "
|
||||
"de la clave. No desactiva de forma remota una clave. Simplemente cambia el "
|
||||
"estado de la clave en la base de datos a caducado."
|
||||
|
||||
#: admin/slm-lic-settings.php:163
|
||||
msgid "General settings"
|
||||
msgstr "Los ajustes generales"
|
||||
|
||||
#: admin/slm-lic-settings.php:166
|
||||
msgid "Enable stats in licenses overview page."
|
||||
msgstr ""
|
||||
"Habilite las estadísticas en la página de información general de licencias."
|
||||
|
||||
#: admin/slm-lic-settings.php:173
|
||||
msgid "Enable admin bar shortcut link"
|
||||
msgstr "Habilitar enlace de acceso directo de la barra de administración"
|
||||
|
||||
#: admin/slm-lic-settings.php:177
|
||||
msgid "Multiple items validation"
|
||||
msgstr "Validación de varios elementos"
|
||||
|
||||
#: admin/slm-lic-settings.php:180
|
||||
msgid "Enable verification of Item reference."
|
||||
msgstr "Habilite la verificación de la referencia del artículo."
|
||||
|
||||
#: admin/slm-lic-settings.php:181
|
||||
msgid ""
|
||||
"When enabled, there will be another field in Licenced product - Item "
|
||||
"reference. This field should correspond to the API parameter item_reference "
|
||||
"of your software."
|
||||
msgstr ""
|
||||
"Cuando está habilitado, habrá otro campo en Producto con licencia - "
|
||||
"Referencia de artículo. Este campo debe corresponder al parámetro API "
|
||||
"item_reference del software."
|
||||
|
||||
#: admin/slm-lic-settings.php:189
|
||||
msgid "Enable Bootstrap javascript libray."
|
||||
msgstr "Habilite la libray javascript de Bootstrap."
|
||||
|
||||
#: admin/slm-lic-settings.php:201
|
||||
msgid "Woocommerce Support"
|
||||
msgstr "Soporte técnico de Woocommerce"
|
||||
|
||||
#: admin/slm-lic-settings.php:204
|
||||
msgid ""
|
||||
"A fully customizable, open source eCommerce platform built for WordPress."
|
||||
msgstr ""
|
||||
"Una plataforma de comercio electrónico totalmente personalizable y de código "
|
||||
"abierto creada para WordPress."
|
||||
|
||||
#: admin/slm-lic-settings.php:210
|
||||
msgid ""
|
||||
"Disable woocommerce download page. Process downloads though license order "
|
||||
"info page."
|
||||
msgstr ""
|
||||
"Deshabilite la página de descarga de woocommerce. Procesar descargas a "
|
||||
"través de la página de información del pedido de licencia."
|
||||
|
||||
#: admin/slm-lic-settings.php:213
|
||||
msgid "Download Manager Support"
|
||||
msgstr "Descargar soporte de Manager"
|
||||
|
||||
#: admin/slm-lic-settings.php:216
|
||||
msgid ""
|
||||
"Download Manager Plugin – Adds a simple download manager to your WordPress "
|
||||
"blog."
|
||||
msgstr ""
|
||||
"Descargar Manager Plugin – Agrega un simple gestor de descargas a tu blog de "
|
||||
"WordPress."
|
||||
|
||||
#: admin/slm-lic-settings.php:220
|
||||
msgid "WP eStores Support"
|
||||
msgstr "Soporte de WP eStores"
|
||||
|
||||
#: admin/slm-lic-settings.php:223
|
||||
msgid ""
|
||||
"WordPress eStore Plugin – Complete Solution to Sell Digital Products from "
|
||||
"Your WordPress Blog Securely"
|
||||
msgstr ""
|
||||
"WordPress eStore Plugin – Solución completa para vender productos digitales "
|
||||
"de su blog de WordPress de forma segura"
|
||||
|
||||
#: admin/slm-lic-settings.php:235
|
||||
msgid "Enable Debug Logging"
|
||||
msgstr "Habilitar el registro de depuración"
|
||||
|
||||
#: admin/slm-lic-settings.php:238
|
||||
msgid ""
|
||||
"If checked, debug output will be written to log files (keep it disabled "
|
||||
"unless you are troubleshooting)."
|
||||
msgstr ""
|
||||
"Si está marcada, la salida de depuración se escribirá en los archivos de "
|
||||
"registro (manténgala deshabilitada a menos que esté solucionando problemas)."
|
||||
|
||||
#: admin/slm-lic-settings.php:249
|
||||
msgid "Expiration reminder"
|
||||
msgstr "Recordatorio de expiración"
|
||||
|
||||
#: admin/slm-lic-settings.php:259
|
||||
msgid "Update Options"
|
||||
msgstr "Opciones de actualización"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:27
|
||||
msgid "No licenses avaliable."
|
||||
msgstr "No hay licencias disponibles."
|
||||
|
||||
#: admin/slm-list-licenses-class.php:43
|
||||
msgid "All"
|
||||
msgstr "Todos"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:50
|
||||
msgid "active"
|
||||
msgstr "activo"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:57
|
||||
msgid "pending"
|
||||
msgstr "pendiente"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:64
|
||||
msgid "expired"
|
||||
msgstr "caducado"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:71
|
||||
msgid "blocked"
|
||||
msgstr "bloqueado"
|
||||
|
||||
#: admin/slm-list-licenses-class.php:210 admin/slm-list-licenses-class.php:227
|
||||
#: admin/slm-list-licenses-class.php:244 admin/slm-list-licenses-class.php:261
|
||||
msgid "Error - Please select some records using the checkboxes"
|
||||
msgstr ""
|
||||
"Error - Seleccione algunos registros usando las casillas de verificación"
|
||||
|
||||
#: admin/slm-manage-licenses.php:15
|
||||
msgid "You do not have permission to manage this license."
|
||||
msgstr "No tiene permiso para administrar esta licencia."
|
||||
|
||||
#: admin/slm-manage-licenses.php:36
|
||||
msgid "Overview - Manage licenses"
|
||||
msgstr "Descripción general - Administrar licencias"
|
||||
|
||||
#: admin/slm-manage-licenses.php:38
|
||||
msgid "Add New"
|
||||
msgstr "Añadir nueva"
|
||||
|
||||
#: admin/slm-manage-licenses.php:65 admin/slm-subscribers.php:219
|
||||
msgid "Search"
|
||||
msgstr "Buscar"
|
||||
|
||||
#: admin/slm-subscribers.php:178
|
||||
msgid "Overview - Manage Subscribers"
|
||||
msgstr "Visión general - Administrar suscriptores"
|
||||
|
||||
#: admin/slm-subscribers.php:180
|
||||
msgid "View all"
|
||||
msgstr "Ver todos los"
|
||||
|
||||
#: admin/slm-subscribers.php:189
|
||||
msgid "ID"
|
||||
msgstr "Id"
|
||||
|
||||
#: admin/slm-subscribers.php:190 woocommerce/includes/purchase.php:419
|
||||
msgid "License key"
|
||||
msgstr "Clave de licencia"
|
||||
|
||||
#: admin/slm-subscribers.php:191
|
||||
msgid "Status"
|
||||
msgstr "Estado"
|
||||
|
||||
#: admin/slm-subscribers.php:208
|
||||
msgid "Overview - All Subscribers"
|
||||
msgstr "Visión general - Todos los suscriptores"
|
||||
|
||||
#: admin/slm_about_menu.php:21
|
||||
msgid "Credits and authors"
|
||||
msgstr "Créditos y autores"
|
||||
|
||||
#: includes/slm-plugin-core.php:56
|
||||
msgid "GitHub"
|
||||
msgstr "GitHub"
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:54
|
||||
msgid "View details"
|
||||
msgstr "Ver detalles"
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:77
|
||||
#, php-format
|
||||
msgid "More information about %s"
|
||||
msgstr "Más información sobre %s"
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:128
|
||||
msgid "Check for updates"
|
||||
msgstr "Buscar actualizaciones"
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:213
|
||||
#, php-format
|
||||
msgctxt "the plugin title"
|
||||
msgid "The %s plugin is up to date."
|
||||
msgstr "El plugin %s está actualizado."
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:215
|
||||
#, php-format
|
||||
msgctxt "the plugin title"
|
||||
msgid "A new version of the %s plugin is available."
|
||||
msgstr "Una nueva versión del %s plugin está disponible."
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:217
|
||||
#, php-format
|
||||
msgctxt "the plugin title"
|
||||
msgid "Could not determine if updates are available for %s."
|
||||
msgstr "No se pudo determinar si hay actualizaciones disponibles para %s."
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Plugin/Ui.php:223
|
||||
#, php-format
|
||||
msgid "Unknown update checker status \"%s\""
|
||||
msgstr "Estado de actualización desconocido \"%s\""
|
||||
|
||||
#: plugin-update-checker/Puc/v4p9/Vcs/PluginUpdateChecker.php:98
|
||||
msgid "There is no changelog available."
|
||||
msgstr "No hay changelog disponible."
|
||||
|
||||
#: woocommerce/includes/my-licenses-page.php:47
|
||||
#: woocommerce/includes/my-licenses-page.php:58
|
||||
msgid "My Licenses"
|
||||
msgstr "Mis licencias"
|
||||
|
||||
#: woocommerce/includes/purchase.php:95
|
||||
msgid "License could not be created: Invalid sites allowed number."
|
||||
msgstr "No se pudo crear la licencia: número permitido de sitios no válidos."
|
||||
|
||||
#: woocommerce/includes/purchase.php:223
|
||||
msgid "License Key(s) generated"
|
||||
msgstr "Clave(s) de licencia generada(s)"
|
||||
|
||||
#: woocommerce/includes/purchase.php:241
|
||||
msgid "License Key(s) could not be created."
|
||||
msgstr "No se han podido crear claves de licencia."
|
||||
|
||||
#: woocommerce/includes/purchase.php:357
|
||||
msgid "Order confirmation email sent to: <a href='mailto:"
|
||||
msgstr ""
|
||||
"Correo electrónico de confirmación del pedido enviado a: <a href-'mailto:"
|
||||
|
||||
#: woocommerce/includes/purchase.php:420
|
||||
msgid "License expiration"
|
||||
msgstr "Caducidad de la licencia"
|
||||
|
||||
#: woocommerce/includes/purchase.php:421
|
||||
msgid "License type"
|
||||
msgstr "Tipo de Licencia"
|
||||
|
||||
#: woocommerce/includes/purchase.php:422
|
||||
msgid "License item reference"
|
||||
msgstr "Referencia del elemento de licencia"
|
||||
|
||||
#: woocommerce/includes/purchase.php:423
|
||||
msgid "License status"
|
||||
msgstr "Estado de la licencia"
|
||||
|
||||
#: woocommerce/includes/purchase.php:424
|
||||
msgid "License current version"
|
||||
msgstr "Licencia versión actual"
|
||||
|
||||
#: woocommerce/includes/purchase.php:425
|
||||
msgid "Supported until version"
|
||||
msgstr "Soportado hasta la versión"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:23
|
||||
msgid "License Manager"
|
||||
msgstr "Administrador de licencias"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:25
|
||||
msgid "Enables the license creation api."
|
||||
msgstr "Habilita la API de creación de licencias."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:81
|
||||
msgid "Licensing"
|
||||
msgstr "Licencias"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:99
|
||||
msgid "Domain Licenses"
|
||||
msgstr "Licencias de dominio"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:108
|
||||
msgid "Enter the allowed amount of domains this license can have (websites)."
|
||||
msgstr ""
|
||||
"Introduzca la cantidad permitida de dominios que esta licencia puede tener "
|
||||
"(sitios web)."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:114
|
||||
msgid "Devices Licenses"
|
||||
msgstr "Licencias de dispositivos"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:123
|
||||
msgid ""
|
||||
"Enter the allowed amount of devices this license can have (computers, "
|
||||
"mobile, etc)."
|
||||
msgstr ""
|
||||
"Introduzca la cantidad permitida de dispositivos que puede tener esta "
|
||||
"licencia (ordenadores, móviles, etc.)."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:130
|
||||
msgid "Item reference"
|
||||
msgstr "Referencia del elemento"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:133
|
||||
msgid ""
|
||||
"Enter the item reference of your application, theme, or plug-in. The licence "
|
||||
"will be then bound to this exact software."
|
||||
msgstr ""
|
||||
"Introduzca la referencia de elemento de la aplicación, el tema o el "
|
||||
"complemento. La licencia se enlazará a este software exacto."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:140
|
||||
msgid "License Type"
|
||||
msgstr "Tipo de licencia"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:145
|
||||
msgid "Select one"
|
||||
msgstr "Seleccione uno"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:146
|
||||
msgid "subscription"
|
||||
msgstr "suscripción"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:147
|
||||
msgid "lifetime"
|
||||
msgstr "toda la vida"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:156
|
||||
msgid "Renewal period lenght "
|
||||
msgstr "Duración del período de renovación"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:158
|
||||
msgid "Amount of days or months or years"
|
||||
msgstr "Cantidad de días o meses o años"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:165
|
||||
msgid "Expiration term"
|
||||
msgstr "Plazo de expiración"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:167
|
||||
msgid "Choose between days or months or years"
|
||||
msgstr "Elija entre días, meses o años"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:169
|
||||
msgid "Day(s)"
|
||||
msgstr "Día(s)"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:170
|
||||
msgid "Month(s)"
|
||||
msgstr "Mes(es)"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:171
|
||||
msgid "Year(s)"
|
||||
msgstr "Año(s)"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:172
|
||||
msgid "One Time"
|
||||
msgstr "Una vez"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:181
|
||||
msgid "Current Version"
|
||||
msgstr "Versión actual"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:184
|
||||
msgid "Enter the current version of your application, theme, or plug-in"
|
||||
msgstr ""
|
||||
"Introduzca la versión actual de la aplicación, el tema o el complemento"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:191
|
||||
msgid "Until Version"
|
||||
msgstr "Hasta la versión"
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:194
|
||||
msgid "Enter the version until support expires."
|
||||
msgstr "Introduzca la versión hasta que expire el soporte técnico."
|
||||
|
||||
#: woocommerce/includes/slm-meta-boxes.php:274
|
||||
msgid "License product"
|
||||
msgstr "Producto de licencia"
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
msgid "https://github.com/michelve/software-license-manager/"
|
||||
msgstr "https://github.com/michelve/software-license-manager/"
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid ""
|
||||
"Software license management solution for your web applications (WordPress "
|
||||
"plugins, Themes, Applications, PHP based membership script etc.). Supports "
|
||||
"WooCommerce."
|
||||
msgstr ""
|
||||
"Solución de gestión de licencias de software para sus aplicaciones web "
|
||||
"(plugins WordPress, Temas, Aplicaciones, script de membresía basado en PHP, "
|
||||
"etc.). Soporta WooCommerce."
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Michel Velis"
|
||||
msgstr "Michel Velis"
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "https://www.epikly.com/"
|
||||
msgstr "https://www.epikly.com/"
|
|
@ -1,26 +1,48 @@
|
|||
<?php
|
||||
/**
|
||||
* Runs on Uninstall of Software License Manager
|
||||
* Activator for SLM Plus
|
||||
*
|
||||
* @package Software License Manager
|
||||
* This class handles tasks that need to be performed when the plugin is activated.
|
||||
* It schedules cron jobs and triggers the database installation process.
|
||||
*
|
||||
* @package SLM Plus
|
||||
* @author Michel Velis
|
||||
* @license GPL-2.0+
|
||||
* @link http://epikly.com
|
||||
*/
|
||||
|
||||
// Prevent direct access to this file
|
||||
if (!defined('WPINC')) {
|
||||
die;
|
||||
}
|
||||
|
||||
class SLM_Activator {
|
||||
|
||||
public static function slm_db_install(){
|
||||
//Installer function
|
||||
/**
|
||||
* Install the plugin's database tables.
|
||||
* This function includes the database installer class.
|
||||
*/
|
||||
public static function slm_db_install() {
|
||||
require_once SLM_LIB . 'class-slm-installer.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs during plugin activation.
|
||||
* This method installs the necessary database tables and schedules a daily cron event.
|
||||
*/
|
||||
public static function activate() {
|
||||
//Do installer task
|
||||
// Run database installer
|
||||
self::slm_db_install();
|
||||
|
||||
//schedule a daily cron event
|
||||
wp_schedule_event(time(), 'daily', 'slm_daily_cron_event');
|
||||
// Schedule a daily cron event for license management tasks
|
||||
if (!wp_next_scheduled('slm_daily_cron_event')) {
|
||||
wp_schedule_event(time(), 'daily', 'slm_daily_cron_event');
|
||||
}
|
||||
|
||||
// Trigger any additional actions related to plugin activation
|
||||
do_action('slm_activation_complete');
|
||||
}
|
||||
}
|
||||
$slm_activator = new SLM_Activator();
|
||||
|
||||
// Instantiate the activator class
|
||||
$slm_activator = new SLM_Activator();
|
||||
|
|
|
@ -1,18 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Runs on Uninstall of Software License Manager
|
||||
* Deactivator for SLM Plus
|
||||
*
|
||||
* @package Software License Manager
|
||||
* This class handles tasks that need to be performed when the plugin is deactivated.
|
||||
* For example, it clears any scheduled cron jobs associated with the plugin.
|
||||
*
|
||||
* @package SLM Plus
|
||||
* @author Michel Velis
|
||||
* @license GPL-2.0+
|
||||
* @link http://epikly.com
|
||||
*/
|
||||
//Deactivation handler
|
||||
|
||||
// Prevent direct access to this file
|
||||
if (!defined('WPINC')) {
|
||||
die;
|
||||
}
|
||||
|
||||
// Deactivation handler class
|
||||
class SLM_Deactivator {
|
||||
|
||||
/**
|
||||
* Runs during plugin deactivation.
|
||||
* This method clears the daily cron job and triggers a custom deactivation action.
|
||||
*/
|
||||
public static function deactivate() {
|
||||
//Clear the daily cron event
|
||||
// Clear the daily cron event if it exists
|
||||
wp_clear_scheduled_hook('slm_daily_cron_event');
|
||||
|
||||
// Trigger any additional actions related to plugin deactivation
|
||||
do_action('slm_deactivation_complete');
|
||||
}
|
||||
}
|
||||
$slm_deactivator = new SLM_Deactivator();
|
||||
|
||||
// Instantiate the deactivator class
|
||||
$slm_deactivator = new SLM_Deactivator();
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Runs on Uninstall of Software License Manager
|
||||
* Runs on Installation of SLM Plus
|
||||
*
|
||||
* @package Software License Manager
|
||||
* @package SLM Plus
|
||||
* @author Michel Velis
|
||||
* @license GPL-2.0+
|
||||
* @link http://epikly.com
|
||||
|
@ -11,155 +11,177 @@
|
|||
global $wpdb;
|
||||
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
||||
|
||||
//***Installer variables***
|
||||
// Define table names
|
||||
$lic_key_table = SLM_TBL_LICENSE_KEYS;
|
||||
$lic_domain_table = SLM_TBL_LIC_DOMAIN;
|
||||
$lic_devices_table = SLM_TBL_LIC_DEVICES;
|
||||
$lic_log_tbl = SLM_TBL_LIC_LOG;
|
||||
$lic_emails_table = SLM_TBL_EMAILS;
|
||||
$lic_status_table = SLM_TBL_LICENSE_STATUS; // New Status Table
|
||||
|
||||
//***Database version check */
|
||||
// Check the current database version
|
||||
$used_db_version = get_option('slm_db_version', SLM_DB_VERSION);
|
||||
|
||||
$charset_collate = '';
|
||||
if (!empty($wpdb->charset)) {
|
||||
$charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
|
||||
} else {
|
||||
$charset_collate = "DEFAULT CHARSET=utf8";
|
||||
}
|
||||
if (!empty($wpdb->collate)) {
|
||||
$charset_collate .= " COLLATE $wpdb->collate";
|
||||
// Set charset and collation for database tables
|
||||
$charset_collate = $wpdb->get_charset_collate();
|
||||
|
||||
// Create license statuses table if it doesn't exist
|
||||
$status_table_sql = "CREATE TABLE IF NOT EXISTS " . $lic_status_table . " (
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
status_key VARCHAR(255) NOT NULL,
|
||||
status_label VARCHAR(255) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)" . $charset_collate . ";";
|
||||
dbDelta($status_table_sql);
|
||||
|
||||
// Insert default statuses if table is empty
|
||||
$status_count = $wpdb->get_var("SELECT COUNT(*) FROM $lic_status_table");
|
||||
if ($status_count == 0) {
|
||||
$default_statuses = array(
|
||||
array('status_key' => 'pending', 'status_label' => __('Pending', 'slmplus')),
|
||||
array('status_key' => 'active', 'status_label' => __('Active', 'slmplus')),
|
||||
array('status_key' => 'blocked', 'status_label' => __('Blocked', 'slmplus')),
|
||||
array('status_key' => 'expired', 'status_label' => __('Expired', 'slmplus'))
|
||||
);
|
||||
|
||||
foreach ($default_statuses as $status) {
|
||||
$wpdb->insert($lic_status_table, $status);
|
||||
}
|
||||
}
|
||||
|
||||
$lk_tbl_sql = "CREATE TABLE " . $lic_key_table . " (
|
||||
id int(12) NOT NULL auto_increment,
|
||||
license_key varchar(255) NOT NULL,
|
||||
max_allowed_domains int(40) NOT NULL,
|
||||
max_allowed_devices int(40) NOT NULL,
|
||||
lic_status ENUM('pending', 'active', 'blocked', 'expired') NOT NULL DEFAULT 'pending',
|
||||
lic_type ENUM('none', 'subscription', 'lifetime') NOT NULL DEFAULT 'subscription',
|
||||
first_name varchar(32) NOT NULL default '',
|
||||
last_name varchar(32) NOT NULL default '',
|
||||
email varchar(64) NOT NULL,
|
||||
item_reference varchar(255) NOT NULL,
|
||||
company_name varchar(100) NOT NULL default '',
|
||||
txn_id varchar(64) NOT NULL default '',
|
||||
manual_reset_count varchar(128) NOT NULL default '',
|
||||
purchase_id_ varchar(255) NOT NULL default '',
|
||||
date_created date NOT NULL DEFAULT '0000-00-00',
|
||||
date_activated date NOT NULL DEFAULT '0000-00-00',
|
||||
date_renewed date NOT NULL DEFAULT '0000-00-00',
|
||||
date_expiry date NOT NULL DEFAULT '0000-00-00',
|
||||
reminder_sent varchar(255) NOT NULL default '0',
|
||||
reminder_sent_date date NOT NULL DEFAULT '0000-00-00',
|
||||
product_ref varchar(255) NOT NULL default '',
|
||||
until varchar(255) NOT NULL default '',
|
||||
current_ver varchar(255) NOT NULL default '',
|
||||
subscr_id varchar(128) NOT NULL default '',
|
||||
slm_billing_length varchar(255) NOT NULL,
|
||||
slm_billing_interval ENUM('days', 'months', 'years', 'onetime') NOT NULL DEFAULT 'days',
|
||||
PRIMARY KEY (id)
|
||||
)" . $charset_collate . ";";
|
||||
// Create or update the license keys table structure
|
||||
$lk_tbl_sql = "CREATE TABLE IF NOT EXISTS " . $lic_key_table . " (
|
||||
id int(12) NOT NULL AUTO_INCREMENT,
|
||||
license_key varchar(255) NOT NULL,
|
||||
max_allowed_domains int(40) NOT NULL,
|
||||
max_allowed_devices int(40) NOT NULL,
|
||||
lic_status varchar(255) NOT NULL DEFAULT 'pending', /* Store status_key here */
|
||||
lic_type ENUM('none', 'subscription', 'lifetime') NOT NULL DEFAULT 'subscription',
|
||||
first_name varchar(32) NOT NULL DEFAULT '',
|
||||
last_name varchar(32) NOT NULL DEFAULT '',
|
||||
email varchar(64) NOT NULL,
|
||||
item_reference varchar(255) NOT NULL,
|
||||
company_name varchar(100) NOT NULL DEFAULT '',
|
||||
txn_id varchar(64) NOT NULL DEFAULT '',
|
||||
manual_reset_count varchar(128) NOT NULL DEFAULT '',
|
||||
purchase_id_ varchar(255) NOT NULL DEFAULT '',
|
||||
date_created date NOT NULL DEFAULT '0000-00-00',
|
||||
date_activated date NOT NULL DEFAULT '0000-00-00',
|
||||
date_renewed date NOT NULL DEFAULT '0000-00-00',
|
||||
date_expiry date NOT NULL DEFAULT '0000-00-00',
|
||||
reminder_sent varchar(255) NOT NULL DEFAULT '0',
|
||||
reminder_sent_date date NOT NULL DEFAULT '0000-00-00',
|
||||
product_ref varchar(255) NOT NULL DEFAULT '',
|
||||
until varchar(255) NOT NULL DEFAULT '',
|
||||
current_ver varchar(255) NOT NULL DEFAULT '',
|
||||
subscr_id varchar(128) NOT NULL DEFAULT '',
|
||||
slm_billing_length varchar(255) NOT NULL,
|
||||
slm_billing_interval ENUM('days', 'months', 'years', 'onetime') NOT NULL DEFAULT 'days',
|
||||
PRIMARY KEY (id)
|
||||
)" . $charset_collate . ";";
|
||||
|
||||
dbDelta($lk_tbl_sql);
|
||||
|
||||
// // thanks to @MechComp
|
||||
// Handle backward compatibility for version 4.1.3 or earlier
|
||||
if (version_compare($used_db_version, '4.1.3', '<=')) {
|
||||
$lk_tbl_sql = "
|
||||
ALTER TABLE " . $lic_key_table . " ADD item_reference varchar(255) NOT NULL;
|
||||
ALTER TABLE " . $lic_key_table . " ADD slm_billing_length varchar(255) NOT NULL;
|
||||
ALTER TABLE " . $lic_key_table . " ADD slm_billing_interval ENUM('days', 'months', 'years', 'onetime') NOT NULL DEFAULT 'days',
|
||||
";
|
||||
dbDelta($lk_tbl_sql);
|
||||
// Alter the table if needed
|
||||
$lk_tbl_sql = "
|
||||
ALTER TABLE $lic_key_table
|
||||
ADD COLUMN IF NOT EXISTS item_reference varchar(255) NOT NULL,
|
||||
ADD COLUMN IF NOT EXISTS slm_billing_length varchar(255) NOT NULL,
|
||||
ADD COLUMN IF NOT EXISTS slm_billing_interval ENUM('days', 'months', 'years', 'onetime') NOT NULL DEFAULT 'days';
|
||||
";
|
||||
dbDelta($lk_tbl_sql);
|
||||
}
|
||||
|
||||
// set default value for reference item when they are empty
|
||||
if (version_compare($used_db_version, '4.1.3', '<=')) {
|
||||
// get empty values
|
||||
$item_result = $wpdb->get_results("SELECT id FROM `$lic_key_table` WHERE `item_reference` LIKE '' ORDER BY id");
|
||||
|
||||
foreach ($item_result as $reference_item) {
|
||||
$item_id = $reference_item->id;
|
||||
// update and set default value
|
||||
$update_reference = "UPDATE $lic_key_table SET item_reference='default' WHERE id='" . $item_id . "';";
|
||||
dbDelta($update_reference);
|
||||
}
|
||||
}
|
||||
|
||||
$ld_tbl_sql = "CREATE TABLE " . $lic_domain_table . " (
|
||||
id INT NOT NULL AUTO_INCREMENT ,
|
||||
lic_key_id INT NOT NULL ,
|
||||
lic_key varchar(255) NOT NULL ,
|
||||
registered_domain text NOT NULL ,
|
||||
registered_devices text NOT NULL ,
|
||||
// Create domains table if not exists
|
||||
$ld_tbl_sql = "CREATE TABLE IF NOT EXISTS " . $lic_domain_table . " (
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
lic_key_id INT NOT NULL,
|
||||
lic_key varchar(255) NOT NULL,
|
||||
registered_domain text NOT NULL,
|
||||
registered_devices text NOT NULL,
|
||||
item_reference varchar(255) NOT NULL,
|
||||
PRIMARY KEY ( id )
|
||||
)" . $charset_collate . ";";
|
||||
PRIMARY KEY (id)
|
||||
)" . $charset_collate . ";";
|
||||
dbDelta($ld_tbl_sql);
|
||||
|
||||
|
||||
$slm_emails_tbl = "CREATE TABLE " . $lic_emails_table . " (
|
||||
id INT NOT NULL AUTO_INCREMENT ,
|
||||
lic_key varchar(255) NOT NULL ,
|
||||
sent_to varchar(255) NOT NULL ,
|
||||
status varchar(255) NOT NULL ,
|
||||
sent text NOT NULL ,
|
||||
// Create emails table if not exists
|
||||
$slm_emails_tbl = "CREATE TABLE IF NOT EXISTS " . $lic_emails_table . " (
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
lic_key varchar(255) NOT NULL,
|
||||
sent_to varchar(255) NOT NULL,
|
||||
status varchar(255) NOT NULL,
|
||||
sent text NOT NULL,
|
||||
date_sent date NOT NULL DEFAULT '0000-00-00',
|
||||
disable_notifications text NOT NULL ,
|
||||
PRIMARY KEY ( id )
|
||||
)" . $charset_collate . ";";
|
||||
disable_notifications text NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)" . $charset_collate . ";";
|
||||
dbDelta($slm_emails_tbl);
|
||||
|
||||
|
||||
$log_tbl_sql = "CREATE TABLE " . $lic_log_tbl . " (
|
||||
id INT NOT NULL AUTO_INCREMENT ,
|
||||
license_key varchar(255) NOT NULL ,
|
||||
slm_action varchar(255) NOT NULL ,
|
||||
// Create log table if not exists
|
||||
$log_tbl_sql = "CREATE TABLE IF NOT EXISTS " . $lic_log_tbl . " (
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
license_key varchar(255) NOT NULL,
|
||||
slm_action varchar(255) NOT NULL,
|
||||
time date NOT NULL DEFAULT '0000-00-00',
|
||||
source varchar(255) NOT NULL ,
|
||||
PRIMARY KEY ( id )
|
||||
)" . $charset_collate . ";";
|
||||
source varchar(255) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)" . $charset_collate . ";";
|
||||
dbDelta($log_tbl_sql);
|
||||
|
||||
$ldv_tbl_sql = "CREATE TABLE " . $lic_devices_table . " (
|
||||
id INT NOT NULL AUTO_INCREMENT ,
|
||||
lic_key_id INT NOT NULL ,
|
||||
lic_key varchar(255) NOT NULL ,
|
||||
registered_devices text NOT NULL ,
|
||||
registered_domain text NOT NULL ,
|
||||
// Create devices table if not exists
|
||||
$ldv_tbl_sql = "CREATE TABLE IF NOT EXISTS " . $lic_devices_table . " (
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
lic_key_id INT NOT NULL,
|
||||
lic_key varchar(255) NOT NULL,
|
||||
registered_devices text NOT NULL,
|
||||
registered_domain text NOT NULL,
|
||||
item_reference varchar(255) NOT NULL,
|
||||
PRIMARY KEY ( id )
|
||||
)" . $charset_collate . ";";
|
||||
PRIMARY KEY (id)
|
||||
)" . $charset_collate . ";";
|
||||
dbDelta($ldv_tbl_sql);
|
||||
|
||||
// Add default options
|
||||
$options = array(
|
||||
'lic_creation_secret' => SLM_Utility::create_secret_keys(),
|
||||
'lic_prefix' => 'SLM-',
|
||||
'default_max_domains' => '2',
|
||||
'default_max_devices' => '2',
|
||||
'lic_verification_secret' => SLM_Utility::create_secret_keys(),
|
||||
'enable_debug' => '',
|
||||
'slm_woo' => '1',
|
||||
'slm_woo_downloads' => '',
|
||||
'slm_woo_affect_downloads' => '1',
|
||||
'slm_wpestores' => '',
|
||||
'slm_stats' => '1',
|
||||
'slm_adminbar' => '1',
|
||||
'slm_multiple_items' => '',
|
||||
'slm_conflictmode' => '1',
|
||||
'slm_front_conflictmode' => '1',
|
||||
'enable_auto_key_expiration' => '1',
|
||||
'slm_dl_manager' => '',
|
||||
'allow_user_activation_removal' => '1',
|
||||
'expiration_reminder_text' => 'Your account has reverted to Basic with limited functionality. Renew today to keep using it on all of your devices and enjoy the valuable features. It’s a smart investment'
|
||||
// Add new options if they don't exist and preserve old settings
|
||||
$new_options = array(
|
||||
'lic_creation_secret' => SLM_Utility::create_secret_keys(),
|
||||
'lic_prefix' => 'SLM-',
|
||||
'default_max_domains' => '2',
|
||||
'default_max_devices' => '2',
|
||||
'lic_verification_secret' => SLM_Utility::create_secret_keys(),
|
||||
'enable_debug' => '',
|
||||
'slm_woo' => '1',
|
||||
'slm_woo_downloads' => '',
|
||||
'slm_woo_affect_downloads' => '1',
|
||||
'slm_wpestores' => '',
|
||||
'slm_stats' => '1',
|
||||
'slm_adminbar' => '1',
|
||||
'slm_multiple_items' => '',
|
||||
'slm_conflictmode' => '1',
|
||||
'slm_front_conflictmode' => '1',
|
||||
'enable_auto_key_expiration' => '1',
|
||||
'slm_backup_dir_hash' => '/slm-plus-' . wp_generate_password(8, false, false),
|
||||
'slm_dl_manager' => '',
|
||||
'allow_user_activation_removal' => '1',
|
||||
'expiration_reminder_text' => 'Your account has reverted to Basic with limited functionality. Renew today to keep using it on all of your devices and enjoy the valuable features. It is a smart investment.'
|
||||
);
|
||||
|
||||
//Bugfix - Prevention of overwriting existing settings
|
||||
// thanks to @MechComp
|
||||
$old_options = get_option('slm_plugin_options');
|
||||
if ($old_options != false) {
|
||||
$options = array_merge($options, $old_options);
|
||||
// Retrieve existing options to merge them with the new ones
|
||||
$existing_options = get_option('slm_plugin_options', []);
|
||||
$merged_options = array_merge($new_options, $existing_options);
|
||||
|
||||
// Update options with merged settings
|
||||
update_option('slm_plugin_options', $merged_options);
|
||||
|
||||
// Create the backup directory if it doesn't already exist
|
||||
$upload_dir = wp_upload_dir(); // Get the WordPress upload directory
|
||||
$backup_dir_path = $upload_dir['basedir'] . $merged_options['slm_backup_dir_hash'];
|
||||
|
||||
// Check if the directory exists, and if not, create it
|
||||
if (!file_exists($backup_dir_path)) {
|
||||
wp_mkdir_p($backup_dir_path);
|
||||
}
|
||||
|
||||
update_option('slm_plugin_options', $options);
|
||||
// Update the database version
|
||||
update_option("slm_db_version", SLM_DB_VERSION);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,18 +1,21 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Logs debug data to a debug file in the "logs" folder. Example usage below:
|
||||
* SLM Plus Debug Logger
|
||||
*
|
||||
* global $slm_debug_logger;
|
||||
* $slm_debug_logger->log_debug("Some debug message");
|
||||
* This class is responsible for logging debug data to a file in the "logs" folder.
|
||||
* It can be used to track various plugin activities and statuses, such as cron jobs, success/failure notices, etc.
|
||||
*
|
||||
* Usage Example:
|
||||
* - global $slm_debug_logger;
|
||||
* - $slm_debug_logger->log_debug("Some debug message");
|
||||
*
|
||||
* OR
|
||||
*
|
||||
* SLM_Debug_Logger::log_debug_st("Some debug message");
|
||||
* - SLM_Debug_Logger::log_debug_st("Some debug message");
|
||||
*/
|
||||
|
||||
class SLM_Debug_Logger
|
||||
{
|
||||
class SLM_Debug_Logger {
|
||||
var $log_folder_path;
|
||||
var $default_log_file = 'log.txt';
|
||||
var $default_log_file_cron = 'log-cron-job.txt';
|
||||
|
@ -21,41 +24,56 @@ class SLM_Debug_Logger
|
|||
var $section_break_marker = "\n----------------------------------------------------------\n\n";
|
||||
var $log_reset_marker = "-------- Log File Reset --------\n";
|
||||
|
||||
function __construct()
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
* Initializes the logger by setting the log folder path and enabling debugging based on plugin settings.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->log_folder_path = SLM_PATH . '/logs';
|
||||
//Check config and if debug is enabled then set the enabled flag to true
|
||||
|
||||
// Check plugin options to see if debugging is enabled
|
||||
$options = get_option('slm_plugin_options');
|
||||
if (!empty($options['enable_debug'])) { //Debugging is enabled
|
||||
if (!empty($options['enable_debug'])) {
|
||||
$this->debug_enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
function get_debug_timestamp()
|
||||
{
|
||||
/**
|
||||
* Get the current timestamp for the log entry
|
||||
*
|
||||
* @return string Timestamp in the format [m/d/Y g:i A]
|
||||
*/
|
||||
function get_debug_timestamp() {
|
||||
return '[' . wp_date('m/d/Y g:i A') . '] - ';
|
||||
}
|
||||
|
||||
function get_debug_status($level)
|
||||
{
|
||||
/**
|
||||
* Get the debug status label based on the level
|
||||
*
|
||||
* @param int $level The severity level of the log message (0-5)
|
||||
* @return string The corresponding status label (e.g., 'SUCCESS', 'FAILURE')
|
||||
*/
|
||||
function get_debug_status($level) {
|
||||
$size = count($this->debug_status);
|
||||
if ($level >= $size) {
|
||||
return 'UNKNOWN';
|
||||
} else {
|
||||
return $this->debug_status[$level];
|
||||
}
|
||||
return ($level >= $size) ? 'UNKNOWN' : $this->debug_status[$level];
|
||||
}
|
||||
|
||||
function get_section_break($section_break)
|
||||
{
|
||||
if ($section_break) {
|
||||
return $this->section_break_marker;
|
||||
}
|
||||
return "";
|
||||
/**
|
||||
* Return a section break marker if required
|
||||
*
|
||||
* @param bool $section_break Whether to include a section break
|
||||
* @return string Section break marker or empty string
|
||||
*/
|
||||
function get_section_break($section_break) {
|
||||
return $section_break ? $this->section_break_marker : "";
|
||||
}
|
||||
|
||||
function reset_log_file($file_name = '')
|
||||
{
|
||||
/**
|
||||
* Reset the log file by clearing its contents and adding a reset marker
|
||||
*
|
||||
* @param string $file_name Optional file name to reset, defaults to main log file
|
||||
*/
|
||||
function reset_log_file($file_name = '') {
|
||||
if (empty($file_name)) {
|
||||
$file_name = $this->default_log_file;
|
||||
}
|
||||
|
@ -66,8 +84,13 @@ class SLM_Debug_Logger
|
|||
fclose($fp);
|
||||
}
|
||||
|
||||
function append_to_file($content, $file_name)
|
||||
{
|
||||
/**
|
||||
* Append content to the specified log file
|
||||
*
|
||||
* @param string $content The content to log
|
||||
* @param string $file_name The file to which content will be appended
|
||||
*/
|
||||
function append_to_file($content, $file_name) {
|
||||
if (empty($file_name)) $file_name = $this->default_log_file;
|
||||
$debug_log_file = $this->log_folder_path . '/' . $file_name;
|
||||
$fp = fopen($debug_log_file, 'a');
|
||||
|
@ -75,37 +98,65 @@ class SLM_Debug_Logger
|
|||
fclose($fp);
|
||||
}
|
||||
|
||||
function log_debug($message, $level = 0, $section_break = false, $file_name = '')
|
||||
{
|
||||
/**
|
||||
* Log a debug message
|
||||
*
|
||||
* @param string $message The debug message to log
|
||||
* @param int $level The debug level (default 0 - SUCCESS)
|
||||
* @param bool $section_break Whether to include a section break after the message
|
||||
* @param string $file_name Optional log file name
|
||||
*/
|
||||
function log_debug($message, $level = 0, $section_break = false, $file_name = '') {
|
||||
if (!$this->debug_enabled) return;
|
||||
$content = $this->get_debug_timestamp(); //Timestamp
|
||||
$content .= $this->get_debug_status($level); //Debug status
|
||||
$content .= ' : ';
|
||||
$content .= $message . "\n";
|
||||
$content .= $this->get_section_break($section_break);
|
||||
$this->append_to_file($content, $file_name);
|
||||
|
||||
// Build the log content
|
||||
$content = $this->get_debug_timestamp(); // Add timestamp
|
||||
$content .= $this->get_debug_status($level); // Add status level
|
||||
$content .= ' : ' . $message . "\n"; // Add message
|
||||
$content .= $this->get_section_break($section_break); // Add section break if needed
|
||||
|
||||
$this->append_to_file($content, $file_name); // Append to log file
|
||||
}
|
||||
|
||||
function log_debug_cron($message, $level = 0, $section_break = false)
|
||||
{
|
||||
/**
|
||||
* Log a debug message specifically for cron jobs
|
||||
*
|
||||
* @param string $message The debug message to log for cron jobs
|
||||
* @param int $level The debug level (default 0 - SUCCESS)
|
||||
* @param bool $section_break Whether to include a section break after the message
|
||||
*/
|
||||
function log_debug_cron($message, $level = 0, $section_break = false) {
|
||||
if (!$this->debug_enabled) return;
|
||||
$content = $this->get_debug_timestamp(); //Timestamp
|
||||
$content .= $this->get_debug_status($level); //Debug status
|
||||
$content .= ' : ';
|
||||
$content .= $message . "\n";
|
||||
|
||||
// Build the log content for cron jobs
|
||||
$content = $this->get_debug_timestamp();
|
||||
$content .= $this->get_debug_status($level);
|
||||
$content .= ' : ' . $message . "\n";
|
||||
$content .= $this->get_section_break($section_break);
|
||||
//$file_name = $this->default_log_file_cron;
|
||||
|
||||
// Log to the cron-specific log file
|
||||
$this->append_to_file($content, $this->default_log_file_cron);
|
||||
}
|
||||
|
||||
static function log_debug_st($message, $level = 0, $section_break = false, $file_name = '')
|
||||
{
|
||||
/**
|
||||
* Static method to log debug messages from a static context
|
||||
*
|
||||
* @param string $message The debug message to log
|
||||
* @param int $level The debug level (default 0 - SUCCESS)
|
||||
* @param bool $section_break Whether to include a section break after the message
|
||||
* @param string $file_name Optional log file name
|
||||
*/
|
||||
static function log_debug_st($message, $level = 0, $section_break = false, $file_name = '') {
|
||||
$options = get_option('slm_plugin_options');
|
||||
if (empty($options['enable_debug'])) { //Debugging is disabled
|
||||
return;
|
||||
if (empty($options['enable_debug'])) {
|
||||
return; // Debugging is disabled
|
||||
}
|
||||
|
||||
// Build the log content
|
||||
$content = '[' . wp_date('m/d/Y g:i A') . '] - STATUS : ' . $message . "\n";
|
||||
$debug_log_file = SLM_PUBLIC . '/logs/log.txt';
|
||||
|
||||
// Append the log content to the file
|
||||
$fp = fopen($debug_log_file, 'a');
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
|
|
|
@ -1,34 +1,57 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Contains the API error codes
|
||||
/**
|
||||
* SLM Plus Error Codes
|
||||
*
|
||||
* This file contains the API error codes used throughout the SLM Plus plugin.
|
||||
* Each constant represents a specific error or success message to be returned in API responses.
|
||||
*
|
||||
* Usage:
|
||||
* - These codes are used to provide standardized error or success responses.
|
||||
* - API endpoints or internal logic should reference these constants to ensure consistency.
|
||||
*
|
||||
* @package SLM Plus
|
||||
*/
|
||||
|
||||
class SLM_Error_Codes {
|
||||
const CREATE_FAILED = 10;
|
||||
const CREATE_KEY_INVALID = 100;
|
||||
const DOMAIN_ALREADY_INACTIVE = 80;
|
||||
const DOMAIN_MISSING = 70;
|
||||
const KEY_CANCELED = 130;
|
||||
const KEY_CANCELED_FAILED = 140;
|
||||
const KEY_DEACTIVATE_DOMAIN_SUCCESS = 360;
|
||||
const KEY_DEACTIVATE_SUCCESS = 340;
|
||||
const KEY_DELETE_FAILED = 300;
|
||||
const KEY_DELETE_SUCCESS = 320;
|
||||
const KEY_DELETED = 130;
|
||||
const KEY_UPDATE_FAILED = 220;
|
||||
const KEY_UPDATE_SUCCESS = 240;
|
||||
const LICENSE_ACTIVATED = 380;
|
||||
const LICENSE_BLOCKED = 20;
|
||||
const LICENSE_CREATED = 400;
|
||||
const LICENSE_EXIST = 200;
|
||||
const LICENSE_EXPIRED = 30;
|
||||
const LICENSE_IN_USE = 40;
|
||||
const LICENSE_INVALID = 60;
|
||||
const LICENSE_VALID = 65;
|
||||
const MISSING_KEY_DELETE_FAILED = 280;
|
||||
const MISSING_KEY_UPDATE_FAILED = 260;
|
||||
const REACHED_MAX_DEVICES = 120;
|
||||
const REACHED_MAX_DOMAINS = 50;
|
||||
const VERIFY_KEY_INVALID = 90;
|
||||
}
|
||||
|
||||
// License creation errors
|
||||
const CREATE_FAILED = 10; // License creation failed
|
||||
const CREATE_KEY_INVALID = 100; // License creation secret key is invalid
|
||||
|
||||
// License key deactivation and cancellation
|
||||
const DOMAIN_ALREADY_INACTIVE = 80; // Domain is already inactive
|
||||
const DOMAIN_MISSING = 70; // Domain information is missing
|
||||
const KEY_CANCELED = 130; // License key was successfully canceled
|
||||
const KEY_CANCELED_FAILED = 140; // Failed to cancel the license key
|
||||
const KEY_DEACTIVATE_DOMAIN_SUCCESS = 360; // Domain successfully deactivated
|
||||
const KEY_DEACTIVATE_SUCCESS = 340; // License key successfully deactivated
|
||||
|
||||
// License key deletion
|
||||
const KEY_DELETE_FAILED = 300; // Failed to delete the license key
|
||||
const KEY_DELETE_SUCCESS = 320; // License key successfully deleted
|
||||
const KEY_DELETED = 130; // License key was deleted
|
||||
|
||||
// License key updates
|
||||
const KEY_UPDATE_FAILED = 220; // Failed to update the license key
|
||||
const KEY_UPDATE_SUCCESS = 240; // License key successfully updated
|
||||
|
||||
// License activation and validation
|
||||
const LICENSE_ACTIVATED = 380; // License key successfully activated
|
||||
const LICENSE_BLOCKED = 20; // License key is blocked
|
||||
const LICENSE_CREATED = 400; // License key was successfully created
|
||||
const LICENSE_EXIST = 200; // License key already exists
|
||||
const LICENSE_EXPIRED = 30; // License key has expired
|
||||
const LICENSE_IN_USE = 40; // License key is currently in use
|
||||
const LICENSE_INVALID = 60; // License key is invalid
|
||||
const LICENSE_VALID = 65; // License key is valid
|
||||
|
||||
// Miscellaneous errors
|
||||
const MISSING_KEY_DELETE_FAILED = 280; // Missing license key for deletion failed
|
||||
const MISSING_KEY_UPDATE_FAILED = 260; // Missing license key for update failed
|
||||
const REACHED_MAX_DEVICES = 120; // Reached the maximum number of devices for the license
|
||||
const REACHED_MAX_DOMAINS = 50; // Reached the maximum number of domains for the license
|
||||
|
||||
// Verification errors
|
||||
const VERIFY_KEY_INVALID = 90; // Verification secret key is invalid
|
||||
}
|
||||
|
|
|
@ -1,33 +1,37 @@
|
|||
<?php
|
||||
|
||||
class SLM_Init_Time_Tasks{
|
||||
function __construct(){
|
||||
class SLM_Init_Time_Tasks {
|
||||
|
||||
public function __construct() {
|
||||
$this->load_scripts();
|
||||
//Add other init time operations here
|
||||
add_action ('slm_daily_cron_event', array(&$this, 'slm_daily_cron_event_handler'));
|
||||
// Add other init time operations here
|
||||
add_action('slm_daily_cron_event', array($this, 'slm_daily_cron_event_handler'));
|
||||
}
|
||||
|
||||
function load_scripts(){
|
||||
//Load all common scripts and styles only
|
||||
wp_enqueue_script('jquery');
|
||||
//Load all admin side scripts and styles only
|
||||
if(is_admin()){
|
||||
// Load common and admin-specific scripts and styles
|
||||
public function load_scripts() {
|
||||
wp_enqueue_script('jquery'); // Common scripts
|
||||
|
||||
if (is_admin()) {
|
||||
wp_enqueue_script('jquery-ui-datepicker');
|
||||
wp_enqueue_script('wplm-custom-admin-js', SLM_ASSETS_URL . 'js/wplm-custom-admin.js', array( 'jquery-ui-dialog' ));//admin only custom js code
|
||||
if (isset($_GET['page']) && $_GET['page'] == 'slm_manage_license') {//Only include if we are in the license add/edit interface
|
||||
wp_enqueue_style('jquery-ui-style', SLM_ASSETS_URL .'css/jquery-ui.css');
|
||||
wp_enqueue_script('wplm-custom-admin-js', SLM_ASSETS_URL . 'js/wplm-custom-admin.js', array('jquery-ui-dialog')); // Admin-only JS
|
||||
if (isset($_GET['page']) && $_GET['page'] == 'slm_manage_license') { // Only include if in license management interface
|
||||
wp_enqueue_style('jquery-ui-style', SLM_ASSETS_URL . 'css/jquery-ui.css');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function slm_daily_cron_event_handler(){
|
||||
// Daily cron event handler
|
||||
public function slm_daily_cron_event_handler() {
|
||||
$options = get_option('slm_plugin_options');
|
||||
do_action('slm_daily_cron_event_triggered');
|
||||
if ( isset($options['enable_auto_key_expiry']) && $options['enable_auto_key_expiry'] == '1'){
|
||||
//Do the auto key expiry task
|
||||
|
||||
if (isset($options['enable_auto_key_expiry']) && $options['enable_auto_key_expiry'] == '1') {
|
||||
// Perform auto key expiry task
|
||||
SLM_Debug_Logger::log_debug_st("SLM daily cronjob - auto expiry of license key is enabled.");
|
||||
SLM_Utility::do_auto_key_expiry();
|
||||
}
|
||||
//Do any ohter daily cronjob tasks.
|
||||
|
||||
// Add any other daily cron job tasks here
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,91 +1,73 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Runs on Uninstall of Software License Manager
|
||||
*
|
||||
* @package Software License Manager
|
||||
* @package SLM Plus
|
||||
* @author Michel Velis
|
||||
* @license GPL-2.0+
|
||||
* @link http://epikly.com
|
||||
* https://api.github.com/repos/michelve/software-license-manager/tags
|
||||
*/
|
||||
|
||||
//require_once(SLM_LIB . 'slm-wizard.php');
|
||||
//require_once(SLM_LIB . 'wp-mail-class.php');
|
||||
|
||||
|
||||
/**
|
||||
* Load plugin textdomain.
|
||||
*/
|
||||
add_action('init', 'slm_load_language');
|
||||
function slm_load_language()
|
||||
{
|
||||
load_plugin_textdomain('softwarelicensemanager', false, plugin_dir_path(__FILE__) . 'i18n/languages/');
|
||||
}
|
||||
|
||||
|
||||
//Includes - utilities and cron jobs
|
||||
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
|
||||
|
||||
require_once(SLM_LIB . 'slm-utility.php');
|
||||
require_once(SLM_CRONS . 'slm-tasks.php');
|
||||
|
||||
add_filter('extra_plugin_headers', 'add_extra_headers');
|
||||
add_filter('plugin_row_meta', 'filter_authors_row_meta', 1, 4);
|
||||
// Filters for adding extra headers and customizing plugin row meta
|
||||
add_filter('extra_plugin_headers', 'slmplus_add_extra_headers');
|
||||
add_filter('plugin_row_meta', 'slmplus_filter_authors_row_meta', 1, 4);
|
||||
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'slm_settings_link');
|
||||
|
||||
function add_extra_headers()
|
||||
{
|
||||
function slmplus_add_extra_headers() {
|
||||
return array('Author2');
|
||||
}
|
||||
function hyphenate($str)
|
||||
{
|
||||
|
||||
function hyphenate($str) {
|
||||
return implode("-", str_split($str, 5));
|
||||
}
|
||||
|
||||
function filter_authors_row_meta($plugin_meta, $plugin_file, $plugin_data, $status)
|
||||
{
|
||||
if (empty($plugin_data['Author'])) {
|
||||
return $plugin_meta;
|
||||
}
|
||||
function slmplus_filter_authors_row_meta($plugin_meta, $plugin_file, $plugin_data, $status) {
|
||||
if (!empty($plugin_data['Author2'])) {
|
||||
$plugin_meta[1] = $plugin_meta[1] . ', ' . $plugin_data['Author2'];
|
||||
$plugin_meta[1] .= ', ' . $plugin_data['Author2'];
|
||||
}
|
||||
return $plugin_meta;
|
||||
}
|
||||
|
||||
// Add settings link
|
||||
function slm_settings_link($links)
|
||||
{
|
||||
$links[] = '<a href="' .
|
||||
admin_url('admin.php?page=slm_settings') .
|
||||
'">' . __('Settings') . '</a>';
|
||||
$links[] = '<a href="https://github.com/michelve/software-license-manager" target="_blank">' . __('GitHub') . '</a>';
|
||||
$settings_link = '<a href="' . esc_url(admin_url('admin.php?page=slm_settings')) . '">' . __('Settings') . '</a>';
|
||||
$github_link = '<a href="' . esc_url('https://github.com/michelve/software-license-manager') . '" target="_blank">' . __('GitHub') . '</a>';
|
||||
$links[] = $settings_link;
|
||||
$links[] = $github_link;
|
||||
return $links;
|
||||
}
|
||||
|
||||
//Includes
|
||||
|
||||
// Includes for essential plugin components
|
||||
require_once(SLM_LIB . 'slm-debug-logger.php');
|
||||
require_once(SLM_LIB . 'slm-error-codes.php');
|
||||
require_once(SLM_LIB . 'slm-init-time-tasks.php');
|
||||
require_once(SLM_LIB . 'slm-api-listener.php');
|
||||
require_once(SLM_LIB . 'slm-scripts.php');
|
||||
|
||||
/**
|
||||
* The code that runs during plugin activation.
|
||||
* This action is documented in includes/class-software-license-manager-activator.php
|
||||
*/
|
||||
function activate_software_license_manager()
|
||||
{
|
||||
// Admin-only includes
|
||||
if (is_admin()) {
|
||||
require_once SLM_ADMIN . 'slm-admin-init.php';
|
||||
}
|
||||
|
||||
// WP eStores integration
|
||||
if (SLM_Helper_Class::slm_get_option('slm_wpestores') == 1) {
|
||||
require_once(SLM_ADMIN . 'includes/wpestores/slm-wpestores.php');
|
||||
}
|
||||
|
||||
// Activation and deactivation hooks
|
||||
function activate_software_license_manager() {
|
||||
require_once SLM_LIB . 'class-slm-activator.php';
|
||||
$slm_activator->activate();
|
||||
}
|
||||
|
||||
/**
|
||||
* The code that runs during plugin deactivation.
|
||||
* This action is documented in includes/class-software-license-manager-deactivator.php
|
||||
*/
|
||||
|
||||
function deactivate_software_license_manager()
|
||||
{
|
||||
function deactivate_software_license_manager() {
|
||||
require_once SLM_LIB . 'class-slm-deactivator.php';
|
||||
$slm_deactivator->deactivate();
|
||||
}
|
||||
|
@ -98,143 +80,101 @@ function slm_get_license($lic_key_prefix = '')
|
|||
register_activation_hook(__FILE__, 'activate_software_license_manager');
|
||||
register_deactivation_hook(__FILE__, 'deactivate_software_license_manager');
|
||||
|
||||
// require_once SLM_LIB . 'admin-page-framework.php';
|
||||
// License key generator function
|
||||
function slmplus_get_license($lic_key_prefix = '') {
|
||||
return strtoupper($lic_key_prefix . hyphenate(md5(uniqid(rand(4, 10), true) . date('Y-m-d H:i:s') . time())));
|
||||
}
|
||||
|
||||
// Front end-menu
|
||||
// TODO check for optional plugins
|
||||
// WooCommerce integration
|
||||
if (SLM_Helper_Class::slm_get_option('slm_woo') == 1 && is_plugin_active('woocommerce/woocommerce.php')) {
|
||||
require_once(SLM_WOO . 'includes/wc_licenses_class.php');
|
||||
require_once(SLM_WOO . 'includes/slm-meta-boxes.php');
|
||||
|
||||
// Third Party Support
|
||||
require_once SLM_WOO . 'includes/register-template.php';
|
||||
require_once SLM_WOO . 'includes/purchase.php';
|
||||
|
||||
if (null !== SLM_Helper_Class::slm_get_option('slm_woo') && SLM_Helper_Class::slm_get_option('slm_woo') == 1) {
|
||||
/**
|
||||
* Check if WooCommerce is activated
|
||||
*/
|
||||
if (is_plugin_active('woocommerce/woocommerce.php')) {
|
||||
require_once(SLM_WOO . 'includes/wc_licenses_class.php');
|
||||
require_once(SLM_WOO . 'includes/wc-slm.php');
|
||||
// support for meta boxes
|
||||
require_once(SLM_WOO . 'includes/slm-meta-boxes.php');
|
||||
}
|
||||
// build woocommerce tabs
|
||||
// Build WooCommerce tabs
|
||||
SLM_Utility::slm_woo_build_tab();
|
||||
}
|
||||
|
||||
|
||||
if (null !== SLM_Helper_Class::slm_get_option('slm_wpestores') && SLM_Helper_Class::slm_get_option('slm_wpestores') == 1) {
|
||||
// wpestores PLugin Integration
|
||||
require_once(SLM_ADMIN . 'includes/wpestores/slm-wpestores.php');
|
||||
// Action hooks
|
||||
add_action('init', 'slmplus_init_handler');
|
||||
add_action('plugins_loaded', 'slmplus_plugins_loaded_handler');
|
||||
add_action('wp_ajax_del_registered_devices', 'slmplus_del_registered_devices');
|
||||
add_action('wp_ajax_del_registered_domain', 'slmplus_del_registered_domain');
|
||||
add_action('wp_ajax_del_activation', 'slmplus_remove_activation');
|
||||
// Initialize plugin on plugins_loaded action
|
||||
add_action('plugins_loaded', array('SLM_Tabbed_Plugin', 'get_object'));
|
||||
|
||||
// Initialize debug logger
|
||||
$slm_debug_logger = new SLM_Debug_Logger();
|
||||
|
||||
// Init-time tasks
|
||||
function slmplus_init_handler() {
|
||||
$init_task = new SLM_Init_Time_Tasks();
|
||||
$api_listener = new SLM_API_Listener();
|
||||
}
|
||||
|
||||
//Include admin side only files
|
||||
if (is_admin()) {
|
||||
require_once SLM_ADMIN . 'slm-admin-init.php';
|
||||
}
|
||||
|
||||
//Action hooks
|
||||
add_action('init', 'slm_init_handler');
|
||||
add_action('plugins_loaded', 'slm_plugins_loaded_handler');
|
||||
add_action('wp_ajax_del_reistered_devices', 'slm_del_reg_devices');
|
||||
add_action('wp_ajax_del_reistered_domain', 'slm_del_reg_dom');
|
||||
// woo public facing
|
||||
add_action('wp_ajax_del_activation', 'slm_remove_activation');
|
||||
|
||||
//Initialize debug logger
|
||||
$slm_debug_logger = new SLM_Debug_Logger();
|
||||
|
||||
//Do init time tasks
|
||||
function slm_init_handler()
|
||||
{
|
||||
$init_task = new SLM_Init_Time_Tasks();
|
||||
$api_listener = new SLM_API_Listener();
|
||||
}
|
||||
|
||||
//Do plugins loaded time tasks
|
||||
function slm_plugins_loaded_handler()
|
||||
{
|
||||
//Runs when plugins_loaded action gets fired
|
||||
if (is_admin()) {
|
||||
//Check if db update needed
|
||||
if (get_option('slm_db_version') != SLM_DB_VERSION) {
|
||||
require_once(SLM_LIB . 'class-slm-installer.php');
|
||||
// TODO - $slm_activator->slm_db_install();
|
||||
}
|
||||
// Plugins loaded tasks
|
||||
function slmplus_plugins_loaded_handler() {
|
||||
if (is_admin() && get_option('slm_db_version') != SLM_DB_VERSION) {
|
||||
require_once(SLM_LIB . 'class-slm-installer.php');
|
||||
// TODO - Implement DB update logic here
|
||||
}
|
||||
}
|
||||
|
||||
class slm_tabbed_plugin
|
||||
{
|
||||
// singleton class variable
|
||||
static private $classobj = NULL;
|
||||
// Singleton pattern for the plugin
|
||||
class SLM_Tabbed_Plugin {
|
||||
private static $classobj = NULL;
|
||||
|
||||
// singleton method
|
||||
public static function get_object()
|
||||
{
|
||||
if (NULL === self::$classobj) {
|
||||
self::$classobj = new self;
|
||||
public static function get_object() {
|
||||
if (self::$classobj === NULL) {
|
||||
self::$classobj = new self();
|
||||
}
|
||||
return self::$classobj;
|
||||
}
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
private function __construct() {}
|
||||
}
|
||||
|
||||
// initialize plugin
|
||||
if (function_exists('add_action') && function_exists('register_activation_hook')) {
|
||||
add_action('plugins_loaded', array('slm_tabbed_plugin', 'get_object'));
|
||||
}
|
||||
|
||||
|
||||
//TODO - need to move this to an ajax handler file
|
||||
function slm_del_reg_dom()
|
||||
{
|
||||
// AJAX handlers
|
||||
function slmplus_del_registered_domain() {
|
||||
global $wpdb;
|
||||
$reg_table = SLM_TBL_LIC_DOMAIN;
|
||||
$id = strip_tags($_GET['id']);
|
||||
$ret = $wpdb->query($wpdb->prepare("DELETE FROM {$reg_table} WHERE id=%d", $id));
|
||||
$id = strip_tags($_GET['id']);
|
||||
$ret = $wpdb->query($wpdb->prepare("DELETE FROM " . SLM_TBL_LIC_DOMAIN . " WHERE id = %d", $id));
|
||||
echo ($ret) ? 'success' : 'failed';
|
||||
exit(0);
|
||||
exit;
|
||||
}
|
||||
|
||||
function slm_del_reg_devices()
|
||||
{
|
||||
function slmplus_del_registered_devices() {
|
||||
global $wpdb;
|
||||
$reg_table = SLM_TBL_LIC_DEVICES;
|
||||
$id = strip_tags($_GET['id']);
|
||||
$ret = $wpdb->query($wpdb->prepare("DELETE FROM {$reg_table} WHERE id=%d", $id));
|
||||
$id = strip_tags($_GET['id']);
|
||||
$ret = $wpdb->query($wpdb->prepare("DELETE FROM " . SLM_TBL_LIC_DEVICES . " WHERE id = %d", $id));
|
||||
echo ($ret) ? 'success' : 'failed';
|
||||
exit(0);
|
||||
exit;
|
||||
}
|
||||
|
||||
//TODO - need to move this to an ajax handler file
|
||||
function slm_remove_activation()
|
||||
{
|
||||
function slmplus_remove_activation() {
|
||||
global $wpdb;
|
||||
$table = '';
|
||||
$id = strip_tags($_GET['id']);
|
||||
$activation_type = strip_tags($_GET['activation_type']);
|
||||
$id = strip_tags($_GET['id']);
|
||||
$activation_type = strip_tags($_GET['activation_type']);
|
||||
|
||||
if ($activation_type == 'Devices') {
|
||||
$table = SLM_TBL_LIC_DEVICES;
|
||||
} else {
|
||||
$table = SLM_TBL_LIC_DOMAIN;
|
||||
}
|
||||
|
||||
$ret = $wpdb->query($wpdb->prepare("DELETE FROM {$table} WHERE id=%d", $id));
|
||||
$table = ($activation_type == 'Devices') ? SLM_TBL_LIC_DEVICES : SLM_TBL_LIC_DOMAIN;
|
||||
$ret = $wpdb->query($wpdb->prepare("DELETE FROM {$table} WHERE id = %d", $id));
|
||||
echo ($ret) ? 'success' : 'failed';
|
||||
exit(0);
|
||||
exit;
|
||||
}
|
||||
|
||||
function wc_print_pretty($args)
|
||||
{
|
||||
// Debugging functions
|
||||
function wc_print_pretty($args) {
|
||||
echo '<pre>';
|
||||
print_r($args);
|
||||
echo '</pre>';
|
||||
}
|
||||
|
||||
function wc_log($msg)
|
||||
{
|
||||
function wc_log($msg) {
|
||||
$log = ABSPATH . DIRECTORY_SEPARATOR . 'slm_log.txt';
|
||||
file_put_contents($log, $msg . '', FILE_APPEND);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,48 +5,36 @@ if (!defined('WPINC')) {
|
|||
die();
|
||||
}
|
||||
|
||||
// add admin styles and scipts
|
||||
function slm_admin_assets()
|
||||
{
|
||||
wp_enqueue_style('softwarelicensemanager', SLM_ASSETS_URL . 'css/slm.css');
|
||||
wp_enqueue_script('slm_validate', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.js', array('jquery'), '1.19.0', true);
|
||||
wp_enqueue_script('slm_validate_js', SLM_ASSETS_URL . 'js/slm.js', array('jquery'), '1.0.1', true);
|
||||
// Enqueue admin styles and scripts
|
||||
function slm_admin_assets() {
|
||||
wp_enqueue_style('slmplus-admin', SLM_ASSETS_URL . 'css/slm.css');
|
||||
wp_enqueue_script('slm-validate', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.0/jquery.validate.min.js', array('jquery'), '1.19.0', true);
|
||||
wp_enqueue_script('slm-admin-js', SLM_ASSETS_URL . 'js/slm.js', array('jquery'), '1.0.1', true);
|
||||
}
|
||||
|
||||
// load frontend styles
|
||||
function slm_js_license(){
|
||||
//wp_enqueue_script('slm_js', SLM_ASSETS_URL . 'js/slm-js.js', array('jquery'), '1.0.1', true);
|
||||
}
|
||||
|
||||
function slm_frontend_assets(){
|
||||
/**
|
||||
* Check if WooCommerce is activated
|
||||
*/
|
||||
// Enqueue frontend styles and scripts
|
||||
function slm_frontend_assets() {
|
||||
if (is_plugin_active('woocommerce/woocommerce.php')) {
|
||||
|
||||
if (is_account_page() && SLM_Helper_Class::slm_get_option('slm_front_conflictmode') == 1) {
|
||||
wp_enqueue_style('bootstrapcdn-slm', 'https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css');
|
||||
wp_enqueue_script('bootstrapcdn-slm-js', 'https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js', array('jquery'), '4.1.3', true);
|
||||
}
|
||||
}
|
||||
// custom css
|
||||
wp_enqueue_style('softwarelicensemanager', SLM_ASSETS_URL . 'css/slm-front-end.css');
|
||||
wp_enqueue_style('slmplus-frontend', SLM_ASSETS_URL . 'css/slm-front-end.css');
|
||||
}
|
||||
|
||||
// Hook assets into the appropriate actions
|
||||
add_action('wp_enqueue_scripts', 'slm_frontend_assets');
|
||||
add_action('admin_enqueue_scripts', 'slm_admin_assets');
|
||||
|
||||
|
||||
/**
|
||||
* Check if WooCommerce is activated
|
||||
*/
|
||||
// If WooCommerce is active, add specific actions for handling scripts on certain pages
|
||||
if (is_plugin_active('woocommerce/woocommerce.php')) {
|
||||
add_action('template_redirect', 'slm_get_page');
|
||||
add_action('template_redirect', 'slm_handle_my_account_page');
|
||||
|
||||
function slm_get_page()
|
||||
{
|
||||
function slm_handle_my_account_page() {
|
||||
if (is_page('my-account')) {
|
||||
//add_action('wp_enqueue_scripts', 'slm_js_license');
|
||||
// If you need to enqueue additional scripts on the "my-account" page, uncomment the line below
|
||||
// wp_enqueue_script('slm-js', SLM_ASSETS_URL . 'js/slm-js.js', array('jquery'), '1.0.1', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
// Helper Class
|
||||
|
||||
// define the wp_mail_failed callback
|
||||
// Define the wp_mail_failed callback
|
||||
function action_wp_mail_failed($wp_error)
|
||||
{
|
||||
return error_log(print_r($wp_error, true));
|
||||
if (is_wp_error($wp_error)) {
|
||||
error_log(print_r($wp_error->get_error_messages(), true));
|
||||
}
|
||||
}
|
||||
|
||||
// add the action
|
||||
add_action('wp_mail_failed', 'action_wp_mail_failed', 10, 1);
|
||||
|
||||
|
||||
|
@ -21,17 +21,16 @@ class SLM_Helper_Class
|
|||
|
||||
public static function slm_get_option($option)
|
||||
{
|
||||
$option_name = '';
|
||||
$slm_opts = get_option('slm_plugin_options');
|
||||
if (is_array($slm_opts) && array_key_exists($option,$slm_opts)) {
|
||||
$slm_opts = get_option('slm_plugin_options');
|
||||
if (is_array($slm_opts) && array_key_exists($option, $slm_opts)) {
|
||||
return $slm_opts[$option];
|
||||
}
|
||||
return $option_name;
|
||||
return '';
|
||||
}
|
||||
|
||||
static function write_log($log)
|
||||
public static function write_log($log)
|
||||
{
|
||||
if (true === WP_DEBUG) {
|
||||
if (defined('WP_DEBUG') && WP_DEBUG === true) {
|
||||
if (is_array($log) || is_object($log)) {
|
||||
error_log(print_r($log, true));
|
||||
} else {
|
||||
|
@ -39,6 +38,7 @@ class SLM_Helper_Class
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* PHP Logger
|
||||
*/
|
||||
|
@ -65,158 +65,238 @@ class SLM_API_Utility
|
|||
* message (a message describing the outcome of the action
|
||||
*/
|
||||
|
||||
static function output_api_response($args)
|
||||
public static function output_api_response($args)
|
||||
{
|
||||
//Log to debug file (if enabled)
|
||||
// Log to debug file (if enabled)
|
||||
global $slm_debug_logger;
|
||||
$slm_debug_logger->log_debug('API Response - Result: ' . $args['result'] . ' Message: ' . $args['message']);
|
||||
if (isset($slm_debug_logger)) {
|
||||
$slm_debug_logger->log_debug('API Response - Result: ' . esc_html($args['result']) . ' Message: ' . esc_html($args['message']));
|
||||
}
|
||||
|
||||
//Send response
|
||||
// Send response
|
||||
$args = apply_filters('slm_ap_response_args', $args);
|
||||
$args = apply_filters('slm_api_response_args', $args);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($args);
|
||||
exit(0);
|
||||
exit;
|
||||
}
|
||||
|
||||
static function verify_secret_key()
|
||||
/**
|
||||
* Validate date format to ensure it's in 'YYYY-MM-DD' format.
|
||||
* Returns the sanitized date or an empty string if invalid.
|
||||
*/
|
||||
public static function slm_validate_date($date) {
|
||||
$date = sanitize_text_field($date);
|
||||
$timestamp = strtotime($date);
|
||||
if ($timestamp && date('Y-m-d', $timestamp) === $date) {
|
||||
return $date;
|
||||
}
|
||||
return ''; // Return an empty string if the date is invalid
|
||||
}
|
||||
|
||||
public static function verify_secret_key()
|
||||
{
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
$right_secret_key = $slm_options['lic_verification_secret'];
|
||||
$received_secret_key = strip_tags($_REQUEST['secret_key']);
|
||||
if ($received_secret_key != $right_secret_key) {
|
||||
$args = (array(
|
||||
'result' => 'error',
|
||||
'message' => 'Verification API secret key is invalid',
|
||||
'error_code' => SLM_Error_Codes::VERIFY_KEY_INVALID
|
||||
));
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
$right_secret_key = $slm_options['lic_verification_secret'] ?? '';
|
||||
$received_secret_key = sanitize_text_field($_REQUEST['secret_key'] ?? '');
|
||||
|
||||
if ($received_secret_key !== $right_secret_key) {
|
||||
$args = array(
|
||||
'result' => 'error',
|
||||
'message' => 'Verification API secret key is invalid',
|
||||
'error_code' => SLM_Error_Codes::VERIFY_KEY_INVALID
|
||||
);
|
||||
self::output_api_response($args);
|
||||
}
|
||||
}
|
||||
public static function get_slm_option($option)
|
||||
{
|
||||
$slm_options_func = get_option('slm_plugin_options', []);
|
||||
$option = $slm_options_func[$option];
|
||||
return $option;
|
||||
}
|
||||
|
||||
|
||||
public static function verify_secret_key_for_creation()
|
||||
{
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
$right_secret_key = $slm_options['lic_creation_secret'] ?? '';
|
||||
$received_secret_key = sanitize_text_field($_REQUEST['secret_key'] ?? '');
|
||||
|
||||
if ($received_secret_key !== $right_secret_key) {
|
||||
$args = array(
|
||||
'result' => 'error',
|
||||
'message' => 'License Creation API secret key is invalid',
|
||||
'error_code' => SLM_Error_Codes::CREATE_KEY_INVALID
|
||||
);
|
||||
self::output_api_response($args);
|
||||
}
|
||||
}
|
||||
|
||||
static function verify_secret_key_for_creation()
|
||||
{
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
$right_secret_key = $slm_options['lic_creation_secret'];
|
||||
$received_secret_key = strip_tags($_REQUEST['secret_key']);
|
||||
if ($received_secret_key != $right_secret_key) {
|
||||
$args = (array(
|
||||
'result' => 'error',
|
||||
'message' => 'License Creation API secret key is invalid',
|
||||
'error_code' => SLM_Error_Codes::CREATE_KEY_INVALID
|
||||
));
|
||||
self::output_api_response($args);
|
||||
}
|
||||
}
|
||||
|
||||
static function insert_license_data_internal($fields)
|
||||
public static function insert_license_data_internal($fields)
|
||||
{
|
||||
global $wpdb;
|
||||
$tbl_name = SLM_TBL_LICENSE_KEYS;
|
||||
$fields = array_filter($fields); //Remove any null values.
|
||||
$result = $wpdb->insert($tbl_name, $fields);
|
||||
$tbl_name = SLM_TBL_LICENSE_KEYS;
|
||||
$fields = array_filter($fields); // Remove any null values.
|
||||
|
||||
$wpdb->insert($tbl_name, $fields);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class SLM_Utility
|
||||
{
|
||||
|
||||
static function check_for_expired_lic($lic_key = '')
|
||||
// Function to export a single license as a JSON file
|
||||
public static function export_license_to_json($license_id_or_key)
|
||||
{
|
||||
global $wpdb, $first_name, $body, $date_expiry, $license_key, $expiration_reminder_text;
|
||||
global $wpdb;
|
||||
|
||||
$headers = array('Content-Type: text/html; charset=UTF-8');
|
||||
$response = '';
|
||||
$sql_query = $wpdb->get_results("SELECT * FROM " . SLM_TBL_LICENSE_KEYS . " WHERE date_expiry < NOW() AND NOT date_expiry='00000000' ORDER BY date_expiry ASC;", ARRAY_A);
|
||||
$subject = get_bloginfo('name') . ' - Your license has expired';
|
||||
$expiration_reminder_text = SLM_Helper_Class::slm_get_option('expiration_reminder_text');
|
||||
// Fetch the custom directory path from options (saved with hash)
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
$custom_dir_hash = isset($slm_options['slm_backup_dir_hash']) ? $slm_options['slm_backup_dir_hash'] : '';
|
||||
|
||||
//SLM_Helper_Class::write_log('Found: ' . $expiration_reminder_text);
|
||||
// Get the WordPress upload directory
|
||||
$upload_dir = wp_upload_dir();
|
||||
$custom_dir = $upload_dir['basedir'] . $custom_dir_hash;
|
||||
|
||||
// Ensure the directory exists
|
||||
if (!file_exists($custom_dir)) {
|
||||
wp_mkdir_p($custom_dir); // Create the directory if it doesn't exist
|
||||
}
|
||||
|
||||
// Check if the input is a license ID or license key and fetch the license data accordingly
|
||||
if (is_numeric($license_id_or_key)) {
|
||||
// Fetch license by ID
|
||||
$data = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . SLM_TBL_LICENSE_KEYS . " WHERE id = %d", $license_id_or_key), ARRAY_A);
|
||||
} else {
|
||||
// Fetch license by key
|
||||
$data = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . SLM_TBL_LICENSE_KEYS . " WHERE license_key = %s", $license_id_or_key), ARRAY_A);
|
||||
}
|
||||
|
||||
if ($data) {
|
||||
$license_key = $data['license_key'];
|
||||
|
||||
// Prepare the file name as "license_key.json"
|
||||
$file_name = sanitize_file_name($license_key) . '.json';
|
||||
$file_path = $custom_dir . '/' . $file_name;
|
||||
|
||||
// Encode the license data to JSON format
|
||||
$json_data = wp_json_encode($data, JSON_PRETTY_PRINT);
|
||||
|
||||
// Save the JSON data to a file in the custom directory
|
||||
if (file_put_contents($file_path, $json_data)) {
|
||||
$file_url = $upload_dir['baseurl'] . $custom_dir_hash . '/' . $file_name;
|
||||
|
||||
// Return the file URL for download
|
||||
return $file_url;
|
||||
} else {
|
||||
return false; // Return false if the file couldn't be saved
|
||||
}
|
||||
}
|
||||
|
||||
return false; // Return false if no data was found
|
||||
}
|
||||
|
||||
public static function check_for_expired_lic($lic_key = '')
|
||||
{
|
||||
global $wpdb;
|
||||
|
||||
$headers = array('Content-Type: text/html; charset=UTF-8');
|
||||
$response = '';
|
||||
$sql_query = $wpdb->get_results(
|
||||
"SELECT * FROM " . SLM_TBL_LICENSE_KEYS . " WHERE date_expiry < NOW() AND date_expiry != '00000000' ORDER BY date_expiry ASC;",
|
||||
ARRAY_A
|
||||
);
|
||||
$subject = get_bloginfo('name') . ' - Your license has expired';
|
||||
$expiration_reminder_text = SLM_Helper_Class::slm_get_option('expiration_reminder_text');
|
||||
|
||||
if (count($sql_query) > 0) {
|
||||
|
||||
foreach ($sql_query as $expired_licenses) {
|
||||
|
||||
// TODO move to template
|
||||
include SLM_LIB . 'mails/expired.php';
|
||||
|
||||
$id = $expired_licenses['id'];
|
||||
$license_key = $expired_licenses['license_key'];
|
||||
$first_name = $expired_licenses['first_name'];
|
||||
$last_name = $expired_licenses['last_name'];
|
||||
$email = $expired_licenses['email'];
|
||||
$date_expiry = $expired_licenses['date_expiry'];
|
||||
|
||||
$id = intval($expired_licenses['id']);
|
||||
$license_key = sanitize_text_field($expired_licenses['license_key']);
|
||||
$first_name = sanitize_text_field($expired_licenses['first_name']);
|
||||
$last_name = sanitize_text_field($expired_licenses['last_name']);
|
||||
$email = sanitize_email($expired_licenses['email']);
|
||||
$date_expiry = sanitize_text_field($expired_licenses['date_expiry']);
|
||||
|
||||
if (SLM_Helper_Class::slm_get_option('enable_auto_key_expiration') == 1) {
|
||||
global $wpdb;
|
||||
$data = array('lic_status' => 'expired');
|
||||
$where = array('id' => $id);
|
||||
$updated = $wpdb->update(SLM_TBL_LICENSE_KEYS, $data, $where);
|
||||
|
||||
self::create_log($license_key, 'set to expired');
|
||||
|
||||
//SLM_Helper_Class::write_log('Found: ' . $license_key);
|
||||
self::slm_check_sent_emails($license_key, $email, $subject, $body, $headers);
|
||||
self::create_log($license_key, 'sent expiration email notification');
|
||||
}
|
||||
|
||||
//SLM_Helper_Class::write_log('DB record logged');
|
||||
$response = 'Reminder message was sent to: ' . $license_key;
|
||||
//SLM_Helper_Class::write_log($response);
|
||||
}
|
||||
} else {
|
||||
SLM_Helper_Class::write_log('array is empty');
|
||||
$response = 'array is empty';
|
||||
SLM_Helper_Class::write_log('No expired licenses found');
|
||||
$response = 'No expired licenses found';
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
static function slm_check_sent_emails($license_key, $email, $subject, $body, $headers)
|
||||
|
||||
public static function slm_check_sent_emails($license_key, $email, $subject, $body, $headers)
|
||||
{
|
||||
global $wpdb;
|
||||
$query = 'SELECT * FROM ' . SLM_TBL_EMAILS . ' WHERE lic_key = "' . $license_key . '";';
|
||||
|
||||
// Prepare the query to avoid SQL injection
|
||||
$query = $wpdb->prepare(
|
||||
'SELECT * FROM ' . SLM_TBL_EMAILS . ' WHERE lic_key = %s',
|
||||
$license_key
|
||||
);
|
||||
$lic_log_results = $wpdb->get_results($query, ARRAY_A);
|
||||
|
||||
if (count($lic_log_results) > 0) {
|
||||
if (!empty($lic_log_results)) {
|
||||
foreach ($lic_log_results as $license) {
|
||||
if ($license["lic_key"] != $license_key) {
|
||||
// TODO: use mail class from include
|
||||
if ($license['lic_key'] !== $license_key) {
|
||||
// Send email if the license key does not match
|
||||
wp_mail($email, $subject, $body, $headers);
|
||||
self::create_email_log($license_key, $email, 'success', 'yes', wp_date("Y/m/d"));
|
||||
return '200'; //reminder was never sent before, first time (record does not exist)
|
||||
self::create_email_log($license_key, $email, 'success', 'yes', current_time('mysql'));
|
||||
return '200'; // Reminder was never sent before, first time (record does not exist)
|
||||
} else {
|
||||
//reminder was sent before
|
||||
// Reminder was sent before
|
||||
return '400';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// array or results are empty (lic key was not found)
|
||||
// TODO: use mail class from include
|
||||
// Array or results are empty (lic key was not found)
|
||||
wp_mail($email, $subject, $body, $headers);
|
||||
self::create_email_log($license_key, $email, 'success', 'yes', wp_date("Y/m/d"));
|
||||
self::create_email_log($license_key, $email, 'success', 'yes', current_time('mysql'));
|
||||
return '300';
|
||||
}
|
||||
}
|
||||
|
||||
static function do_auto_key_expiry()
|
||||
|
||||
public static function do_auto_key_expiry()
|
||||
{
|
||||
global $wpdb;
|
||||
$current_date = wp_date("Y-m-d");
|
||||
$current_date = current_time('Y-m-d');
|
||||
$tbl_name = SLM_TBL_LICENSE_KEYS;
|
||||
|
||||
$sql_prep = $wpdb->prepare("SELECT * FROM $tbl_name WHERE lic_status !=%s", 'expired'); //Load the non-expired keys
|
||||
$licenses = $wpdb->get_results($sql_prep, OBJECT);
|
||||
if (!$licenses) {
|
||||
// Load the non-expired keys
|
||||
$licenses = $wpdb->get_results(
|
||||
$wpdb->prepare("SELECT * FROM $tbl_name WHERE lic_status != %s", 'expired'),
|
||||
OBJECT
|
||||
);
|
||||
|
||||
if (empty($licenses)) {
|
||||
SLM_Debug_Logger::log_debug_st("do_auto_key_expiry() - no license keys found.");
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($licenses as $license) {
|
||||
$key = $license->license_key;
|
||||
$expiry_date = $license->date_expiry;
|
||||
if ($expiry_date == '0000-00-00' || $expiry_date == '00000000' || $expiry_date == '') {
|
||||
$key = sanitize_text_field($license->license_key);
|
||||
$expiry_date = sanitize_text_field($license->date_expiry);
|
||||
|
||||
if ($expiry_date === '0000-00-00' || $expiry_date === '00000000' || empty($expiry_date)) {
|
||||
SLM_Debug_Logger::log_debug_st("This key (" . $key . ") doesn't have a valid expiration date set. The expiration of this key will not be checked.");
|
||||
continue;
|
||||
}
|
||||
|
@ -225,165 +305,356 @@ class SLM_Utility
|
|||
$expire_dt = new DateTime($expiry_date);
|
||||
|
||||
if ($today_dt > $expire_dt) {
|
||||
//This key has reached the expiry. So expire this key.
|
||||
// This key has reached the expiry. So expire this key.
|
||||
SLM_Debug_Logger::log_debug_st("This key (" . $key . ") has expired. Expiry date: " . $expiry_date . ". Setting license key status to expired.");
|
||||
$data = array('lic_status' => 'expired');
|
||||
$where = array('id' => $license->id);
|
||||
$where = array('id' => intval($license->id));
|
||||
$updated = $wpdb->update($tbl_name, $data, $where);
|
||||
|
||||
do_action('slm_license_key_expired', $license->id);
|
||||
self::check_for_expired_lic($key);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static function get_user_info($by, $value)
|
||||
|
||||
public static function get_user_info($by, $value)
|
||||
{
|
||||
$user = get_user_by($by, $value);
|
||||
// Sanitize the input parameters
|
||||
$by = sanitize_key($by);
|
||||
$value = sanitize_text_field($value);
|
||||
|
||||
// Get the user by specified criteria
|
||||
$user = get_user_by($by, $value);
|
||||
return $user;
|
||||
}
|
||||
|
||||
static function get_days_remaining($date1)
|
||||
public static function get_days_remaining($date1)
|
||||
{
|
||||
|
||||
// Validate and sanitize the date input
|
||||
$date1 = sanitize_text_field($date1);
|
||||
|
||||
// Convert the future date to timestamp
|
||||
$future = strtotime($date1);
|
||||
|
||||
// Check if the date is valid
|
||||
if (!$future) {
|
||||
return 0; // Return 0 if the date is invalid
|
||||
}
|
||||
|
||||
// Get the current timestamp
|
||||
$now = time();
|
||||
|
||||
// Calculate the time difference in seconds
|
||||
$timeleft = $future - $now;
|
||||
$daysleft = round((($timeleft / 24) / 60) / 60);
|
||||
return $daysleft;
|
||||
|
||||
// Convert time difference to days
|
||||
$daysleft = floor($timeleft / (60 * 60 * 24));
|
||||
|
||||
// Ensure we don't return negative days if the date has passed
|
||||
if ($daysleft < 0) {
|
||||
$daysleft = 0;
|
||||
}
|
||||
|
||||
// Retrieve the date format setting from WordPress settings
|
||||
$date_format = get_option('date_format');
|
||||
|
||||
// Return the formatted date remaining with the number of days left
|
||||
return sprintf(
|
||||
__('%s days remaining until %s', 'slmplus'),
|
||||
$daysleft,
|
||||
date_i18n($date_format, $future)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Deletes a license key from the licenses table
|
||||
*/
|
||||
static function delete_license_key_by_row_id($key_row_id)
|
||||
* Deletes a license key from the licenses table
|
||||
*/
|
||||
public static function delete_license_key_by_row_id($key_row_id)
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_LICENSE_KEYS;
|
||||
|
||||
//First delete the registered domains entry of this key (if any).
|
||||
// Sanitize the input
|
||||
$key_row_id = intval($key_row_id);
|
||||
|
||||
// First delete the registered domains entry of this key (if any).
|
||||
SLM_Utility::delete_registered_domains_of_key($key_row_id);
|
||||
|
||||
//Now, delete the key from the licenses table.
|
||||
// Now, delete the key from the licenses table.
|
||||
$wpdb->delete($license_table, array('id' => $key_row_id));
|
||||
}
|
||||
|
||||
static function slm_get_lic_email($license)
|
||||
/*
|
||||
* Retrieves the email associated with a license key
|
||||
*/
|
||||
public static function slm_get_lic_email($license)
|
||||
{
|
||||
// DOC: https://www.smashingmagazine.com/2011/09/interacting-with-the-wordpress-database/
|
||||
global $wpdb;
|
||||
$lic_key_table = SLM_TBL_LICENSE_KEYS;
|
||||
$email = $wpdb->get_var("SELECT email FROM $lic_key_table WHERE license_key='$license'");
|
||||
|
||||
// Sanitize the input
|
||||
$license = sanitize_text_field($license);
|
||||
|
||||
// Prepare the query
|
||||
$email = $wpdb->get_var($wpdb->prepare("SELECT email FROM $lic_key_table WHERE license_key = %s", $license));
|
||||
return $email;
|
||||
}
|
||||
|
||||
static function slm_send_mail($to, $subject, $message, $bgcolor)
|
||||
/*
|
||||
* Sends an email with the specified parameters
|
||||
*/
|
||||
public static function slm_send_mail($to, $subject, $message, $bgcolor)
|
||||
{
|
||||
// send activation email
|
||||
$headers[] = 'From: ' . get_bloginfo('name') . ' <' . get_bloginfo('admin_email') . '>';
|
||||
$headers[] = 'Content-Type: text/html; charset=UTF-8';
|
||||
// Sanitize inputs
|
||||
$to = sanitize_email($to);
|
||||
$subject = sanitize_text_field($subject);
|
||||
$message = sanitize_textarea_field($message);
|
||||
|
||||
// Prepare headers
|
||||
$headers = array(
|
||||
'From: ' . get_bloginfo('name') . ' <' . get_bloginfo('admin_email') . '>',
|
||||
'Content-Type: text/html; charset=UTF-8'
|
||||
);
|
||||
|
||||
// Prepare the email body
|
||||
$body = self::slm_email_template($message, $bgcolor);
|
||||
|
||||
// Send the email
|
||||
wp_mail($to, $subject, $body, $headers);
|
||||
}
|
||||
|
||||
static function slm_email_template($message, $bgcolor = '')
|
||||
|
||||
public static function slm_email_template($message, $bgcolor = '')
|
||||
{
|
||||
if ($bgcolor == 'success') {
|
||||
$color = '#eceff0';
|
||||
switch ($bgcolor) {
|
||||
case 'success':
|
||||
$color = '#eceff0';
|
||||
break;
|
||||
case 'error':
|
||||
$color = '#e23b2f';
|
||||
break;
|
||||
default:
|
||||
$color = '#eceff0';
|
||||
break;
|
||||
}
|
||||
|
||||
if (empty($bgcolor)) {
|
||||
$color = '#eceff0';
|
||||
}
|
||||
$template = '<?xml version="1.0" encoding="UTF-8"?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" style="background-color: ' . esc_attr($color) . '; padding: 0; margin: 0;">
|
||||
<head>
|
||||
<style type="text/css">
|
||||
body, html {
|
||||
font-family: Helvetica, Arial;
|
||||
font-size: 13px;
|
||||
background-color: ' . esc_attr($color) . ';
|
||||
background: ' . esc_attr($color) . ';
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
a.schedule_btn, .schedule_btn {
|
||||
display: inline-block;
|
||||
background: #e93e40;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
padding: 6px 12px;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin: 36px 0;
|
||||
}
|
||||
p.legal, .legal {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
font-family: "Open Sans", Helvetica, Arial, sans-serif;
|
||||
line-height: 22px;
|
||||
color: #aaacad;
|
||||
font-weight: 300;
|
||||
}
|
||||
p {
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: #2d2d31;
|
||||
line-height: 26px;
|
||||
font-family: "Open Sans", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
color: #6b6e6f;
|
||||
font-size: 19px;
|
||||
padding: 0 0 15px 0;
|
||||
font-family: "Open Sans", Helvetica, Arial, Sans-serif;
|
||||
}
|
||||
</style>
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet" type="text/css" />
|
||||
<title>' . esc_html(get_bloginfo('name')) . '</title>
|
||||
</head>
|
||||
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space; background-color: ' . esc_attr($color) . '">
|
||||
<div style="background-color: ' . esc_attr($color) . ' !important; font-family: "Open Sans", Helvetica, Arial, sans-serif; margin: 0px; padding: 16px 0 80px 0px;">
|
||||
<br />
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="top" style="background-color:' . esc_attr($color) . '; color:#FFFFFF;">
|
||||
<!-- Content table -->
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" width="600">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left" colspan="2" width="500" style="background-color:' . esc_attr($color) . ';">
|
||||
<div class="main" style="min-width: 320px; max-width: 500px; margin: 62px auto; background: #ffffff; padding: 35px 45px; -webkit-box-shadow: 1px 12px 15px -9px rgba(0,0,0,0.32); -moz-box-shadow: 1px 12px 15px -9px rgba(0,0,0,0.32); box-shadow: 1px 12px 15px -9px rgba(0,0,0,0.32);">
|
||||
<br>
|
||||
<div class="logo" style="text-align: center; max-width: 160px; margin: 0 auto;">
|
||||
<a href="' . esc_url(get_home_url()) . '">
|
||||
<img src="' . esc_url(SLM_Utility::slm_get_icon_url('3x', 'verified.png')) . '" alt="">
|
||||
</a>
|
||||
</div>
|
||||
<br>
|
||||
<h2 style="color: #6b6e6f; font-size: 19px; padding: 0 0 15px 0; font-family: Open Sans, Helvetica, Arial, Sans-serif; text-align: center">License key was activated successfully!</h2>
|
||||
<p style="font-size: 16px; font-weight: 300; color: #2d2d31; line-height: 26px; font-family: Open Sans, Helvetica, Arial, sans-serif;">' . wp_kses_post($message) . '</p>
|
||||
<p>Regards,</p>
|
||||
<div class="signature">
|
||||
<p style="color: #89898c; font-size: 14px; margin: 36px 0; line-height: 20px;">
|
||||
<strong>' . esc_html(get_bloginfo('name')) . '</strong>
|
||||
<br />
|
||||
<a href="mailto:' . esc_attr(get_bloginfo('admin_email')) . '">' . esc_html(get_bloginfo('admin_email')) . '</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear" style="height: 1px; clear: both; float: none; display: block; padding: 1px;"></div>
|
||||
<div class="more-support" style="min-width: 320px; max-width: 500px; margin: 0px auto; padding: 24px 0px;">
|
||||
<p class="legal">The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.</p>
|
||||
<p class="legal">Questions? We are always here to help. Contact <a href="mailto:' . esc_attr(get_bloginfo('admin_email')) . '">' . esc_html(get_bloginfo('admin_email')) . '</a> or simply reply to this email.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
if ($bgcolor == 'error') {
|
||||
$color = '#e23b2f';
|
||||
}
|
||||
|
||||
|
||||
$template = '<?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" style="background-color: ' . $color . '; padding: 0; margin: 0;"> <head> <style type="text/css"> body, html { font-family: Helvetica, Arial; font-size: 13px; background-color: ' . $color . '; background: ' . $color . '; padding: 0px; margin: 0px; } a.schedule_btn, .schedule_btn { display: inline-block; background: #e93e40; color: #fff; text-decoration: none; padding: 6px 12px; text-align: center; border-radius: 2px; font-size: 16px; font-weight: 600; margin: 36px 0; } p.legal, .legal { text-align: center; font-size: 13px; font-family: "Open Sans, Helvetica, Arial, sans-serif; line-height: 22px; color: #aaacad; font-weight: 300 } p { font-size: 16px; font-weight: 300; color: #2d2d31; line-height: 26px; font-family: "Open Sans, helvetica, arial, sans-serif; } h2, h3, h5, h4, h6, h1 { color: #6b6e6f; font-size: 19px; padding: 0 0 15px 0; font-family: "Open Sans, Helvetica, Arial, Sans-serif; } </style> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet" type="text/css" /> <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet" type="text/css" /> <title>Epikly</title> </head> <body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space; background-color: ' . $color . '"> <div style="background-color: ' . $color . ' !important; font-family: " Open Sans,Helvetica,Arial, sans-serif, Helvetica; margin: 0px; padding: 16px 0 80px 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; background-position: initial initial; background-repeat: initial initial;" bgcolor="' . $color . '" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <br /> <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td align="center" style="background-color:' . $color . '; color:#FFFFFF;" valign="top"> <!-- Content table --> <table align="center" border="0" cellpadding="0" cellspacing="0" width="600"> <tbody> <tr> <td align="left" colspan="2" width="500" style="background-color:' . $color . ';"> <div class="main" style="min-width: 320px;max-width: 500px;margin: 62px auto;background: #ffffff;padding: 35px 45px;-webkit-box-shadow: 1px 12px 15px -9px rgba(0,0,0,0.32); -moz-box-shadow: 1px 12px 15px -9px rgba(0,0,0,0.32); box-shadow: 1px 12px 15px -9px rgba(0,0,0,0.32);"> <br> <div class="logo" style="text-align: center; max-width: 160px; margin: 0 auto;"> <a href="' . get_home_url() . '"> <img src="' . SLM_Utility::slm_get_icon_url('3x', 'verified.png') . '" alt=""> </a> </div> <br> <h2 style="color: #6b6e6f;font-size: 19px;padding: 0 0 15px 0;font-family: Open Sans,Helvetica, Arial, Sans-serif; text-align: center">License key was activated successfully !</h2> <p style="font-size: 16px;font-weight: 300;color: #2d2d31;line-height: 26px;font-family: Open Sans,helvetica,arial,sans-serif;"> ' . $message . ' </p> <p>Regards, </p> <div class="signature"> <p style="color: #89898c; font-size: 14px; margin: 36px 0;line-height: 20px;"> <strong> ' . get_bloginfo('name') . ' </strong> <br /> <a href="mailto: ' . get_bloginfo('admin_email') . '"> ' . get_bloginfo('admin_email') . '</a> </p> </div> </div> <div class="clear" style="height: 1px; clear: both;float: none; display: block; padding: 1px"> </div> <div class="more-support" style="min-width: 320px;max-width: 500px;margin: 0px auto;padding: 24px 0px;"> <p class="legal" style="text-align: center; font-size: 13px; font-family: Open Sans,Helvetica, Arial, sans-serif; line-height: 22px; color: #aaacad; font-weight: 300">The content of this email is confidential and intended for the recipient specified in message only. It is strictly forbidden to share any part of this message with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and follow with its deletion, so that we can ensure such a mistake does not occur in the future.</p> <p class="legal" style="text-align: center; font-size: 13px; font-family: Open Sans,Helvetica, Arial, sans-serif; line-height: 22px; color: #aaacad; font-weight: 300">Questions? We are always here to help. Contact <a href="mailto: ' . get_bloginfo('admin_email') . '"> ' . get_bloginfo('admin_email') . '</a> or simply reply to this e-mail. </p> </div> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div> </body> </html>';
|
||||
return $template;
|
||||
}
|
||||
|
||||
static function count_licenses($status)
|
||||
public static function count_licenses($status)
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_LICENSE_KEYS;
|
||||
$get_lic_status = $wpdb->get_var("SELECT COUNT(*) FROM $license_table WHERE lic_status = '" . $status . "'");
|
||||
|
||||
// Sanitize input
|
||||
$status = sanitize_text_field($status);
|
||||
|
||||
// Prepare the SQL statement
|
||||
$query = $wpdb->prepare("SELECT COUNT(*) FROM $license_table WHERE lic_status = %s", $status);
|
||||
$get_lic_status = $wpdb->get_var($query);
|
||||
|
||||
return $get_lic_status;
|
||||
}
|
||||
static function slm_get_icon_url($size, $filename)
|
||||
|
||||
public static function slm_get_icon_url($size, $filename)
|
||||
{
|
||||
// Sanitize inputs
|
||||
$size = sanitize_text_field($size);
|
||||
$filename = sanitize_file_name($filename);
|
||||
|
||||
return SLM_ASSETS_URL . 'icons/' . $size . '/' . $filename;
|
||||
}
|
||||
|
||||
static function count_logrequest()
|
||||
public static function count_logrequest()
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_LIC_LOG;
|
||||
|
||||
$getlogs = $wpdb->get_var("SELECT COUNT(*) FROM $license_table");
|
||||
return $getlogs;
|
||||
}
|
||||
|
||||
static function count_emailsent()
|
||||
public static function count_emailsent()
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_EMAILS;
|
||||
|
||||
$getlogs = $wpdb->get_var("SELECT COUNT(*) FROM $license_table");
|
||||
return $getlogs;
|
||||
}
|
||||
|
||||
static function getstats_licenses($date_created, $interval)
|
||||
public static function getstats_licenses($date_created, $interval)
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_LICENSE_KEYS;
|
||||
$query = $wpdb->get_var("SELECT COUNT(*) FROM $license_table WHERE $date_created >= DATE_ADD(CURDATE(), INTERVAL -" . $interval . " DAY)");
|
||||
return $query;
|
||||
|
||||
// Sanitize inputs
|
||||
$date_created = sanitize_text_field($date_created);
|
||||
$interval = intval($interval);
|
||||
|
||||
$query = $wpdb->prepare(
|
||||
"SELECT COUNT(*) FROM $license_table WHERE $date_created >= DATE_ADD(CURDATE(), INTERVAL -%d DAY)",
|
||||
$interval
|
||||
);
|
||||
|
||||
return $wpdb->get_var($query);
|
||||
}
|
||||
|
||||
static function get_total_licenses()
|
||||
public static function get_total_licenses()
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_LICENSE_KEYS;
|
||||
$license_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $license_table . "");
|
||||
return $license_count;
|
||||
|
||||
$license_count = $wpdb->get_var("SELECT COUNT(*) FROM $license_table");
|
||||
return $license_count;
|
||||
}
|
||||
|
||||
static function get_lic_expiringsoon()
|
||||
public static function get_lic_expiringsoon()
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_LICENSE_KEYS;
|
||||
$license_count = $wpdb->get_var("SELECT COUNT(*) FROM $license_table WHERE date_expiry BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 1 MONTH ) AND DATE_SUB( CURDATE( ) ,INTERVAL 0 MONTH );");
|
||||
return $license_count;
|
||||
|
||||
$license_count = $wpdb->get_var(
|
||||
"SELECT COUNT(*) FROM $license_table WHERE date_expiry BETWEEN DATE_SUB(CURDATE(), INTERVAL 1 MONTH) AND CURDATE()"
|
||||
);
|
||||
|
||||
return $license_count;
|
||||
}
|
||||
|
||||
static function block_license_key_by_row_id($key_row_id)
|
||||
public static function block_license_key_by_row_id($key_row_id)
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_LICENSE_KEYS;
|
||||
//Now, delete the key from the licenses table.
|
||||
|
||||
// Sanitize input
|
||||
$key_row_id = intval($key_row_id);
|
||||
|
||||
$wpdb->update($license_table, array('lic_status' => 'blocked'), array('id' => $key_row_id));
|
||||
}
|
||||
|
||||
static function expire_license_key_by_row_id($key_row_id)
|
||||
public static function expire_license_key_by_row_id($key_row_id)
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_LICENSE_KEYS;
|
||||
|
||||
//Now, delete the key from the licenses table.
|
||||
// Sanitize input
|
||||
$key_row_id = intval($key_row_id);
|
||||
|
||||
$wpdb->update($license_table, array('lic_status' => 'expired'), array('id' => $key_row_id));
|
||||
}
|
||||
|
||||
static function active_license_key_by_row_id($key_row_id)
|
||||
public static function active_license_key_by_row_id($key_row_id)
|
||||
{
|
||||
global $wpdb;
|
||||
$license_table = SLM_TBL_LICENSE_KEYS;
|
||||
$current_date = wp_date('Y/m/d');
|
||||
// 'lic_status' => ''. $current_date.''
|
||||
$current_date = current_time('Y-m-d');
|
||||
|
||||
// Sanitize input
|
||||
$key_row_id = intval($key_row_id);
|
||||
|
||||
$wpdb->update($license_table, array('lic_status' => 'active'), array('id' => $key_row_id));
|
||||
$wpdb->update($license_table, array('date_activated' => '' . $current_date . ''), array('id' => $key_row_id));
|
||||
$wpdb->update($license_table, array('date_activated' => $current_date), array('id' => $key_row_id));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -503,7 +774,7 @@ class SLM_Utility
|
|||
<td scope="row">' . $slm_user["id"] . '</td>
|
||||
<td scope="row">' . $slm_user["license_key"] . '</td>
|
||||
<td scope="row">' . $slm_user["lic_status"] . '</td>
|
||||
<td scope="row"><a href="' . admin_url('admin.php?page=slm_manage_license&edit_record=' . $slm_user["id"] . '') . '">'. __(' view', 'softwarelicensemanager'). ' </a></td>
|
||||
<td scope="row"><a href="' . admin_url('admin.php?page=slm_manage_license&edit_record=' . $slm_user["id"] . '') . '">'. __(' view', 'slmplus'). ' </a></td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
@ -515,7 +786,7 @@ class SLM_Utility
|
|||
$slm_log_table = SLM_TBL_LIC_LOG;
|
||||
|
||||
echo '
|
||||
<div class="table-responsive"> <table class="table table-striped table-hover table-sm"> <thead> <tr> <th scope="col">'. __('ID', 'softwarelicensemanager'). '</th> <th scope="col">'. __('Request', 'softwarelicensemanager'). '</th> </tr> </thead> <tbody>
|
||||
<div class="table-responsive"> <table class="table table-striped table-hover table-sm"> <thead> <tr> <th scope="col">'. __('ID', 'slmplus'). '</th> <th scope="col">'. __('Request', 'slmplus'). '</th> </tr> </thead> <tbody>
|
||||
';
|
||||
$activity = $wpdb->get_results("SELECT * FROM " . $slm_log_table . " WHERE license_key='" . $license_key . "';");
|
||||
foreach ($activity as $log) {
|
||||
|
@ -523,8 +794,8 @@ class SLM_Utility
|
|||
<tr>' .
|
||||
'<th scope="row">' . $log->id . '</th>' .
|
||||
'<td> <span class="badge badge-primary">' . $log->slm_action . '</span>' .
|
||||
'<p class="text-muted"> <b>'. __('Source:', 'softwarelicensemanager'). ' </b> ' . $log->source .
|
||||
'</p><p class="text-muted"> <b>'. __('Time:', 'softwarelicensemanager'). ' </b> ' . $log->time . '</td>
|
||||
'<p class="text-muted"> <b>'. __('Source:', 'slmplus'). ' </b> ' . $log->source .
|
||||
'</p><p class="text-muted"> <b>'. __('Time:', 'slmplus'). ' </b> ' . $log->time . '</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -570,7 +841,7 @@ class SLM_Utility
|
|||
</table>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<?php echo '<div class="alert alert-danger" role="alert">'.__('Not registered yet', 'softwarelicensemanager').'</div>'; ?>
|
||||
<?php echo '<div class="alert alert-danger" role="alert">'.__('Not registered yet', 'slmplus').'</div>'; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
|
@ -588,7 +859,7 @@ class SLM_Utility
|
|||
|
||||
if ($product->is_type('slm_license')) {
|
||||
$tabs['shipping'] = array(
|
||||
'title' => __('License information', 'softwarelicensemanager'),
|
||||
'title' => __('License information', 'slmplus'),
|
||||
'priority' => 50,
|
||||
'callback' => 'slm_woo_tab_lic_info'
|
||||
);
|
||||
|
@ -600,11 +871,11 @@ class SLM_Utility
|
|||
{
|
||||
global $product;
|
||||
// The new tab content
|
||||
echo '<h2>'.__('License information', 'softwarelicensemanager') .'</h2>';
|
||||
echo __('License type: ', 'softwarelicensemanager') . get_post_meta($product->get_id(), '_license_type', true) . '<br>';
|
||||
echo __('Domains allowed: ', 'softwarelicensemanager') . get_post_meta($product->get_id(), '_domain_licenses', true) . '<br>';
|
||||
echo __('Devices allowed: ', 'softwarelicensemanager') . get_post_meta($product->get_id(), '_devices_licenses', true) . '<br>';
|
||||
echo __('Renews every ', 'softwarelicensemanager') . get_post_meta($product->get_id(), '_license_renewal_period', true) . ' ' . get_post_meta($product->get_id(), '_license_renewal_period_term', true) . '<br>';
|
||||
echo '<h2>'.__('License information', 'slmplus') .'</h2>';
|
||||
echo __('License type: ', 'slmplus') . get_post_meta($product->get_id(), '_license_type', true) . '<br>';
|
||||
echo __('Domains allowed: ', 'slmplus') . get_post_meta($product->get_id(), '_domain_licenses', true) . '<br>';
|
||||
echo __('Devices allowed: ', 'slmplus') . get_post_meta($product->get_id(), '_devices_licenses', true) . '<br>';
|
||||
echo __('Renews every ', 'slmplus') . get_post_meta($product->get_id(), '_license_renewal_period_lenght', true) . ' ' . get_post_meta($product->get_id(), '_license_renewal_period_term', true) . '<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
67
readme.txt
67
readme.txt
|
@ -1,49 +1,54 @@
|
|||
=== Software license management ===
|
||||
Contributors: Michel Velis
|
||||
=== SLM Plus ===
|
||||
Contributors: Michel Velis, Tips and Tricks HQ
|
||||
Donate link: http://paypal.me/mvelis
|
||||
Tags: license, software license
|
||||
Requires at least: 4.1
|
||||
Tags: license, software license, woocommerce, license management
|
||||
Requires at least: 5.6
|
||||
Tested up to: 6.1.0
|
||||
Stable tag: 5.6.2
|
||||
Requires PHP: 5.2.4
|
||||
Stable tag: 6.1.0
|
||||
Requires PHP: 7.4
|
||||
License: GPLv2 or later
|
||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Software license management solution for your web applications. Supports WooCommerce.
|
||||
A comprehensive software license management solution for web applications including WordPress plugins, themes, and PHP-based software. Seamlessly integrates with WooCommerce to offer license key generation, management, and validation. Ideal for developers managing software licenses across multiple platforms with built-in multilingual support and performance optimization.
|
||||
|
||||
== Description ==
|
||||
|
||||
Software license management solution for your web applications (WordPress plugins, Themes, Applications, PHP based membership script etc.). Supports WooCommerce.
|
||||
SLM Plus provides a powerful solution for managing software licenses for WordPress plugins, themes, and other web applications. With WooCommerce integration, the plugin allows you to generate, activate, and manage licenses for your customers seamlessly.
|
||||
|
||||
## 📦 Features:
|
||||
- Create license keys
|
||||
- Check the status of a license key from from your application (remotely)
|
||||
- Activate a license key from your application (remotely)
|
||||
- Deactivate a license key (remotely)
|
||||
- Delete a license key (remotely)
|
||||
- Update a license key (remotely)
|
||||
- Check a license key (remotely)
|
||||
- Track where the license key is being used.
|
||||
- Track activation date
|
||||
- You can also create license keys manually from the admin dashboard of this plugin.
|
||||
- Bulk actions are now available
|
||||
- Users and admins can export licenses (new)
|
||||
- Generate and manage license keys for your products
|
||||
- Remote license key validation and activation
|
||||
- Track license key usage across different domains and devices
|
||||
- Manually create licenses from the admin dashboard
|
||||
- Bulk actions for managing licenses
|
||||
- Export licenses for both users and admins (new)
|
||||
- View licenses by subscribers (new)
|
||||
- License info is now included inside woocommerce order (new)
|
||||
- License activity log, track requests and activations per license (new)
|
||||
- Admin stats widgets (new)
|
||||
- Send emails on expiration and activation
|
||||
- Language support (spanish and english)
|
||||
- Woocommerce product type
|
||||
- Pass license info to woocommerce order
|
||||
- Expiration reminder (Emails the user when the license expires)
|
||||
- User can manager and view licenses from my account's page
|
||||
- License info is now included inside WooCommerce order details (new)
|
||||
- License activity logs to track key usage and activations (new)
|
||||
- Admin stats widgets to visualize license usage (new)
|
||||
- Automated emails for license expiration and activation reminders
|
||||
- Multilingual support (English, Spanish)
|
||||
- WooCommerce product type integration to manage licenses through orders
|
||||
- Manage licenses directly from users' "My Account" page
|
||||
- License expiration reminders and notification emails
|
||||
|
||||
== Installation ==
|
||||
|
||||
This section describes how to install the plugin and get it working.
|
||||
|
||||
1. Go to the Add New plugins screen in your WordPress admin area
|
||||
2. Click the upload tab
|
||||
2. Click the Upload tab
|
||||
3. Browse for the plugin file (software-license-manager.zip)
|
||||
4. Click Install Now and then activate the plugin
|
||||
4. Click Install Now and then activate the plugin
|
||||
|
||||
== Changelog ==
|
||||
= 6.1.0 =
|
||||
- Improved compatibility with WordPress 6.1 and WooCommerce
|
||||
- Enhanced performance for large license databases
|
||||
- Added multilingual support for Spanish
|
||||
- New admin widgets for tracking licenses
|
||||
- Improved license information in WooCommerce order details
|
||||
|
||||
== Upgrade Notice ==
|
||||
= 6.1.0 =
|
||||
- Please ensure your WordPress version is at least 5.6 and PHP version is 7.4 or higher before updating.
|
||||
|
|
83
slm-plus.php
Normal file
83
slm-plus.php
Normal file
|
@ -0,0 +1,83 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: SLM Plus
|
||||
Version: 6.1.0
|
||||
Plugin URI: https://github.com/michelve/software-license-manager/
|
||||
Author: Michel Velis
|
||||
Author URI: https://github.com/michelve/
|
||||
Description: A comprehensive software license management solution for web applications including WordPress plugins, themes, and PHP-based software. Seamlessly integrates with WooCommerce to offer license key generation, management, and validation. Ideal for developers managing software licenses across multiple platforms with built-in multilingual support and performance optimization.
|
||||
Text Domain: slmplus
|
||||
Domain Path: /i18n/languages/
|
||||
WC tested up to: 6.6.3
|
||||
Requires at least: 5.6
|
||||
Stable tag: 6.6.2
|
||||
Requires PHP: 7.4
|
||||
License: GPLv2 or later
|
||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
Contributors: Tips and Tricks HQ
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Secure the plugin by blocking direct access
|
||||
}
|
||||
|
||||
// Load plugin textdomain for multilingual support
|
||||
function slmplus_load_textdomain() {
|
||||
load_plugin_textdomain('slmplus', false, dirname(plugin_basename(__FILE__)) . '/i18n/languages');
|
||||
}
|
||||
add_action('plugins_loaded', 'slmplus_load_textdomain');
|
||||
|
||||
// Global variables for database interaction
|
||||
global $wpdb, $slm_debug_logger;
|
||||
|
||||
// Define constants for plugin paths, URLs, and database tables
|
||||
define('SLM_VERSION', '6.1.0');
|
||||
define('SLM_DB_VERSION', '5.0.3');
|
||||
define('SLM_REWRITE_VERSION', '3.0.3');
|
||||
define('SLM_FOLDER', dirname(plugin_basename(__FILE__)));
|
||||
define('SLM_URL', plugins_url('', __FILE__));
|
||||
define('SLM_ASSETS_URL', SLM_URL . '/public/assets/');
|
||||
define('SLM_PATH', plugin_dir_path(__FILE__));
|
||||
define('SLM_LIB', SLM_PATH . 'includes/');
|
||||
define('SLM_WOO', SLM_PATH . 'woocommerce/');
|
||||
define('SLM_ADDONS', SLM_PATH . 'addons/');
|
||||
define('SLM_ADMIN', SLM_PATH . 'admin/');
|
||||
define('SLM_ADMIN_ADDONS', SLM_ADMIN . 'includes/');
|
||||
define('SLM_CRONS', SLM_ADMIN_ADDONS . 'cronjobs/');
|
||||
define('SLM_PUBLIC', SLM_PATH . 'public/');
|
||||
define('SLM_TEMPLATES', SLM_PATH . 'templates/');
|
||||
define('SLM_SITE_HOME_URL', get_home_url());
|
||||
define('SLM_SITE_URL', get_site_url() . '/');
|
||||
define('SLM_TBL_LICENSE_KEYS', $wpdb->prefix . "lic_key_tbl");
|
||||
define('SLM_TBL_EMAILS', $wpdb->prefix . "lic_emails_tbl");
|
||||
define('SLM_TBL_LIC_DOMAIN', $wpdb->prefix . "lic_reg_domain_tbl");
|
||||
define('SLM_TBL_LIC_DEVICES', $wpdb->prefix . "lic_reg_devices_tbl");
|
||||
define('SLM_TBL_LIC_LOG', $wpdb->prefix . "lic_log_tbl");
|
||||
define('SLM_TBL_LICENSE_STATUS', $wpdb->prefix . "lic_status_tbl");
|
||||
define('SLM_MANAGEMENT_PERMISSION', 'manage_options');
|
||||
define('SLM_MAIN_MENU_SLUG', 'slm_overview');
|
||||
define('SLM_MENU_ICON', 'dashicons-lock');
|
||||
|
||||
// Load core plugin functionalities
|
||||
if (file_exists(SLM_LIB . 'slm-plugin-core.php')) {
|
||||
require_once SLM_LIB . 'slm-plugin-core.php';
|
||||
}
|
||||
|
||||
define('SLM_DEFAULT_MAX_DOMAINS', SLM_API_Utility::get_slm_option('default_max_domains'));
|
||||
define('SLM_DEFAULT_MAX_DEVICES', SLM_API_Utility::get_slm_option('default_max_devices'));
|
||||
|
||||
// Use native WordPress function for setting options
|
||||
define('WOO_SLM_API_SECRET', SLM_API_Utility::get_slm_option('lic_creation_secret'));
|
||||
define('KEY_API', SLM_API_Utility::get_slm_option('lic_creation_secret'));
|
||||
define('KEY_API_PREFIX', SLM_API_Utility::get_slm_option('lic_prefix'));
|
||||
|
||||
// Auto-updater integration for GitHub updates
|
||||
if (file_exists('plugin-update-checker/plugin-update-checker.php')) {
|
||||
require 'plugin-update-checker/plugin-update-checker.php';
|
||||
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
|
||||
'https://github.com/michelve/software-license-manager',
|
||||
__FILE__,
|
||||
'software-license-manager'
|
||||
);
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: Software License Manager
|
||||
Version: 5.6.2
|
||||
Plugin URI: https://github.com/michelve/software-license-manager/
|
||||
Author: Michel Velis
|
||||
Author URI: http://www.epikly.com/
|
||||
Description: Software license management solution for your web applications (WordPress plugins, Themes, Applications, PHP based license software script etc.). Supports WooCommerce.
|
||||
Author2: <a href="https://www.tipsandtricks-hq.com/">Tips and Tricks HQ</a>
|
||||
Text Domain: softwarelicensemanager
|
||||
Domain Path: /i18n/languages/
|
||||
WC tested up to: 6.1.0
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('WPINC')) {
|
||||
die();
|
||||
}
|
||||
global $wpdb, $slm_debug_logger;
|
||||
|
||||
//Short name/slug "SLM" or "slm"
|
||||
define('SLM_VERSION', '5.6.2');
|
||||
define('SLM_DB_VERSION', '4.3.5');
|
||||
define('SLM_REWRITE_VERSION', '2.4.5');
|
||||
define('SLM_FOLDER', dirname(plugin_basename(__FILE__)));
|
||||
define('SLM_URL', plugins_url('', __FILE__));
|
||||
define('SLM_ASSETS_URL', SLM_URL . '/public/assets/');
|
||||
define('SLM_PATH', plugin_dir_path(__FILE__));
|
||||
define('SLM_LIB', SLM_PATH . 'includes/');
|
||||
define('SLM_WOO', SLM_PATH . 'woocommerce/');
|
||||
define('SLM_ADDONS', SLM_PATH . 'addons/');
|
||||
define('SLM_ADMIN', SLM_PATH . 'admin/');
|
||||
define('SLM_ADMIN_ADDONS', SLM_ADMIN . 'includes/');
|
||||
define('SLM_CRONS', SLM_ADMIN_ADDONS . 'cronjobs/');
|
||||
define('SLM_PUBLIC', SLM_PATH . 'public/');
|
||||
define('SLM_TEAMPLATES', SLM_PATH . 'templates/');
|
||||
define('SLM_SITE_HOME_URL', get_home_url());
|
||||
define('SLM_SITE_URL', get_site_url() . '/');
|
||||
define('SLM_TBL_LICENSE_KEYS', $wpdb->prefix . "lic_key_tbl");
|
||||
define('SLM_TBL_EMAILS', $wpdb->prefix . "lic_emails_tbl");
|
||||
define('SLM_TBL_LIC_DOMAIN', $wpdb->prefix . "lic_reg_domain_tbl");
|
||||
define('SLM_TBL_LIC_DEVICES', $wpdb->prefix . "lic_reg_devices_tbl");
|
||||
define('SLM_TBL_LIC_LOG', $wpdb->prefix . "lic_log_tbl");
|
||||
define('SLM_MANAGEMENT_PERMISSION', 'manage_options');
|
||||
define('SLM_MAIN_MENU_SLUG', 'slm_overview');
|
||||
define('SLM_MENU_ICON', 'dashicons-lock');
|
||||
|
||||
|
||||
if (file_exists(SLM_LIB . 'slm-plugin-core.php')) {
|
||||
include_once SLM_LIB . 'slm-plugin-core.php';
|
||||
}
|
||||
|
||||
// Options and filters
|
||||
define('WOO_SLM_API_SECRET', SLM_Helper_Class::slm_get_option('lic_creation_secret'));
|
||||
define('KEY_API', SLM_Helper_Class::slm_get_option('lic_creation_secret'));
|
||||
define('KEY_API_PREFIX', SLM_Helper_Class::slm_get_option('lic_prefix'));
|
||||
|
||||
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'slm_settings_link');
|
||||
|
||||
// plugin auto updater helper
|
||||
if (file_exists('plugin-update-checker/plugin-update-checker.php')) {
|
||||
require 'plugin-update-checker/plugin-update-checker.php';
|
||||
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker('https://github.com/michelve/software-license-manager', __FILE__, '/software-license-manager');
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
/**
|
||||
* Runs on Uninstall of Software License Manager
|
||||
* Runs on Uninstall of SLM Plus
|
||||
*
|
||||
* @package Software License Manager
|
||||
* @package SLM Plus
|
||||
* @author Michel Velis
|
||||
* @license GPL-2.0+
|
||||
* @link http://epikly.com
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,17 +1,40 @@
|
|||
<?php
|
||||
|
||||
add_action('woocommerce_single_product_summary', 'slm_license_template', 60);
|
||||
|
||||
function slm_license_template()
|
||||
{
|
||||
global $product;
|
||||
if ('slm_license' == $product->get_type()) {
|
||||
|
||||
// Ensure $product is a valid WooCommerce product object
|
||||
if (!$product || !is_a($product, 'WC_Product')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the product type with backward compatibility handling
|
||||
$product_type = '';
|
||||
if (method_exists($product, 'get_type')) {
|
||||
$product_type = $product->get_type();
|
||||
} else {
|
||||
$product_type = $product->product_type; // For older versions
|
||||
}
|
||||
|
||||
// Check if the product type is 'slm_license'
|
||||
if ($product_type === 'slm_license') {
|
||||
$template_path = SLM_WOO . 'templates/';
|
||||
|
||||
// Ensure the template path exists, if not fall back to plugin's default template directory
|
||||
if (!file_exists($template_path . 'single-product/add-to-cart/slm_license.php')) {
|
||||
// If template is not found, provide a fallback to default WooCommerce template directory or a custom one
|
||||
$template_path = plugin_dir_path(__FILE__) . 'templates/';
|
||||
}
|
||||
|
||||
// Load the template
|
||||
wc_get_template(
|
||||
'single-product/add-to-cart/slm_license.php',
|
||||
'',
|
||||
array(),
|
||||
'',
|
||||
trailingslashit($template_path)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,367 +1,358 @@
|
|||
<?php
|
||||
|
||||
// Author: Michel Velis
|
||||
// Author URI: http://pilotkit.co
|
||||
// Since: 4.4.0
|
||||
// from: https://gist.github.com/JeroenSormani/6b710d079386d096f932
|
||||
|
||||
add_filter('woocommerce_product_data_tabs', 'wc_slm_add_tab');
|
||||
add_action('woocommerce_process_product_meta', 'wc_slm_save_data');
|
||||
add_action('woocommerce_product_data_panels', 'wc_slm_data_panel');
|
||||
//add_filter('product_type_options', 'add_wc_slm_data_tab_enabled_product_option'); //legacy
|
||||
add_action('init', 'slm_register_product_type');
|
||||
add_filter( 'woocommerce_product_class', 'slm_register_product_class', 10, 2 );
|
||||
add_filter('product_type_selector', 'slm_add_product_type');
|
||||
add_action('admin_footer', 'slm_license_admin_custom_js');
|
||||
/**
|
||||
* Add 'License' product option
|
||||
*/
|
||||
function add_wc_slm_data_tab_enabled_product_option($product_type_options)
|
||||
{
|
||||
$product_type_options['wc_slm_data_tab_enabled'] = array(
|
||||
'id' => '_wc_slm_data_tab_enabled',
|
||||
'wrapper_class' => 'show_if_slm_license',
|
||||
'label' => __('License Manager', 'softwarelicensemanager'),
|
||||
'default' => 'no',
|
||||
'description' => __('Enables the license creation api.', 'softwarelicensemanager')
|
||||
);
|
||||
return $product_type_options;
|
||||
// If this file is called directly, abort.
|
||||
if (!defined('WPINC')) {
|
||||
die();
|
||||
}
|
||||
|
||||
function slm_register_product_type() {
|
||||
if ( class_exists( 'WC_Product' ) && ! class_exists( 'WC_Product_SLM_License' ) ) {
|
||||
// WooCommerce 3.0 and above use WC_Product_Simple as the base class
|
||||
if ( version_compare( WC()->version, '3.0.0', '>=' ) ) {
|
||||
class WC_Product_SLM_License extends WC_Product_Simple {
|
||||
protected $product_type = 'slm_license';
|
||||
|
||||
/** CSS To Add Custom tab Icon */
|
||||
function wcpp_custom_style()
|
||||
{
|
||||
?><style>
|
||||
public function __construct( $product = 0 ) {
|
||||
parent::__construct( $product );
|
||||
}
|
||||
|
||||
public function get_type() {
|
||||
return 'slm_license';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Older versions use WC_Product as the base class
|
||||
class WC_Product_SLM_License extends WC_Product {
|
||||
protected $product_type = 'slm_license';
|
||||
|
||||
public function __construct( $product = 0 ) {
|
||||
parent::__construct( $product );
|
||||
}
|
||||
|
||||
public function get_type() {
|
||||
return 'slm_license';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action('init', 'slm_register_product_type');
|
||||
|
||||
|
||||
function slm_register_product_class($classname, $product_type) {
|
||||
if ($product_type == 'slm_license') {
|
||||
$classname = 'WC_Product_SLM_License';
|
||||
}
|
||||
return $classname;
|
||||
}
|
||||
add_filter('woocommerce_product_class', 'slm_register_product_class', 10, 2);
|
||||
|
||||
|
||||
function slm_add_product_type($types) {
|
||||
$types['slm_license'] = __('License product', 'slmplus');
|
||||
return $types;
|
||||
error_log("Saving product type for Product ID: " . $types);
|
||||
|
||||
}
|
||||
add_filter('product_type_selector', 'slm_add_product_type');
|
||||
|
||||
|
||||
/**
|
||||
* Add 'License Manager' product option.
|
||||
*/
|
||||
function add_wc_slm_data_tab_enabled_product_option($product_type_options) {
|
||||
// Check if the current product type is the custom license product type
|
||||
if (isset($_GET['product_type']) && $_GET['product_type'] === 'slm_license') {
|
||||
$product_type_options['wc_slm_data_tab_enabled'] = array(
|
||||
'id' => '_wc_slm_data_tab_enabled',
|
||||
'wrapper_class' => 'show_if_slm_license',
|
||||
'label' => __('License Manager', 'slmplus'),
|
||||
'default' => 'no',
|
||||
'description' => __('Enables the license creation API.', 'slmplus'),
|
||||
'type' => 'checkbox'
|
||||
);
|
||||
}
|
||||
return $product_type_options;
|
||||
}
|
||||
add_filter('product_type_options', 'add_wc_slm_data_tab_enabled_product_option', 10);
|
||||
|
||||
|
||||
/**
|
||||
* CSS To Add Custom tab Icon
|
||||
*/
|
||||
function wcpp_custom_style() {
|
||||
?>
|
||||
<style>
|
||||
#woocommerce-product-data ul.wc-tabs li.wc_slm_data_tab_options a:before {
|
||||
font-family: Dashicons;
|
||||
content: "\f160";
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
jQuery(document).ready(function($) {
|
||||
jQuery('input#_wc_slm_data_tab_enabled').change(function() {
|
||||
// Toggle Visibility for Tab Fields Based on 'License Manager' Checkbox
|
||||
$('input#_wc_slm_data_tab_enabled').change(function() {
|
||||
var isTabEnabled = $(this).is(':checked');
|
||||
$('.show_if_wc_slm_data_tab_enabled').toggle(isTabEnabled);
|
||||
$('.hide_if_wc_slm_data_tab_enabled').toggle(!isTabEnabled);
|
||||
}).trigger('change'); // Trigger change event to apply changes on page load
|
||||
|
||||
var is_wc_slm_data_tab_enabled = jQuery('input#_wc_slm_data_tab_enabled:checked').size();
|
||||
// console.log( is_wc_slm_data_tab_enabled );
|
||||
jQuery('.show_if_wc_slm_data_tab_enabled').hide();
|
||||
jQuery('.hide_if_wc_slm_data_tab_enabled').hide();
|
||||
|
||||
if (is_wc_slm_data_tab_enabled) {
|
||||
jQuery('.hide_if_wc_slm_data_tab_enabled').hide();
|
||||
}
|
||||
if (is_wc_slm_data_tab_enabled) {
|
||||
jQuery('.show_if_wc_slm_data_tab_enabled').show();
|
||||
}
|
||||
});
|
||||
jQuery('input#_wc_slm_data_tab_enabled').trigger('change');
|
||||
});
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
jQuery('#_license_type').change(function() {
|
||||
if (jQuery(this).val() == 'lifetime') {
|
||||
jQuery('._license_renewal_period_field').hide();
|
||||
jQuery('#_license_renewal_period').val('onetime');
|
||||
jQuery('#_license_renewal_period').prop("disabled", true);
|
||||
jQuery('._license_renewal_period_term_field').hide();
|
||||
// Toggle License Renewal Period Fields Based on License Type
|
||||
$('#_license_type').change(function() {
|
||||
if ($(this).val() === 'lifetime') {
|
||||
$('._license_renewal_period_field, ._license_renewal_period_term_field').hide();
|
||||
$('#_license_renewal_period_lenght').val('onetime').prop("disabled", true);
|
||||
} else {
|
||||
jQuery('._license_renewal_period_field').show();
|
||||
jQuery('._license_renewal_period_term_field').show();
|
||||
jQuery('#_license_renewal_period').val('');
|
||||
jQuery('#_license_renewal_period').prop("disabled", false);
|
||||
$('._license_renewal_period_field, ._license_renewal_period_term_field').show();
|
||||
$('#_license_renewal_period_lenght').val('').prop("disabled", false);
|
||||
}
|
||||
});
|
||||
}).trigger('change'); // Trigger change to apply initial setting on load
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
add_action('admin_head', 'wcpp_custom_style');
|
||||
function wc_slm_add_tab($wc_slm_data_tabs){
|
||||
$wc_slm_data_tabs['wc_slm_data_tab'] = array(
|
||||
'label' => __('Licensing', 'softwarelicensemanager'),
|
||||
'target' => 'wc_slm_meta',
|
||||
'class' => array('show_if_slm_license', 'show_if_wc_slm_data_tab_enabled'),
|
||||
);
|
||||
return $wc_slm_data_tabs;
|
||||
}
|
||||
}
|
||||
add_action('admin_head', 'wcpp_custom_style');
|
||||
|
||||
function wc_slm_data_panel(){
|
||||
global $post;
|
||||
$product_id=get_the_ID();
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
/**
|
||||
* Add Custom WooCommerce Product Data Tab
|
||||
*/
|
||||
function wc_slm_add_tab($wc_slm_data_tabs) {
|
||||
$wc_slm_data_tabs['wc_slm_data_tab'] = array(
|
||||
'label' => __('License Info', 'slmplus'),
|
||||
'target' => 'wc_slm_meta',
|
||||
'class' => array('show_if_slm_license', 'show_if_wc_slm_data_tab_enabled'),
|
||||
);
|
||||
return $wc_slm_data_tabs;
|
||||
}
|
||||
add_filter('woocommerce_product_data_tabs', 'wc_slm_add_tab');
|
||||
|
||||
/**
|
||||
* Custom WooCommerce Data Panel
|
||||
*/
|
||||
function wc_slm_data_panel() {
|
||||
global $post;
|
||||
$product_id = get_the_ID();
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
?>
|
||||
<div id='wc_slm_meta' class='panel woocommerce_options_panel'>
|
||||
<?php ?>
|
||||
<div class='options_group'>
|
||||
<?php
|
||||
$value = get_post_meta($product_id, '_domain_licenses',true);
|
||||
if($value === ''){
|
||||
$value = SLM_Helper_Class::slm_get_option('default_max_domains');
|
||||
}
|
||||
woocommerce_wp_text_input(
|
||||
array(
|
||||
'id' => '_domain_licenses',
|
||||
'label' => __('Domain Licenses', 'softwarelicensemanager'),
|
||||
'placeholder' => SLM_Helper_Class::slm_get_option('default_max_domains'),
|
||||
'desc_tip' => 'true',
|
||||
'value' => $value,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array(
|
||||
'step' => 'any',
|
||||
'min' => 0,
|
||||
),
|
||||
'description' => __('Enter the allowed amount of domains this license can have (websites).', 'softwarelicensemanager')
|
||||
)
|
||||
);
|
||||
$value = get_post_meta($product_id, '_devices_licenses',true);
|
||||
if($value === ''){
|
||||
$value = SLM_Helper_Class::slm_get_option('default_max_devices');
|
||||
}
|
||||
woocommerce_wp_text_input(
|
||||
array(
|
||||
'id' => '_devices_licenses',
|
||||
'label' => __('Devices Licenses', 'softwarelicensemanager'),
|
||||
'placeholder' => SLM_Helper_Class::slm_get_option('default_max_devices'),
|
||||
'desc_tip' => 'true',
|
||||
'value' => $value,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array(
|
||||
'step' => 'any',
|
||||
'min' => 0,
|
||||
),
|
||||
'description' => __('Enter the allowed amount of devices this license can have (computers, mobile, etc).', 'softwarelicensemanager')
|
||||
)
|
||||
);
|
||||
if ($slm_options['slm_multiple_items']==1){
|
||||
woocommerce_wp_text_input(
|
||||
array(
|
||||
'id' => '_license_item_reference',
|
||||
'label' => __('Item reference', 'softwarelicensemanager'),
|
||||
'placeholder' => "Software's item reference",
|
||||
'desc_tip' => 'true',
|
||||
'description' => __('Enter the item reference of your application, theme, or plug-in. The licence will be then bound to this exact software.', 'softwarelicensemanager')
|
||||
)
|
||||
);
|
||||
}
|
||||
woocommerce_wp_select(
|
||||
array(
|
||||
'id' => '_license_type',
|
||||
'label' => __('License Type', 'softwarelicensemanager'),
|
||||
'placeholder' => 'Select one',
|
||||
'desc_tip' => 'true',
|
||||
'description' => __('type of license: subscription base or lifetime', 'softwarelicensemanager'),
|
||||
'options' => array(
|
||||
'none' => __('Select one', 'softwarelicensemanager'),
|
||||
'subscription' => __('subscription', 'softwarelicensemanager'),
|
||||
'lifetime' => __('lifetime', 'softwarelicensemanager'),
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
echo '<hr>';
|
||||
woocommerce_wp_text_input(
|
||||
array(
|
||||
'id' => '_license_renewal_period',
|
||||
'label' => __('Renewal period lenght ', 'softwarelicensemanager'),
|
||||
'placeholder' => '0',
|
||||
'description' => __('Amount of days or months or years', 'softwarelicensemanager'),
|
||||
)
|
||||
);
|
||||
// Domain Licenses Input
|
||||
$value = get_post_meta($product_id, '_domain_licenses', true);
|
||||
$value = ($value === '') ? SLM_Helper_Class::slm_get_option('default_max_domains') : $value;
|
||||
|
||||
woocommerce_wp_select(
|
||||
array(
|
||||
'id' => '_license_renewal_period_term',
|
||||
'label' => __('Expiration term', 'softwarelicensemanager'),
|
||||
'placeholder' => 'days',
|
||||
'description' => __('Choose between days or months or years', 'softwarelicensemanager'),
|
||||
'options' => array(
|
||||
'days' => __('Day(s)', 'softwarelicensemanager'),
|
||||
'months' => __('Month(s)', 'softwarelicensemanager'),
|
||||
'years' => __('Year(s)', 'softwarelicensemanager'),
|
||||
'onetime' => __('One Time', 'softwarelicensemanager'),
|
||||
)
|
||||
)
|
||||
);
|
||||
echo '<div class="clear"><hr></div>';
|
||||
woocommerce_wp_text_input(array(
|
||||
'id' => '_domain_licenses',
|
||||
'label' => __('Domain Licenses', 'slmplus'),
|
||||
'placeholder' => SLM_Helper_Class::slm_get_option('default_max_domains'),
|
||||
'desc_tip' => 'true',
|
||||
'value' => $value,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array('step' => 'any', 'min' => 0),
|
||||
'description' => __('Enter the allowed number of domains this license can have (websites).', 'slmplus')
|
||||
));
|
||||
|
||||
woocommerce_wp_text_input(
|
||||
array(
|
||||
'id' => '_license_current_version',
|
||||
'label' => __('Current Version', 'softwarelicensemanager'),
|
||||
'placeholder' => '0.0.0',
|
||||
'desc_tip' => 'true',
|
||||
'description' => __('Enter the current version of your application, theme, or plug-in', 'softwarelicensemanager')
|
||||
)
|
||||
);
|
||||
// Device Licenses Input
|
||||
$value = get_post_meta($product_id, '_devices_licenses', true);
|
||||
$value = ($value === '') ? SLM_Helper_Class::slm_get_option('default_max_devices') : $value;
|
||||
|
||||
woocommerce_wp_text_input(
|
||||
array(
|
||||
'id' => '_license_until_version',
|
||||
'label' => __('Until Version', 'softwarelicensemanager'),
|
||||
'placeholder' => '0.0.0',
|
||||
'desc_tip' => 'true',
|
||||
'description' => __('Enter the version until support expires.', 'softwarelicensemanager')
|
||||
)
|
||||
);
|
||||
?>
|
||||
woocommerce_wp_text_input(array(
|
||||
'id' => '_devices_licenses',
|
||||
'label' => __('Devices Licenses', 'slmplus'),
|
||||
'placeholder' => SLM_Helper_Class::slm_get_option('default_max_devices'),
|
||||
'desc_tip' => 'true',
|
||||
'value' => $value,
|
||||
'type' => 'number',
|
||||
'custom_attributes' => array('step' => 'any', 'min' => 0),
|
||||
'description' => __('Enter the allowed number of devices this license can have (computers, mobile, etc).', 'slmplus')
|
||||
));
|
||||
|
||||
// Item Reference Field (if enabled)
|
||||
if (!empty($slm_options['slm_multiple_items']) && $slm_options['slm_multiple_items'] == 1) {
|
||||
woocommerce_wp_text_input(array(
|
||||
'id' => '_license_item_reference',
|
||||
'label' => __('Item Reference', 'slmplus'),
|
||||
'placeholder' => __("Software's item reference"),
|
||||
'desc_tip' => 'true',
|
||||
'description' => __('Enter the item reference of your application, theme, or plug-in. The license will be then bound to this exact software.', 'slmplus')
|
||||
));
|
||||
}
|
||||
|
||||
// License Type Dropdown
|
||||
woocommerce_wp_select(array(
|
||||
'id' => '_license_type',
|
||||
'label' => __('License Type', 'slmplus'),
|
||||
'desc_tip' => 'true',
|
||||
'description' => __('Type of license: subscription base or lifetime', 'slmplus'),
|
||||
'options' => array(
|
||||
'none' => __('Select one', 'slmplus'),
|
||||
'subscription' => __('Subscription', 'slmplus'),
|
||||
'lifetime' => __('Lifetime', 'slmplus'),
|
||||
)
|
||||
));
|
||||
|
||||
// License Renewal Period Length
|
||||
woocommerce_wp_text_input(array(
|
||||
'id' => '_license_renewal_period_lenght',
|
||||
'label' => __('Renewal Period Length', 'slmplus'),
|
||||
'description' => __('Amount of days, months, or years.', 'slmplus'),
|
||||
'type' => 'text', // Change 'number' to 'text'
|
||||
'value' => get_post_meta($product_id, '_license_renewal_period_lenght', true) ?: '1', // Fallback to '1' if empty
|
||||
));
|
||||
|
||||
|
||||
|
||||
// License Renewal Period Term Dropdown
|
||||
woocommerce_wp_select(array(
|
||||
'id' => '_license_renewal_period_term',
|
||||
'label' => __('Expiration Term', 'slmplus'),
|
||||
'placeholder' => 'select time frame',
|
||||
'description' => __('Choose between days, months, or years', 'slmplus'),
|
||||
'options' => array(
|
||||
'days' => __('Day(s)', 'slmplus'),
|
||||
'months' => __('Month(s)', 'slmplus'),
|
||||
'years' => __('Year(s)', 'slmplus'),
|
||||
'onetime' => __('One Time', 'slmplus'),
|
||||
),
|
||||
'value' => get_post_meta($product_id, '_license_renewal_period_term', true) ?: 'years', // Ensure default value is set to 'years' if empty
|
||||
));
|
||||
|
||||
echo '<div class="clear"><hr></div>';
|
||||
|
||||
// Current Version Input
|
||||
woocommerce_wp_text_input(array(
|
||||
'id' => '_license_current_version',
|
||||
'label' => __('Current Version', 'slmplus'),
|
||||
'placeholder' => '0.0.0',
|
||||
'desc_tip' => 'true',
|
||||
'description' => __('Enter the current version of your application, theme, or plug-in', 'slmplus')
|
||||
));
|
||||
|
||||
// Until Version Input
|
||||
woocommerce_wp_text_input(array(
|
||||
'id' => '_license_until_version',
|
||||
'label' => __('Until Version', 'slmplus'),
|
||||
'placeholder' => '0.0.0',
|
||||
'desc_tip' => 'true',
|
||||
'description' => __('Enter the version until support expires.', 'slmplus')
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
</div><?php
|
||||
}
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_action('woocommerce_product_data_panels', 'wc_slm_data_panel');
|
||||
|
||||
/** Hook callback function to save custom fields information */
|
||||
function wc_slm_save_data($post_id)
|
||||
{
|
||||
// _domain_licenses
|
||||
// _devices_licenses
|
||||
// _license_type
|
||||
// _license_current_version
|
||||
// _license_until_version
|
||||
|
||||
$_domain_licenses = $_POST['_domain_licenses'];
|
||||
update_post_meta($post_id, '_domain_licenses', esc_attr($_domain_licenses));
|
||||
|
||||
$is_wc_slm_data_tab_enabled = isset($_POST['_wc_slm_data_tab_enabled']) ? 'yes' : 'no';
|
||||
update_post_meta($post_id, '_wc_slm_data_tab_enabled', $is_wc_slm_data_tab_enabled);
|
||||
/** Hook callback function to save custom fields information */
|
||||
function wc_slm_save_data($post_id) {
|
||||
// Sanitize and save domain licenses
|
||||
$_domain_licenses = isset($_POST['_domain_licenses']) ? intval($_POST['_domain_licenses']) : 0;
|
||||
update_post_meta($post_id, '_domain_licenses', $_domain_licenses);
|
||||
|
||||
$_license_item_reference = $_POST['_license_item_reference'];
|
||||
if (!empty($_license_item_reference)) {
|
||||
update_post_meta($post_id, '_license_item_reference', esc_attr($_license_item_reference));
|
||||
}
|
||||
else {
|
||||
update_post_meta($post_id, '_license_item_reference', esc_attr('default'));
|
||||
}
|
||||
// Save the tab enable option
|
||||
$is_wc_slm_data_tab_enabled = isset($_POST['_wc_slm_data_tab_enabled']) ? 'yes' : 'no';
|
||||
update_post_meta($post_id, '_wc_slm_data_tab_enabled', $is_wc_slm_data_tab_enabled);
|
||||
|
||||
$_license_type = $_POST['_license_type'];
|
||||
if (!empty($_license_type)) {
|
||||
update_post_meta($post_id, '_license_type', esc_attr($_license_type));
|
||||
}
|
||||
// Save the item reference
|
||||
$_license_item_reference = isset($_POST['_license_item_reference']) ? sanitize_text_field($_POST['_license_item_reference']) : '';
|
||||
update_post_meta($post_id, '_license_item_reference', empty($_license_item_reference) ? 'default' : $_license_item_reference);
|
||||
|
||||
$_devices_licenses = $_POST['_devices_licenses'];
|
||||
update_post_meta($post_id, '_devices_licenses', esc_attr($_devices_licenses));
|
||||
// Save license type
|
||||
$_license_type = isset($_POST['_license_type']) ? sanitize_text_field($_POST['_license_type']) : '';
|
||||
update_post_meta($post_id, '_license_type', $_license_type);
|
||||
|
||||
$_license_renewal_period = $_POST['_license_renewal_period'];
|
||||
if (!empty($_license_renewal_period) && $_license_type == 'lifetime') {
|
||||
update_post_meta($post_id, '_license_renewal_period', esc_attr('0'));
|
||||
}
|
||||
else {
|
||||
update_post_meta($post_id, '_license_renewal_period', esc_attr($_license_renewal_period));
|
||||
}
|
||||
// Sanitize and save device licenses
|
||||
$_devices_licenses = isset($_POST['_devices_licenses']) ? intval($_POST['_devices_licenses']) : 0;
|
||||
update_post_meta($post_id, '_devices_licenses', $_devices_licenses);
|
||||
|
||||
$_license_renewal_period_term = $_POST['_license_renewal_period_term'];
|
||||
if (!empty($_license_renewal_period_term) && $_license_type == 'lifetime') {
|
||||
update_post_meta($post_id, '_license_renewal_period_term', esc_attr('onetime'));
|
||||
}
|
||||
else {
|
||||
update_post_meta($post_id, '_license_renewal_period_term', esc_attr($_license_renewal_period_term));
|
||||
}
|
||||
// Handle license renewal period
|
||||
|
||||
$_license_renewal_period_lenght = isset($_POST['_license_renewal_period_lenght']) ? sanitize_text_field($_POST['_license_renewal_period_lenght']) : '';
|
||||
update_post_meta($post_id, '_license_renewal_period_lenght', $_license_renewal_period_lenght);
|
||||
|
||||
// Handle license renewal period term
|
||||
if (isset($_POST['_license_renewal_period_term'])) {
|
||||
$_license_renewal_period_term = sanitize_text_field($_POST['_license_renewal_period_term']);
|
||||
if ($_license_type == 'lifetime' && $_license_renewal_period_term !== 'onetime') {
|
||||
$_license_renewal_period_term = 'onetime';
|
||||
}
|
||||
update_post_meta($post_id, '_license_renewal_period_term', $_license_renewal_period_term);
|
||||
}
|
||||
|
||||
$_license_current_version = $_POST['_license_current_version'];
|
||||
update_post_meta($post_id, '_license_current_version', esc_attr($_license_current_version));
|
||||
// Save current version
|
||||
$_license_current_version = isset($_POST['_license_current_version']) ? sanitize_text_field($_POST['_license_current_version']) : '';
|
||||
update_post_meta($post_id, '_license_current_version', $_license_current_version);
|
||||
|
||||
$_license_until_version = $_POST['_license_until_version'];
|
||||
update_post_meta($post_id, '_license_until_version', esc_attr($_license_until_version));
|
||||
}
|
||||
// Save until version
|
||||
$_license_until_version = isset($_POST['_license_until_version']) ? sanitize_text_field($_POST['_license_until_version']) : '';
|
||||
update_post_meta($post_id, '_license_until_version', $_license_until_version);
|
||||
}
|
||||
|
||||
function slm_register_product_type(){
|
||||
class WC_Product_SLM_License extends WC_Product{
|
||||
public function __construct($product){
|
||||
$this->product_type = 'slm_license';
|
||||
parent::__construct($product);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function slm_register_product_class( $classname, $product_type ) {
|
||||
if ( $product_type == 'slm_license' ) {
|
||||
$classname = 'WC_Product_SLM_License';
|
||||
}
|
||||
return $classname;
|
||||
}
|
||||
add_action('woocommerce_process_product_meta', 'wc_slm_save_data');
|
||||
|
||||
function slm_add_product_type($types){
|
||||
$types['slm_license'] = __('License product', 'softwarelicensemanager');
|
||||
return $types;
|
||||
}
|
||||
function slm_license_admin_custom_js(){
|
||||
if ('product' != get_post_type()) :
|
||||
return;
|
||||
endif;
|
||||
$slm_options = get_option('slm_plugin_options');
|
||||
$affect_downloads = $slm_options['slm_woo_affect_downloads']==1 ? true : false;
|
||||
?>
|
||||
function slm_license_admin_custom_js() {
|
||||
if ('product' !== get_post_type()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$slm_options = get_option('slm_plugin_options', array());
|
||||
$affect_downloads = isset($slm_options['slm_woo_affect_downloads']) && $slm_options['slm_woo_affect_downloads'] === '1';
|
||||
|
||||
?>
|
||||
<script type='text/javascript'>
|
||||
jQuery(document).ready(function() {
|
||||
//for Price tab
|
||||
$lic_type = jQuery("#_license_type").val();
|
||||
|
||||
if ($lic_type == 'lifetime') {
|
||||
console.log('yes lifetime');
|
||||
jQuery('._license_renewal_period_field').hide();
|
||||
jQuery('._license_renewal_period_term_field').hide();
|
||||
<?php
|
||||
if($affect_downloads == true):
|
||||
?>
|
||||
jQuery('#_download_limit').val('');
|
||||
jQuery('#_download_expiry').val('');
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
}
|
||||
else {
|
||||
console.log('no - is subscription based');
|
||||
jQuery('._license_renewal_period_field').show();
|
||||
jQuery('._license_renewal_period_term_field').show();
|
||||
jQuery(document).ready(function($) {
|
||||
// For Price tab
|
||||
function toggleRenewalFields() {
|
||||
var licType = $("#_license_type").val();
|
||||
if (licType === 'lifetime') {
|
||||
$('._license_renewal_period_lenght_field').hide();
|
||||
<?php if ($affect_downloads): ?>
|
||||
$('#_download_limit, #_download_expiry').val('').prop('disabled', true);
|
||||
<?php endif; ?>
|
||||
} else {
|
||||
$('._license_renewal_period_lenght_field').show();
|
||||
<?php if ($affect_downloads): ?>
|
||||
$('#_download_limit, #_download_expiry').prop('disabled', false);
|
||||
<?php endif; ?>
|
||||
}
|
||||
}
|
||||
|
||||
<?php
|
||||
if($affect_downloads == true):
|
||||
?>
|
||||
jQuery('#_download_limit').on('change', function() {
|
||||
if (jQuery('#_license_type').find(":selected").val() == 'lifetime'){
|
||||
jQuery(this).val('');
|
||||
}
|
||||
// Initial trigger to properly show/hide fields based on saved values
|
||||
toggleRenewalFields();
|
||||
|
||||
// Handle license type change
|
||||
$('#_license_type').on('change', function() {
|
||||
toggleRenewalFields();
|
||||
});
|
||||
jQuery('#_download_expiry').on('change', function() {
|
||||
if (jQuery('#_license_type').find(":selected").val() == 'lifetime'){
|
||||
jQuery(this).val('');
|
||||
}
|
||||
});
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
jQuery('#_license_type').on('change', function() {
|
||||
if (jQuery(this).find(":selected").val() == 'lifetime') {
|
||||
<?php
|
||||
if($affect_downloads == true):
|
||||
?>
|
||||
jQuery('#_download_expiry').val('');
|
||||
jQuery('#_download_limit').val('');
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
jQuery('._license_renewal_period_field').hide();
|
||||
jQuery('._license_renewal_period_term_field').hide();
|
||||
}
|
||||
});
|
||||
jQuery('.product_data_tabs .general_tab').addClass('show_if_slm_license').show();
|
||||
//options_group show_if_downloadable hidden
|
||||
//jQuery('.options_group').addClass('show_if_slm_license').show();
|
||||
jQuery("label[for='_virtual']").addClass('show_if_slm_license').show();
|
||||
jQuery("label[for='_downloadable']").addClass('show_if_slm_license').show();
|
||||
jQuery(".show_if_external").addClass('hide_if_slm_license').hide();
|
||||
jQuery('#general_product_data .pricing').addClass('show_if_slm_license slm-display').show();
|
||||
jQuery("#_virtual").prop("checked", true);
|
||||
jQuery("#_downloadable").prop("checked", true);
|
||||
//for Inventory tab
|
||||
jQuery('.inventory_options').addClass('show_if_slm_license').show();
|
||||
jQuery('#inventory_product_data ._manage_stock_field').addClass('show_if_slm_license').show();
|
||||
jQuery('#inventory_product_data ._sold_individually_field').parent().addClass('show_if_slm_license').show();
|
||||
jQuery('#inventory_product_data ._sold_individually_field').addClass('show_if_slm_license').show();
|
||||
jQuery('.shipping_options').addClass('hide_if_slm_license').hide();
|
||||
jQuery('.marketplace-suggestions_options').addClass('hide_if_slm_license').hide();
|
||||
jQuery('input#_wc_slm_data_tab_enabled').trigger('change');
|
||||
|
||||
// Handle changes on download limit and expiry if downloads are affected
|
||||
<?php if ($affect_downloads): ?>
|
||||
$('#_download_limit, #_download_expiry').on('change', function() {
|
||||
if ($('#_license_type').val() === 'lifetime') {
|
||||
$(this).val('').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
// Set product data tabs to be visible if license type
|
||||
$('.product_data_tabs .general_tab').addClass('show_if_slm_license').show();
|
||||
$("label[for='_virtual'], label[for='_downloadable']").addClass('show_if_slm_license').show();
|
||||
$(".show_if_external").addClass('hide_if_slm_license').hide();
|
||||
$('#general_product_data .pricing').addClass('show_if_slm_license slm-display').show();
|
||||
$("#_virtual, #_downloadable").prop("checked", true);
|
||||
|
||||
// For Inventory tab
|
||||
$('.inventory_options').addClass('show_if_slm_license').show();
|
||||
$('#inventory_product_data ._manage_stock_field, #inventory_product_data ._sold_individually_field').closest('.options_group').addClass('show_if_slm_license').show();
|
||||
$('.shipping_options, .marketplace-suggestions_options').addClass('hide_if_slm_license').hide();
|
||||
|
||||
// Trigger change event for wc_slm_data_tab_enabled to ensure fields are visible
|
||||
$('input#_wc_slm_data_tab_enabled').trigger('change');
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
add_action('admin_footer', 'slm_license_admin_custom_js');
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
<?php
|
||||
class WOO_SLM {
|
||||
private static $instance;
|
||||
public static function instance() {
|
||||
if (!self::$instance) {
|
||||
self::$instance = new WOO_SLM();
|
||||
self::$instance->includes();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
private function includes() {
|
||||
require_once SLM_WOO . 'includes/register-template.php';
|
||||
require_once SLM_WOO . 'includes/purchase.php';
|
||||
}
|
||||
}
|
||||
return WOO_SLM::instance();
|
|
@ -8,8 +8,33 @@
|
|||
// If this file is called directly, abort.
|
||||
if (!defined('WPINC')) {
|
||||
die();
|
||||
|
||||
}
|
||||
|
||||
//slm_woo_downloads
|
||||
function slm_remove_downloads_from_account_menu($items) {
|
||||
// Remove "Downloads" menu item.
|
||||
unset($items['downloads']);
|
||||
return $items;
|
||||
}
|
||||
|
||||
function slm_disable_downloads_endpoint_redirect() {
|
||||
// Check if the current endpoint is "downloads" and if it's part of the My Account page.
|
||||
if (is_wc_endpoint_url('downloads')) {
|
||||
// Redirect to the My Account dashboard.
|
||||
wp_safe_redirect(wc_get_page_permalink('myaccount'));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$enable_downloads_page = SLM_API_Utility::get_slm_option('slm_woo_downloads');
|
||||
// Check if the 'enable_downloads_page' option is enabled.
|
||||
if ($enable_downloads_page == 1) {
|
||||
// If the option is set and enabled, trigger the action.
|
||||
add_action('template_redirect', 'slm_disable_downloads_endpoint_redirect');
|
||||
add_filter('woocommerce_account_menu_items', 'slm_remove_downloads_from_account_menu', 10);
|
||||
}
|
||||
|
||||
class SLM_Woo_Account
|
||||
{
|
||||
public static $endpoint = 'my-licenses';
|
||||
|
@ -55,7 +80,7 @@ class SLM_Woo_Account
|
|||
$is_endpoint = isset($wp_query->query_vars[self::$endpoint]);
|
||||
if ($is_endpoint && !is_admin() && is_main_query() && in_the_loop() && is_account_page()) {
|
||||
// New page title.
|
||||
$title = __('My Licenses', 'softwarelicensemanager');
|
||||
$title = __('My Licenses', 'slmplus');
|
||||
remove_filter('the_title', array($this, 'endpoint_title'));
|
||||
}
|
||||
return $title;
|
||||
|
@ -67,7 +92,7 @@ class SLM_Woo_Account
|
|||
$logout = $items['customer-logout'];
|
||||
unset($items['customer-logout']);
|
||||
// Insert your custom endpoint.
|
||||
$items[self::$endpoint] = __('My Licenses', 'softwarelicensemanager');
|
||||
$items[self::$endpoint] = __('My Licenses', 'slmplus');
|
||||
// Insert back the logout item.
|
||||
$items['customer-logout'] = $logout;
|
||||
return $items;
|
||||
|
@ -94,9 +119,9 @@ class SLM_Woo_Account
|
|||
if (empty($result)) {
|
||||
?>
|
||||
<div class="woocommerce-Message woocommerce-Message--info woocommerce-info">
|
||||
<a class="woocommerce-Button button" href="<?php echo esc_url(get_permalink(wc_get_page_id('shop'))); ?>"><?php echo esc_html__('Browse products', 'softwarelicensemanager'); ?>
|
||||
<a class="woocommerce-Button button" href="<?php echo esc_url(get_permalink(wc_get_page_id('shop'))); ?>"><?php echo esc_html__('Browse products', 'slmplus'); ?>
|
||||
</a>
|
||||
<?php echo esc_html__('No licenses available yet.', 'softwarelicensemanager'); ?>
|
||||
<?php echo esc_html__('No licenses available yet.', 'slmplus'); ?>
|
||||
</div>
|
||||
<?php
|
||||
$slm_hide = 'style="display:none"';
|
||||
|
@ -107,27 +132,27 @@ class SLM_Woo_Account
|
|||
<table id="slm_licenses_table" class="woocommerce-orders-table woocommerce-MyAccount-orders shop_table shop_table_responsive my_account_orders account-orders-table" style="border-collapse:collapse;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Order', 'softwarelicensemanager'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Status', 'softwarelicensemanager'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Product', 'softwarelicensemanager'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('License key', 'softwarelicensemanager'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Renews on', 'softwarelicensemanager'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Info', 'softwarelicensemanager'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Order', 'slmplus'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Status', 'slmplus'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Product', 'slmplus'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('License key', 'slmplus'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Renews on', 'slmplus'); ?></th>
|
||||
<th class="woocommerce-orders-table__header woocommerce-orders-table__header-order-number"><?php echo esc_html__('Info', 'slmplus'); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($result as $license_info) : ?>
|
||||
<tr class="woocommerce-orders-table__row woocommerce-orders-table__row--status-completed order">
|
||||
<td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-order-number slm-order" data-title="<?php echo __('Order', 'softwarelicensemanager'); ?>"><a href="<?php echo get_home_url() . '/my-account/view-order/' . $license_info->purchase_id_; ?>">#<?php echo $license_info->purchase_id_; ?></a></td>
|
||||
<td class="woocommerce-orders-table__cell woocommerce-orders-table__cell-order-number slm-order" data-title="<?php echo __('Order', 'slmplus'); ?>"><a href="<?php echo get_home_url() . '/my-account/view-order/' . $license_info->purchase_id_; ?>">#<?php echo $license_info->purchase_id_; ?></a></td>
|
||||
|
||||
<td class="slm-status" data-title="<?php echo esc_html__('Status', 'softwarelicensemanager'); ?>">
|
||||
<td class="slm-status" data-title="<?php echo esc_html__('Status', 'slmplus'); ?>">
|
||||
<?php $key_status = $license_info->lic_status; ?>
|
||||
<div class="slm-key-status"> <span class="key-status <?php echo $key_status; ?>"><?php echo $key_status; ?></span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="slm-product-reference" data-title="<?php echo esc_html__('Product', 'softwarelicensemanager'); ?>">
|
||||
<td class="slm-product-reference" data-title="<?php echo esc_html__('Product', 'slmplus'); ?>">
|
||||
<?php
|
||||
$product_id = $license_info->product_ref;
|
||||
$product_name = get_the_title($product_id);
|
||||
|
@ -138,9 +163,9 @@ class SLM_Woo_Account
|
|||
?>
|
||||
</td>
|
||||
|
||||
<td class="slm-key" data-title="<?php echo esc_html__('License Key', 'softwarelicensemanager'); ?>"><?php echo $license_info->license_key; ?></td>
|
||||
<td class="slm-key" data-title="<?php echo esc_html__('License Key', 'slmplus'); ?>"><?php echo $license_info->license_key; ?></td>
|
||||
|
||||
<td class="slm-renewal" data-title="<?php echo esc_html__('Renews on', 'softwarelicensemanager'); ?>">
|
||||
<td class="slm-renewal" data-title="<?php echo esc_html__('Renews on', 'slmplus'); ?>">
|
||||
<?php
|
||||
$expiration = new DateTime($license_info->date_expiry);
|
||||
$today = new DateTime();
|
||||
|
@ -156,7 +181,7 @@ class SLM_Woo_Account
|
|||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="slm-view" data-title="<?php echo esc_html__('view', 'softwarelicensemanager'); ?>">
|
||||
<td class="slm-view" data-title="<?php echo esc_html__('view', 'slmplus'); ?>">
|
||||
|
||||
|
||||
<button type="button" class="btn btn-default lic-view-details-btn" data-toggle="modal" data-target="#licModal_<?php echo $license_info->id; ?>">
|
||||
|
@ -181,7 +206,7 @@ class SLM_Woo_Account
|
|||
<div class="modal-dialog modal-md modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="Label"><?php echo esc_html__('License Key:', 'softwarelicensemanager'); ?> <span class="badge badge-dark"><?php echo $license_info->license_key; ?></span></h5>
|
||||
<h5 class="modal-title" id="Label"><?php echo esc_html__('License Key:', 'slmplus'); ?> <span class="badge badge-dark"><?php echo $license_info->license_key; ?></span></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
@ -190,15 +215,15 @@ class SLM_Woo_Account
|
|||
|
||||
<ul class="nav nav-tabs npm" id="myLics" role="tablist">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" id="lic-info-<?php echo $license_info->id; ?>-tab" data-toggle="tab" href="#lic-info-<?php echo $license_info->id; ?>" role="tab" aria-controls="lic-info-<?php echo $license_info->id; ?>" aria-selected="true"><?php echo esc_html__('License Information', 'softwarelicensemanager'); ?></a>
|
||||
<a class="nav-link" id="lic-info-<?php echo $license_info->id; ?>-tab" data-toggle="tab" href="#lic-info-<?php echo $license_info->id; ?>" role="tab" aria-controls="lic-info-<?php echo $license_info->id; ?>" aria-selected="true"><?php echo esc_html__('License Information', 'slmplus'); ?></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="lic-devices-<?php echo $license_info->id; ?>-tab" data-toggle="tab" href="#lic-devices-<?php echo $license_info->id; ?>" role="tab" aria-controls="lic-devices-<?php echo $license_info->id; ?>" aria-selected="false"><?php echo esc_html__('Activations', 'softwarelicensemanager'); ?></a>
|
||||
<a class="nav-link" id="lic-devices-<?php echo $license_info->id; ?>-tab" data-toggle="tab" href="#lic-devices-<?php echo $license_info->id; ?>" role="tab" aria-controls="lic-devices-<?php echo $license_info->id; ?>" aria-selected="false"><?php echo esc_html__('Activations', 'slmplus'); ?></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="lic-code-<?php echo $license_info->id; ?>-tab" data-toggle="tab" href="#lic-code-<?php echo $license_info->id; ?>" role="tab" aria-controls="lic-code-<?php echo $license_info->id; ?>" aria-selected="false"><?php echo esc_html__('Copy License', 'softwarelicensemanager'); ?></a>
|
||||
<a class="nav-link" id="lic-code-<?php echo $license_info->id; ?>-tab" data-toggle="tab" href="#lic-code-<?php echo $license_info->id; ?>" role="tab" aria-controls="lic-code-<?php echo $license_info->id; ?>" aria-selected="false"><?php echo esc_html__('Copy License', 'slmplus'); ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -207,15 +232,15 @@ class SLM_Woo_Account
|
|||
|
||||
<div class="card" style="width: 18rem;">
|
||||
<div class="card-header">
|
||||
<?php echo esc_html__('License information', 'softwarelicensemanager'); ?>
|
||||
<?php echo esc_html__('License information', 'slmplus'); ?>
|
||||
</div>
|
||||
<ul class="list-group list-group-flush lic-group-details">
|
||||
<li class="list-group-item"><?php echo esc_html__('Expiration', 'softwarelicensemanager'); ?> <span><time datetime="<?php echo $license_info->date_expiry; ?>"><?php echo $license_info->date_expiry; ?></time></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('Allowed devices', 'softwarelicensemanager'); ?> <span><?php echo $license_info->max_allowed_devices; ?></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('Allowed Domains', 'softwarelicensemanager'); ?> <span><?php echo $license_info->max_allowed_domains; ?></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('License type', 'softwarelicensemanager'); ?> <span class="badge badge-pill badge-info"><?php echo $license_info->lic_type; ?></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('Date renewed', 'softwarelicensemanager'); ?> <span><?php echo $license_info->date_renewed; ?></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('Activation Date', 'softwarelicensemanager'); ?> <span><?php echo $license_info->date_activated; ?></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('Expiration', 'slmplus'); ?> <span><time datetime="<?php echo $license_info->date_expiry; ?>"><?php echo $license_info->date_expiry; ?></time></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('Allowed devices', 'slmplus'); ?> <span><?php echo $license_info->max_allowed_devices; ?></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('Allowed Domains', 'slmplus'); ?> <span><?php echo $license_info->max_allowed_domains; ?></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('License type', 'slmplus'); ?> <span class="badge badge-pill badge-info"><?php echo $license_info->lic_type; ?></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('Date renewed', 'slmplus'); ?> <span><?php echo $license_info->date_renewed; ?></span></li>
|
||||
<li class="list-group-item"><?php echo esc_html__('Activation Date', 'slmplus'); ?> <span><?php echo $license_info->date_activated; ?></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -287,9 +312,9 @@ class SLM_Woo_Account
|
|||
jQuery.get('<?php echo esc_url(home_url('/')); ?>' + 'wp-admin/admin-ajax.php?action=del_activation&id=' + id + '&activation_type=' + activation_type, function(data) {
|
||||
if (data == 'success') {
|
||||
jQuery(class_name).remove();
|
||||
jQuery('.slm_ajax_msg').html('<div class="alert alert-primary" role="alert"><?php echo esc_html__('License key was deactivated!', 'softwarelicensemanager'); ?></div>');
|
||||
jQuery('.slm_ajax_msg').html('<div class="alert alert-primary" role="alert"><?php echo esc_html__('License key was deactivated!', 'slmplus'); ?></div>');
|
||||
} else {
|
||||
jQuery('.slm_ajax_msg').html('<div class="alert alert-danger" role="alert"> <?php echo esc_html__('License key was not deactivated!', 'softwarelicensemanager'); ?></div>');
|
||||
jQuery('.slm_ajax_msg').html('<div class="alert alert-danger" role="alert"> <?php echo esc_html__('License key was not deactivated!', 'slmplus'); ?></div>');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue