Plugin Directory

Changeset 3089815


Ignore:
Timestamp:
05/21/2024 04:16:07 AM (21 months ago)
Author:
beleaf
Message:

Release 1.6.2

Location:
lazy-embed/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lazy-embed/trunk/lazy-embed.php

    r3089755 r3089815  
    77 * Plugin URI: https://bitbucket.org/beleaf-au/lazy-embed/
    88 * Description: Improves the performance and reduces the emissions of your website by only loading embeds (youtube, vimeo, etc) when they are clicked.
    9  * Version: 1.6.1
     9 * Version: 1.6.2
    1010 * Requires PHP: 7.1
    1111 * Requires at least: 6.2.0
     
    3434        {
    3535            if ($block['blockName'] === 'core/embed' || $block['blockName'] === 'core/video') {
    36                 $tag = $block['blockName'] === 'core/embed'
    37                     ? 'iframe'
    38                     : 'video';
    39 
    40                 $processor = new \WP_HTML_Tag_Processor($html);
    41                 $processor->next_tag($tag);
    42 
    4336                if (!empty($block['attrs']['className']) && str_contains($block['attrs']['className'], self::IGNORE_STRING)) {
     37                    $tag = $block['blockName'] === 'core/embed'
     38                        ? 'iframe'
     39                        : 'video';
     40   
     41                    $processor = new \WP_HTML_Tag_Processor($html);
     42                    $processor->next_tag($tag);
    4443                    $processor->add_class(self::IGNORE_STRING);
    45                     return $processor->get_updated_html();
    46                 }elseif($tag === 'iframe') {
    47                     $processor->set_attribute('loading', 'lazy');
    4844                    return $processor->get_updated_html();
    4945                }
     
    129125            $processor->set_attribute('srcdoc', $srcdoc);
    130126
     127            // Add lazy loading
     128            $processor->set_attribute('loading', 'lazy');
     129
    131130            return $processor;
    132131        }
  • lazy-embed/trunk/readme.txt

    r3089755 r3089815  
    44Requires at least: 6.2.0
    55Tested up to: 6.4
    6 Stable tag: 1.6.1
     6Stable tag: 1.6.2
    77Requires PHP: 5.6
    88License: GPLv2 or later
     
    2727== Changelog ==
    2828
    29 = 1.6.1 =
     29= 1.6.2 - 21/05/2024 =
     30Fix iframe lazy loading implementation
     31
     32= 1.6.1 - 21/05/2024 =
    3033Fix: Load high resolution thumbnail from youtube
    3134Fix: Lazy load iframe and img tag placeholder
Note: See TracChangeset for help on using the changeset viewer.