Plugin Directory

Changeset 3474209


Ignore:
Timestamp:
03/04/2026 06:06:45 AM (6 days ago)
Author:
anik4e
Message:

Version 1.0.2

Location:
wholesalex-migration-tool
Files:
2 deleted
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wholesalex-migration-tool/tags/1.0.2/includes/class-wholesalex-migration-tool.php

    r3134803 r3474209  
    77class WholesaleXMigrationTool {
    88
     9
    910    /**
    1011     * Instance of this class
     
    1920     *
    2021     * @return WholesaleXMigrationTool|null
    21      * @since 1.0.0
     22     * @since  1.0.0
    2223     */
    2324    public static function run() {
     
    3536        /**
    3637         * Fires as an admin screen or script is being initialized.
    37          *
    3838         */
    39         add_action('admin_init',function() : void {
    40             if(isset($_GET['reset_migration']) && $_GET['reset_migration']=='reset' ) {
    41                 wholesalex()->set_setting('wholesale_suite_migration_complete',false);
    42                 wholesalex()->set_setting('b2bking_migration_complete',false);
    43                 delete_transient('wholesalex_b2bking_migration_stats');
    44                 delete_transient('wholesalex_wholesale_suite_migration_stats');
    45                 die();
     39        add_action(
     40            'admin_init',
     41            function (): void {
     42                if ( isset( $_GET['reset_migration'] ) && $_GET['reset_migration'] == 'reset' ) {
     43                    wholesalex()->set_setting( 'wholesale_suite_migration_complete', false );
     44                    wholesalex()->set_setting( 'b2bking_migration_complete', false );
     45                    delete_transient( 'wholesalex_b2bking_migration_stats' );
     46                    delete_transient( 'wholesalex_wholesale_suite_migration_stats' );
     47                    die();
     48                }
    4649            }
    47         } );
    48 
     50        );
    4951    }
    5052
     
    8587
    8688        do_action( 'wholesalex_migration_tools_restapi_action', $post );
    87 
    8889    }
    8990
     
    9192     * Tools Sub Menu Page Callback
    9293     *
    93      * @since 1.2.9
     94     * @since  1.2.9
    9495     * @access public
    9596     */
    9697    public static function migration_tools_content() {
    9798        wp_enqueue_script( 'whx_migration_tools' );
    98         wp_enqueue_script( 'whx_migration_tools', WHOLESALEX_MIGRATION_URL . 'assets/js/whx_migration_tools.js', array( 'react', 'react-dom', 'wp-polyfill', 'wp-api-fetch', 'wholesalex_components', 'wholesalex_node_vendors' ), WHOLESALEX_MIGRATION_VER, true );
     99        wp_enqueue_script( 'whx_migration_tools', WHOLESALEX_MIGRATION_URL . 'assets/js/whx_migration_tools.js', array( 'react', 'react-dom', 'wp-polyfill', 'wp-api-fetch' ), WHOLESALEX_MIGRATION_VER, true );
    99100        wp_localize_script(
    100101            'whx_migration_tools',
     
    106107                'allow_b2bking_migration'         => ! wholesalex()->get_setting( 'b2bking_migration_complete', false ),
    107108                'migration_status'                => array(
    108                     'b2bking_migration'         => get_transient( 'wholesalex_b2bking_migrating' ) ? 'running' : ( wholesalex()->get_setting( 'b2bking_migration_complete' )?'complete':false),
    109                     'wholesale_suite_migration' => get_transient( 'wholesalex_wholesalex_suite_migrating' ) ? 'running' :  ( wholesalex()->get_setting( 'wholesale_suite_migration_complete' )?'complete':false)
    110                 ),
    111                 'stats' => array(
    112                     'b2bking_migration' => get_transient('wholesalex_b2bking_migration_stats'),
    113                     'wholesale_suite_migration' => get_transient('wholesalex_wholesale_suite_migration_stats'),
    114                 )
     109                    'b2bking_migration'         => get_transient( 'wholesalex_b2bking_migrating' ) ? 'running' : ( wholesalex()->get_setting( 'b2bking_migration_complete' ) ? 'complete' : false ),
     110                    'wholesale_suite_migration' => get_transient( 'wholesalex_wholesalex_suite_migrating' ) ? 'running' : ( wholesalex()->get_setting( 'wholesale_suite_migration_complete' ) ? 'complete' : false ),
     111                ),
     112                'stats'                           => array(
     113                    'b2bking_migration'         => get_transient( 'wholesalex_b2bking_migration_stats' ),
     114                    'wholesale_suite_migration' => get_transient( 'wholesalex_wholesale_suite_migration_stats' ),
     115                ),
    115116            )
    116117        );
     
    182183                    'label' => __( 'Wholesale Suite Migration', 'wholesalex' ),
    183184                    'attr'  => array(
    184                         'migrate_to_wholesalex_roles'           => array(
     185                        'migrate_to_wholesalex_roles'     => array(
    185186                            'label' => 'Roles',
    186187                            'desc'  => 'Wholesale Suite Roles to WholesaleX Roles',
    187188                        ),
    188                         'migrate_products_meta'  => array(
     189                        'migrate_products_meta'           => array(
    189190                            'label' => 'Single Product Discounts',
    190191                            'desc'  => 'Wholesale Suite Single Product Discounts to WholesaleX Single Product Discounts',
    191192                        ),
    192                         'migrate_product_variations_meta'  => array(
     193                        'migrate_product_variations_meta' => array(
    193194                            'label' => 'Product Variation Discounts',
    194195                            'desc'  => 'Wholesale Suite Product Variation Discounts to WholesaleX Product Variations Discounts',
    195196                        ),
    196                         'migrate_category_data'         => array(
     197                        'migrate_category_data'           => array(
    197198                            'label' => 'Category',
    198199                            'desc'  => 'Wholesale Suite Category Discounts to WholesaleX Category Discounts',
    199200                        ),
    200                         'migrate_registration_fields' => array(
     201                        'migrate_registration_fields'     => array(
    201202                            'label' => 'Registration Fields',
    202203                            'desc'  => 'Wholesale Suite Custom Fields to WholesaleX Form Fields',
    203204                        ),
    204                         'migrate_general_discount' => array(
     205                        'migrate_general_discount'        => array(
    205206                            'label' => 'General Discounts',
    206207                            'desc'  => 'Wholesale Suite General Discounts to WholesaleX Dynamic Rules',
    207208                        ),
    208                         'migrate_shipping_rule'   => array(
     209                        'migrate_shipping_rule'           => array(
    209210                            'label' => 'Shipping Rules',
    210211                            'desc'  => 'Wholesale Suite Shipping Rule to WholesaleX Dynamic Rules',
    211212                        ),
    212                         'migrate_payment_rule' => array(
     213                        'migrate_payment_rule'            => array(
    213214                            'label' => 'Payment Rules',
    214215                            'desc'  => 'Wholesale Suite Payment Rule to WholesaleX Dynamic Rules',
    215216                        ),
    216                         'migrate_tax_rule'        => array(
     217                        'migrate_tax_rule'                => array(
    217218                            'label' => 'Tax Rules',
    218219                            'desc'  => 'Wholesale Suite Tax Rule to WholesaleX Dynamic Rules',
    219220                        ),
    220                         'migrate_users_meta'      => array(
     221                        'migrate_users_meta'              => array(
    221222                            'label' => 'Users',
    222223                            'desc'  => 'Wholesale Suite Users to WholesaleX Users',
     
    234235        if ( function_exists( 'b2bkingcore_run' ) ) {
    235236            // B2BKing Installed and Activated
    236             require_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-b2bking-background-migration.php';
     237            include_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-b2bking-background-migration.php';
    237238
    238239            // Require B2BKing Migration
    239             require_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-b2bking-migration.php';
     240            include_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-b2bking-migration.php';
    240241            WholesaleX_B2BKing_Migration::run();
    241242            $status = true;
     
    244245        if ( isset( $GLOBALS['wc_wholesale_prices'] ) && ! empty( $GLOBALS['wc_wholesale_prices'] ) ) {
    245246            // Require Wholesale Suite Migration
    246             require_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-wholesale-suite-background-migration.php';
    247 
    248             require_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-wholesale-suite-migration.php';
     247            include_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-wholesale-suite-background-migration.php';
     248
     249            include_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-wholesale-suite-migration.php';
    249250            WholesaleX_Wholesale_Suite_Migration::run();
    250251            $status = true;
     
    252253
    253254        if ( $status ) {
    254             //add_action( 'admin_menu', array( $this, 'migration_tool_submenu_page_callback' ) );
     255            // add_action( 'admin_menu', array( $this, 'migration_tool_submenu_page_callback' ) );
    255256            add_action( 'rest_api_init', array( $this, 'migration_tool_restapi_init' ) );
    256257
  • wholesalex-migration-tool/tags/1.0.2/readme.txt

    r3134803 r3474209  
    22Contributors: wpxpo
    33Tags:  WholesaleX, Wholesale Suite, B2BKing, WooCommerce Wholesale, WooCommerce B2B
    4 Requires at least: 5.0   
    5 Tested up to: 6.6
    6 Requires PHP: 5.4
    7 Stable tag: 1.0.1
     4Requires at least: 6.8
     5Tested up to: 6.9
     6Requires PHP: 7.4
     7Stable tag: 1.0.2
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    129129== Changelog ==
    130130
     131= 1.0.2 – 04 March 2026 =
     132* Fix: Refactored migration tools for better maintainability.
     133
    131134= 1.0.1 – 13 Aug 2024 =
    132135* Fix: Wholesalex Migration Issue Fixed
  • wholesalex-migration-tool/tags/1.0.2/wholesalex-migration-tool.php

    r3134803 r3474209  
    1010 * Plugin URI:        https://wordpress.org/plugins/wholesalex-migration-tool
    1111 * Description:       This is a migration tool for wholesalex.
    12  * Version:           1.0.1
     12 * Version:           1.0.2
    1313 * Author:            wpxpo
    1414 * Author URI:        https://wpxpo.com/
     
    2525
    2626// Plugin Defined.
    27 define( 'WHOLESALEX_MIGRATION_VER', '1.0.1' );
     27define( 'WHOLESALEX_MIGRATION_VER', '1.0.2' );
    2828define( 'WHOLESALEX_MIGRATION_URL', plugin_dir_url( __FILE__ ) );
    2929define( 'WHOLESALEX_MIGRATION_BASE', plugin_basename( __FILE__ ) );
  • wholesalex-migration-tool/trunk/includes/class-wholesalex-migration-tool.php

    r3134803 r3474209  
    77class WholesaleXMigrationTool {
    88
     9
    910    /**
    1011     * Instance of this class
     
    1920     *
    2021     * @return WholesaleXMigrationTool|null
    21      * @since 1.0.0
     22     * @since  1.0.0
    2223     */
    2324    public static function run() {
     
    3536        /**
    3637         * Fires as an admin screen or script is being initialized.
    37          *
    3838         */
    39         add_action('admin_init',function() : void {
    40             if(isset($_GET['reset_migration']) && $_GET['reset_migration']=='reset' ) {
    41                 wholesalex()->set_setting('wholesale_suite_migration_complete',false);
    42                 wholesalex()->set_setting('b2bking_migration_complete',false);
    43                 delete_transient('wholesalex_b2bking_migration_stats');
    44                 delete_transient('wholesalex_wholesale_suite_migration_stats');
    45                 die();
     39        add_action(
     40            'admin_init',
     41            function (): void {
     42                if ( isset( $_GET['reset_migration'] ) && $_GET['reset_migration'] == 'reset' ) {
     43                    wholesalex()->set_setting( 'wholesale_suite_migration_complete', false );
     44                    wholesalex()->set_setting( 'b2bking_migration_complete', false );
     45                    delete_transient( 'wholesalex_b2bking_migration_stats' );
     46                    delete_transient( 'wholesalex_wholesale_suite_migration_stats' );
     47                    die();
     48                }
    4649            }
    47         } );
    48 
     50        );
    4951    }
    5052
     
    8587
    8688        do_action( 'wholesalex_migration_tools_restapi_action', $post );
    87 
    8889    }
    8990
     
    9192     * Tools Sub Menu Page Callback
    9293     *
    93      * @since 1.2.9
     94     * @since  1.2.9
    9495     * @access public
    9596     */
    9697    public static function migration_tools_content() {
    9798        wp_enqueue_script( 'whx_migration_tools' );
    98         wp_enqueue_script( 'whx_migration_tools', WHOLESALEX_MIGRATION_URL . 'assets/js/whx_migration_tools.js', array( 'react', 'react-dom', 'wp-polyfill', 'wp-api-fetch', 'wholesalex_components', 'wholesalex_node_vendors' ), WHOLESALEX_MIGRATION_VER, true );
     99        wp_enqueue_script( 'whx_migration_tools', WHOLESALEX_MIGRATION_URL . 'assets/js/whx_migration_tools.js', array( 'react', 'react-dom', 'wp-polyfill', 'wp-api-fetch' ), WHOLESALEX_MIGRATION_VER, true );
    99100        wp_localize_script(
    100101            'whx_migration_tools',
     
    106107                'allow_b2bking_migration'         => ! wholesalex()->get_setting( 'b2bking_migration_complete', false ),
    107108                'migration_status'                => array(
    108                     'b2bking_migration'         => get_transient( 'wholesalex_b2bking_migrating' ) ? 'running' : ( wholesalex()->get_setting( 'b2bking_migration_complete' )?'complete':false),
    109                     'wholesale_suite_migration' => get_transient( 'wholesalex_wholesalex_suite_migrating' ) ? 'running' :  ( wholesalex()->get_setting( 'wholesale_suite_migration_complete' )?'complete':false)
    110                 ),
    111                 'stats' => array(
    112                     'b2bking_migration' => get_transient('wholesalex_b2bking_migration_stats'),
    113                     'wholesale_suite_migration' => get_transient('wholesalex_wholesale_suite_migration_stats'),
    114                 )
     109                    'b2bking_migration'         => get_transient( 'wholesalex_b2bking_migrating' ) ? 'running' : ( wholesalex()->get_setting( 'b2bking_migration_complete' ) ? 'complete' : false ),
     110                    'wholesale_suite_migration' => get_transient( 'wholesalex_wholesalex_suite_migrating' ) ? 'running' : ( wholesalex()->get_setting( 'wholesale_suite_migration_complete' ) ? 'complete' : false ),
     111                ),
     112                'stats'                           => array(
     113                    'b2bking_migration'         => get_transient( 'wholesalex_b2bking_migration_stats' ),
     114                    'wholesale_suite_migration' => get_transient( 'wholesalex_wholesale_suite_migration_stats' ),
     115                ),
    115116            )
    116117        );
     
    182183                    'label' => __( 'Wholesale Suite Migration', 'wholesalex' ),
    183184                    'attr'  => array(
    184                         'migrate_to_wholesalex_roles'           => array(
     185                        'migrate_to_wholesalex_roles'     => array(
    185186                            'label' => 'Roles',
    186187                            'desc'  => 'Wholesale Suite Roles to WholesaleX Roles',
    187188                        ),
    188                         'migrate_products_meta'  => array(
     189                        'migrate_products_meta'           => array(
    189190                            'label' => 'Single Product Discounts',
    190191                            'desc'  => 'Wholesale Suite Single Product Discounts to WholesaleX Single Product Discounts',
    191192                        ),
    192                         'migrate_product_variations_meta'  => array(
     193                        'migrate_product_variations_meta' => array(
    193194                            'label' => 'Product Variation Discounts',
    194195                            'desc'  => 'Wholesale Suite Product Variation Discounts to WholesaleX Product Variations Discounts',
    195196                        ),
    196                         'migrate_category_data'         => array(
     197                        'migrate_category_data'           => array(
    197198                            'label' => 'Category',
    198199                            'desc'  => 'Wholesale Suite Category Discounts to WholesaleX Category Discounts',
    199200                        ),
    200                         'migrate_registration_fields' => array(
     201                        'migrate_registration_fields'     => array(
    201202                            'label' => 'Registration Fields',
    202203                            'desc'  => 'Wholesale Suite Custom Fields to WholesaleX Form Fields',
    203204                        ),
    204                         'migrate_general_discount' => array(
     205                        'migrate_general_discount'        => array(
    205206                            'label' => 'General Discounts',
    206207                            'desc'  => 'Wholesale Suite General Discounts to WholesaleX Dynamic Rules',
    207208                        ),
    208                         'migrate_shipping_rule'   => array(
     209                        'migrate_shipping_rule'           => array(
    209210                            'label' => 'Shipping Rules',
    210211                            'desc'  => 'Wholesale Suite Shipping Rule to WholesaleX Dynamic Rules',
    211212                        ),
    212                         'migrate_payment_rule' => array(
     213                        'migrate_payment_rule'            => array(
    213214                            'label' => 'Payment Rules',
    214215                            'desc'  => 'Wholesale Suite Payment Rule to WholesaleX Dynamic Rules',
    215216                        ),
    216                         'migrate_tax_rule'        => array(
     217                        'migrate_tax_rule'                => array(
    217218                            'label' => 'Tax Rules',
    218219                            'desc'  => 'Wholesale Suite Tax Rule to WholesaleX Dynamic Rules',
    219220                        ),
    220                         'migrate_users_meta'      => array(
     221                        'migrate_users_meta'              => array(
    221222                            'label' => 'Users',
    222223                            'desc'  => 'Wholesale Suite Users to WholesaleX Users',
     
    234235        if ( function_exists( 'b2bkingcore_run' ) ) {
    235236            // B2BKing Installed and Activated
    236             require_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-b2bking-background-migration.php';
     237            include_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-b2bking-background-migration.php';
    237238
    238239            // Require B2BKing Migration
    239             require_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-b2bking-migration.php';
     240            include_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-b2bking-migration.php';
    240241            WholesaleX_B2BKing_Migration::run();
    241242            $status = true;
     
    244245        if ( isset( $GLOBALS['wc_wholesale_prices'] ) && ! empty( $GLOBALS['wc_wholesale_prices'] ) ) {
    245246            // Require Wholesale Suite Migration
    246             require_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-wholesale-suite-background-migration.php';
    247 
    248             require_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-wholesale-suite-migration.php';
     247            include_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-wholesale-suite-background-migration.php';
     248
     249            include_once WHOLESALEX_MIGRATION_PATH . 'includes/class-wholesalex-wholesale-suite-migration.php';
    249250            WholesaleX_Wholesale_Suite_Migration::run();
    250251            $status = true;
     
    252253
    253254        if ( $status ) {
    254             //add_action( 'admin_menu', array( $this, 'migration_tool_submenu_page_callback' ) );
     255            // add_action( 'admin_menu', array( $this, 'migration_tool_submenu_page_callback' ) );
    255256            add_action( 'rest_api_init', array( $this, 'migration_tool_restapi_init' ) );
    256257
  • wholesalex-migration-tool/trunk/readme.txt

    r3134803 r3474209  
    22Contributors: wpxpo
    33Tags:  WholesaleX, Wholesale Suite, B2BKing, WooCommerce Wholesale, WooCommerce B2B
    4 Requires at least: 5.0   
    5 Tested up to: 6.6
    6 Requires PHP: 5.4
    7 Stable tag: 1.0.1
     4Requires at least: 6.8
     5Tested up to: 6.9
     6Requires PHP: 7.4
     7Stable tag: 1.0.2
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    129129== Changelog ==
    130130
     131= 1.0.2 – 04 March 2026 =
     132* Fix: Refactored migration tools for better maintainability.
     133
    131134= 1.0.1 – 13 Aug 2024 =
    132135* Fix: Wholesalex Migration Issue Fixed
  • wholesalex-migration-tool/trunk/wholesalex-migration-tool.php

    r3134803 r3474209  
    1010 * Plugin URI:        https://wordpress.org/plugins/wholesalex-migration-tool
    1111 * Description:       This is a migration tool for wholesalex.
    12  * Version:           1.0.1
     12 * Version:           1.0.2
    1313 * Author:            wpxpo
    1414 * Author URI:        https://wpxpo.com/
     
    2525
    2626// Plugin Defined.
    27 define( 'WHOLESALEX_MIGRATION_VER', '1.0.1' );
     27define( 'WHOLESALEX_MIGRATION_VER', '1.0.2' );
    2828define( 'WHOLESALEX_MIGRATION_URL', plugin_dir_url( __FILE__ ) );
    2929define( 'WHOLESALEX_MIGRATION_BASE', plugin_basename( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.