diff --git a/classes/pro/MeprCryptoPayGateway.php b/classes/pro/MeprCryptoPayGateway.php index 0a03b5f..0c622a6 100644 --- a/classes/pro/MeprCryptoPayGateway.php +++ b/classes/pro/MeprCryptoPayGateway.php @@ -10,10 +10,10 @@ // @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps // @phpcs:disable SlevomatCodingStandard.TypeHints.ParameterTypeHint +use BeycanPress\CryptoPay\Helpers; use BeycanPress\CryptoPay\Payment; use BeycanPress\CryptoPay\Settings; use BeycanPress\CryptoPay\PluginHero\Hook; -use BeycanPress\CryptoPay\PluginHero\Helpers; use BeycanPress\CryptoPay\Types\Order\OrderType; // @phpcs:ignore @@ -98,11 +98,15 @@ public function __construct() { $this->name = __('CryptoPay', 'memberpress-cryptopay'); $this->key = 'cryptopay'; - $this->icon = MEMBERPRESS_CRYPTOPAY_URL . 'assets/images/icon.png'; - $this->desc = __('Pay with cryptocurrencies via CryptoPay', 'memberpress-cryptopay'); + $this->desc = __('Pay with cryptocurrencies.', 'memberpress-cryptopay'); $this->set_defaults(); $this->has_spc_form = true; + if (!Helpers::getProp('licenseIsWhiteLabel', false)) { + $this->icon = MEMBERPRESS_CRYPTOPAY_URL . 'assets/images/icon.png'; + $this->desc = __('Pay with cryptocurrencies via CryptoPay.', 'memberpress-cryptopay'); + } + $this->capabilities = [ 'process-payments', 'cancel-subscriptions' @@ -141,9 +145,8 @@ protected function set_defaults(): void [ 'id' => $this->generate_id(), 'gateway' => __CLASS__, - 'icon' => MEMBERPRESS_CRYPTOPAY_URL . 'assets/images/icon.png', 'label' => __('CryptoPay', 'memberpress-cryptopay'), - 'desc' => __('Pay with cryptocurrencies via CryptoPay', 'memberpress-cryptopay'), + 'desc' => __('Pay with cryptocurrencies.', 'memberpress-cryptopay'), 'use_label' => true, 'use_icon' => true, 'use_desc' => true, @@ -151,6 +154,11 @@ protected function set_defaults(): void (array) $this->settings ); + if (!Helpers::getProp('licenseIsWhiteLabel', false)) { + $this->settings->icon = MEMBERPRESS_CRYPTOPAY_URL . 'assets/images/icon.png'; + $this->settings->desc = __('Pay with cryptocurrencies via CryptoPay.', 'memberpress-cryptopay'); + } + $this->id = $this->settings->id; $this->label = $this->settings->label; $this->use_label = $this->settings->use_label; @@ -163,12 +171,14 @@ protected function set_defaults(): void */ public function enqueue_payment_form_scripts(): void { - wp_enqueue_style( - 'mepr-cryptopay-form', - MEMBERPRESS_CRYPTOPAY_URL . '/assets/css/main.css', - [], - MEMBERPRESS_CRYPTOPAY_VERSION - ); + if (!Helpers::getProp('licenseIsWhiteLabel', false)) { + wp_enqueue_style( + 'mepr-cryptopay-form', + MEMBERPRESS_CRYPTOPAY_URL . '/assets/css/main.css', + [], + MEMBERPRESS_CRYPTOPAY_VERSION + ); + } } // Process payment diff --git a/cryptopay-gateway-for-memberpress.php b/cryptopay-gateway-for-memberpress.php index 2a0adc1..62105f0 100644 --- a/cryptopay-gateway-for-memberpress.php +++ b/cryptopay-gateway-for-memberpress.php @@ -11,7 +11,7 @@ /** * Plugin Name: CryptoPay Gateway for MemberPress - * Version: 1.0.5 + * Version: 1.0.6 * Plugin URI: https://beycanpress.com/cryptopay/ * Description: Adds Cryptocurrency payment gateway (CryptoPay) for MemberPress. * Author: BeycanPress LLC @@ -21,7 +21,7 @@ * Text Domain: memberpress-cryptopay * Tags: Bitcoin, Ethereum, Cryptocurrency, Payments, MemberPress * Requires at least: 5.0 - * Tested up to: 6.6 + * Tested up to: 6.7.1 * Requires PHP: 8.1 */ @@ -33,7 +33,7 @@ use BeycanPress\CryptoPayLite\PluginHero\Hook as LiteHook; define('MEMBERPRESS_CRYPTOPAY_FILE', __FILE__); -define('MEMBERPRESS_CRYPTOPAY_VERSION', '1.0.4'); +define('MEMBERPRESS_CRYPTOPAY_VERSION', '1.0.6'); define('MEMBERPRESS_CRYPTOPAY_URL', plugin_dir_url(__FILE__)); define('MEMBERPRESS_CRYPTOPAY_DIR', plugin_dir_path(__FILE__)); @@ -74,12 +74,14 @@ function memberpress_cryptopay_addModels(): void memberpress_cryptopay_addModels(); +add_action('init', function (): void { + load_plugin_textdomain('memberpress-cryptopay', false, basename(__DIR__) . '/languages'); +}); + add_action('plugins_loaded', function (): void { memberpress_cryptopay_addModels(); - load_plugin_textdomain('memberpress-cryptopay', false, basename(__DIR__) . '/languages'); - if (!defined('MEPR_VERSION')) { add_action('admin_notices', function (): void { ?> diff --git a/readme.txt b/readme.txt index 3feb2fc..ad09cf9 100644 --- a/readme.txt +++ b/readme.txt @@ -2,10 +2,10 @@ Contributors: BeycanPress Tags: Bitcoin, Ethereum, Cryptocurrency, Payments, MemberPress Requires at least: 5.0 -Tested up to: 6.6 +Tested up to: 6.7.1 Requires PHP: 8.1 -Stable Tag: 1.0.5 -Version: 1.0.5 +Stable Tag: 1.0.6 +Version: 1.0.6 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -64,6 +64,10 @@ You can easily translate with Loco translate. == Changelog == += 1.0.6 = +* Updated: Compatibility for CryptoPay Premium White Label +* Fixed: Text domain warning + = 1.0.4 = * Updated: Fixed welcome emails not works