From d84e086a9f7ba6c906bc66eb699cf33522a70c69 Mon Sep 17 00:00:00 2001 From: Asad Nur Date: Tue, 22 Oct 2024 14:12:56 +0600 Subject: [PATCH 1/7] fix: Activation dependency error with PDF Invoices for WC v3.9.0 --- dokan-invoice.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dokan-invoice.php b/dokan-invoice.php index 07bfd83..c2f1a02 100644 --- a/dokan-invoice.php +++ b/dokan-invoice.php @@ -10,6 +10,7 @@ * Text Domain: dokan-invoice * WC requires at least: 5.0.0 * WC tested up to: 8.1.0 + * Requires Plugins: woocommerce, dokan-lite, woocommerce-pdf-invoices-packing-slips */ /** @@ -73,13 +74,13 @@ public function __construct() { self::$plugin_path = trailingslashit( dirname( __FILE__ ) ); $this->depends_on['dokan'] = array( - 'name' => 'WeDevs_Dokan', - 'notice' => sprintf( __( 'Dokan PDF Invoice requires %sDokan plugin%s to be installed & activated!' , 'dokan-invoice' ), '', '' ), + 'name' => 'WeDevs_Dokan', + 'notice' => sprintf( esc_html__( 'Dokan PDF Invoice requires %sDokan plugin%s to be installed & activated!' , 'dokan-invoice' ), '', '' ), ); $this->depends_on['woocommerce_pdf_invoices'] = array( - 'name' => 'WooCommerce_PDF_Invoices', - 'notice' => sprintf( __( 'Dokan PDF Invoice requires %sWooCommerce PDF Invoices & packing slips plugin%s to be installed & activated!' , 'dokan-invoice' ), '', '' ), + 'name' => 'WPO_WCPDF', + 'notice' => sprintf( esc_html__( 'Dokan PDF Invoice requires %sWooCommerce PDF Invoices & packing slips plugin%s to be installed & activated!' , 'dokan-invoice' ), '', '' ), ); add_action( 'before_woocommerce_init', [ $this, 'add_hpos_support' ] ); @@ -161,7 +162,7 @@ public static function init() { * @return void */ public function init_hooks() { - if ( ! class_exists( 'WooCommerce_PDF_Invoices' ) ) { + if ( ! class_exists( 'WPO_WCPDF' ) ) { return ; } From a67ffa3ab031007d137c37080b57d871b12c2bbd Mon Sep 17 00:00:00 2001 From: Asad Nur Date: Tue, 22 Oct 2024 15:33:00 +0600 Subject: [PATCH 2/7] enhance: Compatibility support for legacy version of the PDF Invoices for WC plugin --- dokan-invoice.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dokan-invoice.php b/dokan-invoice.php index c2f1a02..9a4f3a3 100644 --- a/dokan-invoice.php +++ b/dokan-invoice.php @@ -57,6 +57,15 @@ class Dokan_Invoice { private $depends_on = array(); private $dependency_error = array(); + /** + * WC PDF Plugin Class Name. + * + * @since 1.2.3 + * + * @var string + */ + public $wc_pdf_class = ''; + /** * Constructor for the Dokan_Invoice class * @@ -73,13 +82,15 @@ public function __construct() { self::$plugin_url = plugin_dir_url( self::$plugin_basename ); self::$plugin_path = trailingslashit( dirname( __FILE__ ) ); + $this->wc_pdf_class = version_compare( get_option( 'wpo_wcpdf_version', false ), '3.9.0', '<' ) ? 'WooCommerce_PDF_Invoices' : 'WPO_WCPDF' ; + $this->depends_on['dokan'] = array( 'name' => 'WeDevs_Dokan', 'notice' => sprintf( esc_html__( 'Dokan PDF Invoice requires %sDokan plugin%s to be installed & activated!' , 'dokan-invoice' ), '', '' ), ); $this->depends_on['woocommerce_pdf_invoices'] = array( - 'name' => 'WPO_WCPDF', + 'name' => $this->wc_pdf_class, 'notice' => sprintf( esc_html__( 'Dokan PDF Invoice requires %sWooCommerce PDF Invoices & packing slips plugin%s to be installed & activated!' , 'dokan-invoice' ), '', '' ), ); @@ -162,7 +173,7 @@ public static function init() { * @return void */ public function init_hooks() { - if ( ! class_exists( 'WPO_WCPDF' ) ) { + if ( ! class_exists( $this->wc_pdf_class ) ) { return ; } From 762aa74e3e727998a77f79a706996ce8194fe2f2 Mon Sep 17 00:00:00 2001 From: Asad Nur Date: Tue, 22 Oct 2024 15:35:31 +0600 Subject: [PATCH 3/7] fix: Minor spacing issues --- dokan-invoice.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dokan-invoice.php b/dokan-invoice.php index 9a4f3a3..c90b28c 100644 --- a/dokan-invoice.php +++ b/dokan-invoice.php @@ -57,13 +57,13 @@ class Dokan_Invoice { private $depends_on = array(); private $dependency_error = array(); - /** - * WC PDF Plugin Class Name. - * - * @since 1.2.3 - * - * @var string - */ + /** + * WC PDF Plugin Class Name. + * + * @since 1.2.3 + * + * @var string + */ public $wc_pdf_class = ''; /** From acf20e5c0f8966fc6f71d3618f29fed2cce25aa9 Mon Sep 17 00:00:00 2001 From: Asad Nur Date: Tue, 22 Oct 2024 16:12:32 +0600 Subject: [PATCH 4/7] fix: Minor spacing issue --- dokan-invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dokan-invoice.php b/dokan-invoice.php index c90b28c..7457c0f 100644 --- a/dokan-invoice.php +++ b/dokan-invoice.php @@ -64,7 +64,7 @@ class Dokan_Invoice { * * @var string */ - public $wc_pdf_class = ''; + public $wc_pdf_class = ''; /** * Constructor for the Dokan_Invoice class From a0eb858c9bd533aa71e6c0412cc3632f0e3744aa Mon Sep 17 00:00:00 2001 From: Asad Nur Date: Wed, 23 Oct 2024 14:24:23 +0600 Subject: [PATCH 5/7] refactor: Invoice store name injection --- dokan-invoice.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dokan-invoice.php b/dokan-invoice.php index 7457c0f..cc5e76c 100644 --- a/dokan-invoice.php +++ b/dokan-invoice.php @@ -236,6 +236,8 @@ public function dokan_invoice_listing_actions_my_account( $actions, $order ) { public function wpo_wcpdf_add_dokan_shop_name( $shop_name, $document = null ) { extract( $this->get_order_id_parent_id( $document ) ); + $shop_name_label = apply_filters( 'dokan_invoice_shop_name_label', esc_html__( 'Vendor', 'dokan-invoice' ), $document ); + // If parent order keep Original Store name else set seller store name if ( $parent_id == 0 ) { if ( function_exists( 'dokan_get_seller_ids_by' ) ) { @@ -244,24 +246,24 @@ public function wpo_wcpdf_add_dokan_shop_name( $shop_name, $document = null ) { $seller_list = array_unique( array_keys( dokan_get_sellers_by( $order_id ) ) ); } - if ( count( $seller_list ) > 1 ) { - return $shop_name; - } else { + if ( 1 === count( $seller_list ) ) { $vendor_id = $seller_list[0]; $vendor = dokan()->vendor->get( $vendor_id ); $store_name = $vendor->get_shop_name(); - $store_name = ! empty( $store_name ) ? $store_name : __( 'store_info', 'dokan-invoice' ); + $store_name = $store_name ?: ''; - return $shop_name . "

" . __( 'Vendor:', 'dokan-invoice' ) . $store_name; + $shop_name .= sprintf( '

%s: %s', $shop_name_label, $store_name ); } } else { $vendor_id = dokan_get_seller_id_by_order( $order_id ); $vendor = dokan()->vendor->get( $vendor_id ); $store_name = $vendor->get_shop_name(); - $store_name = ! empty( $store_name ) ? $store_name : __( 'store_info', 'dokan-invoice' ); + $store_name = $store_name ?: ''; - return $shop_name . "

" . __( 'Vendor:', 'dokan-invoice' ) . $store_name; + $shop_name .= sprintf( '

%s: %s', $shop_name_label, $store_name ); } + + return apply_filters( 'dokan_invoice_store_name', $shop_name, $document ); } /** From bd519c8e74d4981d614ba3a3dab2cc046a138e13 Mon Sep 17 00:00:00 2001 From: Asad Nur Date: Wed, 23 Oct 2024 14:27:35 +0600 Subject: [PATCH 6/7] fix: Minor spacing issue in the wpo_wcpdf_add_dokan_shop_name() method --- dokan-invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dokan-invoice.php b/dokan-invoice.php index cc5e76c..a3fa451 100644 --- a/dokan-invoice.php +++ b/dokan-invoice.php @@ -260,7 +260,7 @@ public function wpo_wcpdf_add_dokan_shop_name( $shop_name, $document = null ) { $store_name = $vendor->get_shop_name(); $store_name = $store_name ?: ''; - $shop_name .= sprintf( '

%s: %s', $shop_name_label, $store_name ); + $shop_name .= sprintf( '

%s: %s', $shop_name_label, $store_name ); } return apply_filters( 'dokan_invoice_store_name', $shop_name, $document ); From e23dab55faca13452b5c689e1e985aa74baadaa3 Mon Sep 17 00:00:00 2001 From: Asad Nur Date: Thu, 24 Oct 2024 17:32:28 +0600 Subject: [PATCH 7/7] chore: Bump version to 1.2.3 --- changelog.txt | 7 +++++++ dokan-invoice.php | 6 +++--- languages/dokan-invoice.pot | 32 ++++++++++++++++++-------------- package-lock.json | 4 ++-- package.json | 2 +- readme.txt | 17 ++++++++++++----- 6 files changed, 43 insertions(+), 25 deletions(-) diff --git a/changelog.txt b/changelog.txt index 0a066fa..d29ad27 100755 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,12 @@ ====== Changelog ====== +v1.2.3 -> 23 Oct 2024 +------------------------ +- **Update:** WordPress v6.6.2 compatibility +- **Update:** PDF Invoices & Packing Slips for WooCommerce v3.9.0 compatibility +- **Update:** Rewrite dokan store name adding implementation +- **Fix:** Dependency error with PDF Invoices for WooCommerce v3.9.0 on plugin activation + v1.2.2 -> 16 Sep 2023 ------------------------ - **Update:** WordPress 6.3.1 compatibility diff --git a/dokan-invoice.php b/dokan-invoice.php index a3fa451..ec57864 100644 --- a/dokan-invoice.php +++ b/dokan-invoice.php @@ -3,13 +3,13 @@ * Plugin Name: Dokan - PDF Invoice * Plugin URI: https://dokan.co/wordpress/ * Description: A Dokan plugin Add-on to get PDF invoice. - * Version: 1.2.2 + * Version: 1.2.3 * Author: weDevs * Author URI: https://dokan.co/ * License: GPL2 * Text Domain: dokan-invoice - * WC requires at least: 5.0.0 - * WC tested up to: 8.1.0 + * WC requires at least: 8.0.0 + * WC tested up to: 9.3.3 * Requires Plugins: woocommerce, dokan-lite, woocommerce-pdf-invoices-packing-slips */ diff --git a/languages/dokan-invoice.pot b/languages/dokan-invoice.pot index 832a5fb..317d3a2 100644 --- a/languages/dokan-invoice.pot +++ b/languages/dokan-invoice.pot @@ -1,48 +1,48 @@ -# Copyright (C) 2023 weDevs +# Copyright (C) 2024 weDevs # This file is distributed under the GPL2. msgid "" msgstr "" -"Project-Id-Version: Dokan - PDF Invoice 1.2.2\n" +"Project-Id-Version: Dokan - PDF Invoice 1.2.3\n" "Report-Msgid-Bugs-To: support@wedevs.com\n" -"POT-Creation-Date: 2023-09-16 14:52:26+00:00\n" +"POT-Creation-Date: 2024-10-23 09:43:19+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2023-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2024-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "X-Generator: grunt-wp-i18n 1.0.3\n" -#: dokan-invoice.php:77 +#: dokan-invoice.php:89 msgid "" "Dokan PDF Invoice requires %sDokan plugin%s to be installed & " "activated!" msgstr "" -#: dokan-invoice.php:82 +#: dokan-invoice.php:94 msgid "" "Dokan PDF Invoice requires %sWooCommerce PDF Invoices & packing " "slips plugin%s to be installed & activated!" msgstr "" -#: dokan-invoice.php:241 dokan-invoice.php:249 dokan-invoice.php:283 -msgid "store_info" +#: dokan-invoice.php:239 +msgid "Vendor" msgstr "" -#: dokan-invoice.php:243 dokan-invoice.php:251 -msgid "Vendor:" +#: dokan-invoice.php:293 +msgid "From vendors:" msgstr "" -#: dokan-invoice.php:279 -msgid "From vendors:" +#: dokan-invoice.php:297 +msgid "store_info" msgstr "" #. Plugin Name of the plugin/theme msgid "Dokan - PDF Invoice" msgstr "" -#. Author URI of the plugin/theme -msgid "https://wedevs.com/" +#. Plugin URI of the plugin/theme +msgid "https://dokan.co/wordpress/" msgstr "" #. Description of the plugin/theme @@ -51,4 +51,8 @@ msgstr "" #. Author of the plugin/theme msgid "weDevs" +msgstr "" + +#. Author URI of the plugin/theme +msgid "https://dokan.co/" msgstr "" \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 8173faf..135dbbe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "Dokan-Invoice", - "version": "1.2.2", + "version": "1.2.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "Dokan-Invoice", - "version": "1.2.2", + "version": "1.2.3", "license": "GPL", "devDependencies": { "grunt": "^1.0.1", diff --git a/package.json b/package.json index a7b2765..e0a09c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Dokan-Invoice", - "version": "1.2.2", + "version": "1.2.3", "slug": "dokan-invoice", "description": "Dokan Invoice add-on", "author": "Tareq Hasan", diff --git a/readme.txt b/readme.txt index 7d0f134..8dacb1f 100644 --- a/readme.txt +++ b/readme.txt @@ -2,11 +2,11 @@ Contributors: tareq1988, wedevs, nizamuddinbabu Donate Link: http://tareq.co/donate/ Tags: WooCommerce, Multi seller, Multi vendor, Dokan, Invoice, PDF -Requires at least: 4.7 -Tested up to: 6.3.1 -WC requires at least: 5.0.0 -WC tested up to: 8.1.0 -Stable tag: 1.2.2 +Requires at least: 6.4 +Tested up to: 6.6.2 +WC requires at least: 8.0.0 +WC tested up to: 9.3.3 +Stable tag: 1.2.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -55,6 +55,13 @@ directory take precedence. For example, `/assets/screenshot-1.png` would win ove == Changelog == +v1.2.3 -> 23 Oct 2024 +------------------------ +- **Update:** WordPress v6.6.2 compatibility +- **Update:** PDF Invoices & Packing Slips for WooCommerce v3.9.0 compatibility +- **Update:** Rewrite dokan store name adding implementation +- **Fix:** Dependency error with PDF Invoices for WooCommerce v3.9.0 on plugin activation + v1.2.2 -> 16 Sep 2023 ------------------------ - **Update:** WordPress 6.3.1 compatibility