Title: Fatal error: Uncaught Error: Call to undefined function prepare_request()
Last modified: June 12, 2019

---

# Fatal error: Uncaught Error: Call to undefined function prepare_request()

 *  Resolved [markenm](https://wordpress.org/support/users/markenm/)
 * (@markenm)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-prepare_request/)
 * I’ve started receiving an error message under Woocommerce > Status and all of
   the products have started intermittently experiencing 504 Errors.
 * I think that the error relates to the theme but unfortunately the theme provider
   no longer offers updates or support, so there’s no fix coming and no help from
   them.
 * What I really need is a quick fix to tide me over until I can replace the theme
   entirely. Can anyone help me out.
 * The full error message is:
    Error Details ============= An error of type E_ERROR
   was caused in line 87 of the file /home/xxx/public_html/xxx/wp-content/themes/
   avery/inc/update.php. Error message: Uncaught Error: Call to undefined function
   prepare_request() in /home/xxx/public_html/xxx/wp-content/themes/avery/inc/update.
   php:87 Stack trace: #0 /home/xxx/public_html/xxx/wp-includes/class-wp-hook.php(
   286): my_theme_api_call(false, ‘theme_informati…’, Object(stdClass)) #1 /home/
   xxx/public_html/xxx/wp-includes/plugin.php(208): WP_Hook->apply_filters(false,
   Array) #2 /home/xxx/public_html/xxx/wp-admin/includes/theme.php(480): apply_filters(‘
   themes_api’, false, ‘theme_informati…’, Object(stdClass)) #3 /home/xxx/public_html/
   xxx/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-status.php(244):
   themes_api(‘theme_informati…’, Object(stdClass)) #4 /home/xxx/public_html/xxx/
   wp-content/plugins/woocommerce/includes/api/v2/class-wc-rest-system-status-v2-
   controller.php(944): WC_Admin_Status::get_latest_theme_version(Object(WP_Theme))#
   5 /home/xxx/public_html/xxx/w
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffatal-error-uncaught-error-call-to-undefined-function-prepare_request%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Ryan Ray, a11n](https://wordpress.org/support/users/ryanr14/)
 * (@ryanr14)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-prepare_request/#post-11632365)
 * Hi [@markenm](https://wordpress.org/support/users/markenm/),
 * That first error `Uncaught Error: Call to undefined function prepare_request()`
   says that in the avery/inc/update.php file on line 87 it’s trying to us a function
   that doesn’t exist.
 * I’m not sure what that update file does in Avery, but it doesn’t seem to be necessarily
   causing the 504. At least from what I can see. First though, it seems Avery is
   still in development and you could get updates and support for it from this site.–
   > [https://www.simplethemes.com/wordpress-themes/theme/avery](https://www.simplethemes.com/wordpress-themes/theme/avery)
 * Back to 504 land, from my side I can’t tell or see what is causing it. Alongside
   double checking that you can’t get Avery updated, or report that error to the
   theme developer, as your host if they have any evidence/logs of what is causing
   the 504. Perhaps they are related, but your host should know more. 🙂
 * Let us know what you find, thanks!
 *  Thread Starter [markenm](https://wordpress.org/support/users/markenm/)
 * (@markenm)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-prepare_request/#post-11632475)
 * Simple themes is where I got the theme from in the first place and he started
   ignoring help requests a couple of years ago and there haven’t been any updates
   in just as long.
 * I also spoke with my hosts who said:
 * “We were able to replicate the problem and strace the process. It appears that
   there is a very very large self-referring requests, which the application generates.
   You can check the entire trace file here:
 * We tried using different PHP versions, we ensured that all files/folders have
   correct permissions and we cleared all cache on the server. However, I am afraid
   that nothing worked. We also do not see any error logs on the server indicating
   problems with the server environment. It is best to consult with the website 
   developers for further assistance”
 * Unfortunately for me… im the developer so I cant help myself…
 *  Thread Starter [markenm](https://wordpress.org/support/users/markenm/)
 * (@markenm)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-prepare_request/#post-11634228)
 * So I’ve ‘commented out’ the section in the update.php file, which seems to have
   fixed the fatal error when access WooCommerce > Status, but I’m still getting
   504 errors when I try to enter product pages.
 * The entire website, from core pages, to CPT posts to the main shop page all work
   perfectly and load within seconds, but 9 times out of 10, when I click a on a
   product I get a 504 error.
 *  Plugin Support [Fernando a11n](https://wordpress.org/support/users/fhaps/)
 * (@fhaps)
 * Automattic Happiness Engineer
 * [6 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-prepare_request/#post-11641744)
 * > there is a very very large self-referring requests, which the application generates.
   > You can check the entire trace file here:
 * I’m guessing you removed details from the message, for clarity here. But, does
   that trace file give you any clues about where could the request be generating
   from?
 * Given what they say, about the large request being made, I’m guessing this could
   be a request generated by a plugin on your site, which only kicks in when opening
   product pages. You may want to test disabling all plugins except for WooCommerce,
   and temporarily enabling the Storefront theme, and see if the 504 errors still
   happen under that default setup.
 * It might be that a plugin is causing this unnecessary burden on the server that
   leads to the 504 errors.
 *  Plugin Support [Fernando a11n](https://wordpress.org/support/users/fhaps/)
 * (@fhaps)
 * Automattic Happiness Engineer
 * [6 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-prepare_request/#post-11661586)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   if you have any further questions, you can start a new thread.

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

The topic ‘Fatal error: Uncaught Error: Call to undefined function prepare_request()’
is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [gateway timeout](https://wordpress.org/support/topic-tag/gateway-timeout/)

 * 5 replies
 * 3 participants
 * Last reply from: [Fernando a11n](https://wordpress.org/support/users/fhaps/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/fatal-error-uncaught-error-call-to-undefined-function-prepare_request/#post-11661586)
 * Status: resolved