Plugin Directory

Changeset 3408298


Ignore:
Timestamp:
12/02/2025 05:07:36 PM (4 months ago)
Author:
markhowellsmead
Message:

Add unmaintained comment

Location:
mhm-lazyloadvideo/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • mhm-lazyloadvideo/trunk/Plugin.php

    r1976698 r3408298  
    11<?php
    22/*
    3 Plugin Name: Lazy load video players
    4 Plugin URI: https://github.com/mhmli/mhm-lazyloadvideo
     3Plugin Name: Lazy load video players (UNMAINTAINED)
     4Plugin URI: https://wordpress.org/plugins/mhm-lazyloadvideo/
    55Description: Modifies the HTML output of any video players embedded in the content area using the oEmbed technique. Any video player which is included on the page will only be loaded if/when it is visible within the current browser window. Requires JavaScript. The original player will be displayed if JavaScript is inactive on the page.
    66Author: Mark Howells-Mead
     
    2424    public function dump($var, $die = false)
    2525    {
    26         echo '<pre>'.print_r($var, 1).'</pre>';
     26        echo '<pre>' . print_r($var, 1) . '</pre>';
    2727        if ($die) {
    2828            die();
     
    3838    {
    3939        if (!function_exists('get_plugins')) {
    40             require_once ABSPATH.'wp-admin/includes/plugin.php';
     40            require_once ABSPATH . 'wp-admin/includes/plugin.php';
    4141        }
    42         $plugin_folder = get_plugins('/'.plugin_basename(dirname(__FILE__)));
     42        $plugin_folder = get_plugins('/' . plugin_basename(dirname(__FILE__)));
    4343        $plugin_file = basename((__FILE__));
    4444
     
    5353    public function lazyloader()
    5454    {
    55         $scriptpath = plugins_url('Resources/Public/JavaScript/mhmlazyloadvideo.js?v'.$this->version, __FILE__);
     55        $scriptpath = plugins_url('Resources/Public/JavaScript/mhmlazyloadvideo.js?v' . $this->version, __FILE__);
    5656
    57         echo '<script>(function(i,s,o,g,r,a,m){i["mhmlazyloadvideo_script"]=r;i[r]=i[r]||function(){'.
    58             '(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),'.
    59             'm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)'.
    60             '})(window,document,"script","'.$scriptpath.'","mhmlazyloadvideo");</script>';
     57        echo '<script>(function(i,s,o,g,r,a,m){i["mhmlazyloadvideo_script"]=r;i[r]=i[r]||function(){' .
     58            '(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),' .
     59            'm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)' .
     60            '})(window,document,"script","' . $scriptpath . '","mhmlazyloadvideo");</script>';
    6161    }
    6262
     
    7070    public function initLazyLoad($playerID)
    7171    {
    72         return '<script data-plugin="mhm_lazyloadvideo">mhmlazyloadvideo("'.$playerID.'");</script>';
     72        return '<script data-plugin="mhm_lazyloadvideo">mhmlazyloadvideo("' . $playerID . '");</script>';
    7373    }
    7474
     
    8484    public function lazyLoadVideo($html, $url)
    8585    {
    86         $html_was = '<noscript>'.$html.'</noscript>';
     86        $html_was = '<noscript>' . $html . '</noscript>';
    8787
    8888        $host = parse_url($url, PHP_URL_HOST);
     
    9191            case 'www.vimeo.com':
    9292                $uniqueID = uniqid();
    93                 $html = str_replace(' src="', ' data-mhmlazyloadvideo="'.$uniqueID.'" data-src="', $html).$this->initLazyLoad($uniqueID).$html_was;
     93                $html = str_replace(' src="', ' data-mhmlazyloadvideo="' . $uniqueID . '" data-src="', $html) . $this->initLazyLoad($uniqueID) . $html_was;
    9494                break;
    9595
     
    9898            case 'youtu.be':
    9999                $uniqueID = uniqid();
    100                 $html = str_replace(' src="', ' data-mhmlazyloadvideo="'.$uniqueID.'" data-src="', $html).$this->initLazyLoad($uniqueID).$html_was;
     100                $html = str_replace(' src="', ' data-mhmlazyloadvideo="' . $uniqueID . '" data-src="', $html) . $this->initLazyLoad($uniqueID) . $html_was;
    101101                break;
    102102        }
  • mhm-lazyloadvideo/trunk/README.txt

    r1976697 r3408298  
    1010
    1111== Description ==
     12
     13** This plugin is no longer maintained. **
    1214
    1315Modifies the HTML output of any video players which have been embedded in the content area or in the site using the oEmbed technique. Any video player which is included on the page will only be loaded if/when it is/becomes visible within the current browser window.
Note: See TracChangeset for help on using the changeset viewer.