Title: Plugin Timeout When Bulk Updating
Last modified: September 15, 2018

---

# Plugin Timeout When Bulk Updating

 *  [kesenwang](https://wordpress.org/support/users/kesenwang/)
 * (@kesenwang)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/plugin-timeout-when-bulk-updating/)
 * Hey there, so The plugin is basically timing out when I choose the bulk update
   option. I read another post with a similar problem but it was market resolved
   and the dude had like 10,000-20,000 posts, big range there lol. Anyways I have
   in total 1,173 posts, and I’m still getting a time out issue when trying to bulk
   update posts. Is there any fix for this or way I can stop WordPress from timing
   out?

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

 *  Thread Starter [kesenwang](https://wordpress.org/support/users/kesenwang/)
 * (@kesenwang)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/plugin-timeout-when-bulk-updating/#post-10691166)
 * Here’s the error Log from WP Engine just for reference I dunno if it helps:
 * [Sat Sep 15 14:28:02.169994 2018] [:error] [pid 17813] [client 220.130.220.237:
   19287] PHP Warning: mysqli_query(): MySQL server has gone away in /nas/content/
   live/kesen/wp-includes/wp-db.php on line 1924, referer: [https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly](https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly)
   [
   Sat Sep 15 14:28:02.170088 2018] [:error] [pid 17813] [client 220.130.220.237:
   19287] PHP Warning: mysqli_query(): Error reading result set’s header in /nas/
   content/live/kesen/wp-includes/wp-db.php on line 1924, referer: [https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly](https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly)[
   Sat Sep 15 14:38:02.787774 2018] [:error] [pid 4355] [client 220.130.220.237:
   23593] PHP Warning: mysqli_query(): MySQL server has gone away in /nas/content/
   live/kesen/wp-includes/wp-db.php on line 1924, referer: [https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly](https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly)[
   Sat Sep 15 14:38:02.787862 2018] [:error] [pid 4355] [client 220.130.220.237:
   23593] PHP Warning: mysqli_query(): Error reading result set’s header in /nas/
   content/live/kesen/wp-includes/wp-db.php on line 1924, referer: [https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly](https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly)[
   Sat Sep 15 14:45:02.891826 2018] [:error] [pid 11811] [client 137.74.21.218:26575]
   PHP Warning: mysqli_query(): MySQL server has gone away in /nas/content/live/
   kesen/wp-includes/wp-db.php on line 1924, referer: [https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly](https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly)[
   Sat Sep 15 14:45:02.891920 2018] [:error] [pid 11811] [client 137.74.21.218:26575]
   PHP Warning: mysqli_query(): Error reading result set’s header in /nas/content/
   live/kesen/wp-includes/wp-db.php on line 1924, referer: [https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly](https://willywangstory.com/wp-admin/admin.php?page=amazon_ai_polly)
 *  [ekayy](https://wordpress.org/support/users/ekayy/)
 * (@ekayy)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/plugin-timeout-when-bulk-updating/#post-10747978)
 * I’m getting the same issue and error log statements as kensenwang from WPEngine.
   On top of those errors, I also get one additional error:
 * [client 97.93.147.172:40428] WordPress database error MySQL server has gone away
   for query SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta
   ON (wp_posts.ID = wp_postmeta.post_id AND wp_postmeta.meta_key = ‘amazon_polly_audio_link_location’)
   LEFT JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id ) LEFT JOIN wp_postmeta
   AS mt2 ON ( wp_posts.ID = mt2.post_id ) LEFT JOIN wp_postmeta AS mt3 ON ( wp_posts.
   ID = mt3.post_id ) WHERE 1=1 AND ( \n wp_postmeta.post_id IS NULL \n OR \n ( 
   mt1.meta_key = ‘amazon_polly_voice_id’ AND mt1.meta_value != ‘Matthew’ ) \n OR\
   n ( mt2.meta_key = ‘amazon_polly_sample_rate’ AND mt2.meta_value != ‘22050’ )\
   n OR \n ( mt3.meta_key = ‘amazon_polly_audio_location’ AND mt3.meta_value != ‘
   s3’ )\n) AND wp_posts.post_type = ‘read’ AND (wp_posts.post_status = ‘publish’
   OR wp_posts.post_status = ‘acf-disabled’ OR wp_posts.post_status = ‘future’ OR
   wp_posts.post_status = ‘draft’ OR wp_posts.post_status = ‘pending’ OR wp_posts.
   post_status = ‘private’) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC
   LIMIT 0, 1 /* From [**********.com/wp-admin/admin-ajax.php] in [/nas/content/
   live/cf2018/wp-content/plugins/amazon-polly/admin/AmazonAI-PollyService.php:487]*/
   made by do_action(‘wp_ajax_polly_transcribe’), WP_Hook->do_action, WP_Hook->apply_filters,
   call_user_func_array, AmazonAI_PollyService->ajax_bulk_synthesize, WP_Query->
   __construct, WP_Query->query, WP_Query->get_posts, referer: [https://***********.com/wp-admin/admin.php?page=amazon_ai_polly](https://***********.com/wp-admin/admin.php?page=amazon_ai_polly)
 *  [publicplatform](https://wordpress.org/support/users/teamlanio/)
 * (@teamlanio)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/plugin-timeout-when-bulk-updating/#post-10795089)
 * Commenting to upvote. We’re also seeing 502 Gateway errors on WPEngine during
   Bulk Update Ajax operations. We have about 2000 posts on each of our sites.
 *  [publicplatform](https://wordpress.org/support/users/teamlanio/)
 * (@teamlanio)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/plugin-timeout-when-bulk-updating/#post-10795132)
 * It looks like the OR clause is causing the query to timeout. I was able to generate
   all the audio files by commenting out the voice, sample rate and location
 * Lines 461-486:
 *     ```
       $args     = array(
       				'posts_per_page' => $batch_size,
       				'post_type'      => $post_types_supported,
       				'meta_query'     => array(
       					// 'relation' => 'OR',
       					array(
       						'key'     => 'amazon_polly_audio_link_location',
       						'compare' => 'NOT EXISTS',
       					),
       					// array(
       					// 	'key'     => 'amazon_polly_voice_id',
       					// 	'value'   => $amazon_polly_voice_id,
       					// 	'compare' => '!=',
       					// ),
       					// array(
       					// 	'key'     => 'amazon_polly_sample_rate',
       					// 	'value'   => $amazon_polly_sample_rate,
       					// 	'compare' => '!=',
       					// ),
       					// array(
       					// 	'key'     => 'amazon_polly_audio_location',
       					// 	'value'   => $amazon_polly_audio_location,
       					// 	'compare' => '!=',
       					// ),
       				),
       			);
       ```
   
 * Obviously, this isn’t ideal b/c we do want to check if there’s a change in voice,
   sample rate or location…

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

The topic ‘Plugin Timeout When Bulk Updating’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amazon-polly_303a47.svg)
 * [AWS for WordPress](https://wordpress.org/plugins/amazon-polly/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-polly/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-polly/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-polly/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-polly/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-polly/reviews/)

## Tags

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

 * 4 replies
 * 3 participants
 * Last reply from: [publicplatform](https://wordpress.org/support/users/teamlanio/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/plugin-timeout-when-bulk-updating/#post-10795132)
 * Status: not resolved