Version Description
Download this release
Release Info
Developer | embedplus |
Plugin | YouTube |
Version | 10.3 |
Comparing to | |
See all releases |
Code changes from version 10.2 to 10.3
- images/gallery-page-loader.gif +0 -0
- images/icongallery.png +0 -0
- images/playhover.png +0 -0
- images/ssaltgallery.jpg +0 -0
- images/ssgallery.png +0 -0
- readme.txt +17 -8
- screenshot-6.jpg +0 -0
- screenshot-7.jpg +0 -0
- screenshot-8.jpg +0 -0
- scripts/ytprefs.min.js +9 -6
- styles/index.html +11 -0
- styles/ytprefs.min.css +1 -0
- youtube.php +573 -195
images/gallery-page-loader.gif
ADDED
Binary file
|
images/icongallery.png
ADDED
Binary file
|
images/playhover.png
ADDED
Binary file
|
images/ssaltgallery.jpg
ADDED
Binary file
|
images/ssgallery.png
ADDED
Binary file
|
readme.txt
CHANGED
@@ -1,18 +1,19 @@
|
|
1 |
=== YouTube ===
|
2 |
Contributors: embedplus
|
3 |
Plugin Name: YouTube Embed
|
4 |
-
Tags: accessibility, analytics, api, blocked youtube videos, cache, caching, channel, deleted youtube videos, effects, embed youtube, embedding youtube, featured image, get_locale, i18n, internationalization, l10n, language, lazy, lazy load,
|
5 |
-
Requires at least: 3.
|
6 |
Tested up to: 4.2
|
7 |
-
Stable tag: 10.
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
-
YouTube embed plugin. Embed responsive
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
**Here are a few recently added features (even more features below):**
|
15 |
|
|
|
16 |
* Improved accessibility by using title attributes for screen reader support. It should help your site [pass functional accessibility evaluations (FAE)](https://www.youtube.com/watch?v=gpAiFnYYkbk).
|
17 |
* Site origin information with each embed code as an extra security measure. In YouTube's/Google's own words, checking this option "protects against malicious third-party JavaScript being injected into your page and hijacking control of your YouTube player." We especially recommend checking it as it adds higher security than the built-in YouTube embedding method that comes with the current version of WordPress (i.e. oembed).
|
18 |
* Easy "Insert" button for both the Visual and Text mode of the editor
|
@@ -30,6 +31,7 @@ YouTube embed plugin. Embed responsive YouTube video players & playlists in post
|
|
30 |
|
31 |
You can even extend the plugin with PRO features like:
|
32 |
|
|
|
33 |
* Caching to avoid making frequent requests to YouTube.com and speed up your page loads.
|
34 |
* [Automatic video thumbnail images](http://embedplus.com/add-youtube-video-thumbnails-featured-image-wordpress.aspx): each post or page that contains at least one video will have the thumbnail of its first video serve as its featured image.
|
35 |
* [Eye-catching special effects for YouTube embeds >>](http://www.embedplus.com/add-special-effects-to-youtube-embeds-in-wordpress.aspx) (uses lazy loading)
|
@@ -83,13 +85,14 @@ You can also start and end each individual video at particular times. Like the a
|
|
83 |
|
84 |
**About the PRO version:**
|
85 |
|
86 |
-
Beyond the above features, you have the option of upgrading to PRO to add enhanced features like the full visual embedding wizard (so you can avoid memorizing codes), priority support, and security/performance. As a PRO user, you also get access to our deleted video alerts to help avoid showing embedded videos that are later removed from YouTube.com. You even get an embedder-centric analytics dashboard that adds view tracking to each of your embeds so that you can answers questions like:
|
87 |
|
88 |
* How much are your visitors actually watching the videos you post?
|
89 |
* How does the view activity on your site compare to other sites like it?
|
90 |
* What and when are your best and worst performing YouTube embeds?
|
91 |
* How much do the producers of the YouTube videos you embed rely on **your site**, versus other sites and YouTube.com, for views?
|
92 |
* Are you embedding videos that are blocked in other countries?
|
|
|
93 |
|
94 |
See more details after installing. Enjoy!
|
95 |
|
@@ -101,6 +104,7 @@ See more details after installing. Enjoy!
|
|
101 |
1. Access the Plugins admin menu to activate the YouTube embed plugin.
|
102 |
1. Make your default settings after clicking the new YouTube menu item that shows up in your admin panel.
|
103 |
1. To embed videos in your post, start pasting the links with any desired additional codes needed for your YouTube embed (see below section for additional codes). Make sure each link is on its own line. Or, if you need multiple videos on the same line, make sure each URL is wrapped properly with the shortcode. Example: `[embedyt]http://www.youtube.com/watch?v=ABCDEFGHIJK&width=400&height=250[/embedyt]` If you don't know exactly which video you want to embed, use the free built-in search feature to find and insert one.
|
|
|
104 |
1. To get video SEO, an analytics dashboard and many other premium features, [sign up for one of the options here >>](https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx)
|
105 |
|
106 |
**Additional codes (adding these will override the default settings in the admin):**
|
@@ -133,14 +137,19 @@ You can also start and end each individual video at particular times. Like the a
|
|
133 |
== Screenshots ==
|
134 |
|
135 |
1. YouTube Embed Screenshot 1: Paste a YouTube link on its own line and it will become a YouTube embed on your website. Or, use the shortcode method.
|
136 |
-
2. YouTube Embed Screenshot 2: How to get to YouTube's admin settings
|
137 |
3. YouTube Embed Screenshot 3: Visual YouTube Wizard and Search Tool
|
138 |
4. YouTube Embed Screenshot 4: Wizard Insert Search Result Screenshot
|
139 |
5. YouTube Embed Screenshot 5: Wizard Search Results Screenshot
|
140 |
-
6. YouTube Embed Screenshot 6:
|
|
|
|
|
141 |
|
142 |
== Changelog ==
|
143 |
|
|
|
|
|
|
|
144 |
= YouTube Embed 10.2 =
|
145 |
Adds start video settings for playlist embeds. You can now choose to start a playlist with a specific video or have the plugin automatically start with the most recently added video.
|
146 |
|
@@ -334,6 +343,6 @@ First release uploaded to the plugin repository.
|
|
334 |
|
335 |
== Other Notes ==
|
336 |
|
337 |
-
This YouTube plugin can include premium features like animation effects using lazy loading, automatic video thumbnail support, automatic schema tagging for video SEO, mobile compatibility checking, and deleted video alerts when you [upgrade to PRO](https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx).
|
338 |
|
339 |
We also have a YouTube channel with some helper videos. [Check them out here >>](https://www.youtube.com/user/EmbedPlus)
|
1 |
=== YouTube ===
|
2 |
Contributors: embedplus
|
3 |
Plugin Name: YouTube Embed
|
4 |
+
Tags: video gallery, youtube galleries, channel gallery, gallery, playlist gallery, youtube gallery, accessibility, analytics, api, blocked youtube videos, cache, caching, channel, deleted youtube videos, effects, embed youtube, embedding youtube, featured image, get_locale, i18n, internationalization, l10n, language, lazy, lazy load, locale, localization, mute, no-cookie, oembed, page speed, playlist, playlists, plugin, Reddit, responsive, seo, short code, shortcode, special effects, ssl, subtitles, thumbnail, thumbnail image, thumbnails, tinymce, translate, translator, video, video analytics, video plugin, video seo, video shortcode, video thumbnails, view count, volume, widget, wordpress security, wordpress youtube embed, youtube, youtube api, youtube analytics, youtube embed, youtube impressions, youtube player, youtube playlist, youtube plugin, youtube shortcode, youtube snippets, youtube takedowns, youtube thumbnails, youtube plugin migration
|
5 |
+
Requires at least: 3.3
|
6 |
Tested up to: 4.2
|
7 |
+
Stable tag: 10.3
|
8 |
License: GPLv3 or later
|
9 |
|
10 |
+
YouTube embed plugin. Embed a responsive video, YouTube channel gallery, or playlist gallery. Add video thumbnails, analytics, SEO, caching...
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
**Here are a few recently added features (even more features below):**
|
15 |
|
16 |
+
* The ability to make playlist (and channel) embeds have a gallery layout. By the default, the plugin can generate a grid-based [responsive playlist and channel gallery >>](http://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Your visitors can browse through pages of video thumbnails and choose from videos that are pulled from an entire playlist or channel.
|
17 |
* Improved accessibility by using title attributes for screen reader support. It should help your site [pass functional accessibility evaluations (FAE)](https://www.youtube.com/watch?v=gpAiFnYYkbk).
|
18 |
* Site origin information with each embed code as an extra security measure. In YouTube's/Google's own words, checking this option "protects against malicious third-party JavaScript being injected into your page and hijacking control of your YouTube player." We especially recommend checking it as it adds higher security than the built-in YouTube embedding method that comes with the current version of WordPress (i.e. oembed).
|
19 |
* Easy "Insert" button for both the Visual and Text mode of the editor
|
31 |
|
32 |
You can even extend the plugin with PRO features like:
|
33 |
|
34 |
+
* Alternate playlist and channel gallery styling
|
35 |
* Caching to avoid making frequent requests to YouTube.com and speed up your page loads.
|
36 |
* [Automatic video thumbnail images](http://embedplus.com/add-youtube-video-thumbnails-featured-image-wordpress.aspx): each post or page that contains at least one video will have the thumbnail of its first video serve as its featured image.
|
37 |
* [Eye-catching special effects for YouTube embeds >>](http://www.embedplus.com/add-special-effects-to-youtube-embeds-in-wordpress.aspx) (uses lazy loading)
|
85 |
|
86 |
**About the PRO version:**
|
87 |
|
88 |
+
Beyond the above features, you have the option of upgrading to PRO to add enhanced features like the full visual embedding wizard (so you can avoid memorizing codes), gallery styling for channel and playlist embeds, priority support, and security/performance. As a PRO user, you also get access to our deleted video alerts to help avoid showing embedded videos that are later removed from YouTube.com. You even get an embedder-centric analytics dashboard that adds view tracking to each of your embeds so that you can answers questions like:
|
89 |
|
90 |
* How much are your visitors actually watching the videos you post?
|
91 |
* How does the view activity on your site compare to other sites like it?
|
92 |
* What and when are your best and worst performing YouTube embeds?
|
93 |
* How much do the producers of the YouTube videos you embed rely on **your site**, versus other sites and YouTube.com, for views?
|
94 |
* Are you embedding videos that are blocked in other countries?
|
95 |
+
* Have your visitors tried to view a page and/or gallery on your site with deleted/unavailable videos?
|
96 |
|
97 |
See more details after installing. Enjoy!
|
98 |
|
104 |
1. Access the Plugins admin menu to activate the YouTube embed plugin.
|
105 |
1. Make your default settings after clicking the new YouTube menu item that shows up in your admin panel.
|
106 |
1. To embed videos in your post, start pasting the links with any desired additional codes needed for your YouTube embed (see below section for additional codes). Make sure each link is on its own line. Or, if you need multiple videos on the same line, make sure each URL is wrapped properly with the shortcode. Example: `[embedyt]http://www.youtube.com/watch?v=ABCDEFGHIJK&width=400&height=250[/embedyt]` If you don't know exactly which video you want to embed, use the free built-in search feature to find and insert one.
|
107 |
+
1. You can also [embed a playlist and channel gallery with this plugin >>](http://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Please install the plugin and visit the settings page for instructions.
|
108 |
1. To get video SEO, an analytics dashboard and many other premium features, [sign up for one of the options here >>](https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx)
|
109 |
|
110 |
**Additional codes (adding these will override the default settings in the admin):**
|
137 |
== Screenshots ==
|
138 |
|
139 |
1. YouTube Embed Screenshot 1: Paste a YouTube link on its own line and it will become a YouTube embed on your website. Or, use the shortcode method.
|
140 |
+
2. YouTube Embed Screenshot 2: How to get to YouTube's admin settings
|
141 |
3. YouTube Embed Screenshot 3: Visual YouTube Wizard and Search Tool
|
142 |
4. YouTube Embed Screenshot 4: Wizard Insert Search Result Screenshot
|
143 |
5. YouTube Embed Screenshot 5: Wizard Search Results Screenshot
|
144 |
+
6. YouTube Embed Screenshot 6: Gallery layout for a playlist or channel
|
145 |
+
7. YouTube Embed Screenshot 7: YouTube playlist galleries are also easily supported. Here's the Billboard Top 25 Songs for example.
|
146 |
+
8. YouTube Embed Screenshot 8: Localization/internationalization so you can set the player's interface language
|
147 |
|
148 |
== Changelog ==
|
149 |
|
150 |
+
= YouTube Embed 10.3 =
|
151 |
+
Adds the ability to make playlist and channel embeds have a gallery layout. By the default, the plugin can generate a grid-based [responsive playlist and channel gallery >>](http://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx)
|
152 |
+
|
153 |
= YouTube Embed 10.2 =
|
154 |
Adds start video settings for playlist embeds. You can now choose to start a playlist with a specific video or have the plugin automatically start with the most recently added video.
|
155 |
|
343 |
|
344 |
== Other Notes ==
|
345 |
|
346 |
+
This YouTube plugin can include premium features like animation effects using lazy loading, alternate playlist and channel gallery styles, automatic video thumbnail support, automatic schema tagging for video SEO, mobile compatibility checking, and deleted video alerts when you [upgrade to PRO](https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx).
|
347 |
|
348 |
We also have a YouTube channel with some helper videos. [Check them out here >>](https://www.youtube.com/user/EmbedPlus)
|
screenshot-6.jpg
CHANGED
Binary file
|
screenshot-7.jpg
ADDED
Binary file
|
screenshot-8.jpg
ADDED
Binary file
|
scripts/ytprefs.min.js
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
-
(function(
|
2 |
-
isNaN(
|
3 |
-
justid:function(
|
4 |
-
encodeURIComponent(
|
5 |
-
(a
|
6 |
-
|
|
|
|
|
|
1 |
+
(function(a){document.querySelectorAll||(document.querySelectorAll=function(b){var d=document,c=d.documentElement.firstChild,f=d.createElement("STYLE");c.appendChild(f);d.__qsaels=[];f.styleSheet.cssText=b+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return d.__qsaels});"undefined"===typeof a._EPADashboard_&&(a._EPADashboard_={initStarted:!1,checkCount:0,onPlayerReady:function(b){try{if("undefined"!==typeof epdovol&&epdovol){var a=parseInt(b.target.getIframe().getAttribute("data-vol"));
|
2 |
+
isNaN(a)||(0===a?b.target.mute():(b.target.isMuted()&&b.target.unMute(),b.target.setVolume(a)))}}catch(c){}setTimeout(function(){try{var a=_EPADashboard_.justid(b.target.getVideoUrl());_EPADashboard_.jp("ytid="+a)}catch(d){}},1700)},onPlayerStateChange:function(b){var a=b.target.getIframe();if(b.data===YT.PlayerState.PLAYING&&!0!==b.target.ponce&&-1===a.src.indexOf("autoplay=1")){b.target.ponce=!0;try{var c=_EPADashboard_.justid(b.target.getVideoUrl());_EPADashboard_.jp("ytid="+c+"&p=1")}catch(f){}}},
|
3 |
+
justid:function(b){return/[\?&]v=([^&#]*)/.exec(b)[1]},dynsetupevents:function(){"undefined"===typeof this.epytsetupdone&&_EPADashboard_.setupevents(this.id)},setupevents:function(b){_EPADashboard_.log("Setting up YT API events: "+b);YT.loaded&&(document.getElementById(b).epytsetupdone=!0,new YT.Player(b,{events:{onReady:_EPADashboard_.onPlayerReady,onStateChange:_EPADashboard_.onPlayerStateChange}}))},jp:function(b){var c=document.createElement("script");c.src="//www.embedplus.com/test-page.aspx?es=w&u="+
|
4 |
+
encodeURIComponent(a.location.href.split("#")[0])+"&"+b+(-1<navigator.userAgent.toLowerCase().indexOf("chrome")?"&b=c&":"&b=&");var e=document.getElementsByTagName("head")[0].appendChild(c);setTimeout(function(){e.parentNode.removeChild(e)},500)},apiInit:function(){_EPADashboard_.initStarted=!0;setTimeout(function(){for(var b=document.querySelectorAll('iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]'),a=0;a<b.length;a++)b[a].hasAttribute("id")||
|
5 |
+
(b[a].id="_dytid_"+Math.round(8999*Math.random()+1E3)),_EPADashboard_.setupevents(b[a].id)},300)},log:function(a){try{console.log(a)}catch(c){}},doubleCheck:function(){_EPADashboard_.checkInterval=setInterval(function(){_EPADashboard_.checkCount++;5<=_EPADashboard_.checkCount||_EPADashboard_.initStarted?clearInterval(_EPADashboard_.checkInterval):(_EPADashboard_.apiInit(),_EPADashboard_.log("YT API init"))},1E3)}});if("undefined"===typeof a.YT){var c=document.createElement("script");c.src="//www.youtube.com/iframe_api";
|
6 |
+
c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}else YT.loaded&&(_EPADashboard_.apiInit(),_EPADashboard_.log("YT API available"));_EPADashboard_.doubleCheck();a.onYouTubeIframeAPIReady="undefined"!==typeof a.onYouTubeIframeAPIReady?a.onYouTubeIframeAPIReady:function(){_EPADashboard_.apiInit();_EPADashboard_.log("YT API ready")}})(window);
|
7 |
+
(function(a){a(document).ready(function(){a(".epyt-gallery").each(function(){var c=a(this),b=a(this).find("iframe").first(),d=b.data("ep-gallerysrc"),e=a(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid"),d=d.replace("GALLERYVIDEOID",e);b.attr("src",d);c.on("click",".epyt-gallery-list .epyt-gallery-thumb",function(){var c=a(this).data("videoid"),d=b.data("ep-gallerysrc").replace("GALLERYVIDEOID",c),d=0<d.indexOf("autoplay")?d.replace("autoplay=0","autoplay=1"):d+"&autoplay=1";
|
8 |
+
a("html, body").animate({scrollTop:b.offset().top-20},500,function(){b.attr("src",d)})});c.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){a(this).addClass("hover")});c.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){a(this).removeClass("hover")});c.on("click",".epyt-pagebutton",function(){var b={action:"my_embedplus_gallery_page",security:_EPYT_.security,playlistId:a(this).data("playlistid"),pageToken:a(this).data("pagetoken"),pageSize:a(this).data("pagesize"),
|
9 |
+
columns:a(this).data("columns"),style:a(this).data("style")},d=a(this).hasClass("epyt-next"),e=parseInt(c.data("currpage")+"");c.data("currpage",e+(d?1:-1));c.find(".epyt-gallery-list").addClass("epyt-loading");a.post(_EPYT_.ajaxurl,b,function(b){c.find(".epyt-gallery-list").html(b);c.find(".epyt-current").each(function(){a(this).text(c.data("currpage"))})}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){c.find(".epyt-gallery-list").removeClass("epyt-loading")})})})})})(jQuery);
|
styles/index.html
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title></title>
|
5 |
+
<meta charset="UTF-8">
|
6 |
+
<meta name="viewport" content="width=device-width">
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
<img src="screenshot-3.jpg" />
|
10 |
+
</body>
|
11 |
+
</html>
|
styles/ytprefs.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.epyt-gallery{text-align:center}.epyt-gallery iframe{margin-bottom:0}.epyt-gallery-list{margin:0 -8px}.epyt-gallery-list.epyt-loading{opacity:.5}.epyt-gallery-thumb{box-sizing:border-box;overflow-y:hidden;display:block!important;cursor:pointer;opacity:.8;float:left;padding:0 8px 10px}.epyt-gallery-thumb.hover{opacity:1;transition:opacity ease-out .3s}.epyt-gallery-img-box{width:100%}.epyt-gallery-img{height:0;width:100%;padding-top:56.25%;position:relative;overflow:hidden!important;background-size:cover!important;background-position:center!important}.epyt-gallery-playhover{opacity:0;position:absolute;top:-10px;left:0;width:100%;height:100%;vertical-align:middle;text-align:center;transition:opacity ease-out .3s}.epyt-gallery-thumb.hover .epyt-gallery-playhover{opacity:1;top:0;transition:all ease-out .3s}.epyt-gallery-thumb .epyt-gallery-playcrutch{display:inline-block;height:100%;vertical-align:middle;width:0}.epyt-gallery-playhover .epyt-play-img{height:auto;max-width:15%;min-width:30px;vertical-align:middle;display:inline-block}.epyt-gallery-title{font-size:80%;line-height:120%;padding:10px}.epyt-gallery-thumb.epyt-listview{width:100%!important;padding:0 8px;margin:8px 0}.epyt-gallery-thumb.epyt-listview+.epyt-gallery-rowbreak{display:none}.epyt-gallery-thumb.epyt-listview .epyt-gallery-img-box{float:left;width:150px;max-width:25%;margin-right:20px}.epyt-gallery-thumb.epyt-listview .epyt-gallery-title{padding:10px;text-align:left}.epyt-gallery-thumb.epyt-listview.hover{background-color:#ddd;color:#000;transition:background-color ease-out .3s,color ease-out .3s}.epyt-gallery-rowbreak{clear:both}.epyt-pagination{clear:both;text-align:center;padding:10px 8px}.epyt-pagenumbers>div,.epyt-pagination>div{display:inline-block;padding:0 2px;vertical-align:middle}.epyt-pagination .epyt-pagebutton{cursor:pointer;display:inline-block;padding:0 10px}.epyt-pagebutton>div{display:inline}.epyt-pagination .epyt-loader{display:none}.epyt-gallery-list.epyt-loading .epyt-pagination .epyt-loader{display:inline-block}
|
youtube.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/*
|
3 |
Plugin Name: YouTube
|
4 |
Plugin URI: http://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx
|
5 |
-
Description: YouTube embed plugin
|
6 |
-
Version: 10.
|
7 |
Author: EmbedPlus Team
|
8 |
Author URI: http://www.embedplus.com
|
9 |
*/
|
@@ -32,7 +32,7 @@
|
|
32 |
class YouTubePrefs
|
33 |
{
|
34 |
|
35 |
-
public static $version = '10.
|
36 |
public static $opt_version = 'version';
|
37 |
public static $optembedwidth = null;
|
38 |
public static $optembedheight = null;
|
@@ -85,6 +85,10 @@ class YouTubePrefs
|
|
85 |
public static $spdcall = 'youtubeprefs_spdcall';
|
86 |
public static $opt_dynload = 'dynload';
|
87 |
public static $opt_dyntype = 'dyntype';
|
|
|
|
|
|
|
|
|
88 |
public static $opt_alloptions = 'youtubeprefs_alloptions';
|
89 |
public static $alloptions = null;
|
90 |
public static $yt_options = array();
|
@@ -94,8 +98,6 @@ class YouTubePrefs
|
|
94 |
public static $scriptsprinted = 0;
|
95 |
public static $badentities = array('×', '×', '–', '–', '&');
|
96 |
public static $goodliterals = array('x', 'x', '--', '--', '&');
|
97 |
-
|
98 |
-
|
99 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
100 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
101 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
@@ -167,7 +169,9 @@ class YouTubePrefs
|
|
167 |
add_action('admin_menu', 'YouTubePrefs::ytprefs_plugin_menu');
|
168 |
if (!is_admin())
|
169 |
{
|
|
|
170 |
add_action('wp_print_scripts', array('YouTubePrefs', 'jsvars'));
|
|
|
171 |
add_action('wp_enqueue_scripts', array('YouTubePrefs', 'fitvids'));
|
172 |
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && self::$alloptions[self::$opt_ogvideo] == 1)
|
173 |
{
|
@@ -604,6 +608,29 @@ class YouTubePrefs
|
|
604 |
|
605 |
public static function jsvars()
|
606 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
607 |
$responsiveselector = '[]';
|
608 |
if (self::$alloptions[self::$opt_widgetfit] == 1)
|
609 |
{
|
@@ -614,7 +641,7 @@ class YouTubePrefs
|
|
614 |
$responsiveselector = '["iframe[src*=\'youtube.com\']","iframe[src*=\'youtube-nocookie.com\']","iframe[data-ep-src*=\'youtube.com\']","iframe[data-ep-src*=\'youtube-nocookie.com\']"]';
|
615 |
}
|
616 |
?>
|
617 |
-
<script
|
618 |
var eppathtoscripts = "<?php echo plugins_url('scripts/', __FILE__); ?>";
|
619 |
var epresponsiveselector = <?php echo $responsiveselector; ?>;
|
620 |
var epdovol = true; //<?php echo (self::$alloptions[self::$opt_defaultvol] == 1 ? 'true' : 'false') ?>;
|
@@ -673,6 +700,9 @@ class YouTubePrefs
|
|
673 |
$_apikey = '';
|
674 |
$_hl = '';
|
675 |
$_dohl = 0;
|
|
|
|
|
|
|
676 |
|
677 |
$arroptions = get_option(self::$opt_alloptions);
|
678 |
|
@@ -722,6 +752,9 @@ class YouTubePrefs
|
|
722 |
$_defaultvol = self::tryget($arroptions, self::$opt_defaultvol, 0);
|
723 |
$_vol = self::tryget($arroptions, self::$opt_vol, '');
|
724 |
$_apikey = self::tryget($arroptions, self::$opt_apikey, '');
|
|
|
|
|
|
|
725 |
}
|
726 |
else
|
727 |
{
|
@@ -772,7 +805,10 @@ class YouTubePrefs
|
|
772 |
self::$opt_defaultheight => $_defaultheight,
|
773 |
self::$opt_defaultvol => $_defaultvol,
|
774 |
self::$opt_vol => $_vol,
|
775 |
-
self::$opt_apikey => $_apikey
|
|
|
|
|
|
|
776 |
);
|
777 |
|
778 |
update_option(self::$opt_alloptions, $all);
|
@@ -864,6 +900,182 @@ class YouTubePrefs
|
|
864 |
return self::get_html($m, false);
|
865 |
}
|
866 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
867 |
public static function get_html($m, $iscontent)
|
868 |
{
|
869 |
//$time_start = microtime(true);
|
@@ -1019,7 +1231,7 @@ class YouTubePrefs
|
|
1019 |
|
1020 |
// playlist cleanup
|
1021 |
$videoidoutput = isset($linkparams['v']) ? $linkparams['v'] : '';
|
1022 |
-
|
1023 |
if ((self::$alloptions[self::$opt_playlistorder] == 1 || isset($finalparams['plindex'])) && isset($finalparams['list']))
|
1024 |
{
|
1025 |
try
|
@@ -1029,9 +1241,24 @@ class YouTubePrefs
|
|
1029 |
}
|
1030 |
catch (Exception $ex)
|
1031 |
{
|
|
|
1032 |
}
|
1033 |
}
|
1034 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1035 |
$code1 = '<iframe ' . $dyntype . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
|
1036 |
'" ' . $dynsrc . 'src="//www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
|
1037 |
$code2 = '" frameborder="0" type="text/html" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') .
|
@@ -1059,21 +1286,32 @@ class YouTubePrefs
|
|
1059 |
{
|
1060 |
if (in_array($key, self::$yt_options))
|
1061 |
{
|
1062 |
-
$
|
1063 |
-
|
|
|
|
|
|
|
1064 |
{
|
1065 |
-
$finalsrc .= '
|
|
|
|
|
|
|
|
|
1066 |
}
|
1067 |
}
|
1068 |
}
|
1069 |
}
|
1070 |
|
1071 |
-
$code = $code1 . $finalsrc . $code2; //. '<!--' . $m[0] . '-->';
|
1072 |
// reset static vals for next embed
|
1073 |
self::$defaultheight = null;
|
1074 |
self::$defaultwidth = null;
|
1075 |
self::$oembeddata = null;
|
1076 |
|
|
|
|
|
|
|
|
|
1077 |
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && self::$alloptions[self::$opt_spdc] == 1)
|
1078 |
{
|
1079 |
$daysecs = self::$alloptions[self::$opt_spdcexp] * 60 * 60;
|
@@ -1692,11 +1930,11 @@ class YouTubePrefs
|
|
1692 |
$new_pointer_content .= '<p>'; // ooopointer
|
1693 |
if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
|
1694 |
{
|
1695 |
-
$new_pointer_content .= __(
|
1696 |
}
|
1697 |
else
|
1698 |
{
|
1699 |
-
$new_pointer_content .= __(
|
1700 |
}
|
1701 |
$new_pointer_content .= '</p>';
|
1702 |
|
@@ -1814,11 +2052,49 @@ class YouTubePrefs
|
|
1814 |
}
|
1815 |
$new_options[self::$opt_vol] = $_vol;
|
1816 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1817 |
|
1818 |
$_apikey = '';
|
1819 |
try
|
1820 |
{
|
1821 |
$_apikey = trim(str_replace(array(' ', "'", '"'), array('', '', ''), strip_tags($_POST[self::$opt_apikey])));
|
|
|
|
|
|
|
|
|
1822 |
}
|
1823 |
catch (Exception $ex)
|
1824 |
{
|
@@ -1900,8 +2176,8 @@ class YouTubePrefs
|
|
1900 |
.wrap {font-family: Arial; color: #000000;}
|
1901 |
#ytform p { line-height: 20px; margin-bottom: 11px; }
|
1902 |
#ytform ul li {margin-left: 30px; list-style: disc outside none;}
|
1903 |
-
.ytindent {padding: 0px 0px 0px 20px; font-size:
|
1904 |
-
.ytindent ul, .ytindent p {font-size:
|
1905 |
.shadow {-webkit-box-shadow: 0px 0px 20px 0px #000000; box-shadow: 0px 0px 20px 0px #000000;}
|
1906 |
.gopro {margin: 0px;}
|
1907 |
.gopro img {vertical-align: middle;
|
@@ -1918,6 +2194,7 @@ class YouTubePrefs
|
|
1918 |
.pronon {font-weight: bold; color: #f85d00;}
|
1919 |
ul.reglist li {margin: 0px 0px 0px 30px; list-style: disc outside none;}
|
1920 |
.procol {width: 475px; float: left;}
|
|
|
1921 |
.smallnote {font-style: italic; font-size: 10px;}
|
1922 |
.italic {font-style: italic;}
|
1923 |
.ytindent h3 {font-size: 15px; line-height: 22px; margin: 5px 0px 10px 0px;}
|
@@ -1933,7 +2210,7 @@ class YouTubePrefs
|
|
1933 |
background: linear-gradient(to bottom, #2ea2cc 0%,#007396 98%); /* W3C */
|
1934 |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2ea2cc', endColorstr='#007396',GradientType=0 ); /* IE6-9 */
|
1935 |
}
|
1936 |
-
p.submit em {display: inline-block; padding-left: 20px; vertical-align: middle; width:
|
1937 |
#opt_pro {box-shadow: 0px 0px 5px 0px #1870D5; width: 320px;vertical-align: top;}
|
1938 |
#goprobox h3 {font-size: 13px;}
|
1939 |
.chx p {margin: 0px 0px 5px 0px;}
|
@@ -1944,6 +2221,8 @@ class YouTubePrefs
|
|
1944 |
h3.sect {border-radius: 10px; background-color: #D9E9F7; padding: 5px 5px 5px 10px; position: relative; font-weight: bold;}
|
1945 |
h3.sect a {text-decoration: none; color: #E20000;}
|
1946 |
h3.sect a.button-primary {color: #ffffff;}
|
|
|
|
|
1947 |
.ytnav {margin-bottom: 15px;}
|
1948 |
.ytnav a {font-weight: bold; display: inline-block; padding: 5px 10px; margin: 0px 20px 0px 0px; border: 1px solid #cccccc; border-radius: 6px;
|
1949 |
text-decoration: none; background-color: #ffffff;}
|
@@ -1952,7 +2231,7 @@ class YouTubePrefs
|
|
1952 |
.ssfb {float: right; height: auto; margin-right: 10px; margin-left: 15px; margin-bottom: 10px;}
|
1953 |
.totop {position: absolute; right: 20px; top: 5px; color: #444444; font-size: 10px;}
|
1954 |
input[type=checkbox] {border: 1px solid #000000;}
|
1955 |
-
.chktitle {display: inline-block; padding: 1px
|
1956 |
b, strong {font-weight: bold;}
|
1957 |
input.checkbox[disabled] {border: 1px dashed #444444;}
|
1958 |
.pad10 {padding: 10px;}
|
@@ -1978,16 +2257,19 @@ class YouTubePrefs
|
|
1978 |
div.hr {clear: both; border-bottom: 1px dotted #A8BDD8; margin: 20px 0 20px 0;}
|
1979 |
.wp-pointer-buttons a.close {margin-top: 0 !important;}
|
1980 |
.pad20{padding: 20px 0 20px 0;}
|
|
|
|
|
1981 |
</style>
|
1982 |
<div class="ytindent">
|
1983 |
<br>
|
1984 |
<div id="jumphowto"></div>
|
1985 |
<div class="ytnav">
|
1986 |
<a href="#jumphowto">How To Embed</a>
|
1987 |
-
<a href="#jumpwiz">Visual
|
1988 |
-
<a href="#jumpdefaults">
|
|
|
1989 |
<a href="#jumpoverride">How To Override Defaults</a>
|
1990 |
-
<a target="_blank" href="<?php echo self::$epbase . "/dashboard/pro-easy-video-analytics.aspx?ref=protab" ?>" style="border-color: #888888;">
|
1991 |
<a href="#jumpsupport">Support</a>
|
1992 |
</div>
|
1993 |
|
@@ -2102,7 +2384,7 @@ class YouTubePrefs
|
|
2102 |
</p>
|
2103 |
<p>
|
2104 |
<input name="<?php echo self::$opt_vq; ?>" id="<?php echo self::$opt_vq; ?>" <?php checked($all[self::$opt_vq], 'hd720'); ?> type="checkbox" class="checkbox">
|
2105 |
-
<label for="<?php echo self::$opt_vq; ?>"><?php _e('<b class="chktitle">HD Quality:</b> Force HD quality when available. <b>NOTE: YouTube
|
2106 |
</p>
|
2107 |
<p>
|
2108 |
<input name="<?php echo self::$opt_wmode; ?>" id="<?php echo self::$opt_wmode; ?>" <?php checked($all[self::$opt_wmode], 'opaque'); ?> type="checkbox" class="checkbox">
|
@@ -2195,11 +2477,11 @@ class YouTubePrefs
|
|
2195 |
As of January 2015, YouTube began serving the HTML5 player by default; therefore, this plugin no longer needs a special HTML5 setting. This option is simply kept here as a notice.
|
2196 |
</label>
|
2197 |
</p>
|
2198 |
-
|
2199 |
<p>
|
2200 |
<input name="<?php echo self::$opt_playlistorder; ?>" id="<?php echo self::$opt_playlistorder; ?>" <?php checked($all[self::$opt_playlistorder], 1); ?> type="checkbox" class="checkbox">
|
2201 |
<label for="<?php echo self::$opt_playlistorder; ?>">
|
2202 |
-
<b class="chktitle">Playlist Ordering: <sup class="orange bold">NEW</sup></b> Check this option if you want your playlists to begin with the latest added video by default. (Unchecking this will force playlists to always start with your selected specific video).
|
2203 |
</label>
|
2204 |
</p>
|
2205 |
|
@@ -2216,177 +2498,250 @@ class YouTubePrefs
|
|
2216 |
|
2217 |
</div>
|
2218 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2219 |
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2232 |
</label>
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
<div class="pad20">
|
2242 |
-
<input type="button" class="button button-primary" value="Click to clear YouTube cache"/>
|
2243 |
-
<span style="display: none;" id="clearspdcloading" class="orange bold">Clearing...</span>
|
2244 |
-
<span class="orange bold" style="display: none;" id="clearspdcsuccess">Finished clearing YouTube cache.</span>
|
2245 |
-
<span class="orange bold" style="display: none;" id="clearspdcfailed">Sorry, there seemed to be a problem clearing the cache.</span>
|
2246 |
-
</div>
|
2247 |
</div>
|
2248 |
</div>
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
<
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2268 |
</span>
|
2269 |
</span>
|
2270 |
-
|
2271 |
-
|
2272 |
-
<p>
|
2273 |
-
<input name="<?php echo self::$opt_dynload; ?>" id="<?php echo self::$opt_dynload; ?>" <?php checked($all[self::$opt_dynload], 1); ?> type="checkbox" class="checkbox">
|
2274 |
-
<span id="boxdyn">
|
2275 |
-
Animation:
|
2276 |
-
<?php $cleandyn = trim($all[self::$opt_dyntype]); ?>
|
2277 |
-
<select name="<?php echo self::$opt_dyntype; ?>" id="<?php echo self::$opt_dyntype; ?>" >
|
2278 |
-
<option value="">Select type</option>
|
2279 |
-
<option value="rotateIn" <?php echo 'rotateIn' === $cleandyn ? 'selected' : '' ?> >rotate in</option>
|
2280 |
-
<option value="slideInRight" <?php echo 'slideInRight' === $cleandyn ? 'selected' : '' ?> >slide from right</option>
|
2281 |
-
<option value="slideInLeft" <?php echo 'slideInLeft' === $cleandyn ? 'selected' : '' ?> >slide from left</option>
|
2282 |
-
<option value="bounceIn" <?php echo 'bounceIn' === $cleandyn ? 'selected' : '' ?> >bounce in</option>
|
2283 |
-
<option value="flipInX" <?php echo 'flipInX' === $cleandyn ? 'selected' : '' ?> >flip up/down</option>
|
2284 |
-
<option value="flipInY" <?php echo 'flipInY' === $cleandyn ? 'selected' : '' ?> >flip left/right</option>
|
2285 |
-
<option value="pulse" <?php echo 'pulse' === $cleandyn ? 'selected' : '' ?> >pulse</option>
|
2286 |
-
<option value="tada" <?php echo 'tada' === $cleandyn ? 'selected' : '' ?> >jiggle</option>
|
2287 |
-
<option value="fadeInDown" <?php echo 'fadeInDown' === $cleandyn ? 'selected' : '' ?> >fade in downward</option>
|
2288 |
-
<option value="fadeInUp" <?php echo 'fadeInUp' === $cleandyn ? 'selected' : '' ?> >fade in upward</option>
|
2289 |
-
<option value="zoomInDown" <?php echo 'zoomInDown' === $cleandyn ? 'selected' : '' ?> >zoom in downward</option>
|
2290 |
-
<option value="zoomInUp" <?php echo 'zoomInUp' === $cleandyn ? 'selected' : '' ?> >zoom in upward</option>
|
2291 |
-
</select>
|
2292 |
</span>
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
-
<
|
2299 |
-
|
2300 |
-
|
2301 |
-
<
|
2302 |
-
|
2303 |
-
<
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
|
2311 |
-
<
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2316 |
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
?>
|
2322 |
-
<p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). </p>
|
2323 |
-
<p>
|
2324 |
-
<input disabled type="checkbox" class="checkbox">
|
2325 |
-
<label>
|
2326 |
-
<b class="chktitle">Faster Page Loads (Caching): <sup class="orange">NEW</sup></b> <span class="pronon">(PRO Users)</span>
|
2327 |
-
Use embed caching to speed up your page loads. By default, WordPress needs to request information from YouTube.com's servers for every video you embed, every time a page is loaded. These data requests can add time to your total page load time. Turn on this feature to cache that data (instead of having to request for the same information every time you load a page). This should then make your pages that have videos load faster. It's been noted that even small speed ups in page load can help increase visitor engagement, retention, and conversions.
|
2328 |
-
</label>
|
2329 |
-
<div class="indent-option">
|
2330 |
-
<label>
|
2331 |
-
<b class="chktitle">Cache Liftime (hours): <sup class="orange">NEW</sup></b>
|
2332 |
-
<input id="spdcexp" disabled value="24" type="number">
|
2333 |
-
Tip: If your pages rarely change, you may wish to set this to a much higher value than 24 hours.
|
2334 |
-
</label>
|
2335 |
-
</div>
|
2336 |
-
</p>
|
2337 |
-
<div class="hr"></div>
|
2338 |
-
|
2339 |
-
<p>
|
2340 |
-
<input disabled type="checkbox" class="checkbox">
|
2341 |
-
<label>
|
2342 |
-
<b class="chktitle">Video SEO Tags:</b> <span class="pronon">(PRO Users)</span> Update your YouTube embeds with Google, Bing, and Yahoo friendly video SEO markup.
|
2343 |
-
</label>
|
2344 |
-
</p>
|
2345 |
-
<div class="hr"></div>
|
2346 |
-
<p>
|
2347 |
-
<input disabled type="checkbox" class="checkbox">
|
2348 |
-
<label>
|
2349 |
-
<b class="chktitle">Special Loading Effects:</b> <span class="pronon">(PRO Users)</span>
|
2350 |
-
Add eye-catching special effects that will make your YouTube embeds bounce, flip, pulse, or slide as they load on the screen. Check this box to select your desired effect. <a target="_blank" href="<?php echo self::$epbase ?>/add-special-effects-to-youtube-embeds-in-wordpress.aspx">Read more here »</a>
|
2351 |
-
</label>
|
2352 |
-
</p>
|
2353 |
-
<div class="hr"></div>
|
2354 |
-
<p>
|
2355 |
-
<img class="ssfb" src="<?php echo plugins_url('images/ssfb.jpg', __FILE__) ?>" />
|
2356 |
-
<input disabled type="checkbox" class="checkbox">
|
2357 |
-
<label>
|
2358 |
-
<b class="chktitle">Facebook Open Graph Markup:</b> <span class="pronon">(PRO Users)</span> Update YouTube embeds on your pages with Open Graph markup to enhance Facebook sharing and discovery of the pages. Your shared pages, for example, will also display embedded video thumbnails on Facebook Timelines.
|
2359 |
-
</label>
|
2360 |
-
</p>
|
2361 |
-
<div class="hr"></div>
|
2362 |
-
<p>
|
2363 |
-
<img class="ssfb" src="<?php echo plugins_url('images/youtube_thumbnail_sample.jpg', __FILE__) ?>" />
|
2364 |
-
<input disabled type="checkbox" class="checkbox">
|
2365 |
-
<label>
|
2366 |
-
<b class="chktitle">Automatic Video Thumbnails: <sup class="orange">NEW</sup></b> <span class="pronon">(PRO Users)</span>
|
2367 |
-
Automatically grab the thumbnail image of the first video embedded in each post or page, and use it as the featured image.
|
2368 |
-
All you have to do is click Update on a post or page and the plugin does the rest!
|
2369 |
-
(Example shown on the right) <a target="_blank" href="<?php echo self::$epbase ?>/add-youtube-video-thumbnails-featured-image-wordpress.aspx">Read more here »</a>
|
2370 |
-
</label>
|
2371 |
-
</p>
|
2372 |
-
<div class="hr"></div>
|
2373 |
-
<p>
|
2374 |
-
<a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx" target="_blank">Activate the above and several other features »</a>
|
2375 |
-
</p>
|
2376 |
-
<?php
|
2377 |
-
}
|
2378 |
?>
|
2379 |
-
<
|
2380 |
-
|
2381 |
-
|
2382 |
-
|
2383 |
-
|
2384 |
-
|
2385 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2386 |
|
2387 |
-
<hr>
|
2388 |
|
2389 |
-
</div>
|
2390 |
<div class="jumper" id="jumpoverride"></div>
|
2391 |
|
2392 |
<h3 class="sect">
|
@@ -2452,9 +2807,9 @@ class YouTubePrefs
|
|
2452 |
Full Visual Embedding Wizard (Easily customize embeds without memorizing codes)
|
2453 |
</li>
|
2454 |
<li>
|
2455 |
-
<img src="<?php echo plugins_url('images/
|
2456 |
-
|
2457 |
-
</li>
|
2458 |
<li>
|
2459 |
<img src="<?php echo plugins_url('images/iconfx.png', __FILE__) ?>">
|
2460 |
Add eye-catching special effects as your videos load
|
@@ -2493,10 +2848,14 @@ class YouTubePrefs
|
|
2493 |
<img src="<?php echo plugins_url('images/iconfb.png', __FILE__) ?>">
|
2494 |
Automatic Open Graph tagging for Facebook
|
2495 |
</li>
|
|
|
|
|
|
|
|
|
2496 |
<li>
|
2497 |
-
<img src="<?php echo plugins_url('images/
|
2498 |
-
|
2499 |
-
</li>
|
2500 |
<li>
|
2501 |
<img src="<?php echo plugins_url('images/iconvolume.png', __FILE__) ?>">
|
2502 |
Fine-Grained Volume Initialization – Individual video volume settings in the wizard
|
@@ -2591,10 +2950,11 @@ class YouTubePrefs
|
|
2591 |
?>
|
2592 |
<div class="ytnav">
|
2593 |
<a href="#jumphowto">How To Embed</a>
|
2594 |
-
<a href="#jumpwiz">Visual
|
2595 |
-
<a href="#jumpdefaults">
|
|
|
2596 |
<a href="#jumpoverride">How To Override Defaults</a>
|
2597 |
-
<a target="_blank" href="<?php echo self::$epbase . "/dashboard/pro-easy-video-analytics.aspx?ref=protab" ?>" style="border-color: #888888;">
|
2598 |
<a href="#jumpsupport">Support</a>
|
2599 |
</div>
|
2600 |
|
@@ -2914,13 +3274,29 @@ class YouTubePrefs
|
|
2914 |
|
2915 |
public static function ytprefsscript()
|
2916 |
{
|
2917 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2918 |
|
2919 |
|
2920 |
if (!is_admin() && (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0) && self::$alloptions[self::$opt_dynload] == 1)
|
2921 |
{
|
2922 |
wp_enqueue_style('__dyntype__', plugins_url('scripts/embdyn.min.css', __FILE__));
|
2923 |
-
wp_enqueue_script('__dynload__', plugins_url('scripts/embdyn.min.js', __FILE__), array('jquery')
|
2924 |
}
|
2925 |
}
|
2926 |
|
@@ -3037,6 +3413,8 @@ class YouTubePrefs
|
|
3037 |
add_action("wp_ajax_my_embedplus_glance_vids", array('YouTubePrefs', 'my_embedplus_glance_vids'));
|
3038 |
add_action("wp_ajax_my_embedplus_glance_count", array('YouTubePrefs', 'my_embedplus_glance_count'));
|
3039 |
add_action("wp_ajax_my_embedplus_dismiss_double_plugin_warning", array('YouTubePrefs', 'my_embedplus_dismiss_double_plugin_warning'));
|
|
|
|
|
3040 |
|
3041 |
add_action('admin_enqueue_scripts', 'youtubeprefs_admin_enqueue_scripts');
|
3042 |
|
2 |
/*
|
3 |
Plugin Name: YouTube
|
4 |
Plugin URI: http://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx
|
5 |
+
Description: YouTube embed plugin. Embed a responsive YouTube video, playlist gallery, or channel gallery. Add video thumbnails, analytics, SEO, caching...
|
6 |
+
Version: 10.3
|
7 |
Author: EmbedPlus Team
|
8 |
Author URI: http://www.embedplus.com
|
9 |
*/
|
32 |
class YouTubePrefs
|
33 |
{
|
34 |
|
35 |
+
public static $version = '10.3';
|
36 |
public static $opt_version = 'version';
|
37 |
public static $optembedwidth = null;
|
38 |
public static $optembedheight = null;
|
85 |
public static $spdcall = 'youtubeprefs_spdcall';
|
86 |
public static $opt_dynload = 'dynload';
|
87 |
public static $opt_dyntype = 'dyntype';
|
88 |
+
public static $opt_gallery_pagesize = 'gallery_pagesize';
|
89 |
+
public static $opt_gallery_apikey = 'gallery_apikey';
|
90 |
+
public static $opt_gallery_columns = 'gallery_columns';
|
91 |
+
public static $opt_gallery_style = 'gallery_style';
|
92 |
public static $opt_alloptions = 'youtubeprefs_alloptions';
|
93 |
public static $alloptions = null;
|
94 |
public static $yt_options = array();
|
98 |
public static $scriptsprinted = 0;
|
99 |
public static $badentities = array('×', '×', '–', '–', '&');
|
100 |
public static $goodliterals = array('x', 'x', '--', '--', '&');
|
|
|
|
|
101 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
102 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
103 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
169 |
add_action('admin_menu', 'YouTubePrefs::ytprefs_plugin_menu');
|
170 |
if (!is_admin())
|
171 |
{
|
172 |
+
|
173 |
add_action('wp_print_scripts', array('YouTubePrefs', 'jsvars'));
|
174 |
+
add_action('wp_enqueue_scripts', array('YouTubePrefs', 'jsinitvars'));
|
175 |
add_action('wp_enqueue_scripts', array('YouTubePrefs', 'fitvids'));
|
176 |
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && self::$alloptions[self::$opt_ogvideo] == 1)
|
177 |
{
|
608 |
|
609 |
public static function jsvars()
|
610 |
{
|
611 |
+
//https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode-
|
612 |
+
$responsiveselector = '[]';
|
613 |
+
if (self::$alloptions[self::$opt_widgetfit] == 1)
|
614 |
+
{
|
615 |
+
$responsiveselector = '["iframe.__youtube_prefs_widget__"]';
|
616 |
+
}
|
617 |
+
if (self::$alloptions[self::$opt_responsive] == 1)
|
618 |
+
{
|
619 |
+
$responsiveselector = '["iframe[src*=\'youtube.com\']","iframe[src*=\'youtube-nocookie.com\']","iframe[data-ep-src*=\'youtube.com\']","iframe[data-ep-src*=\'youtube-nocookie.com\']","iframe[data-ep-gallerysrc*=\'youtube.com\']"]';
|
620 |
+
}
|
621 |
+
?>
|
622 |
+
<script data-cfasync="false">
|
623 |
+
var eppathtoscripts = "<?php echo plugins_url('scripts/', __FILE__); ?>";
|
624 |
+
var epresponsiveselector = <?php echo $responsiveselector; ?>;
|
625 |
+
var epdovol = true; //<?php echo (self::$alloptions[self::$opt_defaultvol] == 1 ? 'true' : 'false') ?>;
|
626 |
+
</script>
|
627 |
+
<?php
|
628 |
+
}
|
629 |
+
|
630 |
+
public static function jsinitvars()
|
631 |
+
{
|
632 |
+
|
633 |
+
//https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode-
|
634 |
$responsiveselector = '[]';
|
635 |
if (self::$alloptions[self::$opt_widgetfit] == 1)
|
636 |
{
|
641 |
$responsiveselector = '["iframe[src*=\'youtube.com\']","iframe[src*=\'youtube-nocookie.com\']","iframe[data-ep-src*=\'youtube.com\']","iframe[data-ep-src*=\'youtube-nocookie.com\']"]';
|
642 |
}
|
643 |
?>
|
644 |
+
<script data-cfasync="false">
|
645 |
var eppathtoscripts = "<?php echo plugins_url('scripts/', __FILE__); ?>";
|
646 |
var epresponsiveselector = <?php echo $responsiveselector; ?>;
|
647 |
var epdovol = true; //<?php echo (self::$alloptions[self::$opt_defaultvol] == 1 ? 'true' : 'false') ?>;
|
700 |
$_apikey = '';
|
701 |
$_hl = '';
|
702 |
$_dohl = 0;
|
703 |
+
$_gallery_columns = 3;
|
704 |
+
$_gallery_pagesize = 15;
|
705 |
+
$_gallery_style = 'grid';
|
706 |
|
707 |
$arroptions = get_option(self::$opt_alloptions);
|
708 |
|
752 |
$_defaultvol = self::tryget($arroptions, self::$opt_defaultvol, 0);
|
753 |
$_vol = self::tryget($arroptions, self::$opt_vol, '');
|
754 |
$_apikey = self::tryget($arroptions, self::$opt_apikey, '');
|
755 |
+
$_gallery_pagesize = self::tryget($arroptions, self::$opt_gallery_pagesize, 15);
|
756 |
+
$_gallery_columns = self::tryget($arroptions, self::$opt_gallery_columns, 3);
|
757 |
+
$_gallery_style = self::tryget($arroptions, self::$opt_gallery_style, 'grid');
|
758 |
}
|
759 |
else
|
760 |
{
|
805 |
self::$opt_defaultheight => $_defaultheight,
|
806 |
self::$opt_defaultvol => $_defaultvol,
|
807 |
self::$opt_vol => $_vol,
|
808 |
+
self::$opt_apikey => $_apikey,
|
809 |
+
self::$opt_gallery_columns => $_gallery_columns,
|
810 |
+
self::$opt_gallery_style => $_gallery_style,
|
811 |
+
self::$opt_gallery_pagesize => $_gallery_pagesize
|
812 |
);
|
813 |
|
814 |
update_option(self::$opt_alloptions, $all);
|
900 |
return self::get_html($m, false);
|
901 |
}
|
902 |
|
903 |
+
public static function get_gallery_page($playlistId, $pageToken, $pageSize, $columns, $style, $apiKey)
|
904 |
+
{
|
905 |
+
if (empty($apiKey))
|
906 |
+
{
|
907 |
+
return '<div>Please enter your YouTube API key to embed galleries.</div>';
|
908 |
+
}
|
909 |
+
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && $style == 'listview')
|
910 |
+
{
|
911 |
+
//$columns = 1;
|
912 |
+
}
|
913 |
+
|
914 |
+
$apiEndpoint = 'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet,status&playlistId=' . $playlistId
|
915 |
+
. '&maxResults=' . $pageSize
|
916 |
+
. '&key=' . $apiKey;
|
917 |
+
if ($pageToken != null)
|
918 |
+
{
|
919 |
+
$apiEndpoint .= '&pageToken=' . $pageToken;
|
920 |
+
}
|
921 |
+
$spdckey = '';
|
922 |
+
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && self::$alloptions[self::$opt_spdc] == 1)
|
923 |
+
{
|
924 |
+
try
|
925 |
+
{
|
926 |
+
$spdckey = self::$spdcprefix . '_' . md5($apiEndpoint . $columns . $style);
|
927 |
+
$spdcval = get_transient($spdckey);
|
928 |
+
if (!empty($spdcval))
|
929 |
+
{
|
930 |
+
//self::debuglog((microtime(true) - $time_start) . "\t" . $spdckey . "\t" . $spdcval . "\r\n");
|
931 |
+
return $spdcval;
|
932 |
+
}
|
933 |
+
}
|
934 |
+
catch (Exception $ex)
|
935 |
+
{
|
936 |
+
|
937 |
+
}
|
938 |
+
}
|
939 |
+
|
940 |
+
$code = '';
|
941 |
+
|
942 |
+
$apiResult = wp_remote_get($apiEndpoint);
|
943 |
+
$jsonResult = json_decode($apiResult['body']);
|
944 |
+
|
945 |
+
$resultsPerPage = $jsonResult->pageInfo->resultsPerPage;
|
946 |
+
$totalResults = $jsonResult->pageInfo->totalResults;
|
947 |
+
|
948 |
+
$nextPageToken = '';
|
949 |
+
$prevPageToken = '';
|
950 |
+
if (isset($jsonResult->nextPageToken))
|
951 |
+
{
|
952 |
+
$nextPageToken = $jsonResult->nextPageToken;
|
953 |
+
}
|
954 |
+
|
955 |
+
if (isset($jsonResult->prevPageToken))
|
956 |
+
{
|
957 |
+
$prevPageToken = $jsonResult->prevPageToken;
|
958 |
+
}
|
959 |
+
|
960 |
+
$cnt = 0;
|
961 |
+
foreach ($jsonResult->items as $item)
|
962 |
+
{
|
963 |
+
|
964 |
+
$thumb = new stdClass();
|
965 |
+
|
966 |
+
$thumb->id = isset($item->snippet->resourceId->videoId) ? $item->snippet->resourceId->videoId : null;
|
967 |
+
$thumb->id = $thumb->id ? $thumb->id : $item->id->videoId;
|
968 |
+
$thumb->title = $item->snippet->title;
|
969 |
+
$thumb->privacyStatus = isset($item->status->privacyStatus) ? $item->status->privacyStatus : null;
|
970 |
+
|
971 |
+
if ($thumb->privacyStatus == 'private')
|
972 |
+
{
|
973 |
+
$thumb->img = plugins_url('/images/private.png', __FILE__);
|
974 |
+
$thumb->quality = 'medium';
|
975 |
+
}
|
976 |
+
else
|
977 |
+
{
|
978 |
+
if (isset($item->snippet->thumbnails->high->url))
|
979 |
+
{
|
980 |
+
$thumb->img = $item->snippet->thumbnails->high->url;
|
981 |
+
$thumb->quality = 'high';
|
982 |
+
}
|
983 |
+
elseif (isset($item->snippet->thumbnails->default->url))
|
984 |
+
{
|
985 |
+
$thumb->img = $item->snippet->thumbnails->default->url;
|
986 |
+
$thumb->quality = 'default';
|
987 |
+
}
|
988 |
+
else
|
989 |
+
{
|
990 |
+
$thumb->img = $item->snippet->thumbnails->medium->url;
|
991 |
+
$thumb->quality = 'medium';
|
992 |
+
}
|
993 |
+
}
|
994 |
+
|
995 |
+
$code .= self::get_thumbnail_html($thumb, $style);
|
996 |
+
$cnt++;
|
997 |
+
|
998 |
+
if ($cnt % $columns === 0)
|
999 |
+
{
|
1000 |
+
$code .= '<div class="epyt-gallery-rowbreak"></div>';
|
1001 |
+
}
|
1002 |
+
}
|
1003 |
+
|
1004 |
+
$pagination = '<div class="epyt-pagination">';
|
1005 |
+
if (!empty($prevPageToken))
|
1006 |
+
{
|
1007 |
+
$pagination .= '<div class="epyt-pagebutton epyt-prev" data-playlistid="' . esc_attr($playlistId)
|
1008 |
+
. '" data-pagesize="' . intval($pageSize)
|
1009 |
+
. '" data-pagetoken="' . esc_attr($prevPageToken)
|
1010 |
+
. '" data-style="' . esc_attr($style)
|
1011 |
+
. '" data-columns="' . intval($columns)
|
1012 |
+
. '"><div>«</div> ' . _('Prev') . '</div>';
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
$totalPages = ceil($totalResults / $resultsPerPage);
|
1016 |
+
$pagination .= '<div class="epyt-pagenumbers">';
|
1017 |
+
$pagination .= '<div class="epyt-current">1</div><div class="epyt-pageseparator">' . _("of") . '</div><div class="epyt-totalpages">' . $totalPages . '</div>';
|
1018 |
+
$pagination .= '</div>';
|
1019 |
+
|
1020 |
+
if (!empty($nextPageToken))
|
1021 |
+
{
|
1022 |
+
$pagination .= '<div class="epyt-pagebutton epyt-next" data-playlistid="' . esc_attr($playlistId)
|
1023 |
+
. '" data-pagesize="' . intval($pageSize)
|
1024 |
+
. '" data-pagetoken="' . esc_attr($nextPageToken)
|
1025 |
+
. '" data-style="' . esc_attr($style)
|
1026 |
+
. '" data-columns="' . intval($columns)
|
1027 |
+
. '">' . _('Next') . ' <div>»</div></div>';
|
1028 |
+
}
|
1029 |
+
$pagination .= '<div class="epyt-loader"><img src="' . plugins_url('images/gallery-page-loader.gif', __FILE__) . '"></div></div>';
|
1030 |
+
|
1031 |
+
|
1032 |
+
$code = $pagination . $code . $pagination;
|
1033 |
+
|
1034 |
+
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && self::$alloptions[self::$opt_spdc] == 1)
|
1035 |
+
{
|
1036 |
+
$daysecs = self::$alloptions[self::$opt_spdcexp] * 60 * 60;
|
1037 |
+
set_transient($spdckey, $code, $daysecs);
|
1038 |
+
$allk = get_option(self::$spdcall, array());
|
1039 |
+
$allk[] = $spdckey;
|
1040 |
+
update_option(self::$spdcall, $allk);
|
1041 |
+
|
1042 |
+
//self::debuglog((microtime(true) - $time_start) . "\t" . $spdckey . "\t" . $code . "\r\n");
|
1043 |
+
}
|
1044 |
+
return $code;
|
1045 |
+
}
|
1046 |
+
|
1047 |
+
public static function get_thumbnail_html($thumb, $style)
|
1048 |
+
{
|
1049 |
+
$escId = esc_attr($thumb->id);
|
1050 |
+
$code = '';
|
1051 |
+
$styleclass = '';
|
1052 |
+
|
1053 |
+
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && $style == 'listview')
|
1054 |
+
{
|
1055 |
+
$styleclass = 'epyt-listview';
|
1056 |
+
}
|
1057 |
+
|
1058 |
+
$code .= '<div data-videoid="' . $escId . '" class="epyt-gallery-thumb ' . $styleclass . '">';
|
1059 |
+
$code .= '<div class="epyt-gallery-img-box"><div class="epyt-gallery-img" style="background-image: url(' . esc_attr($thumb->img) . ')">' .
|
1060 |
+
'<div class="epyt-gallery-playhover"><img class="epyt-play-img" src="' . plugins_url('images/playhover.png', __FILE__) . '" /><div class="epyt-gallery-playcrutch"></div></div>' .
|
1061 |
+
'</div></div>';
|
1062 |
+
$code .= '<div class="epyt-gallery-title">' . esc_html($thumb->title) . '</div>';
|
1063 |
+
$code .= '</div>';
|
1064 |
+
|
1065 |
+
|
1066 |
+
return $code;
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
public static function my_embedplus_gallery_page()
|
1070 |
+
{
|
1071 |
+
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
|
1072 |
+
{
|
1073 |
+
check_ajax_referer('embedplus-nonce', 'security');
|
1074 |
+
echo self::get_gallery_page($_POST['playlistId'], $_POST['pageToken'], $_POST['pageSize'], $_POST['columns'], $_POST['style'], self::$alloptions[self::$opt_apikey]);
|
1075 |
+
die();
|
1076 |
+
}
|
1077 |
+
}
|
1078 |
+
|
1079 |
public static function get_html($m, $iscontent)
|
1080 |
{
|
1081 |
//$time_start = microtime(true);
|
1231 |
|
1232 |
// playlist cleanup
|
1233 |
$videoidoutput = isset($linkparams['v']) ? $linkparams['v'] : '';
|
1234 |
+
|
1235 |
if ((self::$alloptions[self::$opt_playlistorder] == 1 || isset($finalparams['plindex'])) && isset($finalparams['list']))
|
1236 |
{
|
1237 |
try
|
1241 |
}
|
1242 |
catch (Exception $ex)
|
1243 |
{
|
1244 |
+
|
1245 |
}
|
1246 |
}
|
1247 |
|
1248 |
+
$galleryWrapper1 = '';
|
1249 |
+
$galleryWrapper2 = '';
|
1250 |
+
$galleryCode = '';
|
1251 |
+
if (
|
1252 |
+
isset($finalparams['layout']) && strtolower($finalparams['layout']) == 'gallery' && isset($finalparams['list'])
|
1253 |
+
)
|
1254 |
+
{
|
1255 |
+
$dynsrc = 'data-ep-gallery';
|
1256 |
+
$galleryWrapper1 = '<div class="epyt-gallery" data-currpage="1">';
|
1257 |
+
$galleryWrapper2 = '</div>';
|
1258 |
+
$galleryCode = '<div class="epyt-gallery-list">' . self::get_gallery_page($finalparams['list'], null, $finalparams[self::$opt_gallery_pagesize], intval($finalparams[self::$opt_gallery_columns]), $finalparams[self::$opt_gallery_style], self::$alloptions[self::$opt_apikey]) . '</div>';
|
1259 |
+
$videoidoutput = 'GALLERYVIDEOID';
|
1260 |
+
}
|
1261 |
+
|
1262 |
$code1 = '<iframe ' . $dyntype . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
|
1263 |
'" ' . $dynsrc . 'src="//www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
|
1264 |
$code2 = '" frameborder="0" type="text/html" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') .
|
1286 |
{
|
1287 |
if (in_array($key, self::$yt_options))
|
1288 |
{
|
1289 |
+
if (!empty($galleryCode) && ($key == 'listType' || $key == 'list'))
|
1290 |
+
{
|
1291 |
+
|
1292 |
+
}
|
1293 |
+
else
|
1294 |
{
|
1295 |
+
$finalsrc .= htmlspecialchars($key) . '=' . htmlspecialchars($value) . '&';
|
1296 |
+
if ($key == 'loop' && $value == 1 && !isset($finalparams['list']))
|
1297 |
+
{
|
1298 |
+
$finalsrc .= 'playlist=' . $finalparams['v'] . '&';
|
1299 |
+
}
|
1300 |
}
|
1301 |
}
|
1302 |
}
|
1303 |
}
|
1304 |
|
1305 |
+
$code = $galleryWrapper1 . $code1 . $finalsrc . $code2 . $galleryCode . $galleryWrapper2; //. '<!--' . $m[0] . '-->';
|
1306 |
// reset static vals for next embed
|
1307 |
self::$defaultheight = null;
|
1308 |
self::$defaultwidth = null;
|
1309 |
self::$oembeddata = null;
|
1310 |
|
1311 |
+
|
1312 |
+
|
1313 |
+
|
1314 |
+
|
1315 |
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0 && self::$alloptions[self::$opt_spdc] == 1)
|
1316 |
{
|
1317 |
$daysecs = self::$alloptions[self::$opt_spdcexp] * 60 * 60;
|
1930 |
$new_pointer_content .= '<p>'; // ooopointer
|
1931 |
if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
|
1932 |
{
|
1933 |
+
$new_pointer_content .= __("This update adds playlist and channel gallery support for FREE and PRO users with some <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">additional PRO settings »</a>");
|
1934 |
}
|
1935 |
else
|
1936 |
{
|
1937 |
+
$new_pointer_content .= __("This update adds playlist and channel gallery support for FREE and PRO users with some additional PRO settings.");
|
1938 |
}
|
1939 |
$new_pointer_content .= '</p>';
|
1940 |
|
2052 |
}
|
2053 |
$new_options[self::$opt_vol] = $_vol;
|
2054 |
|
2055 |
+
$_gallery_pagesize = 12;
|
2056 |
+
try
|
2057 |
+
{
|
2058 |
+
$_gallery_pagesize = is_numeric(trim($_POST[self::$opt_gallery_pagesize])) ? intval(trim($_POST[self::$opt_gallery_pagesize])) : $_gallery_pagesize;
|
2059 |
+
}
|
2060 |
+
catch (Exception $ex)
|
2061 |
+
{
|
2062 |
+
|
2063 |
+
}
|
2064 |
+
$new_options[self::$opt_gallery_pagesize] = $_gallery_pagesize;
|
2065 |
+
|
2066 |
+
|
2067 |
+
$_gallery_columns = 3;
|
2068 |
+
try
|
2069 |
+
{
|
2070 |
+
$_gallery_columns = is_numeric(trim($_POST[self::$opt_gallery_columns])) ? intval(trim($_POST[self::$opt_gallery_columns])) : $_gallery_columns;
|
2071 |
+
}
|
2072 |
+
catch (Exception $ex)
|
2073 |
+
{
|
2074 |
+
|
2075 |
+
}
|
2076 |
+
$new_options[self::$opt_gallery_columns] = $_gallery_columns;
|
2077 |
+
|
2078 |
+
$_gallery_style = 'grid';
|
2079 |
+
try
|
2080 |
+
{
|
2081 |
+
$_gallery_style = trim(str_replace(array(' ', "'", '"'), array('', '', ''), strip_tags($_POST[self::$opt_gallery_style])));
|
2082 |
+
}
|
2083 |
+
catch (Exception $ex)
|
2084 |
+
{
|
2085 |
+
$_gallery_style = 'grid';
|
2086 |
+
}
|
2087 |
+
$new_options[self::$opt_gallery_style] = $_gallery_style;
|
2088 |
+
|
2089 |
|
2090 |
$_apikey = '';
|
2091 |
try
|
2092 |
{
|
2093 |
$_apikey = trim(str_replace(array(' ', "'", '"'), array('', '', ''), strip_tags($_POST[self::$opt_apikey])));
|
2094 |
+
if (empty($_apikey))
|
2095 |
+
{
|
2096 |
+
$_apikey = trim(str_replace(array(' ', "'", '"'), array('', '', ''), strip_tags($_POST[self::$opt_gallery_apikey])));
|
2097 |
+
}
|
2098 |
}
|
2099 |
catch (Exception $ex)
|
2100 |
{
|
2176 |
.wrap {font-family: Arial; color: #000000;}
|
2177 |
#ytform p { line-height: 20px; margin-bottom: 11px; }
|
2178 |
#ytform ul li {margin-left: 30px; list-style: disc outside none;}
|
2179 |
+
.ytindent {padding: 0px 0px 0px 20px; font-size: 12px;}
|
2180 |
+
.ytindent ul, .ytindent p {font-size: 12px;}
|
2181 |
.shadow {-webkit-box-shadow: 0px 0px 20px 0px #000000; box-shadow: 0px 0px 20px 0px #000000;}
|
2182 |
.gopro {margin: 0px;}
|
2183 |
.gopro img {vertical-align: middle;
|
2194 |
.pronon {font-weight: bold; color: #f85d00;}
|
2195 |
ul.reglist li {margin: 0px 0px 0px 30px; list-style: disc outside none;}
|
2196 |
.procol {width: 475px; float: left;}
|
2197 |
+
.ytindent .procol ul {font-size: 11px;}
|
2198 |
.smallnote {font-style: italic; font-size: 10px;}
|
2199 |
.italic {font-style: italic;}
|
2200 |
.ytindent h3 {font-size: 15px; line-height: 22px; margin: 5px 0px 10px 0px;}
|
2210 |
background: linear-gradient(to bottom, #2ea2cc 0%,#007396 98%); /* W3C */
|
2211 |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2ea2cc', endColorstr='#007396',GradientType=0 ); /* IE6-9 */
|
2212 |
}
|
2213 |
+
p.submit em {display: inline-block; padding-left: 20px; vertical-align: middle; width: 240px; margin-top: -6px;}
|
2214 |
#opt_pro {box-shadow: 0px 0px 5px 0px #1870D5; width: 320px;vertical-align: top;}
|
2215 |
#goprobox h3 {font-size: 13px;}
|
2216 |
.chx p {margin: 0px 0px 5px 0px;}
|
2221 |
h3.sect {border-radius: 10px; background-color: #D9E9F7; padding: 5px 5px 5px 10px; position: relative; font-weight: bold;}
|
2222 |
h3.sect a {text-decoration: none; color: #E20000;}
|
2223 |
h3.sect a.button-primary {color: #ffffff;}
|
2224 |
+
h4.sect {border-radius: 10px; background-color: #D9E9F7; padding: 5px 5px 5px 10px; position: relative; font-weight: bold;}
|
2225 |
+
|
2226 |
.ytnav {margin-bottom: 15px;}
|
2227 |
.ytnav a {font-weight: bold; display: inline-block; padding: 5px 10px; margin: 0px 20px 0px 0px; border: 1px solid #cccccc; border-radius: 6px;
|
2228 |
text-decoration: none; background-color: #ffffff;}
|
2231 |
.ssfb {float: right; height: auto; margin-right: 10px; margin-left: 15px; margin-bottom: 10px;}
|
2232 |
.totop {position: absolute; right: 20px; top: 5px; color: #444444; font-size: 10px;}
|
2233 |
input[type=checkbox] {border: 1px solid #000000;}
|
2234 |
+
.chktitle {display: inline-block; padding: 1px 5px 1px 5px; border-radius: 3px; background-color: #ffffff; border: 1px solid #dddddd;}
|
2235 |
b, strong {font-weight: bold;}
|
2236 |
input.checkbox[disabled] {border: 1px dashed #444444;}
|
2237 |
.pad10 {padding: 10px;}
|
2257 |
div.hr {clear: both; border-bottom: 1px dotted #A8BDD8; margin: 20px 0 20px 0;}
|
2258 |
.wp-pointer-buttons a.close {margin-top: 0 !important;}
|
2259 |
.pad20{padding: 20px 0 20px 0;}
|
2260 |
+
.ssgallery {float: right; width: 130px; height: auto; margin-left: 15px; border: 3px solid #ffffff;}
|
2261 |
+
.ssaltgallery {float: right; height: auto; margin-right: 10px; margin-left: 15px; margin-bottom: 10px; width: 210px;}
|
2262 |
</style>
|
2263 |
<div class="ytindent">
|
2264 |
<br>
|
2265 |
<div id="jumphowto"></div>
|
2266 |
<div class="ytnav">
|
2267 |
<a href="#jumphowto">How To Embed</a>
|
2268 |
+
<a href="#jumpwiz">Visual Wizard</a>
|
2269 |
+
<a href="#jumpdefaults">Defaults</a>
|
2270 |
+
<a href="#jumpgallery">Gallery Settings</a>
|
2271 |
<a href="#jumpoverride">How To Override Defaults</a>
|
2272 |
+
<a target="_blank" href="<?php echo self::$epbase . "/dashboard/pro-easy-video-analytics.aspx?ref=protab" ?>" style="border-color: #888888;">Upgrade?</a>
|
2273 |
<a href="#jumpsupport">Support</a>
|
2274 |
</div>
|
2275 |
|
2384 |
</p>
|
2385 |
<p>
|
2386 |
<input name="<?php echo self::$opt_vq; ?>" id="<?php echo self::$opt_vq; ?>" <?php checked($all[self::$opt_vq], 'hd720'); ?> type="checkbox" class="checkbox">
|
2387 |
+
<label for="<?php echo self::$opt_vq; ?>"><?php _e('<b class="chktitle strike">HD Quality:</b> Force HD quality when available. <b>NOTE: YouTube has deprecated this unofficially supported option.</b>') ?> </label>
|
2388 |
</p>
|
2389 |
<p>
|
2390 |
<input name="<?php echo self::$opt_wmode; ?>" id="<?php echo self::$opt_wmode; ?>" <?php checked($all[self::$opt_wmode], 'opaque'); ?> type="checkbox" class="checkbox">
|
2477 |
As of January 2015, YouTube began serving the HTML5 player by default; therefore, this plugin no longer needs a special HTML5 setting. This option is simply kept here as a notice.
|
2478 |
</label>
|
2479 |
</p>
|
2480 |
+
|
2481 |
<p>
|
2482 |
<input name="<?php echo self::$opt_playlistorder; ?>" id="<?php echo self::$opt_playlistorder; ?>" <?php checked($all[self::$opt_playlistorder], 1); ?> type="checkbox" class="checkbox">
|
2483 |
<label for="<?php echo self::$opt_playlistorder; ?>">
|
2484 |
+
<b class="chktitle">Playlist Ordering: <sup class="orange bold">NEW</sup></b> Check this option if you want your playlists to begin with the latest added video by default. (Unchecking this will force playlists to always start with your selected specific video, even if you add videos to the playlist later).
|
2485 |
</label>
|
2486 |
</p>
|
2487 |
|
2498 |
|
2499 |
</div>
|
2500 |
</p>
|
2501 |
+
</div>
|
2502 |
+
<div class="jumper" id="jumpgallery"></div>
|
2503 |
+
<h3 class="sect">Gallery Settings and Directions<sup class="orange bold">NEW</sup></h3>
|
2504 |
+
<img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
|
2505 |
+
<p>
|
2506 |
+
You can now make playlist embeds (and channel-playlist embeds) have a gallery layout. <strong>First, you must obtain your YouTube API key</strong>.
|
2507 |
+
Don't worry, it's an easy process. Just <a href="https://www.youtube.com/watch?v=2vmBACVETf4" target="_blank">click this link »</a> and follow the video on that page to get your API key. Then paste it in the box below, and click the "Save Changes" button:
|
2508 |
+
</p>
|
2509 |
+
<p>
|
2510 |
+
Simply add the following parameter to the end of your playlist url:
|
2511 |
+
</p>
|
2512 |
+
<p><code>&layout=gallery</code></p>
|
2513 |
+
<p>For example, below is a playlist that has been converted into a gallery. Notice the new layout parameter, with no spaces:</p>
|
2514 |
+
<p>
|
2515 |
+
<code style="font-size: .9em;">http://www.youtube.com/embed?listType=playlist&width=474&height=266&list=UUAuUUnT6oDeKwE6v1NGQxug&plindex=0<b>&layout=gallery</b></code>
|
2516 |
+
</p>
|
2517 |
+
<p class="smallnote">
|
2518 |
+
PRO users can just use the playlist or channel wizard steps to fully to build codes like the above.
|
2519 |
+
</p>
|
2520 |
+
<p>
|
2521 |
+
Below are the settings for galleries:
|
2522 |
+
</p>
|
2523 |
+
<div class="ytindent chx">
|
2524 |
+
<p>
|
2525 |
+
<b class="chktitle">YouTube API Key:</b>
|
2526 |
+
<input type="text" name="<?php echo self::$opt_gallery_apikey; ?>" id="<?php echo self::$opt_gallery_apikey; ?>" value="<?php echo trim($all[self::$opt_apikey]); ?>" class="textinput" style="width: 200px;">
|
2527 |
+
Required so your site can get the thumbnails, title text, and other content from YouTube’s servers that used to render galleries. <a href="https://www.youtube.com/watch?v=2vmBACVETf4" target="_blank">Click this link »</a> and follow the video to the right to get your API key.
|
2528 |
+
</p>
|
2529 |
+
<p>
|
2530 |
+
<label for="<?php echo self::$opt_gallery_pagesize; ?>"><b class="chktitle">Gallery Page Size:</b></label>
|
2531 |
+
<input name="<?php echo self::$opt_gallery_pagesize; ?>" id="<?php echo self::$opt_gallery_pagesize; ?>" type="number" class="textinput" style="width: 60px;" value="<?php echo trim($all[self::$opt_gallery_pagesize]); ?>">
|
2532 |
+
Enter how many thumbnails per page should be shown at once.
|
2533 |
+
</p>
|
2534 |
+
<p>
|
2535 |
+
<label for="<?php echo self::$opt_gallery_columns; ?>"><b class="chktitle">Number of Columns:</b></label>
|
2536 |
+
<input name="<?php echo self::$opt_gallery_columns; ?>" id="<?php echo self::$opt_gallery_columns; ?>" type="number" class="textinput" style="width: 60px;" value="<?php echo trim($all[self::$opt_gallery_columns]); ?>">
|
2537 |
+
Enter how many thumbnails can fit per row.
|
2538 |
+
</p>
|
2539 |
+
</div>
|
2540 |
|
2541 |
+
<p class="submit">
|
2542 |
+
<br>
|
2543 |
+
<input type="submit" onclick="return savevalidate();" name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
2544 |
+
<em>If you're using a separate caching plugin and you do not see your changes after saving, you might want to reset your cache.</em>
|
2545 |
+
</p>
|
2546 |
+
|
2547 |
+
|
2548 |
+
<div class="upgchecks">
|
2549 |
+
<h3 class="sect">PRO Features</h3>
|
2550 |
+
<?php
|
2551 |
+
if ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0)
|
2552 |
+
{
|
2553 |
+
?>
|
2554 |
+
<p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). Gallery options for PRO users will also be listed here.</p>
|
2555 |
+
|
2556 |
+
<p>
|
2557 |
+
<input name="<?php echo self::$opt_spdc; ?>" id="<?php echo self::$opt_spdc; ?>" <?php checked($all[self::$opt_spdc], 1); ?> type="checkbox" class="checkbox">
|
2558 |
+
<label for="<?php echo self::$opt_spdc; ?>">
|
2559 |
+
<b>(PRO)</b> <b class="chktitle">Faster Page Loads (Caching): <sup class="orange">NEW</sup></b>
|
2560 |
+
Use embed caching to speed up your page loads. By default, WordPress needs to request information from YouTube.com's servers for every video you embed, every time a page is loaded. These data requests can add time to your total page load time. Turn on this feature to cache that data (instead of having to request for the same information every time you load a page). This should then make your pages that have videos load faster. It's been noted that even small speed ups in page load can help increase visitor engagement, retention, and conversions. Caching also makes galleries run faster.
|
2561 |
+
</label>
|
2562 |
+
<div class="indent-option">
|
2563 |
+
<div id="boxspdc">
|
2564 |
+
<label>
|
2565 |
+
<b class="chktitle">Cache Liftime (hours): <sup class="orange">NEW</sup></b>
|
2566 |
+
<input name="<?php echo self::$opt_spdcexp; ?>" id="<?php echo self::$opt_spdcexp; ?>" value="<?php echo trim($all[self::$opt_spdcexp]); ?>" type="number" min="1"/>
|
2567 |
</label>
|
2568 |
+
Tip: If your pages rarely change, you may wish to set this to a much higher value than 24 hours.
|
2569 |
+
|
2570 |
+
<div class="pad20">
|
2571 |
+
<input type="button" class="button button-primary" value="Click to clear YouTube cache"/>
|
2572 |
+
<span style="display: none;" id="clearspdcloading" class="orange bold">Clearing...</span>
|
2573 |
+
<span class="orange bold" style="display: none;" id="clearspdcsuccess">Finished clearing YouTube cache.</span>
|
2574 |
+
<span class="orange bold" style="display: none;" id="clearspdcfailed">Sorry, there seemed to be a problem clearing the cache.</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2575 |
</div>
|
2576 |
</div>
|
2577 |
+
</div>
|
2578 |
+
</p>
|
2579 |
+
<div class="hr"></div>
|
2580 |
+
<p>
|
2581 |
+
<img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgallery.jpg', __FILE__) ?>" />
|
2582 |
+
<?php $cleanstyle = trim($all[self::$opt_gallery_style]); ?>
|
2583 |
+
<select name="<?php echo self::$opt_gallery_style; ?>" id="<?php echo self::$opt_gallery_style; ?>" >
|
2584 |
+
<option value="">Gallery Style</option>
|
2585 |
+
<option value="grid" <?php echo 'grid' === $cleanstyle ? 'selected' : '' ?> >Default (grid)</option>
|
2586 |
+
<option value="listview" <?php echo 'listview' === $cleanstyle ? 'selected' : '' ?> >List view</option>
|
2587 |
+
</select>
|
2588 |
+
<label for="<?php echo self::$opt_gallery_style; ?>">
|
2589 |
+
<b>(PRO)</b> <b class="chktitle">Alternate Gallery Styling: <sup class="orange">NEW</sup></b></b>
|
2590 |
+
Switch from the grid style of the FREE version to another gallery style. Right now, we provide a vertical (single column) list style as an alternative, with more designs coming. This current alternative was inspired by the standard YouTube playlist player’s “table of contents,” except our gallery’s video list is always visible and shown under the playing video. <a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">Read more here »</a>
|
2591 |
+
</label>
|
2592 |
+
</p>
|
2593 |
+
<div class="hr"></div>
|
2594 |
+
<p>
|
2595 |
+
<input name="<?php echo self::$opt_schemaorg; ?>" id="<?php echo self::$opt_schemaorg; ?>" <?php checked($all[self::$opt_schemaorg], 1); ?> type="checkbox" class="checkbox">
|
2596 |
+
<label for="<?php echo self::$opt_schemaorg; ?>">
|
2597 |
+
<b>(PRO)</b> <b class="chktitle">Video SEO Tags:</b> Update your YouTube embeds with Google, Bing, and Yahoo friendly video SEO markup.
|
2598 |
+
</label>
|
2599 |
+
<span id="boxschemaorg">
|
2600 |
+
<span class="apikey-msg">
|
2601 |
+
The video SEO tags include data like the title, description, and thumbnail information of each video you embed. This plugin automatically extracts this data directly from YouTube using the version 3 API,
|
2602 |
+
which will soon replace the version 2 API. This particular API version requires that you obtain an API key so that YouTube can authenticate the requests. Don't worry, it's an easy process.
|
2603 |
+
Just <a href="https://developers.google.com/youtube/registering_an_application" target="_blank">click this link »</a> and follow the video to the right to get your API key. Then paste it in the box below, and click the "Save Changes" button:
|
2604 |
+
<br>
|
2605 |
+
<span style="vertical-align: middle; display: inline-block;">
|
2606 |
+
YouTube API Key: <input type="text" name="<?php echo self::$opt_apikey; ?>" id="<?php echo self::$opt_apikey; ?>" value="<?php echo trim($all[self::$opt_apikey]); ?>" class="textinput" style="width: 200px;">
|
2607 |
</span>
|
2608 |
</span>
|
2609 |
+
<span class="apikey-video">
|
2610 |
+
<iframe width="384" height="216" src="https://www.youtube.com/embed/2vmBACVETf4?rel=0" frameborder="0" allowfullscreen></iframe>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2611 |
</span>
|
2612 |
+
</span>
|
2613 |
+
</p>
|
2614 |
+
<div class="hr"></div>
|
2615 |
+
<p>
|
2616 |
+
<input name="<?php echo self::$opt_dynload; ?>" id="<?php echo self::$opt_dynload; ?>" <?php checked($all[self::$opt_dynload], 1); ?> type="checkbox" class="checkbox">
|
2617 |
+
<span id="boxdyn">
|
2618 |
+
Animation:
|
2619 |
+
<?php $cleandyn = trim($all[self::$opt_dyntype]); ?>
|
2620 |
+
<select name="<?php echo self::$opt_dyntype; ?>" id="<?php echo self::$opt_dyntype; ?>" >
|
2621 |
+
<option value="">Select type</option>
|
2622 |
+
<option value="rotateIn" <?php echo 'rotateIn' === $cleandyn ? 'selected' : '' ?> >rotate in</option>
|
2623 |
+
<option value="slideInRight" <?php echo 'slideInRight' === $cleandyn ? 'selected' : '' ?> >slide from right</option>
|
2624 |
+
<option value="slideInLeft" <?php echo 'slideInLeft' === $cleandyn ? 'selected' : '' ?> >slide from left</option>
|
2625 |
+
<option value="bounceIn" <?php echo 'bounceIn' === $cleandyn ? 'selected' : '' ?> >bounce in</option>
|
2626 |
+
<option value="flipInX" <?php echo 'flipInX' === $cleandyn ? 'selected' : '' ?> >flip up/down</option>
|
2627 |
+
<option value="flipInY" <?php echo 'flipInY' === $cleandyn ? 'selected' : '' ?> >flip left/right</option>
|
2628 |
+
<option value="pulse" <?php echo 'pulse' === $cleandyn ? 'selected' : '' ?> >pulse</option>
|
2629 |
+
<option value="tada" <?php echo 'tada' === $cleandyn ? 'selected' : '' ?> >jiggle</option>
|
2630 |
+
<option value="fadeInDown" <?php echo 'fadeInDown' === $cleandyn ? 'selected' : '' ?> >fade in downward</option>
|
2631 |
+
<option value="fadeInUp" <?php echo 'fadeInUp' === $cleandyn ? 'selected' : '' ?> >fade in upward</option>
|
2632 |
+
<option value="zoomInDown" <?php echo 'zoomInDown' === $cleandyn ? 'selected' : '' ?> >zoom in downward</option>
|
2633 |
+
<option value="zoomInUp" <?php echo 'zoomInUp' === $cleandyn ? 'selected' : '' ?> >zoom in upward</option>
|
2634 |
+
</select>
|
2635 |
+
</span>
|
2636 |
+
<label for="<?php echo self::$opt_dynload; ?>">
|
2637 |
+
<b>(PRO)</b> <b class="chktitle">Special Lazy-Loading Effects:</b>
|
2638 |
+
Add eye-catching special effects that will make your YouTube embeds bounce, flip, pulse, or slide as they lazy load on the screen. Check this box to select your desired effect. <a target="_blank" href="<?php echo self::$epbase ?>/add-special-effects-to-youtube-embeds-in-wordpress.aspx">Read more here »</a>
|
2639 |
+
</label>
|
2640 |
+
</p>
|
2641 |
+
<div class="hr"></div>
|
2642 |
+
<p>
|
2643 |
+
<img class="ssfb" src="<?php echo plugins_url('images/ssfb.jpg', __FILE__) ?>" />
|
2644 |
+
<input name="<?php echo self::$opt_ogvideo; ?>" id="<?php echo self::$opt_ogvideo; ?>" <?php checked($all[self::$opt_ogvideo], 1); ?> type="checkbox" class="checkbox">
|
2645 |
+
<label for="<?php echo self::$opt_ogvideo; ?>">
|
2646 |
+
<b>(PRO)</b> <b class="chktitle">Facebook Open Graph Markup:</b> Update YouTube embeds on your pages with Open Graph markup to enhance Facebook sharing and discovery of the pages. Your shared pages, for example, will also display embedded video thumbnails on Facebook Timelines.
|
2647 |
+
</label>
|
2648 |
+
</p>
|
2649 |
+
<div class="hr"></div>
|
2650 |
+
<p>
|
2651 |
+
<img class="ssfb" src="<?php echo plugins_url('images/youtube_thumbnail_sample.jpg', __FILE__) ?>" />
|
2652 |
+
<input name="<?php echo self::$opt_ftpostimg; ?>" id="<?php echo self::$opt_ftpostimg; ?>" <?php checked($all[self::$opt_ftpostimg], 1); ?> type="checkbox" class="checkbox">
|
2653 |
+
<label for="<?php echo self::$opt_ftpostimg; ?>">
|
2654 |
+
<b>(PRO)</b> <b class="chktitle">Automatic Video Thumbnails: <sup class="orange">NEW</sup></b>
|
2655 |
+
Automatically grab the thumbnail image of the first video embedded in each post or page, and use it as the featured image. If your theme can display featured images of posts on your blog home, you’ll see the thumbnails there as shown in the picture on the right. All you have to do is click Update on a post or page and the plugin does the rest!
|
2656 |
+
(Example shown on the right) <a target="_blank" href="<?php echo self::$epbase ?>/add-youtube-video-thumbnails-featured-image-wordpress.aspx">Watch example here »</a>
|
2657 |
+
</label>
|
2658 |
+
</p>
|
2659 |
|
2660 |
+
<?php
|
2661 |
+
}
|
2662 |
+
else
|
2663 |
+
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2664 |
?>
|
2665 |
+
<p class="smallnote orange">Below are PRO features for enhanced SEO and performance (works for even past embed links). </p>
|
2666 |
+
<p>
|
2667 |
+
<input disabled type="checkbox" class="checkbox">
|
2668 |
+
<label>
|
2669 |
+
<b class="chktitle">Faster Page Loads (Caching): <sup class="orange">NEW</sup></b> <span class="pronon">(PRO Users)</span>
|
2670 |
+
Use embed caching to speed up your page loads. By default, WordPress needs to request information from YouTube.com's servers for every video you embed, every time a page is loaded. These data requests can add time to your total page load time. Turn on this feature to cache that data (instead of having to request for the same information every time you load a page). This should then make your pages that have videos load faster. It's been noted that even small speed ups in page load can help increase visitor engagement, retention, and conversions. Caching also makes galleries run faster.
|
2671 |
+
</label>
|
2672 |
+
<div class="indent-option">
|
2673 |
+
<label>
|
2674 |
+
<b class="chktitle">Cache Liftime (hours): <sup class="orange">NEW</sup></b>
|
2675 |
+
<input disabled value="24" type="number">
|
2676 |
+
Tip: If your pages rarely change, you may wish to set this to a much higher value than 24 hours.
|
2677 |
+
</label>
|
2678 |
+
</div>
|
2679 |
+
</p>
|
2680 |
+
<div class="hr"></div>
|
2681 |
+
<p>
|
2682 |
+
<img class="ssaltgallery" src="<?php echo plugins_url('images/ssaltgallery.jpg', __FILE__) ?>" />
|
2683 |
+
<select disabled>
|
2684 |
+
<option value="">Gallery Style</option>
|
2685 |
+
</select>
|
2686 |
+
<label>
|
2687 |
+
<b>(PRO)</b> <b class="chktitle">Alternate Gallery Styling: <sup class="orange">NEW</sup></b> <span class="pronon">(PRO Users)</span>
|
2688 |
+
Switch from the grid style of the FREE version to another gallery style. Right now, we provide a vertical (single column) list style as an alternative, with more designs coming. This current alternative was inspired by the standard YouTube playlist player’s “table of contents,” except our gallery’s video list is always visible and shown under the playing video. <a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">Read more here »</a>
|
2689 |
+
</label>
|
2690 |
+
</p>
|
2691 |
+
|
2692 |
+
<div class="hr"></div>
|
2693 |
+
|
2694 |
+
<p>
|
2695 |
+
<input disabled type="checkbox" class="checkbox">
|
2696 |
+
<label>
|
2697 |
+
<b class="chktitle">Video SEO Tags:</b> <span class="pronon">(PRO Users)</span> Update your YouTube embeds with Google, Bing, and Yahoo friendly video SEO markup.
|
2698 |
+
</label>
|
2699 |
+
</p>
|
2700 |
+
<div class="hr"></div>
|
2701 |
+
<p>
|
2702 |
+
<input disabled type="checkbox" class="checkbox">
|
2703 |
+
<label>
|
2704 |
+
<b class="chktitle">Special Loading Effects:</b> <span class="pronon">(PRO Users)</span>
|
2705 |
+
Add eye-catching special effects that will make your YouTube embeds bounce, flip, pulse, or slide as they load on the screen. Check this box to select your desired effect. <a target="_blank" href="<?php echo self::$epbase ?>/add-special-effects-to-youtube-embeds-in-wordpress.aspx">Read more here »</a>
|
2706 |
+
</label>
|
2707 |
+
</p>
|
2708 |
+
<div class="hr"></div>
|
2709 |
+
<p>
|
2710 |
+
<img class="ssfb" src="<?php echo plugins_url('images/ssfb.jpg', __FILE__) ?>" />
|
2711 |
+
<input disabled type="checkbox" class="checkbox">
|
2712 |
+
<label>
|
2713 |
+
<b class="chktitle">Facebook Open Graph Markup:</b> <span class="pronon">(PRO Users)</span> Update YouTube embeds on your pages with Open Graph markup to enhance Facebook sharing and discovery of the pages. Your shared pages, for example, will also display embedded video thumbnails on Facebook Timelines.
|
2714 |
+
</label>
|
2715 |
+
</p>
|
2716 |
+
<div class="hr"></div>
|
2717 |
+
<p>
|
2718 |
+
<img class="ssfb" src="<?php echo plugins_url('images/youtube_thumbnail_sample.jpg', __FILE__) ?>" />
|
2719 |
+
<input disabled type="checkbox" class="checkbox">
|
2720 |
+
<label>
|
2721 |
+
<b class="chktitle">Automatic Video Thumbnails:</b> <span class="pronon">(PRO Users)</span>
|
2722 |
+
Automatically grab the thumbnail image of the first video embedded in each post or page, and use it as the featured image.
|
2723 |
+
All you have to do is click Update on a post or page and the plugin does the rest!
|
2724 |
+
(Example shown on the right) <a target="_blank" href="<?php echo self::$epbase ?>/add-youtube-video-thumbnails-featured-image-wordpress.aspx">Read more here »</a>
|
2725 |
+
</label>
|
2726 |
+
</p>
|
2727 |
+
<div class="hr"></div>
|
2728 |
+
<p>
|
2729 |
+
<a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx" target="_blank">Activate the above and several other features »</a>
|
2730 |
+
</p>
|
2731 |
+
<?php
|
2732 |
+
}
|
2733 |
+
?>
|
2734 |
+
<div class="clearboth"></div>
|
2735 |
+
</div>
|
2736 |
+
<p class="submit">
|
2737 |
+
<br>
|
2738 |
+
<input type="submit" onclick="return savevalidate();" name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
2739 |
+
<em>If you're using a separate caching plugin and you do not see your changes after saving, you might want to reset your cache.</em>
|
2740 |
+
</p>
|
2741 |
+
|
2742 |
+
<hr>
|
2743 |
|
|
|
2744 |
|
|
|
2745 |
<div class="jumper" id="jumpoverride"></div>
|
2746 |
|
2747 |
<h3 class="sect">
|
2807 |
Full Visual Embedding Wizard (Easily customize embeds without memorizing codes)
|
2808 |
</li>
|
2809 |
<li>
|
2810 |
+
<img src="<?php echo plugins_url('images/icongallery.png', __FILE__) ?>">
|
2811 |
+
Alternate Gallery Styling
|
2812 |
+
</li>
|
2813 |
<li>
|
2814 |
<img src="<?php echo plugins_url('images/iconfx.png', __FILE__) ?>">
|
2815 |
Add eye-catching special effects as your videos load
|
2848 |
<img src="<?php echo plugins_url('images/iconfb.png', __FILE__) ?>">
|
2849 |
Automatic Open Graph tagging for Facebook
|
2850 |
</li>
|
2851 |
+
<!-- <li>
|
2852 |
+
<img src="<?php echo plugins_url('images/iconythealth.png', __FILE__) ?>">
|
2853 |
+
Instant YouTube embed diagnostic reports
|
2854 |
+
</li> -->
|
2855 |
<li>
|
2856 |
+
<img src="<?php echo plugins_url('images/vseo.png', __FILE__) ?>">
|
2857 |
+
Automatic tagging for video SEO (will even work for your old embeds)
|
2858 |
+
</li>
|
2859 |
<li>
|
2860 |
<img src="<?php echo plugins_url('images/iconvolume.png', __FILE__) ?>">
|
2861 |
Fine-Grained Volume Initialization – Individual video volume settings in the wizard
|
2950 |
?>
|
2951 |
<div class="ytnav">
|
2952 |
<a href="#jumphowto">How To Embed</a>
|
2953 |
+
<a href="#jumpwiz">Visual Wizard</a>
|
2954 |
+
<a href="#jumpdefaults">Defaults</a>
|
2955 |
+
<a href="#jumpgallery">Gallery Settings</a>
|
2956 |
<a href="#jumpoverride">How To Override Defaults</a>
|
2957 |
+
<a target="_blank" href="<?php echo self::$epbase . "/dashboard/pro-easy-video-analytics.aspx?ref=protab" ?>" style="border-color: #888888;">Upgrade?</a>
|
2958 |
<a href="#jumpsupport">Support</a>
|
2959 |
</div>
|
2960 |
|
3274 |
|
3275 |
public static function ytprefsscript()
|
3276 |
{
|
3277 |
+
wp_enqueue_style(
|
3278 |
+
'__EPYT__style', plugins_url('styles/ytprefs.min.css', __FILE__)
|
3279 |
+
);
|
3280 |
+
|
3281 |
+
$colwidth = 100.0 / floatval(self::$alloptions[self::$opt_gallery_columns]);
|
3282 |
+
$custom_css = "
|
3283 |
+
.epyt-gallery-thumb {
|
3284 |
+
width: {$colwidth}%;
|
3285 |
+
}";
|
3286 |
+
wp_add_inline_style('__EPYT__style', $custom_css);
|
3287 |
+
|
3288 |
+
|
3289 |
+
wp_enqueue_script('__ytprefs__', plugins_url('scripts/ytprefs.min.js', __FILE__), array('jquery'));
|
3290 |
+
wp_localize_script('__ytprefs__', '_EPYT_', array(
|
3291 |
+
'ajaxurl' => admin_url('admin-ajax.php'),
|
3292 |
+
'security' => wp_create_nonce('embedplus-nonce')
|
3293 |
+
));
|
3294 |
|
3295 |
|
3296 |
if (!is_admin() && (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0) && self::$alloptions[self::$opt_dynload] == 1)
|
3297 |
{
|
3298 |
wp_enqueue_style('__dyntype__', plugins_url('scripts/embdyn.min.css', __FILE__));
|
3299 |
+
wp_enqueue_script('__dynload__', plugins_url('scripts/embdyn.min.js', __FILE__), array('jquery'));
|
3300 |
}
|
3301 |
}
|
3302 |
|
3413 |
add_action("wp_ajax_my_embedplus_glance_vids", array('YouTubePrefs', 'my_embedplus_glance_vids'));
|
3414 |
add_action("wp_ajax_my_embedplus_glance_count", array('YouTubePrefs', 'my_embedplus_glance_count'));
|
3415 |
add_action("wp_ajax_my_embedplus_dismiss_double_plugin_warning", array('YouTubePrefs', 'my_embedplus_dismiss_double_plugin_warning'));
|
3416 |
+
add_action("wp_ajax_my_embedplus_gallery_page", array('YouTubePrefs', 'my_embedplus_gallery_page'));
|
3417 |
+
add_action("wp_ajax_nopriv_my_embedplus_gallery_page", array('YouTubePrefs', 'my_embedplus_gallery_page'));
|
3418 |
|
3419 |
add_action('admin_enqueue_scripts', 'youtubeprefs_admin_enqueue_scripts');
|
3420 |
|