Title: Problem with widget
Last modified: August 21, 2016

---

# Problem with widget

 *  [ajkphotography](https://wordpress.org/support/users/ajkphotography/)
 * (@ajkphotography)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-widget-5/)
 * I was wondering why my site was painfully slow, taking many seconds to load and
   sometimes just timing out. I found that I had to remove my gallery widget from
   the sidebar which was displaying 6 thumbnails and the site returned to normal
   speed. Adding the widget back to the sidebar caused the site to bog down again
   so clearly it was the problem.
 * Is this a known problem?
 * [http://wordpress.org/plugins/nextgen-gallery/](http://wordpress.org/plugins/nextgen-gallery/)

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

 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-widget-5/#post-4548862)
 * [@ajkphotography](https://wordpress.org/support/users/ajkphotography/) – It is
   possible the NextGEN Gallery widget may take some time to load but that may also
   be related to the specific settings you are using … for example if you are choosing
   6 random images from 1000’s of images then it will take some time to “choose”
   those 6 images as it has to index all of those images before it can make the 
   selections.
 * – Cais.
 *  [fucine](https://wordpress.org/support/users/fucine/)
 * (@fucine)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-widget-5/#post-4548879)
 * This depends on MySQL slow_queries.
 * Here are some that I have logged (WP 3.8.1 and NGG 2.x branch) in our server:
 * #######################################################
 * # Time: 140125 8:13:25
    # User@Host: fucinemute[fucinemute] @ localhost [] # 
   Query_time: 10.767526 Lock_time: 0.000053 Rows_sent: 1273 Rows_examined: 7407587
   SET timestamp=1390634005; SELECT pid , `wp_options`.`option_value` AS ‘custom_post_id’,
   GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘extras’ FROM `wp_ngg_pictures`
   LEFT OUTER JOIN `wp_options` ON `wp_options`.option_name = CONCAT(‘wp_ngg_pictures_’,
   wp_ngg_pictures.pid) LEFT OUTER JOIN `wp_postmeta` ON `wp_postmeta`.`post_id`
   = `wp_options`.`option_value` WHERE (`exclude` = 0) GROUP BY wp_ngg_pictures.
   pid ORDER BY rand();
 * #######################################################
 * # Time: 140125 8:13:36
    # User@Host: fucinemute[fucinemute] @ localhost [] # 
   Query_time: 10.748086 Lock_time: 0.000079 Rows_sent: 30 Rows_examined: 7406344
   SET timestamp=1390634016; SELECT wp_ngg_pictures.* , `wp_options`.`option_value`
   AS ‘custom_post_id’, GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘
   extras’ FROM `wp_ngg_pictures` LEFT OUTER JOIN `wp_options` ON `wp_options`.option_name
   = CONCAT(‘wp_ngg_pictures_’, wp_ngg_pictures.pid) LEFT OUTER JOIN `wp_postmeta`
   ON `wp_postmeta`.`post_id` = `wp_options`.`option_value` WHERE (`exclude` = 0)
   GROUP BY wp_ngg_pictures.pid ORDER BY rand() LIMIT 30;
 * #######################################################
 * # Time: 140125 8:13:54
    # User@Host: fucinemute[fucinemute] @ localhost [] # 
   Query_time: 11.220924 Lock_time: 0.000054 Rows_sent: 1273 Rows_examined: 7410133
   SET timestamp=1390634034; SELECT pid , `wp_options`.`option_value` AS ‘custom_post_id’,
   GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘extras’ FROM `wp_ngg_pictures`
   LEFT OUTER JOIN `wp_options` ON `wp_options`.option_name = CONCAT(‘wp_ngg_pictures_’,
   wp_ngg_pictures.pid) LEFT OUTER JOIN `wp_postmeta` ON `wp_postmeta`.`post_id`
   = `wp_options`.`option_value` WHERE (`exclude` = 0) GROUP BY wp_ngg_pictures.
   pid ORDER BY rand();
 * #######################################################
 * # Time: 140125 8:14:06
    # User@Host: fucinemute[fucinemute] @ localhost [] # 
   Query_time: 10.822486 Lock_time: 0.000076 Rows_sent: 30 Rows_examined: 7408890
   SET timestamp=1390634046; SELECT wp_ngg_pictures.* , `wp_options`.`option_value`
   AS ‘custom_post_id’, GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘
   extras’ FROM `wp_ngg_pictures` LEFT OUTER JOIN `wp_options` ON `wp_options`.option_name
   = CONCAT(‘wp_ngg_pictures_’, wp_ngg_pictures.pid) LEFT OUTER JOIN `wp_postmeta`
   ON `wp_postmeta`.`post_id` = `wp_options`.`option_value` WHERE (`exclude` = 0)
   GROUP BY wp_ngg_pictures.pid ORDER BY rand() LIMIT 30;
 * #######################################################
 * As you can see Query_time was alway 10 seconds and even more.
    Such logging happened
   with NGG widget being enabled.
 * Rollback to NGG 1.9.x and even with WP 3.8.1 everything works perfectly as always:
   [http://www.fucinemute.it/](http://www.fucinemute.it/)
 * My 2 cents.
 *  Thread Starter [ajkphotography](https://wordpress.org/support/users/ajkphotography/)
 * (@ajkphotography)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-widget-5/#post-4548880)
 * Thanks for your replies photocrati and fucine.
 * The site has 980 mostly optimised images, 48 galleries and 9 albums and was running
   fine not so long ago with the widget and same number of images. I don’t know 
   the exact point where it slowed down, whether it was after an NGG update or after
   a recent wordpress update. All I know is that with the widget the site is virtually
   crippled and without it it’s fine.
 *  [fucine](https://wordpress.org/support/users/fucine/)
 * (@fucine)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-widget-5/#post-4548881)
 * Believe me, ajkphotography… When NGG widget was active, and considering that 
   our webmagazine has 20.000 pageviews per day, MySQL’s CPU usage was almost 200%(
   widget is inoculated into any page, and home as well).
    The fact is quite clear:
   NGG above **1.9.13** version AND WordPress above **3.7.1** version **are not 
   compatible**. Not at all. If you want to run WP 3.8.x then you have to revert
   NGG back to 1.9.13. As simple as this: [http://www.nextgen-gallery.com/how-to-rollback-a-version/](http://www.nextgen-gallery.com/how-to-rollback-a-version/)
   Anyway the plugin developers should take a look at those queries. Some profiling
   is _highly_ required…
 *  Plugin Contributor [photocrati](https://wordpress.org/support/users/photocrati/)
 * (@photocrati)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-widget-5/#post-4548882)
 * [@ajkphotography](https://wordpress.org/support/users/ajkphotography/) – If you
   are seeing similar issues as [@fucine](https://wordpress.org/support/users/fucine/)
   is trying to in your topic then you can expect improvements with our next (beta)
   release which addresses many of the query calls that are being pointed to.
 * – Cais.
 *  [fucine](https://wordpress.org/support/users/fucine/)
 * (@fucine)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-widget-5/#post-4548887)
 * [@photocrati](https://wordpress.org/support/users/photocrati/): thanks for the
   effort you’ll put in optimizing both queries and the overall PHP code.

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

The topic ‘Problem with widget’ is closed to new replies.

 * ![](https://ps.w.org/nextgen-gallery/assets/icon-256x256.png?rev=2083961)
 * [Photo Gallery, Sliders, Proofing and Themes - NextGEN Gallery](https://wordpress.org/plugins/nextgen-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/nextgen-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/nextgen-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/nextgen-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/nextgen-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/nextgen-gallery/reviews/)

## Tags

 * [speed](https://wordpress.org/support/topic-tag/speed/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 6 replies
 * 3 participants
 * Last reply from: [fucine](https://wordpress.org/support/users/fucine/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/problem-with-widget-5/#post-4548887)
 * Status: not resolved