Plugin Directory

Changeset 3138323


Ignore:
Timestamp:
08/20/2024 04:31:18 PM (7 months ago)
Author:
yukyhendiawan
Message:

update version 1.2.5

Location:
import-export-menu
Files:
85 added
10 edited

Legend:

Unmodified
Added
Removed
  • import-export-menu/trunk/README.txt

    r3126044 r3138323  
    44Requires at least: 6.0
    55Tested up to:      6.6
    6 Stable tag:        1.2.4
     6Stable tag:        1.2.5
    77Requires PHP:      7.4
    88License:           GPL-2.0-or-later
     
    1313== Description ==
    1414
    15 The Menu Import & Export plugin provides an easy and efficient way to manage your WordPress menus. With this plugin, you can seamlessly import and export your website menus, making it simple to transfer menu structures between different WordPress installations or to back up your menu configurations.
     15The Import Export Menu plugin provides an easy and efficient way to manage your WordPress menus. With this plugin, you can seamlessly import and export your website menus, making it simple to transfer menu structures between different WordPress installations or to back up your menu configurations.
    1616
    1717== Key Features: ==
     
    3030On the left panel, click "Plugins" and select "Add New."
    3131
    32 3. Search for "Menu Import & Export":
     323. Search for "Import Export Menu":
    3333On the Add Plugin page, locate the search box in the top right corner.
    34 Type "Menu Import & Export" in the search box.
     34Type "Import Export Menu" in the search box.
    3535
    36364. Install the Plugin:
    37 After finding the "Menu Import & Export" plugin, click the "Install Now" button below it.
     37After finding the "Import Export Menu" plugin, click the "Install Now" button below it.
    3838
    39395. Activate the Plugin:
     
    4141
    42426. You're Ready to Use the Plugin:
    43 After activation, navigate to the "Menu Import & Export" section in your WordPress dashboard to start importing and exporting menus.
     43After activation, navigate to the "Import Export Menu" section in your WordPress dashboard to start importing and exporting menus.
    4444
    4545== Frequently Asked Questions ==
     
    5555= Is the plugin compatible with all WordPress themes? =
    5656
    57 Yes, the Menu Import & Export plugin is designed to be compatible with all WordPress themes. It works with any theme that supports the WordPress menu system.
     57Yes, the Import Export Menu plugin is designed to be compatible with all WordPress themes. It works with any theme that supports the WordPress menu system.
    5858
    5959= Can I use this plugin to migrate menus between different WordPress sites? =
     
    6464
    6565== Changelog ==
    66 = Version: 1.2.4 =
    6766
    68 **Fix**
    69 * Fix prefix define
     67## [1.2.5](https://github.com/yukyhendiawan/import-export-menu/compare/1.2.4...1.2.5) (2024-08-20)
    7068
    71 = Version: 1.2.3 =
     69### Bug Fixes
     70* all linter issues ([db16d38](https://github.com/yukyhendiawan/import-export-menu/commit/db16d3888d6ed13a93fe52ffce335d09dfcbb5e0))
     71* enqueue style ([708eca6](https://github.com/yukyhendiawan/import-export-menu/commit/708eca6c7120ef5bbadfdbbe5478d7096575d284))
     72* enqueues the necessary css and js ([4bb5226](https://github.com/yukyhendiawan/import-export-menu/commit/4bb522623f771727a0039f958f39af4c62cbc234))
     73* remove all admin notices ([be813ca](https://github.com/yukyhendiawan/import-export-menu/commit/be813cae75062f6a2e83d2924651751d6cac1354))
    7274
    73 **Fix**
    74 * Fix import
     75### Code Refactoring
     76* admin import export ([e98b48f](https://github.com/yukyhendiawan/import-export-menu/commit/e98b48fb5de31096331494bcd228f576cbde0a6b))
     77* admin menu about ([2386c95](https://github.com/yukyhendiawan/import-export-menu/commit/2386c95de3a3e26ed008d0ae099a9cca0114cea3))
     78* before:release package ([8eea963](https://github.com/yukyhendiawan/import-export-menu/commit/8eea96332a778cd4b7eab3cf71389aa5d40b6a9f))
     79* distignore file ([15eadcb](https://github.com/yukyhendiawan/import-export-menu/commit/15eadcb5a335ae3babd1918004b6ba854fac565e))
     80* information plugin ([0ffc164](https://github.com/yukyhendiawan/import-export-menu/commit/0ffc1647ac873de13d8493c9d052558fba7f64b7))
     81* update icon, banner, and screenshots ([56360d6](https://github.com/yukyhendiawan/import-export-menu/commit/56360d6470615864c1e292617e42dc89865eea40))
    7582
    76 = Version: 1.2.2 =
    77 
    78 **Fix**
    79 * Plugin check
    80 
    81 = Version: 1.2.1 =
    82 
    83 **Fix**
    84 
    85 * Update plugin information
    86 
    87 = Version: 1.2.0 =
    88 
    89 **New**
    90 
    91 * Export & Import Menu
    92 
    93 = Version: 1.0.0 =
    94 
    95 **New**
    96 
    97 * Initial Release
     83### Build System
     84* setup plugin with various packages and dependencies ([42d3646](https://github.com/yukyhendiawan/import-export-menu/commit/42d3646c5378e26a24ae2466e96013d8aee65ec5))
    9885
    9986== Upgrade Notice ==
  • import-export-menu/trunk/admin/class-import-export-menu-admin.php

    r3126044 r3138323  
    5454
    5555    /**
    56      * Register the stylesheets for the admin area.
    57      *
    58      * This function enqueues the CSS file for the admin area of the plugin.
    59      * The CSS file is only enqueued when the 'toplevel_page_import-export-menu' admin page is loaded.
    60      *
    61      * @since 1.0.0
    62      *
    63      * @param string $hook The current admin page hook.
     56     * Enqueues the necessary CSS for the Import Export Menu admin page.
     57     *
     58     * @param string $hook The hook name for the current admin page.
    6459     *
    6560     * @return void
     
    6762    public function enqueue_styles( $hook ) {
    6863
    69         // If not, exit the function to prevent unnecessary loading of the CSS stylesheet.
    70         if ( 'toplevel_page_import-export-menu' !== $hook ) {
    71             return;
    72         }
    73 
    74         wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/import-export-menu-admin.css', array(), $this->version, 'all' );
    75     }
    76 
    77     /**
    78      * Register the JavaScript for the admin area.
    79      *
    80      * This function enqueues the JavaScript file for the admin area of the plugin.
    81      * The JavaScript file is only enqueued when the 'toplevel_page_import-export-menu' admin page is loaded.
    82      *
    83      * @since    1.0.0
    84      *
    85      * @param string $hook The current admin page hook.
     64        // Check if the current admin page is the Import Export Menu admin page or the About page.
     65        if ( 'toplevel_page_import-export-menu' === $hook || 'import-export-menu_page_information' === $hook ) {
     66            // Enqueue the CSS file for the Import Export Menu admin page.
     67            wp_enqueue_style(
     68                $this->plugin_name,
     69                plugins_url( 'import-export-menu' ) . '/assets/css/import-export-menu-admin.min.css',
     70                array(),
     71                $this->version
     72            );
     73        }
     74    }
     75
     76    /**
     77     * Enqueues the necessary scripts for the Import Export Menu admin page.
     78     *
     79     * This function is responsible for enqueuing the necessary scripts for the Import Export Menu admin page.
     80     * It checks if the current admin page is the Import Export Menu admin page or the "About" page.
     81     * If it is, it enqueues the SweetAlert JavaScript library, the main JavaScript file for the Import Export Menu admin page, and the admin-menu.min.js JavaScript file.
     82     * It also localizes the ajaxObject object, which contains the admin-ajax.php URL and a nonce for making AJAX requests.
     83     *
     84     * @param string $hook The hook name for the current admin page.
    8685     *
    8786     * @return void
     
    8988    public function enqueue_scripts( $hook ) {
    9089
    91         // If not, exit the function to prevent unnecessary loading of the CSS stylesheet.
    92         if ( 'toplevel_page_import-export-menu' !== $hook ) {
    93             return;
    94         }
    95 
    96         // Sweetalert.
    97         wp_enqueue_script( $this->plugin_name . '-sweetalert', plugin_dir_url( __FILE__ ) . 'js/sweetalert.min.js', array(), $this->version, true );
    98 
    99         // Script.
    100         wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/import-export-menu-admin.js', array( 'jquery' ), $this->version, true );
    101 
    102         wp_localize_script(
    103             $this->plugin_name,
    104             'ajaxObject',
    105             array(
    106                 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
    107                 'nonce'   => wp_create_nonce( 'ajax-nonce' ),
    108             )
    109         );
     90        if ( 'toplevel_page_import-export-menu' === $hook || 'import-export-menu_page_information' === $hook ) {
     91            // Enqueue the SweetAlert JavaScript library.
     92            wp_enqueue_script( $this->plugin_name . '-sweetalert', plugins_url( 'import-export-menu' ) . '/assets/js/sweetalert.min.js', array(), $this->version, true );
     93
     94            // Enqueue the main JavaScript file for the Import Export Menu admin page.
     95            wp_enqueue_script( $this->plugin_name, plugins_url( 'import-export-menu' ) . '/assets/js/import-export-menu-admin.js', array( 'jquery' ), $this->version, true );
     96
     97            // Enqueue the admin-menu.min.js JavaScript file.
     98            wp_enqueue_script( 'import-export-menu-script', plugins_url( 'import-export-menu' ) . '/assets/js/admin-menu.min.js', array(), $this->version, true );
     99
     100            // Localize the ajaxObject object.
     101            wp_localize_script(
     102                $this->plugin_name,
     103                'ajaxObject',
     104                array(
     105                    'ajaxUrl' => admin_url( 'admin-ajax.php' ),
     106                    'nonce'   => wp_create_nonce( 'ajax-nonce' ),
     107                )
     108            );
     109        }
    110110    }
    111111
     
    124124        // Check if the current page is in the WordPress admin area.
    125125        if ( is_admin() ) {
    126             if ( 'import-export-menu' === $plugin_page ) {
     126            if ( 'import-export-menu' === $plugin_page || 'information' === $plugin_page ) {
    127127                remove_all_actions( 'admin_notices' );
    128128            }
    129129        }
    130     }
    131 
    132     /**
    133      * Adds a new top-level menu page to the WordPress admin area.
    134      *
    135      * @since 1.0.0
    136      *
    137      * @return void
    138      */
    139     public function import_export_menu_add_page() {
    140         /**
    141          * Add a top-level menu page.
    142          *
    143          * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected.
    144          * @param string $menu_title The text to be used for the menu.
    145          * @param string $capability The capability required for this menu to be displayed to the user.
    146          * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu).
    147          * @param callable $callback The function to be called to output the content for this page.
    148          * @param string $icon_url The URL to the icon to be used for this menu.
    149          * @param int $position The position in the menu order this menu should appear.
    150          *
    151          * @return void
    152          */
    153         add_menu_page(
    154             __( 'Import Export Menu', 'import-export-menu' ),       // $page_title
    155             __( 'Import Export Menu', 'import-export-menu' ),       // $menu_title
    156             'manage_options',                                  // $capability
    157             'import-export-menu',                              // $menu_slug
    158             array( $this, 'import_export_menu_display_page' ), // $callback
    159             'dashicons-admin-generic',                         // $icon_url
    160             30                                                 // $position
    161         );
    162130    }
    163131
     
    172140        // Include the partial file that contains the HTML content.
    173141        include plugin_dir_path( __FILE__ ) . 'partials/import-export-menu.php';
     142    }
     143
     144    /**
     145     * Registers the top-level admin menu page and adds a submenu page for 'Import Export'.
     146     *
     147     * This function uses the WordPress add_menu_page() and add_submenu_page() functions to create
     148     * the necessary admin menu structure. It also sets up the callback functions for
     149     * the top-level and submenu pages.
     150     *
     151     * @return void
     152     */
     153    public function register_admin_menu_page() {
     154        add_menu_page(
     155            __( 'Import Export Menu', 'import-export-menu' ), // Page title.
     156            __( 'Import Export Menu', 'import-export-menu' ), // Menu title.
     157            'manage_options', // Capability required.
     158            'import-export-menu', // Menu slug.
     159            array( $this, 'callback_template_for_import_export_menu' ), // Callback function.
     160            'dashicons-admin-generic', // Icon URL.
     161            30 // $position.
     162        );
     163
     164        add_submenu_page(
     165            'import-export-menu', // Parent menu slug.
     166            __( 'Information', 'import-export-menu' ), // Page title.
     167            __( 'Information', 'import-export-menu' ), // Menu title.
     168            'manage_options', // Capability required.
     169            'information', // Menu slug.
     170            array( $this, 'callback_template_for_information_menu' ) // Callback function.
     171        );
     172    }
     173
     174    /**
     175     * Loads the template for the 'Import Export' menu page in the plugin.
     176     *
     177     * This function constructs the path to the template file located
     178     * in the plugin directory and includes it if it exists.
     179     */
     180    public function callback_template_for_import_export_menu() {
     181        // Define the path to the template file.
     182        $template_path = plugin_dir_path( __FILE__ ) . 'partials/import-export-menu.php';
     183
     184        // Check if the template file exists.
     185        if ( file_exists( $template_path ) ) {
     186            // Include the template file if it exists.
     187            include $template_path;
     188        }
     189    }
     190
     191    /**
     192     * Loads the template for the 'Information' menu page in the plugin.
     193     *
     194     * This function constructs the path to the template file located
     195     * in the plugin directory and includes it if it exists.
     196     */
     197    public function callback_template_for_information_menu() {
     198        // Define the path to the template file.
     199        $template_path = plugin_dir_path( __FILE__ ) . 'partials/content.php';
     200
     201        // Check if the template file exists.
     202        if ( file_exists( $template_path ) ) {
     203            // Include the template file if it exists.
     204            include $template_path;
     205        }
    174206    }
    175207
  • import-export-menu/trunk/admin/partials/import-export-menu.php

    r3126044 r3138323  
    2020
    2121<div class="wrap">
    22     <h1><?php esc_html_e( 'Export & Import Menu', 'import-export-menu' ); ?></h1>
     22    <h1><?php esc_html_e( 'Import Export Menu', 'import-export-menu' ); ?></h1>
    2323    <button type="button" class="export">
    2424        <?php esc_html_e( 'Export Menu', 'import-export-menu' ); ?>
  • import-export-menu/trunk/import-export-menu.php

    r3126044 r3138323  
    1616 * Plugin URI:        https://yukyhendiawan.com
    1717 * Description:       This plugin allows you to export and import menus in WordPress, making it easier to manage and migrate menu structures between sites.
    18  * Version:           1.2.4
     18 * Version:           1.2.5
    1919 * Author:            Yuky Hendiawan
    2020 * Author URI:        https://yukyhendiawan.com/
     
    3636 */
    3737define( 'IMPORT_EXPORT_MENU_PLUGIN_NAME', 'Import Export Menu' );
    38 define( 'IMPORT_EXPORT_MENU_VERSION', '1.2.4' );
     38define( 'IMPORT_EXPORT_MENU_VERSION', '1.2.5' );
    3939
    4040/**
  • import-export-menu/trunk/includes/class-import-export-menu.php

    r3126044 r3138323  
    153153        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
    154154        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
    155         $this->loader->add_action( 'admin_menu', $plugin_admin, 'import_export_menu_add_page' );
     155        $this->loader->add_action( 'admin_menu', $plugin_admin, 'register_admin_menu_page' );
    156156
    157157        // Add custom MIME types to the allowed upload types.
Note: See TracChangeset for help on using the changeset viewer.