Plugin Directory

Changeset 3139965


Ignore:
Timestamp:
08/22/2024 08:52:20 PM (19 months ago)
Author:
bigcommerce
Message:

Update to version 5.1.0 from GitHub

Location:
bigcommerce
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • bigcommerce/tags/5.1.0/CHANGELOG.md

    r3127781 r3139965  
    11# Changelog
     2
     3## [5.1.0]
     4
     5### Changed
     6- Sync all categories for MSF stores via API
    27
    38## [5.0.8]
     
    19201925
    19211926
     1927[5.1.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.8...5.1.0
    19221928[5.0.8]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.7...5.0.8
    19231929[5.0.7]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.6...5.0.7
  • bigcommerce/tags/5.1.0/bigcommerce.php

    r3127781 r3139965  
    44Description:  Scale your ecommerce business with WordPress on the front-end and BigCommerce on the back end. Free up server resources from things like catalog management, processing payments, and managing fulfillment logistics.
    55Author:       BigCommerce
    6 Version:      5.0.8
     6Version:      5.1.0
    77Author URI:   https://www.bigcommerce.com/wordpress
    88Requires PHP: 7.4.0
  • bigcommerce/tags/5.1.0/readme.txt

    r3127781 r3139965  
    44Requires at least: 5.2
    55Tested up to: 6.6
    6 Stable tag: 5.0.8
     6Stable tag: 5.1.0
    77Requires PHP: 7.4.0
    88License: GPLv2 or later
  • bigcommerce/tags/5.1.0/src/BigCommerce/Import/Processors/Category_Import.php

    r2865940 r3139965  
    3030        try {
    3131            if ( Store_Settings::is_msf_on() ) {
    32                 $data = $this->get_msf_categories( $this->catalog_api );
    3332
    34                 if ( ! empty( $data ) ) {
    35                     return $data->getData();
     33                /* loop though all categories and return $allCategories */
     34                $allCategories = [];
     35                $currentPage = 1;
     36                $totalPages = 1;
     37
     38                do {
     39
     40                    $params['page'] = $currentPage;
     41
     42                    $data = $this->get_msf_categories( $this->catalog_api, $params);
     43
     44                    if ( ! empty( $data ) ) {
     45
     46                        $currentData = $data->getData();
     47
     48                        if (is_array($currentData) && !empty($currentData)) {
     49                            $allCategories = array_merge($allCategories, $currentData);
     50                        } else {
     51                            do_action('bigcommerce/log', Error_Log::WARNING, __('Current data is not an array or is empty.', 'bigcommerce'), []);
     52                        }
     53
     54                        if ( method_exists( $data, 'getMeta' ) ){
     55                            $meta = $data->getMeta();
     56                            if ( isset( $meta['pagination']['current_page'] ) && isset( $meta['pagination']['total_pages'] ) ) {
     57                                $currentPage = $meta['pagination']['current_page'];
     58                                $totalPages  = $meta['pagination']['total_pages'];
     59                            } else {
     60                                do_action( 'bigcommerce/log', Error_Log::WARNING, __( 'Pagination information is missing in the response meta.', 'bigcommerce' ), [] );
     61                                break; // Exit the loop
     62                            }
     63                        } else {
     64                            do_action('bigcommerce/log', Error_Log::WARNING, __('getMeta method does not exist on the data object.', 'bigcommerce'), []);
     65                            break; // Exit the loop
     66                        }
     67                    } else {
     68                        do_action('bigcommerce/log', Error_Log::WARNING, __('No data returned from get_msf_categories.', 'bigcommerce'), []);
     69                        break; // Exit the loop
     70                    }
     71
     72                    do_action( 'bigcommerce/log', Error_Log::INFO, __( "Category import Page $currentPage of $totalPages", 'bigcommerce' ), [] );
     73                    $currentPage ++;
     74
     75                } while ( $currentPage <= $totalPages );
     76
     77                do_action( 'bigcommerce/log', Error_Log::INFO, __( "Total categories found: ".count($allCategories) , 'bigcommerce' ), [] );
     78
     79                if ( ! empty( $allCategories ) ) {
     80                    return $allCategories;
    3681                }
     82
    3783            }
    3884
  • bigcommerce/tags/5.1.0/src/BigCommerce/Plugin.php

    r3127781 r3139965  
    55
    66class Plugin {
    7     const VERSION = '5.0.8';
     7    const VERSION = '5.1.0';
    88
    99    protected static $_instance;
  • bigcommerce/trunk/CHANGELOG.md

    r3127781 r3139965  
    11# Changelog
     2
     3## [5.1.0]
     4
     5### Changed
     6- Sync all categories for MSF stores via API
    27
    38## [5.0.8]
     
    19201925
    19211926
     1927[5.1.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.8...5.1.0
    19221928[5.0.8]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.7...5.0.8
    19231929[5.0.7]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/5.0.6...5.0.7
  • bigcommerce/trunk/bigcommerce.php

    r3127781 r3139965  
    44Description:  Scale your ecommerce business with WordPress on the front-end and BigCommerce on the back end. Free up server resources from things like catalog management, processing payments, and managing fulfillment logistics.
    55Author:       BigCommerce
    6 Version:      5.0.8
     6Version:      5.1.0
    77Author URI:   https://www.bigcommerce.com/wordpress
    88Requires PHP: 7.4.0
  • bigcommerce/trunk/readme.txt

    r3127781 r3139965  
    44Requires at least: 5.2
    55Tested up to: 6.6
    6 Stable tag: 5.0.8
     6Stable tag: 5.1.0
    77Requires PHP: 7.4.0
    88License: GPLv2 or later
  • bigcommerce/trunk/src/BigCommerce/Import/Processors/Category_Import.php

    r2865940 r3139965  
    3030        try {
    3131            if ( Store_Settings::is_msf_on() ) {
    32                 $data = $this->get_msf_categories( $this->catalog_api );
    3332
    34                 if ( ! empty( $data ) ) {
    35                     return $data->getData();
     33                /* loop though all categories and return $allCategories */
     34                $allCategories = [];
     35                $currentPage = 1;
     36                $totalPages = 1;
     37
     38                do {
     39
     40                    $params['page'] = $currentPage;
     41
     42                    $data = $this->get_msf_categories( $this->catalog_api, $params);
     43
     44                    if ( ! empty( $data ) ) {
     45
     46                        $currentData = $data->getData();
     47
     48                        if (is_array($currentData) && !empty($currentData)) {
     49                            $allCategories = array_merge($allCategories, $currentData);
     50                        } else {
     51                            do_action('bigcommerce/log', Error_Log::WARNING, __('Current data is not an array or is empty.', 'bigcommerce'), []);
     52                        }
     53
     54                        if ( method_exists( $data, 'getMeta' ) ){
     55                            $meta = $data->getMeta();
     56                            if ( isset( $meta['pagination']['current_page'] ) && isset( $meta['pagination']['total_pages'] ) ) {
     57                                $currentPage = $meta['pagination']['current_page'];
     58                                $totalPages  = $meta['pagination']['total_pages'];
     59                            } else {
     60                                do_action( 'bigcommerce/log', Error_Log::WARNING, __( 'Pagination information is missing in the response meta.', 'bigcommerce' ), [] );
     61                                break; // Exit the loop
     62                            }
     63                        } else {
     64                            do_action('bigcommerce/log', Error_Log::WARNING, __('getMeta method does not exist on the data object.', 'bigcommerce'), []);
     65                            break; // Exit the loop
     66                        }
     67                    } else {
     68                        do_action('bigcommerce/log', Error_Log::WARNING, __('No data returned from get_msf_categories.', 'bigcommerce'), []);
     69                        break; // Exit the loop
     70                    }
     71
     72                    do_action( 'bigcommerce/log', Error_Log::INFO, __( "Category import Page $currentPage of $totalPages", 'bigcommerce' ), [] );
     73                    $currentPage ++;
     74
     75                } while ( $currentPage <= $totalPages );
     76
     77                do_action( 'bigcommerce/log', Error_Log::INFO, __( "Total categories found: ".count($allCategories) , 'bigcommerce' ), [] );
     78
     79                if ( ! empty( $allCategories ) ) {
     80                    return $allCategories;
    3681                }
     82
    3783            }
    3884
  • bigcommerce/trunk/src/BigCommerce/Plugin.php

    r3127781 r3139965  
    55
    66class Plugin {
    7     const VERSION = '5.0.8';
     7    const VERSION = '5.1.0';
    88
    99    protected static $_instance;
Note: See TracChangeset for help on using the changeset viewer.