Linux 软件免费装

WP YouTube Lyte

开发者 futtta
optimizingmatters
更新时间 2024年2月3日 16:49
捐献地址: 去捐款
PHP版本: 4.0 及以上
WordPress版本: 6.3

标签

performance video youtube lazy load gdpr

下载

0.7.1 1.2.2 1.6.2 1.7.12 1.7.16 1.7.9 0.1.4 0.2 0.2.1 0.2.2 0.3.0 0.3.4 0.3.5 0.4.0 0.4.1 0.5.1 0.5.2 0.5.3 0.6.0 0.6.1 0.6.2 0.6.3 0.6.4 0.6.5 0.7.2 0.7.3 0.8.0 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 1.0.0 1.1.0 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.3.0 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.7.0 1.7.1 1.7.10 1.7.11 1.7.13 1.7.14 1.7.15 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 0.1.2 0.3.2 0.7.0 1.7.17 1.7.18 0.1 1.7.19 0.5.0 1.7.20 1.7.21 0.1.3 1.1.1 1.7.22 0.1.1 1.3.1 0.3.1 0.3.3 1.7.23

详情介绍:

WP YouTube Lyte allows you to "lazy load" your video's, by inserting responsive "Lite YouTube Embeds". These look and feel like normal embedded YouTube, but only call the "fat" YouTube-player when clicked on, thereby reducing download size & rendering time substantially when embedding YouTube occasionally and improving page performance dramatically when you've got multiple YouTube video's on one and the same page. The plugin can be configured to cache YouTube thumbnails locally, improving both performance and privacy. As such LYTE embedded YouTube videos do not require requests to the YouTube servers, probably (I am not a lawyer) allowing for better GDPR-compliance. The plugin picks up on normal YouTube links, taking over from WordPress core's oEmbed. Alternatively you can add a YouTube-link for a video or an entire playlist with "httpv" instead of "http(s)" or add a Lyte widget to your sidebar and WP YouTube Lyte replaces that link with the correct performance-optimized code. Some examples: Or using shortcodes: [lyte id='_SQkWbRublY' /] [lyte id='_SQkWbRublY' audio='true' /] [lyte id='A486E741B25F8E00' playlist='true' /] WP YouTube Lyte has been written with optimal performance as primary goal, but has been tested for maximum browser-compatibility (iPad included) while keeping an eye on accessibility. Starting with version 1.2.0 lyte embeds are fully responsive and can automatically embed videoObject microdata as well. The plugin is fully multi-language, with support for Catalan, Dutch, English, French, German, Hebrew, Romanian, Spanish and Slovene. Feedback is welcome; see info in the faq for bug reports/ feature requests and feel free to rate and/or report on compatibility on wordpress.org.

安装:

Just install form your Wordpress "Plugins|Add New" screen and all will be well. Manual installation is very straightforward as well:
  1. Upload the zip-file and unzip it in the /wp-content/plugins/ directory
  2. 通过 WordPress 的“插件”菜单激活插件
  3. Place a link to a YouTube clip like this; httpv://www.youtube.com/watch?v=_SQkWbRublY

常见问题:

Why does WP YouTube Lyte need to access the YouTube API? What is an API anyway?

An API is a way to have two pieces of software talk to each other to exchange information. In this case WP YouTube Lyte contacts YouTube to ask it for the thumbnail, the title and the description of the video you added. The thumbnail and title are visible on the webpage (in the Lyte player) while the description is in the HTML as microdata for search engines optimization reasons (see below).

OK, now how can get that API key?

  1. Go to Google Developer Console and log in with your Google account.
  2. Click on 'Create Project' and:
  3. Fill in a Project Name
  4. Fill in a Project ID
  5. Click on 'Create'
  6. On the next page (or when there is no next page, click on your Project's name):
  7. Scroll down to YouTube Data API v3 and click on it
  8. Click on 'ENABLE' at the top to enable the API
  9. Optionally disable other API's
  10. In the sidebar on the left:
  11. Click on 'Credentials'
  12. Click on 'Create Credential' at the top.
  13. Click on 'API key'
  14. Set as little restrictions as possible, most problems with getting this working are caused by these settings.
  15. Click on 'Create'
  16. Copy your API key to WP YouTube Lyte settings page.

I'm getting "technical errors" when validating my YouTube API key

In certain cases when adding restrictions the API key when tested might give technical warnings even if things are working correctly, make sure to check if new video’s are having the title displayed to confirm all is well.

Will WP YouTube Lyte work if I don't provide an API key?

Yes, with some exceptions; WP YouTube Lyte will continue to work, rendering Lyte players, but without the title and microdata (description, time, ...) and without thumbnails for playlists.

I don't want an API key, how can I get rid of the "API key"-notice?

Just enter "none" (without the quotes) in the API key field and Lyte will stop nagging you.

Does WP YouTube Lyte protect my visitor's privacy?

As opposed to some of the most important plugins there is no 3rd party tracking code in WP YouTube Lyte, but YouTube off course does see visitor requests coming in for the thumbnails unless the option to cache thumbnails locally is enabled. If thumbnails are cached locally, no request will be sent to YouTube by your visitor's browser until/ unless the video is played.

I use a page builder and LYTE does not seem active on the YouTube video's I add there?

LYTE by default uses WordPress' "the_content"-filter. Page builders don't apply that filter to their content and thus LYTE does not get triggered on those. As a workaround you can either add the LYTE widget or add the LYTE video using the shortcode in your page-builder Text-block, this works in most page-builders.

Can I use WP YouTube Lyte for a custom field?

Just pass the httpv url of such a field to lyte_preparse like this: if(function_exists('lyte_preparse')) { echo lyte_preparse($video); } and you're good to go!

Does WP YouTube Lyte work with Infinite Scroll?

Starting from version 1.1.0 it does; in Infinite Scroll's configuration you just have to add "ly.te()" in the "Javascript to be called after the next posts are fetched"-box.

How does WP YouTube Lyte support microdata?

  • There is a specific microdata scheme for "videoObject" which WP YouTube Lyte can add to your page, which Google can use to display the video thumbnail next to the search-result
  • This is optional and can be disabled in the options page
  • The videoobject microdata is NOT added for audio-only embeds, playlists or widgets
  • Google will not always display the thumbnail, this presumably depends of the relevance of the video to the rest of the page.

How does captions-support get added to the microdata?

In January 2014 Benetech, a U.S. nonprofit that develops and uses technology to create positive social change, offered a patch that adds the accessibilityFeature property to the microdata for videos that have captions. If you have microdata enabled, WP YouTube Lyte will automatically try to check (in a seperate, asynchronous call via a proxy-webservice, as YouTube only offers captions in their API v3 which requires authentication) if captions are available and if so, adds the accessibilityFeature property with value captions to the microdata. This can be disabled by either disabling microdata or, if you want microdata but not the accessibilityFeature-property by using the "lyte_docaptions"-filter to set captions to false (example-code is in lyte_helper.php_example).

Responsive LYTE embeds

  • The video width in posts and pages will adapt to the width of the container (the div) in which your blogposts/ pages are shown. This means that if your theme is responsive, WP YouTube Lyte will follow.
  • Widgets are not responsive.
  • if the content div width gets to around 200 pixels, the LYTE UI will become garbled (YouTube requires the minimum embed width to be 200px as well).

Can I use WP YouTube Lyte on normal YouTube links or iframes?

Yes, starting with version 1.5.0 normal YouTube links are automatically transferred in Lyte embeds as well. You will automagically also get a (non-Lyte) preview of the video in your visual post edit screen. Starting from LYTE 1.7.5 YouTube iframes can be automatically converted as well.

What can I do with the API?

A whole lot; there are filters to pre-parse the_content, to change settings, to change the CSS, to change the HTML of the LYTE-div, ... There are examples for all filters (and one action) in lyte_helper.php_example

Problem with All In One Seo Pack

All in One SEO Pack be default generates a description which still has httpv-links in it. To remove those, you'll have to use (example code in) lyte_helper.php (see above) and add lyte_filter_aioseop_description to the aioseop-filter in there.

When I click on a LYTE video, a link to YouTube opens, what's up with that?

You probably added a link around the httpv-url. No link is needed, just the httpv-url.

My video's seem to load slower on mobile devices?

By default (unless "cache thumbnail locally" is active) WP YouTube Lyte will indeed load slower normal YouTube video's instead of Lyte ones, as Lyte video's require would require two clicks from the user to play a video (once to load the YouTube video and once to start it) because there is no autoplay-support on mobile. If you want to, you can force WP YouTube Lyte to make video's Lyte on mobile with this code (add it in your child theme's functions.php, in a seperate helper plugin or using the code snippets plugin; add_filter( 'lyte_do_mobile', '__return_true' );

lyteCache.php is using a lot of resources

lyteCache.php is a standalone file (it does not rely on WordPress) that is used when local thumbnail caching is active, which means requests for those thumbnails are handled by PHP. In WP YouTube Lyte 1.7.14 logic was added to prevent lyteCache.php doing thumbnail caching when being called directy without "local thumbnail caching" being active. Moreover if you want to ensure the thumbnails can only be used on your own site (and not hotlinked) you can use this code snippet: add_filter( 'lyte_filter_local_thumb_doublecheck', '__return_true' ); This will have WP YouTube Lyte set (in JavaScript in the HTML) and check (in the request for the thumbnail) a cookie. If the cookie is not set, the image request will be redirected to the YouTube origin URL.

Any other issues should I know about?

  • Having the same YouTube-video on one page can cause WP YouTube Lyte to malfunction (as the YouTube id is used as the div's id in the DOM, and DOM id's are supposed to be unique)

I found a bug/ I would like a feature to be added!

Just tell me, I like the feedback! Use the Contact-page on my blog, leave a comment in a post about wp-youtube-lyte or create a new topic on the wordpress.org forum.

How you can help

更新日志:

1.7.23 1.7.22 1.7.21 1.7.20 1.7.19 1.7.18 1.7.17 1.7.16 1.7.15 1.7.14 1.7.13 1.7.12 1.7.11 1.7.10 1.7.9 1.7.8 1.7.7 1.7.6 1.7.5 1.7.4 1.7.3 1.7.2 1.7.1 1.7.0 1.6.8 1.6.7 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.0 1.4.2 1.4.1 1.4.0 1.3.3 1.3.2 1.3.1 1.3.0 1.2.2 1.2.1 1.2.0 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.0 0.9.4 0.9.3 0.9.2 0.9.1 0.9.0 0.8.0 0.7.3 0.7.2 0.7.1 0.7.0 0.6.5 0.6.4 0.6.3 0.6.2 0.6.1 0.6.0 0.5.3 0.5.2 0.5.1 0.5.0 0.4.1 0.4.0 0.3.5 0.3.4 0.3.3 0.3.2 0.3.0 0.2.2 0.2.1 0.2.0 0.1.4 0.1.3 0.1.2 Accessibility enhancements (hat tip: Ricky Buchanan): 0.1.1 0.1