Plugin Directory

Changeset 3222391


Ignore:
Timestamp:
01/14/2025 04:13:12 PM (15 months ago)
Author:
addonspress
Message:

1.4.5

Location:
advanced-import
Files:
40 added
3 edited

Legend:

Unmodified
Added
Removed
  • advanced-import/trunk/admin/class-advanced-import-admin.php

    r3140716 r3222391  
    10851085
    10861086        }
    1087         /*Put nav last*/
     1087        /*Put nav 1last*/
    10881088        $nav = isset( $content['nav_menu_item'] ) ? $content['nav_menu_item'] : array();
    10891089        if ( $nav ) {
    10901090            unset( $content['nav_menu_item'] );
    10911091            $content['nav_menu_item'] = $nav;
     1092        }
     1093
     1094        /*
     1095        Put last*/
     1096        /*For Gutenberg navigation*/
     1097        $nav = isset( $content['wp_navigation'] ) ? $content['wp_navigation'] : array();
     1098        if ( $nav ) {
     1099            unset( $content['wp_navigation'] );
     1100            $content['wp_navigation'] = $nav;
     1101        }
     1102
     1103        $template_part = isset( $content['wp_template_part'] ) ? $content['wp_template_part'] : array();
     1104        if ( $template_part ) {
     1105            unset( $content['wp_template_part'] );
     1106            $content['wp_template_part'] = $template_part;
    10921107        }
    10931108        /*check if there is files*/
     
    20152030            }
    20162031        }
     2032
     2033        /*Gutenberg ref id changed*/
     2034        if ( preg_match_all( '/\{"ref":(\d+)\}/', $content, $matches ) ) {
     2035            foreach ( $matches[0] as $match_id => $string ) {
     2036                $new_id = $this->imported_post_id( $matches[1][ $match_id ] );
     2037                if ( $new_id ) {
     2038                    $content = str_replace( $string, '{"ref":' . $new_id . '}', $content );
     2039                }
     2040            }
     2041        }
     2042        /* Replace for menu item like "page","id":147 */
     2043        if ( preg_match_all( '/"page","id":(\d+)/', $content, $matches ) ) {
     2044            foreach ( $matches[0] as $match_id => $string ) {
     2045                $old_id = $matches[1][ $match_id ];
     2046                $new_id = $this->imported_post_id( $old_id );
     2047                if ( $new_id ) {
     2048                    $content = str_replace( $string, '"page","id":' . $new_id, $content );
     2049                }
     2050            }
     2051        }
     2052
     2053        $replaced_data = apply_filters(
     2054            'advanced_import_replace_content_string',
     2055            $content
     2056        );
    20172057        return $content;
    20182058    }
     
    23392379
    23402380        /*menu data*/
    2341         $menu_ids = $theme_options['menu'];
     2381        $menu_ids = isset( $theme_options['menu'] ) ? $theme_options['menu'] : array();
    23422382
    23432383        /*we also want to update the widget area manager options.*/
     
    23792419        Menu Start*/
    23802420        $save = array();
    2381         foreach ( $menu_ids as $menu_id => $term_id ) {
    2382             $new_term_id = $this->imported_term_id( $term_id );
    2383             if ( $new_term_id ) {
    2384                 $save[ $menu_id ] = $new_term_id;
     2421        if ( $menu_ids ) {
     2422            foreach ( $menu_ids as $menu_id => $term_id ) {
     2423                $new_term_id = $this->imported_term_id( $term_id );
     2424                if ( $new_term_id ) {
     2425                    $save[ $menu_id ] = $new_term_id;
     2426                }
    23852427            }
    23862428        }
  • advanced-import/trunk/advanced-import.php

    r3186508 r3222391  
    1414 * Plugin Name:       Advanced Import
    1515 * Plugin URI:        https://addonspress.com/item/advanced-import
    16  * Description:       Easily import demo data starter site packages or Migrate your site data
    17  * Version:           1.4.4
     16 * Description:       Easily import demo data for WordPress sites, including posts, pages, media, widgets, customizer settings, and Gutenberg Blocks with ease.
     17 * Version:           1.4.5
    1818 * Author:            AddonsPress
    1919 * Author URI:        https://addonspress.com/
     
    2525
    2626/*Define Constants for this plugin*/
    27 define( 'ADVANCED_IMPORT_VERSION', '1.4.4' );
     27define( 'ADVANCED_IMPORT_VERSION', '1.4.5' );
    2828define( 'ADVANCED_IMPORT_PLUGIN_NAME', 'advanced-import' );
    2929define( 'ADVANCED_IMPORT_PATH', plugin_dir_path( __FILE__ ) );
  • advanced-import/trunk/readme.txt

    r3186508 r3222391  
    1 === Advanced Import : One Click Import for WordPress or Theme Demo Data ===
    2 
    3 Contributors: addonspress, codersantosh, acmeit
    4 Donate link: https://addonspress.com/
    5 Tags: advanced import, demo import, theme import, widget import, customizer import
    6 Requires at least: 5.0
    7 Tested up to: 6.7
    8 Requires PHP: 5.6.20
    9 Stable tag: 1.4.4
    10 License: GPLv2 or later
    11 License URI: http://www.gnu.org/licenses/gpl-2.0.html
    12 
    13 Advanced Import is a very flexible plugin which convenient user to import site data( posts, page, media and even widget and customizer option ).
     1=== Advanced Import: One-Click Demo Import for WordPress ===
     2
     3Contributors: addonspress, codersantosh, acmeit 
     4Donate link: https://addonspress.com/ 
     5Tags: demo import, theme import, widget import, customizer import, gutenberg import 
     6Requires at least: 5.0 
     7Tested up to: 6.7 
     8Requires PHP: 5.6.20 
     9Stable tag: 1.4.
     10License: GPLv2 or later 
     11License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     12
     13Advanced Import simplifies importing demo data for WordPress sites, enabling users to import posts, pages, media, widgets, customizer settings, and Gutenberg Blocks with ease.
    1414
    1515== Description ==
     
    1717Import Data or Demo Content which is exported by [Advanced Export](https://wordpress.org/plugins/advanced-export/)
    1818
    19 Advanced Import is one of the best and powerful data importer plugin. It has several features which make more manageable and convenient to WordPress user to import their WordPress site data from another website.
    20 
    21 It is designed specially for theme developer who wants to provide demo data to their customer but it can be used for migration purpose too.
    22 
    23 While you use Demo Import features of themes, Advanced Import may fetches screenshots, images and templates(demo) JSON files from a respective theme site. This helps you to import your site with a single click. You must accept the terms and privacy of the themes you are using to use Demo Import ( Starter Sites Template Library ) Features.
    24 
    25 View [Advanced Import](https://www.addonspress.com/wordpress-plugins/advanced-import/) Details and Documentation
    26 
    27 Some listed features of Advanced Import are given below :
    28 
    29 * Import demo starter sites very easily
    30 * Import widget
    31 * Import option
    32 * Import media,
    33 * Import pages,
    34 * Import post
    35 * Import custom post type
    36 * Import actual media files
     19Advanced Import is the ultimate solution for WordPress theme and plugin developers who want to provide a seamless demo import experience for their users. With a simple one-click interface, it allows users to import demo content, widgets, customizer settings, and even Gutenberg block data effortlessly.
     20
     21### Key Features
     22- **One-Click Demo Import:** Easily import all demo content with a single click.
     23- **Customizer Settings Import:** Retain your theme's look and feel by importing customizer settings.
     24- **Widget Data Import:** Quickly set up widgets to match your demo layout.
     25- **Gutenberg Blocks Import:** Import block-based content for modern themes.
     26- **Media Files Import:** Seamlessly upload and integrate demo media.
     27- **Developer-Friendly Hooks:** Extend or customize the import process with available actions and filters.
     28
     29### Why Use Advanced Import?
     30Whether you're a theme developer offering demo content or a user setting up a site, Advanced Import makes the process hassle-free. It saves time, reduces manual setup effort, and ensures consistency between demo and live sites.
     31
    3732
    3833== Features for Theme Author ==
     
    4035* Code/Plugin example available
    4136* Support for the premium version or premium plugin of the free theme
    42 * Install separate dependent plugin/s for each demo starter packages of the theme
    43 * Categorized available demo import starter packages to type and categories
     37* Install separate dependent plugin/s for each demo starter package of the theme
     38* Categorized available demo import starter package to type and categories
    4439* Search filter keywords for demo starter packages
    4540* Sufficient hooks to customize the plugin design and functionality
     
    6156There are two ways to install any Advanced Import Plugin:-
    62571. Upload zip file from Dashboard->Plugin->Add New "upload plugin".
    63 2. Extract Advanced Import and placed it to the "/wp-content/plugins/" directory.
     582. Extract Advanced Import and place it in the "/wp-content/plugins/" directory.
    6459    - Activate the plugin through the "Plugins" menu in WordPress.
    6560
     
    6762== Frequently Asked Questions ==
    6863
    69 = Is Advanced Import is a free plugin? =
     64= Is Advanced Import a free plugin? =
    7065
    7166Yes, it is a free plugin.
     
    7873
    7974Login to your WordPress dashboard, go to Appearance -> Demo Import.
    80 You can also find Import zip options on WordPress dashboard -> Tools -> Advanced Import.
     75You can also find Import zip options on the WordPress dashboard -> Tools -> Advanced Import.
    8176
    8277= Do I need to check to include media while Export? =
     
    8984First of all, you need to Export your theme demo data from your live demo site using [Advanced Export](https://wordpress.org/plugins/advanced-export/) plugin.
    9085Export the zip file, it should contain 3 files content.json, options.json and widgets.json.
    91 If you are submitting theme on WordPress dot org, you are not allowed to include Demo files ( XML, JSON, ZIP), You have to create a separate plugin for your theme/company. We would like to highly recommend to create a single plugin for your all themes. For other platforms, you may add code on your theme.
     86If you are submitting a theme on WordPress dot org, you are not allowed to include Demo files ( XML, JSON, ZIP), You have to create a separate plugin for your theme/company. We would like to highly recommend creating a single plugin for your all themes. For other platforms, you may add code to your theme.
    9287Code Example :
     88
    9389`
    9490function prefix_demo_import_lists(){
     
    179175= Do I need to assign "Front page", "Posts page" and "Menu Locations" after the importer is done or do they automatically assign? =
    180176
    181 You don't need to assign them manually, they will be automatically assigned. Theme author also doesn't have to write additional code for it.
    182 
    183 = I am a theme author and I would like to customize it for my theme, Can you list hooks available on Advanced Import plugin? =
    184 
    185 Here are some important list of filter hooks:
     177You don't need to assign them manually, they will be automatically assigned. The theme author also doesn't have to write additional code for it.
     178
     179= I am a theme author and I would like to customize it for my theme, Can you list hooks available on theme Advanced Import plugin? =
     180
     181Here is an important list of filter hooks:
    186182
    187183- advanced_import_is_template_available
     
    199195- advanced_import_update_value_['option-name']
    200196- advanced_import_menu_hook_suffix
    201 
    202 Here are some important list of action hooks:
     197- advanced_import_replace_content_string
     198
     199Here is an important list of action hooks:
    203200
    204201- advanced_import_before_demo_import_screen
     
    211208- advanced_import_after_complete_screen
    212209
    213 = I would like to develop a companion/starter sites/toolset plugin for my theme/company, Do you have any starter plugin? =
    214 
    215 We don't have any starter plugin but we have developed a plugin for [Acme Themes](https://www.acmethemes.com/). The plugin name is [Acme Demo Setup](https://wordpress.org/plugins/acme-demo-setup/), you can download and view the code of the plugin and develop one for yourself.
    216 
    217 = Are there any themes using these plugin? =
    218 
    219 Yes, many themes are using this plugin, for an example, you can look on [CosmosWP Theme](https://cosmoswp.com/)
     210= I would like to develop a companion/starter sites/toolset plugin for my theme/company, Do you have any starter plugins? =
     211
     212We don't have any starter plugin but we have developed a plugins for [Acme Themes](https://www.acmethemes.com/). The plugin name is [Acme Demo Setup](https://wordpress.org/plugins/acme-demo-setup/), you can download and view the code of the plugin and develop one for yourself.
     213
     214= Are there any themes using these plugins? =
     215
     216Yes, many themes are using this plugin, for example, you can look on [CosmosWP Theme](https://cosmoswp.com/)
    220217
    221218== Screenshots ==
     
    230227== Changelog ==
    231228
     229= 1.4.5 - 2025-01-14 =
     230* Added: Introduced support for Blocks Navigation feature.
     231* Added: Implemented a new filter hook `advanced_import_replace_content_string`.
     232* Updated: Enhanced plugin tagline title for clearer comprehension.
     233
    232234= 1.4.4 - 2024-11-12 =
    233235* Added: Tested with the latest WordPress
     
    238240
    239241= 1.4.2 - 2024-08-16 =
    240 * Added: Developers can now enable plugin installation from a URL by including source in the demo list array. This is ideal for plugins hosted outside of WordPress.org. Important: If a recommended plugin is already available on WordPress.org, there's no need to use the "source" option.
     242* Added: Developers can now enable plugin installation from a URL by including theme source in the demo list array. This is ideal for plugins hosted outside of WordPress.org. Important: If a recommended plugin is already available on WordPress.org, there's no need to use the "source" option.
    241243
    242244`
Note: See TracChangeset for help on using the changeset viewer.