Title: [Plugin: Duplicate Menu] Parse error on activation
Last modified: August 20, 2016

---

# [Plugin: Duplicate Menu] Parse error on activation

 *  Resolved [araucaria](https://wordpress.org/support/users/araucaria/)
 * (@araucaria)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/)
 * When I activate the plugin it throws an error:
    `Parse error: syntax error, unexpected
   T_FUNCTION in /home/tgc_dev/sptc.the-graphics.net/wp-content/plugins/duplicate-
   menu/duplicate-menu.php on line 41`
 * I edited the code to make the creation of the page a separate function:
 *     ```
       // WordPress actions
       if( IS_ADMIN )
       {
           add_action( 'admin_menu', 'duplicate_menu_admin_page' );
   
       }
       function duplicate_menu_admin_page () {
       	add_theme_page( 'Duplicate Menu', 'Duplicate Menu', 'manage_options', 'duplicate-menu', array( 'DuplicateMenu', 'options_screen' ) );
       }
       ```
   
 * With that change the plugin seems to work fine. Thanks for this – I’ve been looking
   for a way to easily duplicate a menu!
 * – Chris
 * [http://wordpress.org/extend/plugins/duplicate-menu/](http://wordpress.org/extend/plugins/duplicate-menu/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [Sridhar Katakam](https://wordpress.org/support/users/srikat/)
 * (@srikat)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053707)
 * Thank you Chris.
 * Faced the same issue, came here to report and found your working solution!
 *  [webpagedesign](https://wordpress.org/support/users/webpagedesign/)
 * (@webpagedesign)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053788)
 * Awesome, the fix works!
 * This plugin will save me so much time 😀
 *  Plugin Author [Jon Christopher](https://wordpress.org/support/users/jchristopher/)
 * (@jchristopher)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053789)
 * Thanks for the report/feedback. I’ll make sure to make the change for the next
   release, the way the function is implemented is a PHP 5.3+ feature, sorry about
   that!
 *  Plugin Author [Jon Christopher](https://wordpress.org/support/users/jchristopher/)
 * (@jchristopher)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053790)
 * Version 0.1.1 solves this issue, thanks again!
 *  [morcom](https://wordpress.org/support/users/morcom/)
 * (@morcom)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053794)
 * Hi Jonathan, great plugin which will come in very handy. My problem is that I
   get the following error when I use it and it gives a partial copy.
    My menus 
   are quite large as we are an online directory so I presume that may be the timeout
   problem
 * > Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\new\
   > wp-includes\plugin.php on line 161
 * Not sure that anything can be done about this but thought I’d ask.
    By the way
   I’m doing this on my local WAMP machine so no host gets upset
 * Regards
 * Fred Morgan
 *  Plugin Author [Jon Christopher](https://wordpress.org/support/users/jchristopher/)
 * (@jchristopher)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053796)
 * Hey Fred, those must be some huge Menus! It makes sense that you get a partial
   copy because the plugin periodically saves the Menu it’s working with as it’s
   working with it. I’ll see what I can do to alter the execution time, but if it’s
   possible for you (and I think it should be in your local environment) you can
   edit your php.ini file and update the max execution time.
 *  [morcom](https://wordpress.org/support/users/morcom/)
 * (@morcom)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053797)
 * Hi Jonathan, yes it is pretty big and maybe get bigger as the the site expands.
   It also goes to 2nd, 3rd and 4th sub-menu levels.
    Should have thought about 
   the php.ini file which at local machine is accessible so will try it and let 
   you know. Working on local level is fine but problem will come if/when I want
   to import/export just the menu which I don’t believe is possible at the moment.
   That would be good to get your teeth into.
 * Regards and thanks
 * Fred
 *  Plugin Author [Jon Christopher](https://wordpress.org/support/users/jchristopher/)
 * (@jchristopher)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053798)
 * Yeah definitely let me know if editing your php.ini works locally. In the meantime
   there are some things I can do in the plugin programmatically to increase that
   time limit just for the plugin script execution itself.
 * I think you’re right, that it’s not possible to import/export Menus by themselves,
   but perhaps that’s something this plugin could do in a feature version as well…
   I’ll have that rattle around my brain a little bit!
 *  [morcom](https://wordpress.org/support/users/morcom/)
 * (@morcom)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053799)
 * Update:
    php.ini _mainmenu-max\_execution\_time = **60**_ fixed my problem.
 * Thanks
 * Fred
 *  [morcom](https://wordpress.org/support/users/morcom/)
 * (@morcom)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053800)
 * Sorry should have read _max\_execution\_time = **60**_

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘[Plugin: Duplicate Menu] Parse error on activation’ is closed to new 
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/duplicate-menu.svg)
 * [Duplicate Menu](https://wordpress.org/plugins/duplicate-menu/)
 * [Support Threads](https://wordpress.org/support/plugin/duplicate-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/duplicate-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duplicate-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duplicate-menu/reviews/)

## Tags

 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)

 * 10 replies
 * 5 participants
 * Last reply from: [morcom](https://wordpress.org/support/users/morcom/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-duplicate-menu-parse-error-on-activation/#post-3053800)
 * Status: resolved