Title: Too Many Posts? 502 Error
Last modified: August 22, 2016

---

# Too Many Posts? 502 Error

 *  Resolved [junger](https://wordpress.org/support/users/junger/)
 * (@junger)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/too-many-posts-502-error/)
 * We’re running a multisite install, and have no problem activating this on 3 out
   of our 4 subsites.
 * However, on one of the sites — which has about 3,000 posts — we’re getting 502
   errors upon trying to activate. It’s hosted on WPEngine, and their support says
   the really long queries are being killed because, well, they’re really long and
   the server automatically kills them.
 * Is there a way to activate the plugin before the queries run, and then run them
   in chunks so we can get this working?
 * It’s an amazing plugin — we love it where it works.
 * Thanks!
 * [https://wordpress.org/plugins/social-metrics-tracker/](https://wordpress.org/plugins/social-metrics-tracker/)

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

 *  Plugin Author [Ben Cole](https://wordpress.org/support/users/bcole808/)
 * (@bcole808)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/too-many-posts-502-error/#post-5450076)
 * Hello!
 * I think you are correct; currently the plugin attempts to query all of the posts
   during plugin activation. I will change this for the next version (1.3) which
   I plan to release within 2 weeks so that the plugin does not attempt to query/
   activate.
 * If you would like to help me test out version 1.3, send me an email (ben@colehost.
   com) and I’ll send you a .zip file with the new plugin code which should hopefully
   be able to activate on your site.
 * I’ll post another reply here when the update is released. Thanks for your feedback
   with the plugin!
 *  Thread Starter [junger](https://wordpress.org/support/users/junger/)
 * (@junger)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/too-many-posts-502-error/#post-5450103)
 * Awesome, thanks Ben!
 * Any direction on, if for the meantime, I want to activate the plugin but NOT 
   run the query at the same time? Happy to comment out the code that does it for
   now.
 *  Plugin Author [Ben Cole](https://wordpress.org/support/users/bcole808/)
 * (@bcole808)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/too-many-posts-502-error/#post-5450113)
 * Yes, in the mean time you can edit the file **social-metrics-tracker.php**:
 * Around line 238, find this code:
 *     ```
       if ($this->is_development_server()) {
       	// Do not schedule update
       } else {
       	// Sync all data
       	MetricsUpdater::scheduleFullDataSync();
       }
       ```
   
 * and replace with:
 *     ```
       if ($this->is_development_server()) {
       	// Do not schedule update
       } else {
       	// Sync all data
       	// MetricsUpdater::scheduleFullDataSync();
       }
       ```
   
 * So that you simply comment out the line which schedules the full sync when the
   plugin is activated. Data will still be collected after the plugin is activated,
   it will just take a little while for all of the posts to be updated.
 * Note that in this case data will only be collected if a post is actually viewed
   by a site visitor, so if you have old posts which don’t receive any visitors,
   then no data will be retrieved for those posts until they are viewed at least
   once.
 *  Plugin Author [Ben Cole](https://wordpress.org/support/users/bcole808/)
 * (@bcole808)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/too-many-posts-502-error/#post-5450323)
 * Version 1.3 is now released, try it out and let me know if you have any issues!

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

The topic ‘Too Many Posts? 502 Error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/social-metrics-tracker_99a19a.svg)
 * [Social Metrics Tracker](https://wordpress.org/plugins/social-metrics-tracker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/social-metrics-tracker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/social-metrics-tracker/)
 * [Active Topics](https://wordpress.org/support/plugin/social-metrics-tracker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/social-metrics-tracker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/social-metrics-tracker/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Ben Cole](https://wordpress.org/support/users/bcole808/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/too-many-posts-502-error/#post-5450323)
 * Status: resolved