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.

 

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 02-17-2013, 10:01 AM   #1
LucyVanAngel
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 );
LucyVanAngel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 02-17-2013, 07:01 PM   #2
P. Enrique
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.
P. Enrique is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 02-17-2013, 08:04 PM   #3
BigChad
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?
__________________
Adult Affiliate Directory

Email: webmaster[at]wankyourself . com
BigChad is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 02-20-2013, 05:23 AM   #4
Jinn
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.
Jinn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 02-20-2013, 08:57 AM   #5
Kostly
Confirmed User
 
Kostly's Avatar
 
Industry Role:
Join Date: Oct 2011
Posts: 474
print_f($old_values); should do a good job.
__________________
Slippery Onion - Upload Images for Free Backlinks
Our Kinky Life - Our Adult Sites
Kostly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 02-21-2013, 02:42 AM   #6
LucyVanAngel
Confirmed User
 
Join Date: Mar 2009
Posts: 305
Thanks guys, Problem solved !!
LucyVanAngel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
 
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.