Plugin Directory

Changeset 3607033


Ignore:
Timestamp:
07/14/2026 07:23:04 AM (3 months ago)
Author:
kovalchik8
Message:

Version 2.0.1

Location:
magic-export-import
Files:
71 added
5 edited

Legend:

Unmodified
Added
Removed
  • magic-export-import/trunk/class-magic-ex-im-setup.php

    r3599178 r3607033  
    33 * Plugin Name: Magic Export & Import
    44 * Description: The ultimate tool to migrate any content including posts, terms, users, comments, WooCommerce shop orders, menus and ACF Options pages.
    5  * Version: 2.0.0
     5 * Version: 2.0.1
    66 * Requires at least: 6.2
    77 * Requires PHP: 7.4
  • magic-export-import/trunk/includes/class-magic-ex-im-type.php

    r3599178 r3607033  
    25582558                                        'finish'            => false,
    25592559                                        'total'             => 0,
     2560                                        'extra_total'       => 0,
    25602561                                        'processed'         => 0,
    25612562                                        'related_total'     => 0,
    … …  
    26662667                }
    26672668
     2669                // Count items added automatically along with the selected ones (e.g. refunds of
     2670                // refunded orders or variations of variable products), so the progress can
     2671                // explain why the total exceeds the user's selection.
     2672                $extra_items_cnt = count( $item_ids ) - count( $this->get_export_items( $posted_data, false ) );
     2673
     2674                $this->export_progress['extra_total'] = max( 0, $extra_items_cnt );
     2675
    26682676                // Additional data plan: groups with their prefixed keys and item IDs.
    26692677                $related_plan = $this->get_export_related_plan( $posted_data );
    … …  
    26812689                if ( $related_plan ) {
    26822690                        $params['related-manifest'] = $this->get_related_manifest_from_plan( $related_plan );
     2691                }
     2692
     2693                // Pass the automatically added items count to the import progress.
     2694                if ( $this->export_progress['extra_total'] ) {
     2695                        $params['extra-items'] = $this->export_progress['extra_total'];
    26832696                }
    26842697
    … …  
    31043117                                        'finish'                   => false,
    31053118                                        'total'                    => 0,
     3119                                        'extra_total'              => 0,
    31063120                                        'related_total'            => 0,
    31073121                                        'related_group'            => 0,
    … …  
    33313345                                $this->import_progress['user_params'] = $user_params;
    33323346                                $this->import_progress['file_params'] = $file_params;
     3347                                $this->import_progress['extra_total'] = intval( $file_params['extra-items'] ?? 0 );
    33333348                                $this->import_progress['first_entry'] = false;
    33343349
    … …  
    33713386
    33723387                                // Determine if the last slice is being processed.
    3373                                 $finish_cnt                                    = $this->import_progress['processed'] + count( $next_slice );
    3374                                 $this->import_progress['file_items_processed'] = $this->import_progress['total'] <= $finish_cnt;
     3388                                $finish_cnt = $this->import_progress['processed'] + count( $next_slice );
    33753389
    33763390                                // Set import items data.
    … …  
    33843398
    33853399                                $this->import_items( $import_items_data );
     3400
     3401                                // Mark file items as processed only after importing the slice, so the last
     3402                                // slice still honors the 'skip-existing-items' user parameter.
     3403                                $this->import_progress['file_items_processed'] = $this->import_progress['total'] <= $finish_cnt;
    33863404
    33873405                                // Process deferred items data.
  • magic-export-import/trunk/readme.txt

    r3599178 r3607033  
    66Tested up to: 7.0
    77Requires PHP: 7.4
    8 Stable tag: 2.0.0
     8Stable tag: 2.0.1
    99License: GPL v3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.txt
    … …  
    8585== Changelog ==
    8686
     87= 2.0.1 =
     88* Fix: the "Do not update existing items, only create new" import setting was not applied to the last slice of the file, so the trailing items (typically Refunds, which ride at the end of Shop Orders files) were updated instead of skipped.
     89* Improvement: when related items are exported automatically along with the selected ones (e.g. Refunds of refunded Orders or Variations of variable Products), the export and import progress now show how many such items are included, clarifying why the total exceeds the number of selected items.
     90
    8791= 2.0.0 =
    8892* New: export and import related data types within one file. Check "Export related data types and referenced items" to include the data referenced by the exporting items (e.g. Products, Users and Coupons for Shop Orders; Terms and Users for Posts; linked Posts and Terms for Menus and Comments, including nested relations like Product Categories for ordered Products). The offered types follow the data selected for export and reset when that selection changes. On import, related items are processed first so all the references resolve: missing items are created, existing ones are kept untouched (adjustable with the separate related items import settings).
  • magic-export-import/trunk/template-parts/export-progress.php

    r3599178 r3607033  
    4040</p>
    4141
     42<?php if ( ! empty( $args['extra_total'] ) ) : ?>
     43<p class="description">
     44        <?php
     45        printf(
     46                /* translators: %s: number of automatically added related items wrapped in HTML. */
     47                esc_html__( 'The total exceeds your selection by %s items exported automatically along with the selected ones (e.g. Refunds of refunded Orders or Variations of variable Products).', 'magic-export-import' ),
     48                '<b>' . intval( $args['extra_total'] ) . '</b>'
     49        );
     50        ?>
     51</p>
     52<?php endif; ?>
     53
    4254<?php if ( ! $is_finished && ! $has_error ) : ?>
    4355<button id="magic-ex-stop" class="button button-link-delete" style="margin-top: 10px;"><?php esc_html_e( 'Stop export', 'magic-export-import' ); ?></button>
  • magic-export-import/trunk/template-parts/import-progress.php

    r3599178 r3607033  
    4949</p>
    5050
     51<?php if ( ! empty( $args['extra_total'] ) ) : ?>
     52<p class="description">
     53        <?php
     54        printf(
     55                /* translators: %s: number of automatically added related items wrapped in HTML. */
     56                esc_html__( 'The file contains %s items exported automatically along with the selected ones (e.g. Refunds of refunded Orders or Variations of variable Products), included in the total.', 'magic-export-import' ),
     57                '<b>' . intval( $args['extra_total'] ) . '</b>'
     58        );
     59        ?>
     60</p>
     61<?php endif; ?>
     62
    5163<?php if ( magic_ex_im_get_user_params( 'download-media' ) ) : ?>
    5264<p style="margin-top:1em;"><?php esc_html_e( 'Media downloaded:', 'magic-export-import' ); ?> <b><?php echo intval( $args['media_downloaded'] ); ?></b></p>
Note: See TracChangeset for help on using the changeset viewer.