| 1 |
<?php |
| 2 |
/** |
| 3 |
* Class to assist with checking charitable extension versions. |
| 4 |
* |
| 5 |
* @package Charitable/Classes/Charitable_Licenses |
| 6 |
* @version 1.8.2 |
| 7 |
* @author David Bisset |
| 8 |
* @copyright Copyright (c) 2023, WP Charitable LLC |
| 9 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 10 |
*/ |
| 11 |
|
| 12 |
use CharitablePluginUpdater\CharitablePluginUpdater; |
| 13 |
|
| 14 |
// Exit if accessed directly. |
| 15 |
if ( ! defined( 'ABSPATH' ) ) { |
| 16 |
exit; |
| 17 |
} |
| 18 |
|
| 19 |
if ( ! class_exists( 'Charitable_Checker' ) ) : |
| 20 |
|
| 21 |
/** |
| 22 |
* Charitable_Updater |
| 23 |
*/ |
| 24 |
class Charitable_Checker { |
| 25 |
private $api_url = ''; // phpcs:ignore |
| 26 |
private $api_data = array(); // phpcs:ignore |
| 27 |
private $name = ''; // phpcs:ignore |
| 28 |
private $slug = ''; // phpcs:ignore |
| 29 |
private $version = ''; // phpcs:ignore |
| 30 |
|
| 31 |
/** |
| 32 |
* Class constructor. |
| 33 |
* |
| 34 |
* @uses plugin_basename() |
| 35 |
* @uses hook() |
| 36 |
* |
| 37 |
* @param string $_api_url The URL pointing to the custom API endpoint. |
| 38 |
* @param string $_plugin_file Path to the plugin file. |
| 39 |
* @param array $_api_data Optional data to send with API calls. |
| 40 |
*/ |
| 41 |
public function __construct( $_api_url, $_plugin_file, $_api_data = array() ) { |
| 42 |
|
| 43 |
// check if CharitablePluginUpdater class exists. |
| 44 |
if ( ! class_exists( 'CharitablePluginUpdater' ) ) { |
| 45 |
return; |
| 46 |
} |
| 47 |
|
| 48 |
$updater = new CharitablePluginUpdater( $_api_url, $_plugin_file, $_api_data ); |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
endif; |
| 53 |
|