Skip to content

Commit

Permalink
Compatibility due to updates for new CryptoPay versions
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBeycan committed Apr 4, 2024
1 parent ecc4a87 commit 98a3a24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
19 changes: 9 additions & 10 deletions cryptocurrency-payments-for-paid-memberships-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/**
* Plugin Name: CryptoPay Gateway for Paid Memberships Pro
* Requires Plugins: paid-memberships-pro, cryptopay-wc-lite
* Version: 1.0.6
* Version: 1.0.7
* Plugin URI: https://beycanpress.com/cryptopay/
* Description: Adds CryptoPay as a gateway option for Paid Memberships Pro.
* Author: BeycanPress LLC
Expand All @@ -30,11 +30,10 @@

use BeycanPress\CryptoPay\Loader;
use BeycanPress\CryptoPay\PluginHero\Hook;
use BeycanPress\CryptoPayLite\Loader as LiteLoader;
use BeycanPress\CryptoPayLite\PluginHero\Hook as LiteHook;

define('PMPRO_CRYPTOPAY_FILE', __FILE__);
define('PMPRO_CRYPTOPAY_VERSION', '1.0.6');
define('PMPRO_CRYPTOPAY_VERSION', '1.0.7');
define('PMPRO_CRYPTOPAY_URL', plugin_dir_url(__FILE__));

add_filter('wp_plugin_dependencies_slug', function ($slug) {
Expand All @@ -45,11 +44,11 @@
});

register_activation_hook(PMPRO_CRYPTOPAY_FILE, function (): void {
if (class_exists(Loader::class)) {
if (defined('CRYPTOPAY_LOADED')) {
require_once __DIR__ . '/classes/pro/class.pmpro_transaction_model.php';
(new PMPro_Transaction_Model())->createTable();
}
if (class_exists(LiteLoader::class)) {
if (defined('CRYPTOPAY_LITE_LOADED')) {
require_once __DIR__ . '/classes/lite/class.pmpro_transaction_model.php';
(new PMPro_Transaction_Model_Lite())->createTable();
}
Expand All @@ -61,7 +60,7 @@
*/
function pmpro_cryptopay_addModels(): void
{
if (class_exists(Loader::class)) {
if (defined('CRYPTOPAY_LOADED')) {
require_once __DIR__ . '/classes/pro/class.pmpro_transaction_model.php';
Hook::addFilter('models', function ($models) {
return array_merge($models, [
Expand All @@ -70,7 +69,7 @@ function pmpro_cryptopay_addModels(): void
});
}

if (class_exists(LiteLoader::class)) {
if (defined('CRYPTOPAY_LITE_LOADED')) {
require_once __DIR__ . '/classes/lite/class.pmpro_transaction_model.php';
LiteHook::addFilter('models', function ($models) {
return array_merge($models, [
Expand Down Expand Up @@ -121,15 +120,15 @@ function pmpro_cryptopay_check_discount_code(object &$level, ?string $discountCo
return;
}

if ((class_exists(Loader::class) || class_exists(LiteLoader::class))) {
if ((defined('CRYPTOPAY_LOADED') || defined('CRYPTOPAY_LITE_LOADED'))) {
require_once __DIR__ . '/classes/class.pmpro_ajax_api.php';

if (class_exists(Loader::class)) {
if (defined('CRYPTOPAY_LOADED')) {
require_once __DIR__ . '/classes/pro/class.pmpro_register_hooks.php';
require_once __DIR__ . '/classes/pro/class.pmprogateway_cryptopay.php';
}

if (class_exists(LiteLoader::class)) {
if (defined('CRYPTOPAY_LITE_LOADED')) {
require_once __DIR__ . '/classes/lite/class.pmpro_register_hooks.php';
require_once __DIR__ . '/classes/lite/class.pmprogateway_cryptopay.php';
}
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Tags: Bitcoin, Ethereum, Binance Smart Chain, Blockchain, Networks, Cryptocurren
Requires at least: 5.0
Tested up to: 6.5.0
Requires PHP: 8.1
Stable Tag: 1.0.6
Version: 1.0.6
Stable Tag: 1.0.7
Version: 1.0.7
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -55,6 +55,9 @@ You can easily translate with Loco translate.

== Changelog ==

= 1.0.7 =
* Updated: Compatibility due to updates for new CryptoPay versions

= 1.0.6 =
* Updated: Compatibility due to updates for WordPress 6.5.0

Expand Down

0 comments on commit 98a3a24

Please sign in to comment.