Support » Theme: Customizr » Extremely SLOW loading when using image-logo

  • Hi,

    Having a weird issue, have bunch of different wordpress website running on same server, all work like a charm, except for one, and only when using UPLOAD PNG logo with fixed width-height…
    Takes about 20 seconds to load the page, and same goes for each page i click on. If i remove the PNG logo and just leave text title, loads fine.
    PNG file it self is only 5KB size. Not sure what the issue is.

    Link to the customizr site –
    http://teamupb.com/~denttech/

    Any ideas what might be wrong?

    Thanks

Viewing 15 replies - 1 through 15 (of 16 total)
  • When I look at the code on your page, I see a max-width and max-height for the logo in the CSS, but no width or height values in the corresponding attributes for the img tag in the header; although those attribues are there, they’re blank. I think that means your entire site has to load before the browser knows what size the logo is going to be. That may be the problem.

    Try hard-coding the logo in the header.php with the width and height attributes set and see if that solves the problem.

    The other thing that seems to contribute to slow page loading is using a temporary URL for the site instead of the domain, though that does not explain why you’re only having the problem when the logo is up.

    It looks like you were able to fix this issue. I’m encountering the same problem. What was your solution?

    I got same problem and I have been resolve it. I got a waring message in debug information: WARNING: wp-content/themes/customizr/parts/class-header-header_main.php:133 – getimagesize(http://xxx.xxxxxxxx.com/ucom/wp-content/uploads/2014/03/logo.png): failed to open stream: Connection timed out.

    I tried the connection to the host xxx.xxxxxxx.com, It’s broke. Change the access method to local path is better. you have to edit the code, or make sure the host is accessible from wp server(NOT from you brower).

    i getting same problem now..

    help me..

    No solutions?

    We’ve managed to track this bug down and nikeo knows about it, but there’s no fix yet.

    [If anyone else wants to come up with a workaround, it’s due to a failure in @getimagesize.]

    have anyone found a solution to this problem?

    Yes, I found out a couple of weeks ago that it’s related to a server setting that stops the server being able to find out the size of the logo. It also causes the logo not to be displayed in some versions of IE.

    It requires a sizeable chunk of code to be rewritten.

    In the meantime, if you have a child theme with a functions.php file, you can use the following workaround:

    // Workaround for those affected by the IE logo non-display bug
    add_filter( 'tc_logo_img_display', 'replace_erroneous_width_and_height');
    function replace_erroneous_width_and_height($html) {
    
    		$width_of_logo_in_px = '1477'; // <<<<<<<<<<<< CHANGE TO YOUR LOGO'S WIDTH
    
    		$height_of_logo_in_px = '472'; // <<<<<<<<<<< CHANGE TO YOUR LOGO'S HEIGHT
    
    		return str_replace('width="" height=""', 'width="'.$width_of_logo_in_px.'" height="'.$height_of_logo_in_px.'"', $html);
    }

    If it’s the server setting that is causing your problem, then this should fix it. Change the numbers where indicated to your logo’s size.

    Let us know if it works.

    thank for your help!

    unfortunately, it did not solve the problem.

    the code below is what I have written in my child theme’s functions.php file. Is that correct?

    <?php
    /**
    * This is where you can copy and paste your functions !
    */
    // Workaround for those affected by the IE logo non-display bug
    add_filter( 'tc_logo_img_display', 'replace_erroneous_width_and_height');
    function replace_erroneous_width_and_height($html) {
    
    		$width_of_logo_in_px = '90'; // <<<<<<<<<<<< CHANGE TO YOUR LOGO'S WIDTH
    
    		$height_of_logo_in_px = '90'; // <<<<<<<<<<< CHANGE TO YOUR LOGO'S HEIGHT
    
    		return str_replace('width="" height=""', 'width="'.$width_of_logo_in_px.'" height="'.$height_of_logo_in_px.'"', $html);
    }

    if the above is correct, do you have any idea what could then be causing the problem?

    Hmm. That code fixes the IE bug. I should have realised that the slowdown will still happen.

    Could you try the following (after removing the above workaround code from your functions.php)? Change lines 145-150 of class-header-header_main.php in the \inc\parts folder FROM:

    $width 				= '';
    $height 			= '';
    //gets height and width from image, we check if getimagesize can be used first with the error control operator
    if ( @getimagesize($logo_src) ) {
    	list( $width, $height ) = getimagesize($logo_src);
    }

    TO:

    $width = '123'; // <<<<<<<<<<<< CHANGE TO YOUR LOGO'S WIDTH
    $height = '45'; // <<<<<<<<<<< CHANGE TO YOUR LOGO'S HEIGHT
    //gets height and width from image, we check if getimagesize can be used first with the error control operator
    // if ( @getimagesize($logo_src) ) {
    // 	list( $width, $height ) = getimagesize($logo_src);
    // }

    The exact line numbers will change if you have a version different to 3.1.23. You need to edit the 123 and 45 figures to match your logo size in pixels.

    This is an edit of a core file, which is not a permanent solution (as it will be overwritten if you upgrade). It’s a test to pin the problem down.

    Let me know if it works.

    This works! Only thing is, the logo got distorted when at its actual pixel size – became too wide, so I made it about 40% narrower.

    it works!
    Thank you very much for your help!

    I had this same issue where I made zero changes to my website. It went from a good page load time to taking up to 40 seconds or more to load a page. I spent countless hours blaming it on InMotionHosting servers and then came across ElectricFeet’s post.

    I forced the size of the image and commented out the getimagesize() call as per ElectricFeet’s suggestion.

    It worked!
    Page load time back to normal.
    Phew!
    Thank you!

    So I wonder if something changed on my ISP server in their handling of the PHP getimagesize() call as it went from working fine to not working at all?

    (I am not a developer but end user so if I knew how to use debugging tools I probably would have seen it spinning in this PHP code and not wasted a gorgeous Sunday in front of my computer.)

    Thanks again for a great theme and great support!

    Lisa

    (@ldanielpour962gmailcom)

    Thank goodness for reading this support forum string, it fixed my problem, too! I suddenly had the same issue 9 days ago. I didn’t do anything differently to my site when it suddenly developed the same super slow loading problem. And this fix worked! Thank you so much, @electricfeet! (My web site is gooseling.com, running WordPress 3.9.2, Customizr 3.1.24.)

    I also spent countless hours troubleshooting my site, and initially blamed my hosting service Inmotion. They gave me advice about optimizing my site which I spent tons of time learning and working on but was puzzled since I couldn’t understand why optimizing my site or not hadn’t affected its speed before. I implemented the W3 Cache plug in, checked size of all my images to make sure they were small enough, ran the site through developer speed tools, etc.

    I’m still working on learning some of the optimizing lingo and fixes, slower going for me as I’m not a developer. For example, eliminating render-blocking JavaScript and CSS in above-the-fold content, figuring out how to change some of the image URLs that automatically have a ? in them which i’m reading can slow down speed but now that doesn’t seem as pressing since this logo fix seems to have done the job. I’m going to look in the general wordpress support forum for info on these issues and do more reading on them.

    Thanks for your advice and help, this support forum is fantastic!

    @lisa. Wow so we both had the same problem around the same time on the same ISP InMotionHosting.
    I asked them if anything could have changed on their servers and they denied it. I don’t understand enough to know what changed, but something did for their PHP servers it appears.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Extremely SLOW loading when using image-logo’ is closed to new replies.