From e9347b15d6e2bc570685ef03c718f66ec62d03ea Mon Sep 17 00:00:00 2001 From: Emanuel Lopes Date: Fri, 3 May 2024 10:28:23 -0300 Subject: [PATCH 1/2] improvement: Add obscurity for product name, description and image --- .../class-wc-woomercadopago-preference-abstract.php | 2 +- src/Transactions/AbstractTransaction.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/module/preference/class-wc-woomercadopago-preference-abstract.php b/includes/module/preference/class-wc-woomercadopago-preference-abstract.php index 91d53bb7d..b40631a4d 100755 --- a/includes/module/preference/class-wc-woomercadopago-preference-abstract.php +++ b/includes/module/preference/class-wc-woomercadopago-preference-abstract.php @@ -318,7 +318,7 @@ public function get_items_build_array() { foreach ( $this->order->get_items() as $item ) { if ( $item['qty'] ) { $product = wc_get_product( $item['product_id'] ); - // TODO Maybe add option to activate or deactivate anonymous products + // TODO Here is product name for transaction $product_title = "Product"; $product_content = ""; $product_image = plugins_url( '../../assets/images/cart.png', plugin_dir_path( __FILE__ ) ); diff --git a/src/Transactions/AbstractTransaction.php b/src/Transactions/AbstractTransaction.php index 91d41bb4c..28678ffbf 100644 --- a/src/Transactions/AbstractTransaction.php +++ b/src/Transactions/AbstractTransaction.php @@ -278,7 +278,8 @@ public function setItemsTransaction($items): void $product = $item->get_product(); $quantity = $item->get_quantity(); - $title = $product->get_name(); + // TODO Here is product name for transaction + $title = 'Product'; $title = "$title x $quantity"; $amount = $this->getItemAmount($item); @@ -289,7 +290,7 @@ public function setItemsTransaction($items): void $item = [ 'id' => $item->get_product_id(), 'title' => $title, - 'description' => $this->mercadopago->helpers->strings->sanitizeAndTruncateText($product->get_description()), + 'description' => 'Common product for sale', // TODO description of product is hidden too $this->mercadopago->helpers->strings->sanitizeAndTruncateText($product->get_description()), 'picture_url' => $this->getItemImage($product), 'category_id' => $this->mercadopago->storeConfig->getStoreCategory('others'), 'unit_price' => $amount, @@ -387,9 +388,8 @@ public function getItemAmount(\WC_Order_Item $item): float */ public function getItemImage($product): string { - return is_object($product) && method_exists($product, 'get_image_id') - ? wp_get_attachment_url($product->get_image_id()) - : $this->mercadopago->helpers->url->getPluginFileUrl('assets/images/gateways/all/blue-cart', '.png', true); + // TODO hide image from product + return $this->mercadopago->helpers->url->getPluginFileUrl('assets/images/gateways/all/blue-cart', '.png', true); } /** From 2eea1083a705153634295344ebf4819e82d58606 Mon Sep 17 00:00:00 2001 From: Emanuel Lopes Date: Fri, 3 May 2024 10:30:18 -0300 Subject: [PATCH 2/2] chore: Add new version 7.3.6 --- .github/workflows/main.yml | 2 +- CHANGELOG.md | 4 ++++ lkn-wc-mercadopago.php | 2 +- src/WoocommerceMercadoPago.php | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07037d989..6c4c41fe9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: uses: mathieudutour/github-tag-action@v6.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - custom_tag: "7.3.5" + custom_tag: "7.3.6" # Generate new release - name: Generate new Release diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ec7bab63..cdd4361f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [7.3.6] - 2024-05-03 +### Changed: +- Add obscurity for product fields. + ## [7.3.5] - 2024-04-17 ### Fixed: - Checked field on checkout now validated. diff --git a/lkn-wc-mercadopago.php b/lkn-wc-mercadopago.php index 1efdac56a..1202aecdb 100644 --- a/lkn-wc-mercadopago.php +++ b/lkn-wc-mercadopago.php @@ -4,7 +4,7 @@ * Plugin Name: Mercado Pago by Link Nacional * Plugin URI: https://github.com/mercadopago/cart-woocommerce * Description: Configure as opções de pagamento e aceite pagamentos com cartões, boleto e dinheiro da conta Mercado Pago. - * Version: 7.3.5 + * Version: 7.3.6 * Author: Mercado Pago * Author URI: https://developers.mercadopago.com/ * Text Domain: lkn-woocommerce-mercadopago diff --git a/src/WoocommerceMercadoPago.php b/src/WoocommerceMercadoPago.php index c23742ac1..15f235494 100644 --- a/src/WoocommerceMercadoPago.php +++ b/src/WoocommerceMercadoPago.php @@ -31,7 +31,7 @@ class WoocommerceMercadoPago /** * @const */ - private const PLUGIN_VERSION = '7.3.5'; + private const PLUGIN_VERSION = '7.3.6'; /** * @const