Title: Custom Code Export error
Last modified: August 30, 2016

---

# Custom Code Export error

 *  Resolved [david](https://wordpress.org/support/users/dskirk/)
 * (@dskirk)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/custom-code-export-error/)
 * I tried the new feature to export my custom code and receive this error:
 * > Warning: ksort() expects parameter 1 to be array, boolean given in /home/mary117/
   > public_html/wp-content/plugins/bulletproof-security/admin/core/core-export-
   > import.php on line 62
   > Warning: Invalid argument supplied for foreach() in /home/mary117/public_html/
   > wp-content/plugins/bulletproof-security/admin/core/core-export-import.php on
   > line 97
 * Please advise. Otherwise, all seems working well. Thanks,
    david
 * [https://wordpress.org/plugins/bulletproof-security/](https://wordpress.org/plugins/bulletproof-security/)

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

 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/custom-code-export-error/#post-6400790)
 * File: core-export-import.php
    code line 62: `ksort($CC_wpadmin_options);` code
   line 97: `foreach ( $CC_wpadmin_options as $key => $value ) {`
 * Yep, we are aware of this problem. What is causing the error is that your wp-
   admin Custom Code DB options have never been saved before so they do not exist
   yet. The fix is to click the Save wp-admin Custom Code button, which will create/
   save your wp-admin DB options. You should then be able to Export and Import Custom
   Code successfully. We will be permanently fixing this error/problem from occurring
   in BPS .52.3 by pre-saving the wp-admin Custom Code DB options on BPS plugin 
   upgrades and when running the Setup Wizard for new BPS installations.
 *  Thread Starter [david](https://wordpress.org/support/users/dskirk/)
 * (@dskirk)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/custom-code-export-error/#post-6400813)
 * Thanks. I had custom settings for root but not wp-admin. I did what you said 
   and the error disappeared. However, the popup window that states success and 
   shows a button to download the zip file does not appear. The screen blinks quickly,
   but no message. The file was created successfully, as I found it via FTP. I hope
   the next release makes the message stay on screen. Thanks for your promptness.
   
   david
 *  Plugin Author [AITpro](https://wordpress.org/support/users/aitpro/)
 * (@aitpro)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/custom-code-export-error/#post-6400820)
 * The displayed success message with the download button does stay on the page 
   and even after you click the download button (intentional in case of orphaned
   downloads). I think what may be happening is the page jumps/is shifted down so
   that you are not seeing the displayed success message in your Browser viewing
   area. Click the Export button and then scroll to the top of the Custom Code page.
 *  Thread Starter [david](https://wordpress.org/support/users/dskirk/)
 * (@dskirk)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/custom-code-export-error/#post-6400825)
 * Aha! You are correct. Thank you for adding this very very nice feature. I have
   several sites and use the same features with minor variations on all of them.
   This is a nice feature and was unanticipated. Surprise and delight. Thank you.
   I will close this.
    david

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

The topic ‘Custom Code Export error’ is closed to new replies.

 * ![](https://ps.w.org/bulletproof-security/assets/icon-128x128.png?rev=1731938)
 * [BulletProof Security](https://wordpress.org/plugins/bulletproof-security/)
 * [Support Threads](https://wordpress.org/support/plugin/bulletproof-security/)
 * [Active Topics](https://wordpress.org/support/plugin/bulletproof-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bulletproof-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bulletproof-security/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [david](https://wordpress.org/support/users/dskirk/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/custom-code-export-error/#post-6400825)
 * Status: resolved