Changeset 3386155
- Timestamp:
- 10/29/2025 04:27:22 AM (2 months ago)
- Location:
- clone-duplicate-orders-for-woocommerce
- Files:
-
- 2 deleted
- 28 edited
- 1 copied
-
tags/1.0.7 (copied) (copied from clone-duplicate-orders-for-woocommerce/trunk)
-
tags/1.0.7/.phpunit.result.cache (deleted)
-
tags/1.0.7/clone-duplicate-orders-for-woocommerce.php (modified) (1 diff)
-
tags/1.0.7/includes/class-cdo-wc-cloner.php (modified) (8 diffs)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-ar.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-bn_BD.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-es_ES.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-fr_FR.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-hi_IN.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-ja.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-pa_IN.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-pt_BR.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-ru_RU.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-zh_CN.po (modified) (1 diff)
-
tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce.pot (modified) (5 diffs)
-
tags/1.0.7/readme.txt (modified) (3 diffs)
-
trunk/.phpunit.result.cache (deleted)
-
trunk/clone-duplicate-orders-for-woocommerce.php (modified) (1 diff)
-
trunk/includes/class-cdo-wc-cloner.php (modified) (8 diffs)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-ar.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-bn_BD.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-es_ES.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-fr_FR.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-hi_IN.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-ja.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-pa_IN.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-pt_BR.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-ru_RU.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce-zh_CN.po (modified) (1 diff)
-
trunk/languages/clone-duplicate-orders-for-woocommerce.pot (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
clone-duplicate-orders-for-woocommerce/tags/1.0.7/clone-duplicate-orders-for-woocommerce.php
r3363816 r3386155 16 16 * Text Domain: clone-duplicate-orders-for-woocommerce 17 17 * Domain Path: /languages 18 * Version: 1.0. 618 * Version: 1.0.7 19 19 * Requires PHP: 7.4 20 20 * Requires at least: 6.0 21 * Tested up to: 6.8. 221 * Tested up to: 6.8.3 22 22 * WC requires at least: 8.2.0 23 23 * WC tested up to: 10.1.2 -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/includes/class-cdo-wc-cloner.php
r3363816 r3386155 35 35 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) ); 36 36 37 // Show the Actions column by default (runs after WooCommerce's filter with priority 11). 38 add_filter( 'default_hidden_columns', array( $this, 'show_actions_column_by_default' ), 11, 2 ); 39 37 40 // Add the clone button to the orders index page. 38 41 add_filter( 'woocommerce_admin_order_actions_end', array( $this, 'add_clone_order_action_button' ) ); … … 63 66 esc_url( CDO_WC_ASSETS_URL . 'css/cdo-wc-main.css' ), 64 67 array(), 65 '1.0. 6'68 '1.0.7' 66 69 ); 70 } 71 72 /** 73 * Show the Actions column by default on WooCommerce orders list. 74 * 75 * This filter runs after WooCommerce's default_hidden_columns filter (priority 10) 76 * to ensure the wc_actions column is visible by default, making the clone button accessible. 77 * 78 * @param array $hidden Array of column IDs that are hidden by default. 79 * @param object $screen The current screen object. 80 * @return array Modified array of hidden columns. 81 */ 82 public function show_actions_column_by_default( $hidden, $screen ) { 83 // Check if we're on the orders list screen (both classic and HPOS). 84 $order_screen_ids = array( 'edit-shop_order', 'woocommerce_page_wc-orders' ); 85 86 if ( ! isset( $screen->id ) || ! in_array( $screen->id, $order_screen_ids, true ) ) { 87 return $hidden; 88 } 89 90 // Remove wc_actions from the hidden columns array to show it by default. 91 if ( is_array( $hidden ) ) { 92 $hidden = array_diff( $hidden, array( 'wc_actions' ) ); 93 } 94 95 return $hidden; 67 96 } 68 97 … … 167 196 'admin_footer', 168 197 function () use ( $redirect_url, $delay_seconds ) { 169 wp_register_script( 'cdo_wc_clonning_redirect', '', array(), '1.0. 6', true );198 wp_register_script( 'cdo_wc_clonning_redirect', '', array(), '1.0.7', true ); 170 199 wp_enqueue_script( 'cdo_wc_clonning_redirect' ); 171 200 … … 242 271 return sprintf( 243 272 wp_kses( 244 /* translators: % s: New order URL, %d: New order ID*/245 __( 'Order successfully duplicated. New order ID: <a href="%1$s">#%2$d</a> ', 'clone-duplicate-orders-for-woocommerce' ),273 /* translators: %1$s: New order URL, %2$d: New order ID, %3$s: View the cloned order URL */ 274 __( 'Order successfully duplicated. New order ID: <a href="%1$s">#%2$d</a>. <a href="%3$s">View the cloned order</a>', 'clone-duplicate-orders-for-woocommerce' ), 246 275 array( 'a' => array( 'href' => array() ) ) 247 276 ), 248 277 esc_url( $new_order_url ), 249 intval( $new_order_id ) 278 intval( $new_order_id ), 279 esc_url( $new_order_url ) 250 280 ); 251 281 } … … 326 356 '_wcpdf_invoice_number_data', 327 357 '_wcdn_invoice_number', 328 'wf_invoice_number' 358 'wf_invoice_number', 329 359 ); 360 361 /** 362 * Filters the list of meta keys to ignore when cloning an order. 363 * 364 * This filter allows developers to add or remove meta keys that should not be 365 * copied when cloning an order. By default, payment-related and invoice-related 366 * meta keys are excluded for security reasons. 367 * 368 * @since 1.0.7 369 * 370 * @param array $ignore_meta_keys Array of meta keys to ignore during order cloning. 371 * @param int $original_order_id The ID of the original order being cloned. 372 * @param WC_Order $original_order The original order object being cloned. 373 * 374 * @return array Modified array of meta keys to ignore. 375 */ 376 $filtered_ignore_meta_keys = apply_filters( 'cdo_wc_clone_order_ignore_meta_keys', $ignore_meta_keys, $original_order_id, $original_order ); 377 378 // Ensure the filtered value is an array for security. 379 if ( ! is_array( $filtered_ignore_meta_keys ) ) { 380 $filtered_ignore_meta_keys = $ignore_meta_keys; 381 } 382 383 $ignore_meta_keys = $filtered_ignore_meta_keys; 330 384 331 385 foreach ( $original_order->get_meta_data() as $meta ) { … … 363 417 $new_item->set_total( (string) $item->get_total() ); 364 418 419 // Preserve tax class from original item so calculate_totals() applies correct tax. 420 $new_item->set_tax_class( $item->get_tax_class() ); 421 365 422 // Copy item meta. 366 423 foreach ( $item->get_meta_data() as $meta ) { … … 409 466 $order->save(); 410 467 411 do_action( 'woocommerce_new_order', $order->get_id(), $order ); 468 do_action( 'woocommerce_new_order', $order->get_id(), $order ); // phpcs:ignore WPOrgSubmissionRules.Naming.UniqueName.MissingPrefix 412 469 413 470 // Enable all WooCommerce order status emails. … … 476 533 */ 477 534 private function prevent_multiple_submissions_js() { 478 wp_register_script( 'cdo_wc_prevent_duplicate_submissions', '', array( 'jquery' ), '1.0. 6', true );535 wp_register_script( 'cdo_wc_prevent_duplicate_submissions', '', array( 'jquery' ), '1.0.7', true ); 479 536 wp_enqueue_script( 'cdo_wc_prevent_duplicate_submissions' ); 480 537 -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-ar.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-bn_BD.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-es_ES.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-fr_FR.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-hi_IN.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-ja.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-pa_IN.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-pt_BR.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-ru_RU.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce-zh_CN.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/languages/clone-duplicate-orders-for-woocommerce.pot
r3363816 r3386155 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"5 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 6 6 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025- 01-01T10:19:41+00:00\n"12 "POT-Creation-Date: 2025-10-28T07:13:01+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.1 1.0\n"14 "X-Generator: WP-CLI 2.12.0\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" 16 16 17 17 #. Plugin Name of the plugin 18 18 #: clone-duplicate-orders-for-woocommerce.php 19 #: includes/class-cdo-wc-cloner.php: 39119 #: includes/class-cdo-wc-cloner.php:520 20 20 msgid "Clone / Duplicate Orders for WooCommerce" 21 21 msgstr "" … … 36 36 msgstr "" 37 37 38 #: includes/class-cdo-wc-cloner.php:1 0539 #: includes/class-cdo-wc-cloner.php:1 4238 #: includes/class-cdo-wc-cloner.php:131 39 #: includes/class-cdo-wc-cloner.php:169 40 40 msgid "Clone Order" 41 41 msgstr "" 42 42 43 #: includes/class-cdo-wc-cloner.php:1 0943 #: includes/class-cdo-wc-cloner.php:135 44 44 msgid "Clone is not available for this order." 45 45 msgstr "" 46 46 47 #: includes/class-cdo-wc-cloner.php:1 2847 #: includes/class-cdo-wc-cloner.php:155 48 48 msgid "Clone order" 49 49 msgstr "" 50 50 51 #: includes/class-cdo-wc-cloner.php:159 51 #: includes/class-cdo-wc-cloner.php:178 52 #: includes/class-cdo-wc-cloner.php:243 53 msgid "You do not have permission to clone orders." 54 msgstr "" 55 56 #: includes/class-cdo-wc-cloner.php:190 52 57 msgid "This order is already being cloned, and we have detected multiple clicks. You will be redirected to the orders page shortly." 53 58 msgstr "" 54 59 55 60 #. translators: %1$ is number of seconds. %2$ is the word here that links to orders index. 56 #: includes/class-cdo-wc-cloner.php:161 61 #: includes/class-cdo-wc-cloner.php:192 62 #, php-format 57 63 msgid "If you are not redirected within %1$d seconds, click %2$s." 58 64 msgstr "" 59 65 60 66 #. translators: %1$ is number of seconds. %2$ is the word here that links to orders index. 61 #: includes/class-cdo-wc-cloner.php:1 6167 #: includes/class-cdo-wc-cloner.php:192 62 68 msgid "here" 63 69 msgstr "" 64 70 65 #. translators: %s: New order URL, %d: New order ID 66 #: includes/class-cdo-wc-cloner.php:190 67 #: includes/class-cdo-wc-cloner.php:221 68 msgid "Order successfully duplicated. New order ID: <a href=\"%1$s\">#%2$d</a>" 71 #: includes/class-cdo-wc-cloner.php:218 72 #: includes/class-cdo-wc-cloner.php:250 73 msgid "Failed to clone the order. Please try again." 69 74 msgstr "" 70 75 71 #: includes/class-cdo-wc-cloner.php:2 0376 #: includes/class-cdo-wc-cloner.php:232 72 77 msgid "Nonce verification failed or order ID not set." 73 78 msgstr "" 74 79 75 #: includes/class-cdo-wc-cloner.php:373 80 #. translators: %1$s: New order URL, %2$d: New order ID, %3$s: View the cloned order URL 81 #: includes/class-cdo-wc-cloner.php:274 82 #, php-format 83 msgid "Order successfully duplicated. New order ID: <a href=\"%1$s\">#%2$d</a>. <a href=\"%3$s\">View the cloned order</a>" 84 msgstr "" 85 86 #: includes/class-cdo-wc-cloner.php:502 76 87 msgid "HPOS Status" 77 88 msgstr "" … … 84 95 #. translators: %1$s is the opening <a> tag with a link to activate WooCommerce, and %2$s is the closing </a> tag. 85 96 #: includes/class-cdo-wc-init.php:115 97 #, php-format 86 98 msgid "Clone / Duplicate Orders for WooCommerce requires WooCommerce to be active. Please %1$s Activate WooCommerce %2$s." 87 99 msgstr "" … … 89 101 #. translators: %1$s is the opening <a> tag with a link to install WooCommerce, and %2$s is the closing </a> tag. 90 102 #: includes/class-cdo-wc-init.php:127 103 #, php-format 91 104 msgid "Clone / Duplicate Orders for WooCommerce requires WooCommerce to be installed and active. Please %1$s Install WooCommerce%2$s." 92 105 msgstr "" -
clone-duplicate-orders-for-woocommerce/tags/1.0.7/readme.txt
r3363816 r3386155 8 8 Domain Path: /languages 9 9 Tags: clone, duplicate, clone order, copy order, duplicate order 10 Version: 1.0. 611 Stable tag: 1.0. 610 Version: 1.0.7 11 Stable tag: 1.0.7 12 12 Requires PHP: 7.4 13 13 Requires at least: 6.0 … … 125 125 = Can I customize Clone / Duplicate Orders for WooCommerce with developer hooks? = 126 126 127 Yes, Clone / Duplicate Orders for WooCommerce includes a filter called `cdo_wc_permission_capabilities` to customize user permissions and capabilities required for cloning orders. 127 Yes, Clone / Duplicate Orders for WooCommerce includes developer filters: 128 129 * `cdo_wc_permission_capabilities` - Customize user permissions and capabilities required for cloning orders. 130 * `cdo_wc_clone_order_ignore_meta_keys` - Add or remove meta keys that should not be copied when cloning an order (since 1.0.7). 128 131 129 132 = Does Clone / Duplicate Orders for WooCommerce slow down my website? = … … 193 196 == Changelog == 194 197 198 = 1.0.7 = 199 * Improvement: Display WooCommerce Actions column by default for quicker access to the clone button 200 * Improvement: Includes a direct "View cloned order" link after cloning 201 * Feature: Introduce filter `cdo_wc_clone_order_ignore_meta_keys` for customizable meta exclusion 202 * Bugfix: Preserve line-item tax class when cloning orders 203 195 204 = 1.0.6 = 196 * Feature: Improved compat ability with various plugins.205 * Feature: Improved compatibility with various plugins. 197 206 * Feature: Comprehensive security review 198 207 * Bugfix: Missing permission checks in AJAX handlers -
clone-duplicate-orders-for-woocommerce/trunk/clone-duplicate-orders-for-woocommerce.php
r3363816 r3386155 16 16 * Text Domain: clone-duplicate-orders-for-woocommerce 17 17 * Domain Path: /languages 18 * Version: 1.0. 618 * Version: 1.0.7 19 19 * Requires PHP: 7.4 20 20 * Requires at least: 6.0 21 * Tested up to: 6.8. 221 * Tested up to: 6.8.3 22 22 * WC requires at least: 8.2.0 23 23 * WC tested up to: 10.1.2 -
clone-duplicate-orders-for-woocommerce/trunk/includes/class-cdo-wc-cloner.php
r3363816 r3386155 35 35 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) ); 36 36 37 // Show the Actions column by default (runs after WooCommerce's filter with priority 11). 38 add_filter( 'default_hidden_columns', array( $this, 'show_actions_column_by_default' ), 11, 2 ); 39 37 40 // Add the clone button to the orders index page. 38 41 add_filter( 'woocommerce_admin_order_actions_end', array( $this, 'add_clone_order_action_button' ) ); … … 63 66 esc_url( CDO_WC_ASSETS_URL . 'css/cdo-wc-main.css' ), 64 67 array(), 65 '1.0. 6'68 '1.0.7' 66 69 ); 70 } 71 72 /** 73 * Show the Actions column by default on WooCommerce orders list. 74 * 75 * This filter runs after WooCommerce's default_hidden_columns filter (priority 10) 76 * to ensure the wc_actions column is visible by default, making the clone button accessible. 77 * 78 * @param array $hidden Array of column IDs that are hidden by default. 79 * @param object $screen The current screen object. 80 * @return array Modified array of hidden columns. 81 */ 82 public function show_actions_column_by_default( $hidden, $screen ) { 83 // Check if we're on the orders list screen (both classic and HPOS). 84 $order_screen_ids = array( 'edit-shop_order', 'woocommerce_page_wc-orders' ); 85 86 if ( ! isset( $screen->id ) || ! in_array( $screen->id, $order_screen_ids, true ) ) { 87 return $hidden; 88 } 89 90 // Remove wc_actions from the hidden columns array to show it by default. 91 if ( is_array( $hidden ) ) { 92 $hidden = array_diff( $hidden, array( 'wc_actions' ) ); 93 } 94 95 return $hidden; 67 96 } 68 97 … … 167 196 'admin_footer', 168 197 function () use ( $redirect_url, $delay_seconds ) { 169 wp_register_script( 'cdo_wc_clonning_redirect', '', array(), '1.0. 6', true );198 wp_register_script( 'cdo_wc_clonning_redirect', '', array(), '1.0.7', true ); 170 199 wp_enqueue_script( 'cdo_wc_clonning_redirect' ); 171 200 … … 242 271 return sprintf( 243 272 wp_kses( 244 /* translators: % s: New order URL, %d: New order ID*/245 __( 'Order successfully duplicated. New order ID: <a href="%1$s">#%2$d</a> ', 'clone-duplicate-orders-for-woocommerce' ),273 /* translators: %1$s: New order URL, %2$d: New order ID, %3$s: View the cloned order URL */ 274 __( 'Order successfully duplicated. New order ID: <a href="%1$s">#%2$d</a>. <a href="%3$s">View the cloned order</a>', 'clone-duplicate-orders-for-woocommerce' ), 246 275 array( 'a' => array( 'href' => array() ) ) 247 276 ), 248 277 esc_url( $new_order_url ), 249 intval( $new_order_id ) 278 intval( $new_order_id ), 279 esc_url( $new_order_url ) 250 280 ); 251 281 } … … 326 356 '_wcpdf_invoice_number_data', 327 357 '_wcdn_invoice_number', 328 'wf_invoice_number' 358 'wf_invoice_number', 329 359 ); 360 361 /** 362 * Filters the list of meta keys to ignore when cloning an order. 363 * 364 * This filter allows developers to add or remove meta keys that should not be 365 * copied when cloning an order. By default, payment-related and invoice-related 366 * meta keys are excluded for security reasons. 367 * 368 * @since 1.0.7 369 * 370 * @param array $ignore_meta_keys Array of meta keys to ignore during order cloning. 371 * @param int $original_order_id The ID of the original order being cloned. 372 * @param WC_Order $original_order The original order object being cloned. 373 * 374 * @return array Modified array of meta keys to ignore. 375 */ 376 $filtered_ignore_meta_keys = apply_filters( 'cdo_wc_clone_order_ignore_meta_keys', $ignore_meta_keys, $original_order_id, $original_order ); 377 378 // Ensure the filtered value is an array for security. 379 if ( ! is_array( $filtered_ignore_meta_keys ) ) { 380 $filtered_ignore_meta_keys = $ignore_meta_keys; 381 } 382 383 $ignore_meta_keys = $filtered_ignore_meta_keys; 330 384 331 385 foreach ( $original_order->get_meta_data() as $meta ) { … … 363 417 $new_item->set_total( (string) $item->get_total() ); 364 418 419 // Preserve tax class from original item so calculate_totals() applies correct tax. 420 $new_item->set_tax_class( $item->get_tax_class() ); 421 365 422 // Copy item meta. 366 423 foreach ( $item->get_meta_data() as $meta ) { … … 409 466 $order->save(); 410 467 411 do_action( 'woocommerce_new_order', $order->get_id(), $order ); 468 do_action( 'woocommerce_new_order', $order->get_id(), $order ); // phpcs:ignore WPOrgSubmissionRules.Naming.UniqueName.MissingPrefix 412 469 413 470 // Enable all WooCommerce order status emails. … … 476 533 */ 477 534 private function prevent_multiple_submissions_js() { 478 wp_register_script( 'cdo_wc_prevent_duplicate_submissions', '', array( 'jquery' ), '1.0. 6', true );535 wp_register_script( 'cdo_wc_prevent_duplicate_submissions', '', array( 'jquery' ), '1.0.7', true ); 479 536 wp_enqueue_script( 'cdo_wc_prevent_duplicate_submissions' ); 480 537 -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-ar.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-bn_BD.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-es_ES.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-fr_FR.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-hi_IN.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-ja.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-pa_IN.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-pt_BR.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-ru_RU.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce-zh_CN.po
r3363816 r3386155 11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 12 "POT-Creation-Date: 2025-11-01T14:07:31+00:00\n" 13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"13 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 14 14 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" -
clone-duplicate-orders-for-woocommerce/trunk/languages/clone-duplicate-orders-for-woocommerce.pot
r3363816 r3386155 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0. 6\n"5 "Project-Id-Version: Clone / Duplicate Orders for WooCommerce 1.0.7\n" 6 6 "Report-Msgid-Bugs-To: https://www.ymmv.co\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025- 01-01T10:19:41+00:00\n"12 "POT-Creation-Date: 2025-10-28T07:13:01+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.1 1.0\n"14 "X-Generator: WP-CLI 2.12.0\n" 15 15 "X-Domain: clone-duplicate-orders-for-woocommerce\n" 16 16 17 17 #. Plugin Name of the plugin 18 18 #: clone-duplicate-orders-for-woocommerce.php 19 #: includes/class-cdo-wc-cloner.php: 39119 #: includes/class-cdo-wc-cloner.php:520 20 20 msgid "Clone / Duplicate Orders for WooCommerce" 21 21 msgstr "" … … 36 36 msgstr "" 37 37 38 #: includes/class-cdo-wc-cloner.php:1 0539 #: includes/class-cdo-wc-cloner.php:1 4238 #: includes/class-cdo-wc-cloner.php:131 39 #: includes/class-cdo-wc-cloner.php:169 40 40 msgid "Clone Order" 41 41 msgstr "" 42 42 43 #: includes/class-cdo-wc-cloner.php:1 0943 #: includes/class-cdo-wc-cloner.php:135 44 44 msgid "Clone is not available for this order." 45 45 msgstr "" 46 46 47 #: includes/class-cdo-wc-cloner.php:1 2847 #: includes/class-cdo-wc-cloner.php:155 48 48 msgid "Clone order" 49 49 msgstr "" 50 50 51 #: includes/class-cdo-wc-cloner.php:159 51 #: includes/class-cdo-wc-cloner.php:178 52 #: includes/class-cdo-wc-cloner.php:243 53 msgid "You do not have permission to clone orders." 54 msgstr "" 55 56 #: includes/class-cdo-wc-cloner.php:190 52 57 msgid "This order is already being cloned, and we have detected multiple clicks. You will be redirected to the orders page shortly." 53 58 msgstr "" 54 59 55 60 #. translators: %1$ is number of seconds. %2$ is the word here that links to orders index. 56 #: includes/class-cdo-wc-cloner.php:161 61 #: includes/class-cdo-wc-cloner.php:192 62 #, php-format 57 63 msgid "If you are not redirected within %1$d seconds, click %2$s." 58 64 msgstr "" 59 65 60 66 #. translators: %1$ is number of seconds. %2$ is the word here that links to orders index. 61 #: includes/class-cdo-wc-cloner.php:1 6167 #: includes/class-cdo-wc-cloner.php:192 62 68 msgid "here" 63 69 msgstr "" 64 70 65 #. translators: %s: New order URL, %d: New order ID 66 #: includes/class-cdo-wc-cloner.php:190 67 #: includes/class-cdo-wc-cloner.php:221 68 msgid "Order successfully duplicated. New order ID: <a href=\"%1$s\">#%2$d</a>" 71 #: includes/class-cdo-wc-cloner.php:218 72 #: includes/class-cdo-wc-cloner.php:250 73 msgid "Failed to clone the order. Please try again." 69 74 msgstr "" 70 75 71 #: includes/class-cdo-wc-cloner.php:2 0376 #: includes/class-cdo-wc-cloner.php:232 72 77 msgid "Nonce verification failed or order ID not set." 73 78 msgstr "" 74 79 75 #: includes/class-cdo-wc-cloner.php:373 80 #. translators: %1$s: New order URL, %2$d: New order ID, %3$s: View the cloned order URL 81 #: includes/class-cdo-wc-cloner.php:274 82 #, php-format 83 msgid "Order successfully duplicated. New order ID: <a href=\"%1$s\">#%2$d</a>. <a href=\"%3$s\">View the cloned order</a>" 84 msgstr "" 85 86 #: includes/class-cdo-wc-cloner.php:502 76 87 msgid "HPOS Status" 77 88 msgstr "" … … 84 95 #. translators: %1$s is the opening <a> tag with a link to activate WooCommerce, and %2$s is the closing </a> tag. 85 96 #: includes/class-cdo-wc-init.php:115 97 #, php-format 86 98 msgid "Clone / Duplicate Orders for WooCommerce requires WooCommerce to be active. Please %1$s Activate WooCommerce %2$s." 87 99 msgstr "" … … 89 101 #. translators: %1$s is the opening <a> tag with a link to install WooCommerce, and %2$s is the closing </a> tag. 90 102 #: includes/class-cdo-wc-init.php:127 103 #, php-format 91 104 msgid "Clone / Duplicate Orders for WooCommerce requires WooCommerce to be installed and active. Please %1$s Install WooCommerce%2$s." 92 105 msgstr "" -
clone-duplicate-orders-for-woocommerce/trunk/readme.txt
r3363816 r3386155 8 8 Domain Path: /languages 9 9 Tags: clone, duplicate, clone order, copy order, duplicate order 10 Version: 1.0. 611 Stable tag: 1.0. 610 Version: 1.0.7 11 Stable tag: 1.0.7 12 12 Requires PHP: 7.4 13 13 Requires at least: 6.0 … … 125 125 = Can I customize Clone / Duplicate Orders for WooCommerce with developer hooks? = 126 126 127 Yes, Clone / Duplicate Orders for WooCommerce includes a filter called `cdo_wc_permission_capabilities` to customize user permissions and capabilities required for cloning orders. 127 Yes, Clone / Duplicate Orders for WooCommerce includes developer filters: 128 129 * `cdo_wc_permission_capabilities` - Customize user permissions and capabilities required for cloning orders. 130 * `cdo_wc_clone_order_ignore_meta_keys` - Add or remove meta keys that should not be copied when cloning an order (since 1.0.7). 128 131 129 132 = Does Clone / Duplicate Orders for WooCommerce slow down my website? = … … 193 196 == Changelog == 194 197 198 = 1.0.7 = 199 * Improvement: Display WooCommerce Actions column by default for quicker access to the clone button 200 * Improvement: Includes a direct "View cloned order" link after cloning 201 * Feature: Introduce filter `cdo_wc_clone_order_ignore_meta_keys` for customizable meta exclusion 202 * Bugfix: Preserve line-item tax class when cloning orders 203 195 204 = 1.0.6 = 196 * Feature: Improved compat ability with various plugins.205 * Feature: Improved compatibility with various plugins. 197 206 * Feature: Comprehensive security review 198 207 * Bugfix: Missing permission checks in AJAX handlers
Note: See TracChangeset
for help on using the changeset viewer.