• Hi,

    first of all, thanks for a great plugin.

    Just in the few weeks I’ve noticed exceedingly long page load times for any participant entry with an image field in it.

    I’ve recreated the same list on my test site with no plugins and still get the same issues. You can see in the links to the test site below:

    https://www.playoflight.co.uk/datavault/characters/character-details/?pdb=3
    (entry with no image field)

    https://www.playoflight.co.uk/datavault/characters/creature-details/?pdb=149
    (entry set to display the image)

    The image in this example is 168k.

    I’ve also found on both sites that if I try and test out the unresponsive pages, after a while the whole site becomes unresponsive, and I get ‘connection lost’ messages in the admin section for pages I am working on.

    The records with an image in also take an age to update in the back end compared to ones without.

    As I say, this problem only seems to have happened recently, perhaps with the latest wp update (4.4.1).

    Any help would be greatly appreciated.

    Many thanks,
    Ian

    p.s the loading is greatly amplified for multiple images in a list – the pdb-list just times-out my server.

    https://www.ads-software.com/plugins/participants-database/

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author xnau webdesign

    (@xnau)

    I loaded the pages just now, and I’m not seeing any real difference between the one with the image and the one without. Is it still loading slow for you? Have you tried it with another browser?

    It likely this is a server issue. Connection lost errors can be an indication that the server is so bogged down it can’t send out data in a timely manner. It’s probably not caused by a page with an image, more likely either a server configuration issue or another application on the server or even a brute force attack.

    Thread Starter ighulme

    (@ighulme)

    Thanks for the reply; my apologies, I think you got a cached page, as I had turned cloudflare back on without thinking (it’s off now). ??

    Would you be able to take a look at the full list please? I’m still finding that the list with images takes almost a minute to load compared to the version without. It’s definitely a recent phenomenon, and is identical on my main site.

    https://www.playoflight.co.uk/datavault/glossary/
    (list without images)

    https://www.playoflight.co.uk/datavault/glossary-with-images/
    (list with images)

    I’m watching the server while the page loads, and the cpu is under 50% and there are only one or two sites being accessed alongside, so I don’t think that’s the problem. The problem is purely on pages displaying participant images. I’ve had to stop displaying images in the list on my main site as it still hangs.

    Many thanks for your help – I know these problems are difficult to track down, and often not the problem of the plugin that gets affected, but the problem does seem very specific at present.

    Ian

    Plugin Author xnau webdesign

    (@xnau)

    Ian,

    I’m guessing this is due to use of the PHP function getimagesize() which can be slow. I should probably optimize this in the code, but for now there are a few things you can do.

    First, don’t try to show all your listings on one page, use the list limit setting to show only a few records per page.

    Second, image uploads should only be as large as you need for the largest display. The plugin does not resize images, so if someone uploads a 300KB image file, it will have to load that every time, even of you’re only showing a 50×50 thumbnail, and it will be very slow. If you can, resize all the images to only as large as the largest image you need to display. It’s possible to do this automatically, but it takes some know-how. It may be easier to download all the images to your local machine (using FTP), then use an image file batch processor to resize and re-optimize all the images, then upload them. The filenames have to stay the same.

    Third, make sure you’re not trying to load remote (that is, image files that are not on your site) images into the list, that is guaranteed to be extremely slow.

    Thread Starter ighulme

    (@ighulme)

    Thanks for your reply and suggestions, but I don’t think that the problem is down to filesizes. I’ve just tested it out by resizing the 4 images in the test list to about 4kb each and it still hangs (it just took exactly 5 minutes 20 seconds to load each time I attempted to open this page!):

    https://www.playoflight.co.uk/datavault/glossary-with-images/

    (all images are in the default upload folder).

    The odd thing is that I’ve been using the same lists in development for over a year now, and it’s only in the last few weeks that it has become a problem. The lists had at least twenty 500kb images in them and worked fine. The page would load up straight away and then the images would all progressively load. Now the page just hangs and (if it doesn’t timeout) then appears with all the images together.

    I was just wondering if wordpress has changed the way the images load in a recent update? I’ve disabled all other plugins so I can’t think of anything else that may have changed.

    Many thanks,
    Ian

    Thread Starter ighulme

    (@ighulme)

    …also, I meant to say that exactly the same shortcode, with only the addition of the image upload field, only displays around 10 out of 150 or so items when it does finally load:

    https://www.playoflight.co.uk/datavault/glossary/
    (full list, no images)

    https://www.playoflight.co.uk/datavault/glossary-with-images/
    (same list, with images, only displays 10 or so items)

    Thread Starter ighulme

    (@ighulme)

    Is it possible that the database could become corrupted?

    It’s just that, with more testing it appears to be certain entries that consistently take a long time to load compared to others, both in the front and back end. When I re-create the slow entry, the new one loads immediately.

    Is there a way to check in the database?

    Plugin Author xnau webdesign

    (@xnau)

    I’m not aware of any situation where a database entry would cause slow loading, but if recreating a record makes it load faster, I would take a look at the database directly to see what is getting changed.

    In most hosting situations, there is in the control panel an application called phpMyAdmin that gives you direct access to the database, you can see exactly what is stored, you may see evidence of the problem there.

    Thread Starter ighulme

    (@ighulme)

    Thanks for getting back to me.

    I’ve found out that if I remove all the slow loading entries then the list comes up fine. If I add one back to the list, it hangs.

    Then, if I delete the image from a problem entry, it all works fine. Add an image again and it hangs.

    My colleague’s server uses mySQL Workbench, and I’ve had a look at the database tables there. The image field column just has the filenames (I’ve named all the images to correspond to their id number, e.g. id=161 – 161.jpg). All the entries I can see appear okay. Are there any other references to the images in the database tables?

    Many thanks.

    Thread Starter ighulme

    (@ighulme)

    This is so peculiar. About half the entries are consistently hanging. I have renamed different images to test with, but even with tiny files the problem reoccurs.
    But as soon as I take the image out of the pdb upload folder (via ftp) the entry loads instantly. Re-add the image and it hangs.

    Plugin Author xnau webdesign

    (@xnau)

    I would suggest taking a look at the server error logs (not PHP error log) to see if there is something coming in there. Not sure why some files would be a problem and others not.

    The symptoms sound like the server is running out of memory, but that seems unlikely.

    Thread Starter ighulme

    (@ighulme)

    I’ll have a look, but it seems strange that the problem is repeatable on specific entries.

    Thread Starter ighulme

    (@ighulme)

    I’m viewing the error logs in the Event Viewer, but I’m not really sure what I’m looking for. I can’t see anything relating to my sites.

    I’ve tested the pdb lists on two different wordpress installs, one multisite and one single and get the same results. The only thing I can think of that has changed recently is the wp version.

    Both installs are running on the same wp version and windows server.

    Plugin Author xnau webdesign

    (@xnau)

    I’m pretty sure it’s not the WP version, that’s well tested by now, but Windows servers are very different from unix-based servers, so it’s possible there is a specific incompatibility.

    Hard for me to debug this, I don’t know Windows servers. If I were to guess it’s due to the getimagesize() PHP call, but debugging that won’t be simple.

    If you want to dig into the code, there are two calls to getimagesize() in the file classes/PDb_Image_Handler.class.php they could be bypassed, see if that helps.

    Thread Starter ighulme

    (@ighulme)

    Thanks for your help – I don’t really understand much about the code (or windows servers), so perhaps I’ll have to find a way around the problem, one that avoids using the image field.

    It has proved quite a surreal problem – I’ve just found that if I move the image folder location, a completely different set of entries are affected and the previous hanging ones are fine – all in a completely repeatable way – weird! ??

    Anyway, thanks again for your help. Pdb has been a great plugin, one that I’ve been working with for about 2 years now to help me write.

    Ian

    Plugin Author xnau webdesign

    (@xnau)

    Have you asked your web host for help in finding the problem? There may be something in the server logs that indicates where the problem is.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Image field makes page loading unresponsive’ is closed to new replies.