Title: Errors in plugin code
Last modified: August 22, 2016

---

# Errors in plugin code

 *  Resolved [pik256](https://wordpress.org/support/users/pik256/)
 * (@pik256)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/errors-in-plugin-code/)
 * You have at least 2 errors in your code.
 * 1. I use bad behavior plugin. It use table with a field named ‘key’. When you
   clone table then an error occurs:
 * > You have an error in your SQL syntax; check the manual that corresponds to 
   > your MySQL server version for the right syntax to use near ‘key FROM bio_4_bad_behavior
   > WHERE key LIKE ….
 * this is because key is reserved MySQL word. You need use field names in `backticks`
   
   I did not want to struggle wit it. I simply disabled BB plugin and deleted its
   table. After cloning I could reenable plugin and it recreate the table.
 * 2. This is worse. This is fatal. When you enable advanced option to “Keep users
   and roles from duplicated site” then cloning stops before successful finish and
   do not copy all users. I struggled with it an hour and finally when I enabled
   error reporting I saw the following fatal error:
 * > PHP Fatal error: Cannot redeclare user_array_map() (previously declared in …
   > duplicate.php…)
 * This is because you declare function user_array_map() in a loop. When you relocate
   declaration before a loop then code works properly (duplicates all roles).
 * [https://wordpress.org/plugins/multisite-clone-duplicator/](https://wordpress.org/plugins/multisite-clone-duplicator/)

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

 *  Plugin Author [Pierre Dargham](https://wordpress.org/support/users/pdargham/)
 * (@pdargham)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/errors-in-plugin-code/#post-5595953)
 * Thank you for reporting those two errors !
 * I just made the bugfixes. We will run a few more tests and it will available 
   in the next version of the plugin (probably within two weeks from now).
 * Best regards,
 * Pierre D.
 *  [simon696](https://wordpress.org/support/users/simon696/)
 * (@simon696)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/errors-in-plugin-code/#post-5596023)
 * Hi Pierre,
    is it almost ready the new version fixed?
 * Best regards
 *  Plugin Author [Pierre Dargham](https://wordpress.org/support/users/pdargham/)
 * (@pdargham)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/errors-in-plugin-code/#post-5596050)
 * Hi Simon
 * Version 1.1.0 was released today !
 * Best regards

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

The topic ‘Errors in plugin code’ is closed to new replies.

 * ![](https://ps.w.org/multisite-clone-duplicator/assets/icon-256x256.png?rev=1011466)
 * [MultiSite Clone Duplicator](https://wordpress.org/plugins/multisite-clone-duplicator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/multisite-clone-duplicator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/multisite-clone-duplicator/)
 * [Active Topics](https://wordpress.org/support/plugin/multisite-clone-duplicator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multisite-clone-duplicator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multisite-clone-duplicator/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Pierre Dargham](https://wordpress.org/support/users/pdargham/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/errors-in-plugin-code/#post-5596050)
 * Status: resolved