Plugin Directory

Changeset 3116570

Timestamp:
07/11/2024 03:57:33 PM (4 weeks ago)
Author:
mrwweb
Message:

Update to version 1.1.0 from GitHub

Location:
enhanced-embed-block
Files:
8 added
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • enhanced-embed-block/tags/1.1.0/css/lite-youtube-custom.css

    r3095750 r3116570  
    66*/
    77lite-youtube {
    8     display: block; /* required for layout if JS fails to load */
    9     padding-bottom: 0; /* remove old method of aspect ratio */
    10     aspect-ratio: 16/9;
     8    display: block; /* required for layout if JS fails to load */
     9    padding-bottom: 0; /* remove old method of aspect ratio */
     10    aspect-ratio: 16/9;
    1111}
    1212
    1313.lite-youtube-fallback {
    14     display: flex;
    15     flex-direction: column;
    16     justify-content: center;
    17     align-items: center;
    18     text-align: center;
    19     gap: 5%;
    20     aspect-ratio: 16/9;
    21     padding: 5%;
    22     background-color: #000;
    23     text-decoration: none;
    24     transition: opacity 0.15s ease-in-out;
    25     opacity: 0.85;
     14    --eeb-fallback-background: #000;
     15
     16    display: flex !important;
     17    flex-direction: column !important;
     18    justify-content: center !important;
     19    align-items: center !important;
     20    text-align: center !important;
     21    gap: 5% !important;
     22    aspect-ratio: 16/9 !important;
     23    padding: 5% !important;
     24    background-color: var(--eeb-fallback-background) !important;
     25    text-decoration: none !important;
     26    transition: opacity 0.15s ease-in-out !important;
    2627}
    2728
    2829.lite-youtube-fallback:hover {
    29     opacity: 1;
     30    text-decoration: underline !important;
     31}
     32.lite-youtube-fallback:hover::before {
     33    transform: scale(1.1) !important;
     34}
     35@media (prefers-reduced-motion: reduce) {
     36    .lite-youtube-fallback:hover::before {
     37        transform: none !important;
     38    }
    3039}
    3140
    3241.lite-youtube-fallback:focus-visible {
    33     outline: 1px solid red;
    34     outline-offset: 3px;
    35     opacity: 1;
     42    red;
     43    outline;
     44    o;
    3645}
    3746
     
    4554
    4655.lite-youtube-fallback::before {
    47     display: block;
    48     content: "";
    49     background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="94" height="67" xml:space="preserve"><path fill="red" d="M15.113 3.169C8.148 3.716 2.883 9.38 2.543 16.36 2.262 22.114 2 28.731 2 33.301c0 4.621.27 11.341.551 17.138.336 6.891 5.484 12.52 12.355 13.151C22.511 64.293 33.515 65 47 65c13.449 0 24.434-.703 32.035-1.402 6.898-.637 12.055-6.301 12.387-13.219.293-6.106.578-13.086.578-17.078 0-3.949-.281-10.824-.57-16.883-.332-7.008-5.61-12.707-12.602-13.254C71.34 2.574 60.543 2 47 2c-13.578 0-24.396.578-31.887 1.169zM38 19.942l23.199 13.359L38 46.656V19.942z"/><path fill="white" d="m38 19.942 23.199 13.359L38 46.656z"/></svg>')
    50         center / cover no-repeat;
    51     width: 20%;
    52     aspect-ratio: 94/67;
     56    display: block !important;
     57    content: "" !important;
     58    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>')
     59        center / cover no-repeat !important;
     60    width: 68px !important;
     61    height: 48px !important;
     62    aspect-ratio: 94/67 !important;
     63    transition: 0.15s transform ease-in-out !important;
    5364}
  • enhanced-embed-block/tags/1.1.0/enhanced-embed-block.php

    r3095750 r3116570  
    77 * Author URI:      https://MRWweb.com
    88 * Text Domain:     enhanced-embed-block
    9  * Version:         1.0.0
     9 * Version:         1..0
    1010 * Requires at least: 6.5
    1111 * Requires PHP:    7.4
     
    1313 * License URI:     https://www.gnu.org/licenses/gpl-3.0.html
    1414 *
    15  * @package         Enhanced_YouTube_Embed_Block
     15 * @package         Enhanced_Embed_Block
    1616 */
    1717
     
    2020use WP_HTML_TAG_Processor;
    2121
    22 define( 'EEB_VERSION', '1.0.0' );
     22define( 'EEB_VERSION', '1..0' );
    2323
    2424add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_lite_youtube_component' );
     
    3636        array( 'in_footer' => true )
    3737    );
     38
    3839
     40
     41
    3942    wp_enqueue_block_style(
    4043        'core/embed',
     
    4750    );
    4851}
     52
    4953
    5054/* Pre-2020 Blocks */
     
    6064 */
    6165function replace_youtube_embed_with_web_component( $content, $block ) {
    62     if ( 'youtube' !== $block['attrs']['providerNameSlug'] && isset( $block['attrs']['url'] ) ) {
     66    $isValidYouTube = 'youtube' === $block['attrs']['providerNameSlug'] && isset( $block['attrs']['url'] );
     67    if( ! $isValidYouTube || is_feed() ) {
    6368        return $content;
    6469    }
     
    7883    $play_button = sprintf( __( 'Play: %s', 'enhanced-embed-block' ), $video_title );
    7984
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
    80101    /* Craft the new output: the web component with HTML fallback link */
    81102    $content = sprintf(
    82103        '<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube">
    83104            <div class="wp-block-embed__wrapper">
    84                 <lite-youtube videoid="%1$s" videoplay="%2$s" videoStartAt="%3$d" posterloading="lazy" nocookie>
    85                     <a href="%4$s" class="lite-youtube-fallback" target="_blank" rel="noreferrer noopenner">Watch "%5$s" on YouTube</a>
     105                <lite-youtube videoid="%1$s" videoplay="%2$s" videoStartAt="%3$d" poster>
     106                    <a href="%$s" on YouTube</a>
    86107                </lite-youtube>
    87108            </div>
    88             %6$s
     109            %$s
    89110        </figure>',
    90111        esc_attr( $video_id ),
    91112        esc_attr( $play_button ),
    92113        $start_time ? intval( $start_time ) : 0,
     114
     115
    93116        esc_url( $block['attrs']['url'] ),
    94117        esc_html( $video_title ),
     
    118141 * @param string $html A block of HTML containing a YouTube iframe.
    119142 * @return string The figcaption OR an empty string
     143
     144
    120145 */
    121146function extract_figcaption_from_embed_code( $html ) {
  • enhanced-embed-block/tags/1.1.0/readme.txt

    r3101319 r3116570  
    11=== Enhanced Embed Block for YouTube ===
    2 Contributors: mrwweb
     2Contributors: mrwweb
    33Donate link: https://paypal.me/rootwiley
    44Tags: YouTube, embed, video, block, performance
    55Requires at least: 6.5
    6 Tested up to: 6.5
     6Tested up to: 6.
    77Requires PHP: 7.4
    8 Stable tag: 1.0.0-retry-github-action
     8Stable tag: 1.
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5858= Does this create a new block? =
    5959
    60 No. It enhances the default WordPress YouTube embed block.
     60No. It enhances the default WordPress .
    6161
    6262= Does it automatically enhance all my YouTube embeds? =
     
    7676Not right now. If you'd pay for a PRO version with this feature, [let me know](https://mrwweb.com/wordpress-plugins/enhanced-embed-block/#pro).
    7777
    78 = Known Issues =
    79 
    80 Some older videos do not have a thumbnail image in the modern webp format. This can lead to a blurry gray video poster image for the video. [Upstream issue](https://github.com/justinribeiro/lite-youtube/issues/79)
    81 
    8278== Software ==
    8379
     
    8682== Changelog ==
    8783
     84
     85
     86
     87
     88
     89
     90
     91
     92
    8893= 1.0.0 =
    8994- Initial release to the WordPress repository!
    9095
    9196== Upgrade Notice ==
     97
     98
     99
  • enhanced-embed-block/trunk/css/lite-youtube-custom.css

    r3095750 r3116570  
    66*/
    77lite-youtube {
    8     display: block; /* required for layout if JS fails to load */
    9     padding-bottom: 0; /* remove old method of aspect ratio */
    10     aspect-ratio: 16/9;
     8    display: block; /* required for layout if JS fails to load */
     9    padding-bottom: 0; /* remove old method of aspect ratio */
     10    aspect-ratio: 16/9;
    1111}
    1212
    1313.lite-youtube-fallback {
    14     display: flex;
    15     flex-direction: column;
    16     justify-content: center;
    17     align-items: center;
    18     text-align: center;
    19     gap: 5%;
    20     aspect-ratio: 16/9;
    21     padding: 5%;
    22     background-color: #000;
    23     text-decoration: none;
    24     transition: opacity 0.15s ease-in-out;
    25     opacity: 0.85;
     14    --eeb-fallback-background: #000;
     15
     16    display: flex !important;
     17    flex-direction: column !important;
     18    justify-content: center !important;
     19    align-items: center !important;
     20    text-align: center !important;
     21    gap: 5% !important;
     22    aspect-ratio: 16/9 !important;
     23    padding: 5% !important;
     24    background-color: var(--eeb-fallback-background) !important;
     25    text-decoration: none !important;
     26    transition: opacity 0.15s ease-in-out !important;
    2627}
    2728
    2829.lite-youtube-fallback:hover {
    29     opacity: 1;
     30    text-decoration: underline !important;
     31}
     32.lite-youtube-fallback:hover::before {
     33    transform: scale(1.1) !important;
     34}
     35@media (prefers-reduced-motion: reduce) {
     36    .lite-youtube-fallback:hover::before {
     37        transform: none !important;
     38    }
    3039}
    3140
    3241.lite-youtube-fallback:focus-visible {
    33     outline: 1px solid red;
    34     outline-offset: 3px;
    35     opacity: 1;
     42    red;
     43    outline;
     44    o;
    3645}
    3746
     
    4554
    4655.lite-youtube-fallback::before {
    47     display: block;
    48     content: "";
    49     background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="94" height="67" xml:space="preserve"><path fill="red" d="M15.113 3.169C8.148 3.716 2.883 9.38 2.543 16.36 2.262 22.114 2 28.731 2 33.301c0 4.621.27 11.341.551 17.138.336 6.891 5.484 12.52 12.355 13.151C22.511 64.293 33.515 65 47 65c13.449 0 24.434-.703 32.035-1.402 6.898-.637 12.055-6.301 12.387-13.219.293-6.106.578-13.086.578-17.078 0-3.949-.281-10.824-.57-16.883-.332-7.008-5.61-12.707-12.602-13.254C71.34 2.574 60.543 2 47 2c-13.578 0-24.396.578-31.887 1.169zM38 19.942l23.199 13.359L38 46.656V19.942z"/><path fill="white" d="m38 19.942 23.199 13.359L38 46.656z"/></svg>')
    50         center / cover no-repeat;
    51     width: 20%;
    52     aspect-ratio: 94/67;
     56    display: block !important;
     57    content: "" !important;
     58    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>')
     59        center / cover no-repeat !important;
     60    width: 68px !important;
     61    height: 48px !important;
     62    aspect-ratio: 94/67 !important;
     63    transition: 0.15s transform ease-in-out !important;
    5364}
  • enhanced-embed-block/trunk/enhanced-embed-block.php

    r3095750 r3116570  
    77 * Author URI:      https://MRWweb.com
    88 * Text Domain:     enhanced-embed-block
    9  * Version:         1.0.0
     9 * Version:         1..0
    1010 * Requires at least: 6.5
    1111 * Requires PHP:    7.4
     
    1313 * License URI:     https://www.gnu.org/licenses/gpl-3.0.html
    1414 *
    15  * @package         Enhanced_YouTube_Embed_Block
     15 * @package         Enhanced_Embed_Block
    1616 */
    1717
     
    2020use WP_HTML_TAG_Processor;
    2121
    22 define( 'EEB_VERSION', '1.0.0' );
     22define( 'EEB_VERSION', '1..0' );
    2323
    2424add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_lite_youtube_component' );
     
    3636        array( 'in_footer' => true )
    3737    );
     38
    3839
     40
     41
    3942    wp_enqueue_block_style(
    4043        'core/embed',
     
    4750    );
    4851}
     52
    4953
    5054/* Pre-2020 Blocks */
     
    6064 */
    6165function replace_youtube_embed_with_web_component( $content, $block ) {
    62     if ( 'youtube' !== $block['attrs']['providerNameSlug'] && isset( $block['attrs']['url'] ) ) {
     66    $isValidYouTube = 'youtube' === $block['attrs']['providerNameSlug'] && isset( $block['attrs']['url'] );
     67    if( ! $isValidYouTube || is_feed() ) {
    6368        return $content;
    6469    }
     
    7883    $play_button = sprintf( __( 'Play: %s', 'enhanced-embed-block' ), $video_title );
    7984
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
    80101    /* Craft the new output: the web component with HTML fallback link */
    81102    $content = sprintf(
    82103        '<figure class="wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube">
    83104            <div class="wp-block-embed__wrapper">
    84                 <lite-youtube videoid="%1$s" videoplay="%2$s" videoStartAt="%3$d" posterloading="lazy" nocookie>
    85                     <a href="%4$s" class="lite-youtube-fallback" target="_blank" rel="noreferrer noopenner">Watch "%5$s" on YouTube</a>
     105                <lite-youtube videoid="%1$s" videoplay="%2$s" videoStartAt="%3$d" poster>
     106                    <a href="%$s" on YouTube</a>
    86107                </lite-youtube>
    87108            </div>
    88             %6$s
     109            %$s
    89110        </figure>',
    90111        esc_attr( $video_id ),
    91112        esc_attr( $play_button ),
    92113        $start_time ? intval( $start_time ) : 0,
     114
     115
    93116        esc_url( $block['attrs']['url'] ),
    94117        esc_html( $video_title ),
     
    118141 * @param string $html A block of HTML containing a YouTube iframe.
    119142 * @return string The figcaption OR an empty string
     143
     144
    120145 */
    121146function extract_figcaption_from_embed_code( $html ) {
  • enhanced-embed-block/trunk/readme.txt

    r3101319 r3116570  
    11=== Enhanced Embed Block for YouTube ===
    2 Contributors: mrwweb
     2Contributors: mrwweb
    33Donate link: https://paypal.me/rootwiley
    44Tags: YouTube, embed, video, block, performance
    55Requires at least: 6.5
    6 Tested up to: 6.5
     6Tested up to: 6.
    77Requires PHP: 7.4
    8 Stable tag: 1.0.0-retry-github-action
     8Stable tag: 1.
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5858= Does this create a new block? =
    5959
    60 No. It enhances the default WordPress YouTube embed block.
     60No. It enhances the default WordPress .
    6161
    6262= Does it automatically enhance all my YouTube embeds? =
     
    7676Not right now. If you'd pay for a PRO version with this feature, [let me know](https://mrwweb.com/wordpress-plugins/enhanced-embed-block/#pro).
    7777
    78 = Known Issues =
    79 
    80 Some older videos do not have a thumbnail image in the modern webp format. This can lead to a blurry gray video poster image for the video. [Upstream issue](https://github.com/justinribeiro/lite-youtube/issues/79)
    81 
    8278== Software ==
    8379
     
    8682== Changelog ==
    8783
     84
     85
     86
     87
     88
     89
     90
     91
     92
    8893= 1.0.0 =
    8994- Initial release to the WordPress repository!
    9095
    9196== Upgrade Notice ==
     97
     98
     99
Note: See TracChangeset for help on using the changeset viewer.