Skip to content

Commit

Permalink
ready to send wp.org
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBeycan committed Nov 26, 2024
1 parent b441d64 commit f0da39f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 100 deletions.
17 changes: 9 additions & 8 deletions classes/DokanCryptoPayWithdrawal.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// @phpcs:disable PSR1.Files.SideEffects
// @phpcs:disable Generic.Files.InlineHTML
// @phpcs:disable Generic.Files.LineLength
// @phpcs:disable WordPress.Security.NonceVerification.Recommended

use BeycanPress\CryptoPay\Helpers;
use BeycanPress\CryptoPay\Payment;
Expand Down Expand Up @@ -191,7 +192,7 @@ public function userSettingForm(mixed $args): void
<div class="dokan-form-group">
<div>
<label>
<?php esc_html_e('Payment network', 'dokan-cryptopay'); ?>
<?php esc_html_e('Payment network', 'cryptopay-withdrawal-for-dokan'); ?>
</label>
</div>
<div class="dokan-w12">
Expand All @@ -207,7 +208,7 @@ public function userSettingForm(mixed $args): void
<div class="dokan-form-group">
<div>
<label>
<?php esc_html_e('Payment currency', 'dokan-cryptopay'); ?>
<?php esc_html_e('Payment currency', 'cryptopay-withdrawal-for-dokan'); ?>
</label>
</div>
<div class="dokan-w12">
Expand All @@ -228,7 +229,7 @@ public function userSettingForm(mixed $args): void
<div class="dokan-form-group">
<div>
<label>
<?php esc_html_e('Address', 'dokan-cryptopay'); ?>
<?php esc_html_e('Address', 'cryptopay-withdrawal-for-dokan'); ?>
</label>
</div>
<div class="dokan-w12">
Expand Down Expand Up @@ -356,15 +357,15 @@ function getCustomPaymentDetails(details, method, data) {
if (network && network) {
anotherDetails = `
<p>
<label><?php echo esc_html__('Network:'); ?></label>
<label><?php echo esc_html__('Network:', 'cryptopay-withdrawal-for-dokan'); ?></label>
${network.name}
</p>
<p>
<label><?php echo esc_html__('Currency:'); ?></label>
<label><?php echo esc_html__('Currency:', 'cryptopay-withdrawal-for-dokan'); ?></label>
${currency.symbol}
</p>
<p>
<label><?php echo esc_html__('Address:'); ?></label>
<label><?php echo esc_html__('Address:', 'cryptopay-withdrawal-for-dokan'); ?></label>
${data[method].address}
</p>
<br>
Expand All @@ -375,11 +376,11 @@ function getCustomPaymentDetails(details, method, data) {
details = status == 'pending' ? anotherDetails + `
<button title="<?php
/* translators: %s: payment method title */
echo esc_attr(sprintf(__('Pay with %s', 'dokan-cryptopay'), $this->title))
echo esc_attr(sprintf(__('Pay with %s', 'cryptopay-withdrawal-for-dokan'), $this->title))
?>" class="button button-small pay-with-cryptopay" data-key="<?php echo esc_attr($this->key); ?>" data-details='${JSON.stringify(data[method])}'>
<?php
// translators: %s: payment method title
echo esc_html(sprintf(__('Pay with %s', 'dokan-cryptopay'), $this->title))
echo esc_html(sprintf(__('Pay with %s', 'cryptopay-withdrawal-for-dokan'), $this->title))
?>
</button>
` : anotherDetails;
Expand Down
17 changes: 9 additions & 8 deletions cryptopay-withdrawal-for-dokan.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// @phpcs:disable PSR1.Files.SideEffects
// @phpcs:disable PSR12.Files.FileHeader
// @phpcs:disable Generic.Files.LineLength
// @phpcs:disable WordPress.Security.NonceVerification.Recommended

/**
* Plugin Name: CryptoPay Withdrawal for Dokan
Expand All @@ -17,10 +18,10 @@
* Author URI: https://beycanpress.com
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: dokan-cryptopay
* Text Domain: cryptopay-withdrawal-for-dokan
* Tags: Cryptopay, Cryptocurrency, WooCommerce, WordPress, MetaMask, Trust, Binance, Wallet, Ethereum, Bitcoin, Binance smart chain, Payment, Plugin, Gateway, Moralis, Converter, API, coin market cap, CMC
* Requires at least: 5.0
* Tested up to: 6.6
* Tested up to: 6.7.1
* Requires PHP: 8.1
*/

Expand All @@ -35,13 +36,13 @@

add_action('plugins_loaded', function (): void {
require_once __DIR__ . '/classes/DokanCryptoPayWithdrawal.php';
load_plugin_textdomain('dokan-cryptopay', false, basename(__DIR__) . '/languages');
load_plugin_textdomain('cryptopay-withdrawal-for-dokan', false, basename(__DIR__) . '/languages');

if (!function_exists('dokan')) {
add_action('admin_notices', function (): void {
$class = 'notice notice-error';
// translators: %s: Dokan plugin URL
$message = sprintf(esc_html__('CryptoPay Withdrawal for Dokan: This plugin is an extra feature plugin so it cannot do anything on its own. It needs Dokan to work. You can buy download Dokan by %s.', 'dokan-cryptopay'), '<a href="https://wordpress.org/plugins/dokan-lite/" target="_blank">' . esc_html__('clicking here', 'dokan-cryptopay') . '</a>');
$message = sprintf(esc_html__('CryptoPay Withdrawal for Dokan: This plugin is an extra feature plugin so it cannot do anything on its own. It needs Dokan to work. You can buy download Dokan by %s.', 'cryptopay-withdrawal-for-dokan'), '<a href="https://wordpress.org/plugins/dokan-lite/" target="_blank">' . esc_html__('clicking here', 'cryptopay-withdrawal-for-dokan') . '</a>');
printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), wp_kses_post($message));
});
return;
Expand All @@ -52,14 +53,14 @@
if (version_compare(Helpers::getProp('pluginVersion'), '2.1.0', '<')) {
add_action('admin_notices', function (): void {
$class = 'notice notice-error';
$message = esc_html__('CryptoPay Withdrawal for Dokan requires CryptoPay version 2.1.0 or higher. Please update CryptoPay.', 'cryptopay');
$message = esc_html__('CryptoPay Withdrawal for Dokan requires CryptoPay version 2.1.0 or higher. Please update CryptoPay.', 'cryptopay-withdrawal-for-dokan');
printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
});
} else {
$gateway = new DokanCryptoPayWithdrawal(esc_html__('CryptoPay', 'dokan-cryptopay'), 'dokan_cryptopay');
$gateway = new DokanCryptoPayWithdrawal(esc_html__('CryptoPay', 'cryptopay-withdrawal-for-dokan'), 'dokan_cryptopay');
}
} elseif (class_exists(LiteLoader::class)) {
$gateway = new DokanCryptoPayWithdrawal(esc_html__('CryptoPay Lite', 'dokan-cryptopay'), 'dokan_cryptopay_lite');
$gateway = new DokanCryptoPayWithdrawal(esc_html__('CryptoPay Lite', 'cryptopay-withdrawal-for-dokan'), 'dokan_cryptopay_lite');
}

// This a WordPress page detection
Expand Down Expand Up @@ -90,7 +91,7 @@
add_action('admin_notices', function (): void {
$class = 'notice notice-error';
// translators: %s: CryptoPay plugin URL
$message = sprintf(esc_html__('CryptoPay Withdrawal for Dokan: This plugin is an extra feature plugin so it cannot do anything on its own. It needs CryptoPay to work. You can buy CryptoPay by %s.', 'dokan-cryptopay'), '<a href="https://beycanpress.com/product/cryptopay-all-in-one-cryptocurrency-payments-for-wordpress/?utm_source=wp_org_addons&utm_medium=dokan" target="_blank">' . esc_html__('clicking here', 'dokan-cryptopay') . '</a>');
$message = sprintf(esc_html__('CryptoPay Withdrawal for Dokan: This plugin is an extra feature plugin so it cannot do anything on its own. It needs CryptoPay to work. You can buy CryptoPay by %s.', 'cryptopay-withdrawal-for-dokan'), '<a href="https://beycanpress.com/product/cryptopay-all-in-one-cryptocurrency-payments-for-wordpress/?utm_source=wp_org_addons&utm_medium=dokan" target="_blank">' . esc_html__('clicking here', 'cryptopay-withdrawal-for-dokan') . '</a>');
printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), wp_kses_post($message));
});
}
Expand Down
83 changes: 0 additions & 83 deletions languages/dokan-cryptopay.pot

This file was deleted.

2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: BeycanPress
Tags: Bitcoin, Ethereum, Cryptocurrency, Payments, Dokan
Requires at least: 5.0
Tested up to: 6.6
Tested up to: 6.7.1
Requires PHP: 8.1
Stable Tag: 1.0.6
Version: 1.0.6
Expand Down

0 comments on commit f0da39f

Please sign in to comment.