File: /home/sundryrecruitment.co.uk/public_html/wp-content/plugins/gpltimes/gpltimes.php
<?php
/**
* GPL Times - Automatic Updates for GPL Licensed Products
*
* @package GPLTimes
* @author GPL Times
* @copyright 2024 GPL Times
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: GPL Times
* Plugin URI: https://www.gpltimes.com/
* Description: Automatically update your GPL licensed plugins and themes directly from GPL Times. Features include one-click activation, selective update control, whitelabel options, and seamless integration with your WordPress dashboard.
* Version: 5.8.3
* Requires at least: 5.0
* Requires PHP: 7.4
* Author: GPL Times
* Author URI: https://www.gpltimes.com/
* Text Domain: gpltimes
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
/**
* Plugin Constants
*/
define('GPLTIMES_VERSION', '5.8.3');
/**
* Backward Compatibility Toggle
*
* Set to false after all users have upgraded to v4.1.0+
* This disables:
* - Legacy cron hook cleanup
* - Legacy function aliases (gpl_cron_main, etc.)
* - Old option cleanup (packagereturndata, gplcheckedstatus)
* - Lowercase version constant
*
* Safe to disable after ~6-12 months from v4.1.0 release
*/
define('GPLTIMES_BACKWARD_COMPAT', true);
define('GPLTIMES_PLUGIN_FILE', __FILE__);
define('GPLTIMES_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('GPLTIMES_PLUGIN_URL', plugin_dir_url(__FILE__));
define('GPLTIMES_PLUGIN_BASENAME', plugin_basename(__FILE__));
define('GPLTIMES_WEBSITE', 'https://www.gpltimes.com');
define('GPLTIMES_FILTER_PRIORITY', 99999999);
// Backward compatibility constant (legacy - can be removed when GPLTIMES_BACKWARD_COMPAT is false)
if (GPLTIMES_BACKWARD_COMPAT && !defined('gpltimes_version')) {
define('gpltimes_version', GPLTIMES_VERSION);
}
/**
* Autoloader
*/
require_once GPLTIMES_PLUGIN_DIR . 'includes/autoload.php';
/**
* Plugin Activation Hook
*/
register_activation_hook(__FILE__, function() {
GPLTimes\Core\Activator::activate();
});
/**
* Plugin Deactivation Hook
*/
register_deactivation_hook(__FILE__, function() {
GPLTimes\Core\Deactivator::deactivate();
});
/**
* Initialize the plugin
*/
function gpltimes_init() {
return GPLTimes\Core\Plugin::get_instance();
}
// Start the plugin
add_action('plugins_loaded', 'gpltimes_init');
/**
* Global helper function for checking updates
* Maintains backward compatibility with existing code
*
* @param bool $force_refresh Force a fresh API call
* @return object|false Update data or false on failure
*/
function gpltimes_check_updates($force_refresh = false) {
$api = new GPLTimes\Api\Client();
return $api->check_updates($force_refresh);
}
// Legacy function aliases (only when backward compatibility is enabled)
if (GPLTIMES_BACKWARD_COMPAT) {
function gpl_cron_main() {
return gpltimes_check_updates(false);
}
function gpl_cron_main_no_transient() {
return gpltimes_check_updates(true);
}
}