Title: Plugin load function.php twice?
Last modified: October 1, 2018

---

# Plugin load function.php twice?

 *  Resolved [Nagase](https://wordpress.org/support/users/nagase/)
 * (@nagase)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/plugin-load-function-php-twice/)
 * Hello,
 * i have a static page where WordPress is loaded
    `require_once($_SERVER['DOCUMENT_ROOT'].'/
   wp-load.php');`
 * when flexible-shippingis is activate i have a ” Cannot redeclare XXX function”(
   xxx function is in function.php) on my page, it’s look like function.php is loaded
   twice.
    when i deactivate the plugin it’s ok.
 * maybe you have somewhere in plugin code an include (xxxxxx) instead include_once(
   xxxx)?

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

 *  Thread Starter [Nagase](https://wordpress.org/support/users/nagase/)
 * (@nagase)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/plugin-load-function-php-twice/#post-10739101)
 * wp : 4.9.8
    plugin : 2.1.7 Woocommerce: 3.4.4
 *  Thread Starter [Nagase](https://wordpress.org/support/users/nagase/)
 * (@nagase)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/plugin-load-function-php-twice/#post-10739181)
 * i have tried some version and it’s like that since v2.1.
 * v2.0.1 is ok !
 *  [ospiotr](https://wordpress.org/support/users/ospiotr/)
 * (@ospiotr)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/plugin-load-function-php-twice/#post-10745451)
 * Helllo [@nagase](https://wordpress.org/support/users/nagase/),
 * Using this code is not a good solution:
    `require_once($_SERVER['DOCUMENT_ROOT'].'/
   wp-load.php');`
 * you can hurt your WordPress installation that way. Please use the [WP AJAX API](https://codex.wordpress.org/AJAX_in_Plugins)
   instead.

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

The topic ‘Plugin load function.php twice?’ is closed to new replies.

 * ![](https://ps.w.org/flexible-shipping/assets/icon.svg?rev=2737045)
 * [Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping](https://wordpress.org/plugins/flexible-shipping/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flexible-shipping/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flexible-shipping/)
 * [Active Topics](https://wordpress.org/support/plugin/flexible-shipping/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flexible-shipping/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flexible-shipping/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [ospiotr](https://wordpress.org/support/users/ospiotr/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/plugin-load-function-php-twice/#post-10745451)
 * Status: resolved