這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

SARVAROV Lazy Load

外掛說明

This plugin is the best way to make your images, iframes & videos lazy. Just activate the plugin and lazy loading will work automatically. It’s very simple, just try it!

THIS PLUGIN WILL MAKE YOUR SITE FASTER

All your media content will be loaded only when it’s in the browser viewport. Also you can hide loading process from visitors at all: the lazy elements can be loaded invisibly before the user reaches it.

THIS PLUGIN WILL MAKE YOUR SITE LOOK BETTER

In just one click your can enable blurred LQIP (inspired by Medium) and average color placeholder. Both of them look very modern & interesting.

Main features

  • Speed up your blog, improve its PageSpeed Insights score
  • Change style of placeholder, animation, transition etc.
  • Make placeholder color based of the average color
  • LQIP technology (Low Quality Image Placeholders)
  • <noscript> for visitors who don’t have a JavaScript enabled
  • Using the Lazysizes library and a lot of hooks give the possibility for customization to make the result the way you want
  • High-quality code
  • SEO friendly
  • Mobile friendly
  • Low server load (due to caching)

螢幕擷圖

  • A small demonstration of what can be done.
  • Settings page.

安裝方式

  1. Upload the complete sarvarov-lazy-load folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. You can configure the plugin by clicking on the ‘Lazy Load’ link in the ‘Settings’ menu.

常見問題集

Will that plugin work on any template?

I hope so, but might be not. I originally made this plugin for myself and I tested it only on latest WordPress release on the default Twenty Fifteen theme. If you have compatibility issues with my plugin and your theme – just write me and I will try to fix it on next update.

Why isn’t LQIP technologue working?

LQIP (Low Quality Image Placeholders) is working only on newly uploaded images (.jpg & .jpeg). If you want to make it work with existing images, you need to regenerate lqip image size using a third-party plugin like Regenerate Thumbnails.

How to make lazy custom images/iframes?

You can create a custom function like this:

function my_lazy_process( $content = '', $params = array() ) {

    if( class_exists( 'SARVAROV_Lazy_Load' ) ) {
        return apply_filters( 'lazy_process', $content, $params );
    }

    return $content;
}

Will this plugin affect SEO?

Definitely Yes, in a positive way. The pages of your site will load faster, which positively affects the indexing of your site by search engine robots. The plugin has no effect on image indexing: search engines see them, don’t worry!

How to add Schema.org vocabulary?

For example:

add_filter( 'sarvarov_lazy_load_image_container_atts', function( $atts ) {
    $new_atts = array(
        'itemprop' => array(
            'value' => 'image'
        ), 
        'itemscope' => array(
            'value' => 'itemscope'
        ), 
        'itemtype' => array(
            'value' => 'http://schema.org/ImageObject'
        )
    );

    $atts = array_merge(
        $atts,
        $new_atts
    );

    return $atts;
}, 10, 1 );

add_filter( 'sarvarov_lazy_load_image_container', function( $content = '', $img_width, $img_height, $atts ) {
    if( $img_width && $img_height ) {
        $content .= sprintf( '<meta itemprop="width" content="%1$d" /><meta itemprop="height" content="%2$d" />', $img_width, $img_height );
    }

    return $content;
}, 10, 4 );

I still have a question

I can help with solving your problem on our forum.

使用者評論

閱讀全部 1 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈SARVAROV Lazy Load〉的開發相關工作。

參與者

〈SARVAROV Lazy Load〉外掛目前已有 1 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈SARVAROV Lazy Load〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.1.0

  • Post thumbnail fix

1.0.9

  • WordPress 5.4.x support
  • Post thumbnail fix

1.0.8

  • Adds loading="lazy" to images & iframes inside <noscript>
  • General performance improvements

1.0.7

  • Use cURL if host has allow_url_fopen set to false
  • Added Russian translation.

1.0.6

  • New option: Completely disable placeholders
  • General performance improvements and bug fixes

1.0.5

  • Posts with no blocks support

1.0.4

  • Critical cache bug fix

1.0.3

  • General performance improvements
  • Better cache method

1.0.2

  • Cache error fix
  • Global stability fix

1.0.1

  • PHP error fix
  • Minify public CSS & JavaScript files

1.0.0

  • Initial release