![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Mar 2009
Posts: 305
|
wordpress nextgen gallery - php question
Hi,
i got a big problem, i use the nextgen gallery plugin on one of my blogs, the blog has already 12k posts and aprox 300k images in the nextgen database. although the blog it self loads perfect (also due to a very fast server) the wp admin became incredibly slow. my host said its the nextgen gallery plugin which makes it load so slow. each time i am uploading a picture zip file to the database the plugin is running "SELECT meta_data FROM wp_ngg_pictures" which returns over 332000 rows. Is there a way to stop this ? Or a way to reduce the requests ? here is the php code: // Query database for existing values // Use cache object $old_values = $wpdb->get_var( $wpdb->prepare( "SELECT meta_data FROM $wpdb->nggpictures WHERE pid = %d ", $id ) ); $old_values = unserialize( $old_values ); |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#2 |
Registered User
Industry Role:
Join Date: Dec 2012
Posts: 16
|
Hi, from quickly searching the source code of NextGen gallery it seems that the php code you posted is from the function that updates meta data for one image (the one whose pid matches $id). So this database query should only return one row. I browsed through the calls to this function and it doesn't look like anyone's looping through a huge amount of images, at a maximum only the number of images that you're uploading. What makes you so sure this query is returning such a huge amount of rows? Please note that I'm no expert in NextGen Gallery, I just happen to have a copy of the sources.
![]() |
![]() |
![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Nov 2012
Posts: 502
|
I'm not an expert in anything, but I know my word press site has been running extremely slow on video uploads, and I don't use the nextgen gallery. My video uploads are so slow that it times out at times. Maybe it's in the WordPress update itself?
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Nov 2001
Posts: 72
|
Why not just add a line to check the length of the query result? Or do a var_dump on the query result. It's inside the admin area so it won't affect your visitor view (not tested). Turn on WP_DEBUG for more info. But don't do it on your production site, it may produce all sorts of warning messages, depending how well your plugins were tested.
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Oct 2011
Posts: 474
|
print_f($old_values); should do a good job.
__________________
|
![]() |
![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Mar 2009
Posts: 305
|
Thanks guys, Problem solved !!
![]() |
![]() |
![]() ![]() ![]() ![]() |