Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: mathieudutour/github-tag-action@v6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: '3.1.3'
custom_tag: '3.1.4'

# Generate new release
- name: Generate new Release
Expand Down
101 changes: 51 additions & 50 deletions Admin/GiveMultiCurrencyAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,52 +41,52 @@ public function setup_setting($settings)
// Custom metabox settings.
$settings["{$this->id}_tab"] = array(
'id' => "{$this->id}_tab",
'title' => __('Opções de moedas', 'give-multi-currency'),
'title' => __('Currency Options', 'give-multi-currency'),
'icon-html' => '<span class="dashicons dashicons-money-alt"></span>',
'fields' => array(
array(
'id' => "{$this->id}_status",
'name' => __('Opções globais', 'give-multi-currency'),
'name' => __('Global Options', 'give-multi-currency'),
'type' => 'radio_inline',
'desc' => __('Habilitar opções globais para o formulário ou desabilitar para usar as opções definidas no formulário.', 'give-multi-currency'),
'desc' => __('Enable global options for the form or disable to use form-specific options.', 'give-multi-currency'),
'options' => array(
'enabled' => __('Habilitado', 'give-multi-currency'),
'disabled' => __('Desabilitado', 'give-multi-currency'),
'enabled' => __('Enabled', 'give-multi-currency'),
'disabled' => __('Disabled', 'give-multi-currency'),
),
'default' => 'enabled',
),
array(
'id' => "{$this->id}_default_currency",
'name' => __('Moeda padrão', 'give-multi-currency'),
'name' => __('Default Currency', 'give-multi-currency'),
'type' => 'radio',
'desc' => __('Selecione a moeda padrão.', 'give-multi-currency'),
'desc' => __('Select the default currency.', 'give-multi-currency'),
'options' => array(
'BRL' => __('Real Brasileiro (R$)', 'give'),
'USD' => __('Dólar Americano ($)', 'give'),
'EUR' => __('Euro (€)', 'give'),
'JPY' => __('Iene (¥)', 'give'),
'GBP' => __('Libra esterlina (£)', 'give'),
'SAR' => __('Rial Saudita (ر.س)', 'give'),
'MXN' => __('Peso mexicano ($)', 'give'),
'CHF' => __('Franco Suíço (CHF)', 'give')
'BRL' => __('Brazilian Real (R$)', 'give-multi-currency'),
'USD' => __('US Dollar ($)', 'give-multi-currency'),
'EUR' => __('Euro (€)', 'give-multi-currency'),
'JPY' => __('Japanese Yen (¥)', 'give-multi-currency'),
'GBP' => __('British Pound (£)', 'give-multi-currency'),
'SAR' => __('Saudi Riyal (ر.س)', 'give-multi-currency'),
'MXN' => __('Mexican Peso ($)', 'give-multi-currency'),
'CHF' => __('Swiss Franc (CHF)', 'give-multi-currency')
),
'default' => 'BRL',
),
array(
'id' => "{$this->id}_active_currency",
'name' => __('Moedas Habilitadas', 'give-multi-currency'),
'name' => __('Enabled Currencies', 'give-multi-currency'),
'type' => 'multicheck',
'desc' => __('Selecione as moedas que seu formulário irá aceitar.', 'give-multi-currency'),
'desc' => __('Select the currencies your form will accept.', 'give-multi-currency'),
'default' => '1',
'options' => array(
'BRL' => __('Real Brasileiro (R$)', 'give'),
'USD' => __('Dólar Americano ($)', 'give'),
'EUR' => __('Euro (€)', 'give'),
'JPY' => __('Iene (¥)', 'give'),
'GBP' => __('Libra esterlina (£)', 'give'),
'SAR' => __('Rial Saudita (ر.س)', 'give'),
'MXN' => __('Peso mexicano ($)', 'give'),
'CHF' => __('Franco Suíço (CHF)', 'give')
'BRL' => __('Brazilian Real (R$)', 'give-multi-currency'),
'USD' => __('US Dollar ($)', 'give-multi-currency'),
'EUR' => __('Euro (€)', 'give-multi-currency'),
'JPY' => __('Japanese Yen (¥)', 'give-multi-currency'),
'GBP' => __('British Pound (£)', 'give-multi-currency'),
'SAR' => __('Saudi Riyal (ر.س)', 'give-multi-currency'),
'MXN' => __('Mexican Peso ($)', 'give-multi-currency'),
'CHF' => __('Swiss Franc (CHF)', 'give-multi-currency')
),
),
),
Expand All @@ -106,54 +106,54 @@ public function lkn_give_multi_currency_add_setting_into_existing_tab($settings)
foreach ($settings as $key => $setting) {
if ('give_docs_link' === $setting['type']) { // You can use id to compare or create own sub section to add new setting.
$new_setting[] = array(
'name' => __('Habilitar Multi Moedas', 'give'),
'name' => __('Enable Multi Currency', 'give-multi-currency'),
'id' => 'multi_currency_enabled_setting_field',
'desc' => __('Ative ou desative o plugin Multi Moedas, esse plugin só funcionará com a moeda real (BRL - R$)'),
'desc' => __('Enable or disable the Multi Currency plugin. This plugin only works with Brazilian Real (BRL - R$)', 'give-multi-currency'),
'type' => 'radio',
'default' => 'disabled',
'options' => array(
'enabled' => __('Habilitado', 'give'),
'disabled' => __('Desabilitado', 'give'),
'enabled' => __('Enabled', 'give-multi-currency'),
'disabled' => __('Disabled', 'give-multi-currency'),
),
);
// Only apears if 'multi_currency_enabled_setting_field' is 'enabled'
if (give_get_option('multi_currency_enabled_setting_field') == 'enabled' && give_get_option('currency') == 'BRL') {
$new_setting[] = array(
'name' => __('Moedas Habilitadas', 'give'),
'name' => __('Enabled Currencies', 'give-multi-currency'),
'id' => 'multi_currency_active_currency',
'desc' => __('Selecione as moedas que seu formulário irá aceitar') . '<br><a href="https://www.linknacional.com.br/wordpress/givewp/multimoeda/#nova-moeda" target="_blank">Adicionar nova moeda</a>',
'desc' => __('Select the currencies your form will accept', 'give-multi-currency') . '<br><a href="https://www.linknacional.com.br/wordpress/givewp/multimoeda/#nova-moeda" target="_blank">' . __('Add new currency', 'give-multi-currency') . '</a>',
'type' => 'multicheck',
'default' => 1,
'options' => array(
'brl' => __('Real Brasileiro (R$)', 'give'),
'usd' => __('Dólar Americano ($)', 'give'),
'eur' => __('Euro (€)', 'give'),
'jpy' => __('Iene (¥)', 'give'),
'gbp' => __('Libra esterlina (£)', 'give'),
'sar' => __('Rial Saudita (ر.س)', 'give'),
'mxn' => __('Peso mexicano ($)', 'give'),
'chf' => __('Franco Suíço (CHF)', 'give')
'brl' => __('Brazilian Real (R$)', 'give-multi-currency'),
'usd' => __('US Dollar ($)', 'give-multi-currency'),
'eur' => __('Euro (€)', 'give-multi-currency'),
'jpy' => __('Japanese Yen (¥)', 'give-multi-currency'),
'gbp' => __('British Pound (£)', 'give-multi-currency'),
'sar' => __('Saudi Riyal (ر.س)', 'give-multi-currency'),
'mxn' => __('Mexican Peso ($)', 'give-multi-currency'),
'chf' => __('Swiss Franc (CHF)', 'give-multi-currency')
),
);
}

// Default currency option
if (give_get_option('multi_currency_enabled_setting_field') == 'enabled' && give_get_option('currency') == 'BRL') {
$new_setting[] = array(
'name' => __('Moeda padrão', 'give'),
'name' => __('Default Currency', 'give-multi-currency'),
'id' => 'multi_currency_default_currency',
'desc' => __('Selecione a moeda padrão'),
'desc' => __('Select the default currency', 'give-multi-currency'),
'type' => 'radio',
'default' => 'BRL',
'options' => array(
'BRL' => __('Real Brasileiro (R$)', 'give'),
'USD' => __('Dólar Americano ($)', 'give'),
'EUR' => __('Euro (€)', 'give'),
'JPY' => __('Iene (¥)', 'give'),
'GBP' => __('Libra esterlina (£)', 'give'),
'SAR' => __('Rial Saudita (ر.س)', 'give'),
'MXN' => __('Peso mexicano ($)', 'give'),
'CHF' => __('Franco Suíço (CHF)', 'give')
'BRL' => __('Brazilian Real (R$)', 'give-multi-currency'),
'USD' => __('US Dollar ($)', 'give-multi-currency'),
'EUR' => __('Euro (€)', 'give-multi-currency'),
'JPY' => __('Japanese Yen (¥)', 'give-multi-currency'),
'GBP' => __('British Pound (£)', 'give-multi-currency'),
'SAR' => __('Saudi Riyal (ر.س)', 'give-multi-currency'),
'MXN' => __('Mexican Peso ($)', 'give-multi-currency'),
'CHF' => __('Swiss Franc (CHF)', 'give-multi-currency')
),
);
}
Expand All @@ -180,11 +180,12 @@ public function disabled_for_non_legacy_templates_html()
{
ob_start(); ?>
<p class="ffconfs-disabled">
<?php esc_attr('O formulário customizado não é relevante para o formulário Multi-Step do giveWP. Caso você deseje utilizar o Free Form Plugin é necessário mudar o Template do formulário para opção "Legado".', 'give-multi-currency-notices'); ?>
<?php esc_html_e('Custom form is not relevant for GiveWP Multi-Step forms. If you want to use the Free Form Plugin, you need to change the form template to "Legacy" option.', 'give-multi-currency'); ?>
</p>
<?php

$html = ob_get_contents();
ob_end_clean();

return $html;
}
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 3.1.4 - 10/11/2025
* Remoção do plugin updater.

# 3.1.3 - 27/06/2025
* Adição de rotas de fallback em caso de erro na API.

Expand Down
10 changes: 0 additions & 10 deletions Includes/GiveMultiCurrency.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ private function admin_hooks(): void
$plugin_admin = new GiveMultiCurrencyAdmin();
$this->loader->add_filter('give_get_settings_general', $plugin_admin, 'lkn_give_multi_currency_add_setting_into_existing_tab');
$this->loader->add_filter('give_metabox_form_data_settings', $plugin_admin, 'setup_setting', 999);
$this->loader->add_action("give_init", $this, "lkn_give_multi_currency_updater");
$this->loader->add_action('givewp_register_payment_gateway', $this, 'register_gateways_paypal', 999);
}

Expand Down Expand Up @@ -200,13 +199,4 @@ public function register_gateways_paypal(PaymentGatewayRegister $registrar)
$registrar->registerGateway(GiveMultiCurrencyPaypalGateway::class);
}
}

public function lkn_give_multi_currency_updater()
{
return new Lkn_Puc_Plugin_UpdateChecker(
'https://api.linknacional.com/v2/u/?slug=give-multimoeda',
GIVE_MULTI_CURRENCY_FILE,//(caso o plugin não precise de compatibilidade com ioncube utilize: __FILE__), //Full path to the main plugin file or functions.php.
'give-multimoeda'
);
}
}
31 changes: 18 additions & 13 deletions Includes/GiveMultiCurrencyHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ public static function lkn_give_multi_currency_dependency_notice(): void {
// Admin notice.
$message = sprintf(
'<strong>%1$s</strong> %2$s <a href="%3$s" target="_blank">%4$s</a> %5$s %6$s+ %7$s.',
__('Activation Error:', 'give'),
__('You must have', 'give'),
__('Activation Error:', 'give-multi-currency'),
__('You must have', 'give-multi-currency'),
'https://givewp.com',
__('Give', 'give'),
__('version', 'give'),
__('Give', 'give-multi-currency'),
__('version', 'give-multi-currency'),
GIVE_MULTI_CURRENCY_MIN_GIVE_VERSION,
__('for the Give Multi Currency add-on to activate', 'give')
__('for the Give Multi Currency add-on to activate', 'give-multi-currency')
);
$message = wp_kses_post( $message );
Give()->notices->register_notice(array(
Expand All @@ -38,11 +38,11 @@ public static function lkn_give_multi_currency_inactive_notice(): void {
// Admin notice.
$message = sprintf(
'<div class="notice notice-error"><p><strong>%1$s</strong> %2$s <a href="%3$s" target="_blank">%4$s</a> %5$s.</p></div>',
__('Activation Error:', 'give'),
__('You must have', 'give'),
__('Activation Error:', 'give-multi-currency'),
__('You must have', 'give-multi-currency'),
'https://givewp.com',
__('Give', 'give'),
__(' plugin installed and activated for the Give Multi Currency to activate', 'give')
__('Give', 'give-multi-currency'),
__(' plugin installed and activated for the Give Multi Currency to activate', 'give-multi-currency')
);

echo wp_kses_post($message);
Expand All @@ -62,7 +62,7 @@ public static function lkn_give_multi_currency_plugin_row_meta($plugin_meta, $pl
$new_meta_links['setting'] = sprintf(
'<a href="%1$s">%2$s</a>',
admin_url('edit.php?post_type=give_forms&page=give-settings&tab=general&section=currency-settings'),
__('Settings', 'give')
__('Settings', 'give-multi-currency')
);

return array_merge($plugin_meta, $new_meta_links);
Expand All @@ -80,7 +80,7 @@ public static function lkn_give_multi_currency_activation(): void {
// Only runs on admin.
$args = array(
'file' => GIVE_MULTI_CURRENCY_FILE,
'name' => __('Multi Currency', 'give'),
'name' => __('Multi Currency', 'give-multi-currency'),
'version' => GIVE_MULTI_CURRENCY_VERSION,
'settings_url' => admin_url('edit.php?post_type=give_forms&page=give-settings&tab=general&section=currency-settings'),
'documentation_url' => 'https://www.linknacional.com.br/wordpress/givewp/',
Expand All @@ -101,7 +101,7 @@ public static function lkn_give_multi_currency_get_exchange_rates($currenciesCod
$exRate[$currency] = $result->rates->BRL;
}

// retorna um array com o rate das moedas ativas
// returns an array with the exchange rates of active currencies
return wp_json_encode($exRate);
}

Expand Down Expand Up @@ -140,7 +140,12 @@ public static function lkn_multi_currency_curl_get_contents($url) {
}

public static function __lkn_multicurrency_linkn_inactive_notice(): void {
$message = '<div id="message" class="error"><p><b>Atenção: </b>O plugin Give Multimoedas detectou que o plugin Cielo API 3.0 encontra-se inativo. <a href="plugins.php">Ativar na área de plugins</a>.</div>';
$message = sprintf(
'<div id="message" class="error"><p><b>%1$s</b> %2$s <a href="plugins.php">%3$s</a>.</div>',
__('Attention:', 'give-multi-currency'),
__('The Give Multi Currency plugin detected that the Cielo API 3.0 plugin is inactive.', 'give-multi-currency'),
__('Activate in plugins area', 'give-multi-currency')
);
echo wp_kses_post($message);
}

Expand Down
57 changes: 0 additions & 57 deletions Includes/plugin-updater/Puc/Autoloader.php

This file was deleted.

Loading
Loading