title: Persistent 504 Timeouts with WooCommerce
body: <p>I am consistently getting 504 "Gateway Timeout" errors when trying to update posts, settings, or other data in Wordpress. This is on a shared NetworkSolutions host, and Network Solutions support told me:</p>
  
  <blockquote>
    <p>These errors occur when the SSL Proxy tier "Times out" waiting for code on your hosting package to execute or load. Our SSL Proxy admins are not able to raise the timeout settings on the proxy server without negatively impacting performance globally. The only solutions are to not use an SSL on your site, or to optimize your code. If your code is able to complete loading server-side and be delivered to a client machine in under 30 seconds, the timeouts will not occur on your site(s). For example, your site has 30 .CSS files and 38 .JS files. There should be less than 10 of each on an optimized site, and having more will increase the chance of the SSL proxy timing out waiting for these to be called, downloaded, and rendered.</p>
  </blockquote>
  
  <p>I have already attempted to set <code>max_execution_time = 1600</code> and <code>memory_limit = 128M</code> in php.ini. And it doesn't seem to matter if I force https in the Wordpress Admin, or just use http.</p>
  
  <p>We have a fairly complex Wordpress install (see the list of plugins below), with our own custom post types in addition to WooCommerce. And we are using a Storefront child theme.</p>
  
  <h2>My Questions:</h2>
  
  <ul>
  <li>Is there a good way to figure out what exactly is causing the timeout?</li>
  <li>Would simplifying my theme (essentially building our own parent theme, rather than modifying Storefront via a Child theme) improve performance at all?</li>
  <li>Do I really just need to explore alternative hosting environments?</li>
  </ul>
  
  <p>--</p>
  
  <p>Here are additional system details from WooCommerce:</p>
  
  <pre><code>WC Version: 2.6.3
  WP Version: 4.5.3
  WP Memory Limit: 256 MB
  </code></pre>
  
  <h3>Server Info: Apache</h3>
  
  <pre><code>PHP Version: 7.0.2-pl0-gentoo
  PHP Post Max Size: 50 MB
  PHP Time Limit: 1600
  PHP Max Input Vars: 1000
  cURL Version: 7.39.0
  OpenSSL/1.0.1r
  
  Max Upload Size: 50 MB
  GZip: ✔
  Multibyte String: ✔
  Remote Post: ✔
  Remote Get: ✔
  </code></pre>
  
  <h3>Database</h3>
  
  <pre><code>WC Database Version: 2.6.3
  woocommerce_sessions: ✔
  woocommerce_api_keys: ✔
  woocommerce_attribute_taxonomies: ✔
  woocommerce_downloadable_product_permissions: ✔
  woocommerce_order_items: ✔
  woocommerce_order_itemmeta: ✔
  woocommerce_tax_rates: ✔
  woocommerce_tax_rate_locations: ✔
  woocommerce_shipping_zones: ✔
  woocommerce_shipping_zone_locations: ✔
  woocommerce_shipping_zone_methods: ✔
  woocommerce_payment_tokens: ✔
  woocommerce_payment_tokenmeta: ✔
  MaxMind GeoIP Database: ✔
  </code></pre>
  
  <h3>Active Plugins (31)</h3>
  
  <ul>
  <li>Advanced Custom Fields Pro: by elliot condon – 5.2.7</li>
  <li>Akismet: by Automattic – 3.1.11</li>
  <li>Breadcrumb NavXT: by John Havlik – 5.4.0</li>
  <li>Contact Form 7: by Takayuki Miyoshi – 4.4.2</li>
  <li>Disqus Comment System: by Disqus  – 2.85</li>
  <li>Enable Media Replace: by Måns Jonasson – 3.0.4</li>
  <li>Enhanced Media Library: by wpUXsolutions – 2.3</li>
  <li>Google XML Sitemaps: by Arne Brachhold – 4.0.8</li>
  <li>Members: by Justin Tadlock – 1.1.2</li>
  <li>Menu Exporter: by Joe Hoyle - Human Made Limited – 1</li>
  <li>PDF Image Generator: by Mizuho Ogino – 1.4.6.5</li>
  <li>Public Post Preview: by Dominik Schilling – 2.5.0</li>
  <li>Redirection: by John Godley – 2.4.5</li>
  <li>Optimize Database after Deleting Revisions: by CAGE Web Design | Rolf van Gelder Eindhoven The Netherlands – 4.1.10</li>
  <li>Say What?: by Lee Willis – 1.7.1</li>
  <li>W3 Total Cache: by Frederick Townes – 0.9.4.1 </li>
  <li>WooCommerce Authorize.net Reporting: by WooThemes / SkyVerge – 1.5.0</li>
  <li>WooCommerce Checkout Field Editor: by WooThemes – 1.4.10</li>
  <li>WooCommerce Customer/Order CSV Export: by WooThemes / SkyVerge – 3.12.1</li>
  <li>WooCommerce Authorize.net CIM Gateway: by WooThemes / SkyVerge – 2.3.0</li>
  <li>WooCommerce Google Analytics Integration: by WooThemes – 1.4.0</li>
  <li>WooCommerce MailChimp Integration: by WooThemes – 1.0.0</li>
  <li>WooCommerce Name Your Price: by Kathy Darling – 2.3.4</li>
  <li>WooCommerce Product Add-ons: by WooThemes – 2.7.21</li>
  <li>WooCommerce Sequential Order Numbers Pro: by WooThemes / SkyVerge – 1.10.0</li>
  <li>WooCommerce Social Login: by WooThemes / SkyVerge – 1.8.0</li>
  <li>WooCommerce: by WooThemes – 2.6.3</li>
  <li>WooThemes Helper: by WooThemes – 1.6.2</li>
  <li>WP User Avatar: by flippercode – 2.0.7</li>
  <li>wpMandrill: by Mandrill – 1.33</li>
  </ul>