Lazy Widget Loader

Description

The Lazy Widget Loader plugin provides lazy loading for widgets to improve page loading. Use it on slow widgets, especially those where external data is loaded, like widgets from Facebook, Twitter, AdSense, …

What this plugin basically does is to postpone loading the content of those widgets you choose, so that their content is loaded after the main content of the page that is displayed.

You can choose which widgets should be loaded like that, by default the plugin does not “impose” itself on any widget. You may also choose to display a throbber while the content of a widget is loaded.

Advanced lazy loading integration

The Lazy Widget Loader can take advantage of the advanced asynchronous loading mechanism provided by the Itthinx LazyLoader for content and widgets. This plugin helps to optimize site speed by greatly improving page load time and bandwidth usage. Instead of deferred loading in the footer, it provides advanced options that allow to load any content only when needed. These include shortcodes that allow to lazy-load content anywhere on a page, the option to load content on sight and an automatic noscript feature that helps to provide alternative content for visitors that have disabled JavaScript. You can see a demo of the Itthinx LazyLoader here.

Documentation

36 comments

  • William

    Hi,

    Thanks for releasing the plugin, I tried and it worked as described except I am getting a error like below after I activated the plugin.

    Warning: Cannot use a scalar value as an array in /home/vichen18/sweethomemoms.com/wp-content/plugins/lazy-widget-loader/lazy-widget-loader.php on line 471

    The front end is running ok, this only showed up in the back end

    is there any thing we need to modify?

    • Thanks for mentioning this William. Actually this is not an Error but a Warning.

      Sounds like somewhere $wp_registered_widget_controls[$id]['params'][0] is turned into a scalar when it is supposed to be an array. I’ve already had another user reporting this (see http://wordpress.org/support/topic/plugin-lazy-widget-loader-conflict-with-widget-logic-and-work-around) and have checked if there is any conflict between Widget Logic and Lazy Widget Loader but could not reproduce the Warning, it doesn’t seem to be related to the order in which those two plugins are activated either. Both ways, on WP 3.2.1 with Widget Logic 0.48 and Lazy Widget Loader 1.1.0, I could not observe the Warning.

      Could you please post what other plugins you have currently installed (including version), along with your current WP version?

      • Mike

        Has anyone figured this out? Maybe William can send you his list of plugins to see which ones we have in common. I deactivated my plugins one-by-one last night but couldn’t get the warning to go away. However, on my “test” WP installation, I’ve installed the same plugins and I can’t get the warning to appear at all! I’m stumped.

        • Not yet, but I’ll be running tests later on and have additional information provided by others.

          • Mike

            Excellent, I’ll stay tuned for any updates. Thanks for checking into this!

            • Mike I’d also like to thank you for contributing your time and efforts to this. I appreciate that very much, as it is important for users to get involved, that way you help to improve things and of course I do my part in taking the feedback to make sure that possible problems that arise are eventually solved. Win-win :)

    • I’ve just released an update of the plugin (1.2.1) which should avoid any issues related to the warning reported.

  • I’m finding that when I enable Lazy Loading on my widgets, they shift to the left and don’t stay in the column where they’re supposed to be.

    Example: http://eatspress.com/~mariachi/?page_id=2

    I’ve included the same Facebook widget twice. First is properly aligned, doesn’t have Lazy Loading enabled. Second one does.

    Do you have any thoughts on fixing this?

    Thank you,
    Steven

    • I’ve tested the plugin you are using and it works fine on a plain WP 3.2.1 (using the Twenty Eleven theme). But on your page, the HTML rendered for the two widgets is not the same, difficult to say what’s causing this without a closer look but this is what’s enclosing the Like Box: <widget class=”widget … and that’s obviously not correct HTML. Have you tried with the default theme?

  • Kento,

    Definitely one of the major drawbacks to using a program like Artisteer is that it does deviate a bit from the standards in it’s coding and bloats the code a some. This is a great plugin and I would love to see it working with Artisteer themes as well. If you ever want a theme to check out with the plugin let me know or I can install the plugin on a site with a Artisteer theme and give you access to mess around with it.

    • Thanks Thomas, I’ve already taken a look and this is what I find in sidebars.php:

      if (function_exists('register_sidebar')) {

      $theme_widget_args = array(
      'before_widget' => '',
      'before_title' => '',
      'after_title' => '',
      'after_widget' => ''
      );

      And in theme_get_dynamic_sidebar_data($name) they use it to extract class, id and title. As I see it, they assume that no other plugins may do things to code in widgets, but that assumption is wrong. From what I see, unless the way they handle this there’s a good chance of conflict with a good amount of plugins.

      • Kento,

        So I can better understand, is the Lazy Widget Loader moving the widgets to the footer until after the page is loading then moving them back to the sidebar? Also is it artisteer or Lazy Loader removing the art-block from the class file and would it not be possible to add this somewhere in the code to be rewritten to the class tag.

        Thanks for all your help.

        Is your number captcha a wordpress plugin. I like the simplicity of it.

        • Hi Thomas, to your first question: Lazy Widget Loader renders the selected widgets in the footer. When the onload/load event occurs, their content is moved to where it should appear.

          Lazy Widget Loader does not transform or modify the widget’s content. It simply adds a wrapper around the widget to act as a placeholder and provide extra options like the throbber or dimensions – but it’s not the loader that removes e.g. art-block.

          The captcha plugin is available here: http://wordpress.org/extend/plugins/captcha – the authors bestwebsoft did a nice job :)

  • I get another error message :

    Invalid Content for CSS :
    - High impact
    - Easy to solve

    Issue Summary :
    The resource at this URL is not a CSS file. However it was referenced from another resource as a CSS file either using a tag or an @import directive. This is usually caused when the CSS file is missing and the web server instead returns an error page or another resource which is not a valid CSS file.

    Affected URLs :

    http://www.oreille-malade.com/wp-content/plugins/lazy-widget-loader/css/lwl-widget-css.php

    Thanks for your help,
    Laurent

  • Hey Kento,

    I am having problems with the Widget Loader on SSL pages. Not sure why but the jQuery ends up being a mess I think. I have deactivated the plugin now. But maybe you have an idea, what the cause of this may be.

    Cheers.

    • Hi Martin,
      I’d have to try it out to see the cause, if you let me know on what page and with what widget that happens, I’ll try to have a look.
      Cheers

  • amazing plugin thanks so much for sharing

  • Jon

    Hi,
    I have tried your lazy loader at our Redooce.com website as it is really slow loading the twitter and FB follow info (code pasted into a text box widget), but instead of loading the text/social widget last, we just get the throbber all the time and the widget never loads.

    Please could you help us as we are trying to speed up page load ime and think your plugins could solve this issue for us if we can get them to work.
    thanks

    • Can you please post the code pasted into a text box widget and what widget settings you are using? Also which other plugins are active and what theme are you using please?

  • Erik

    Hello Kento!

    Very nice plugin, I have just briefly tested it and it seems to work smoothly. Only one problem sofar, the upper admin menu that is displayed when you are logged in to the site disappears.. any idea about reasons behind this phenomenom?

    Best regards,
    Erik

  • Hi,
    this is really a GREAT plugin I love !

    I have just realize that I have a Javascript error on my site and I can’t fix it.

    I got this error : TypeError: ‘null’ is not an object (evaluating ‘widget_container.parentNode’)

    the plugin seems to work but this error is annoying

    http://www.concertsenboite.fr

    • Thanks so much Arnaud :)
      Regarding the error, do you know what widget is producing it? It seems an additional check that widget_container is not null would be in place, but I’m wondering in what context it happens, as I’ve not seen that happen before.

  • Hi Kento,

    Once I got one widget in lazy mode, I got this mistake ! But this is working by the way. This is just intellectually annoying.

    I also see that my lazy mode for image isn’t working.

Leave a comment

Your email address will not be published. Required fields are marked *

*

Please follow the Support guidelines.

Premium Support is available for customers in the Forums.