Lazy Widget Loader

Posted by kento on June 19, 2011 7:02 pm

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

About kento
Computer Science Engineer, IT & Business Consultant, Drupal, WordPress, Scenario Planning ...

24 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

Leave a comment

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

*


5 × = thirty five