Version Description
Download this release
Release Info
Developer | embedplus |
Plugin | YouTube |
Version | 3.5 |
Comparing to | |
See all releases |
Version 3.5
- images/btn_embedplusstats.png +0 -0
- images/btn_embedplusstatsoff.png +0 -0
- images/btn_embedpluswiz.png +0 -0
- images/btn_embedpluswizoff.png +0 -0
- images/bulletgraph45.png +0 -0
- images/clickdashboard.png +0 -0
- images/epstats16.png +0 -0
- images/erase.png +0 -0
- images/hideget.jpg +0 -0
- images/html5.png +0 -0
- images/infinity.png +0 -0
- images/lock.png +0 -0
- images/ownline.jpg +0 -0
- images/prioritysupport.png +0 -0
- images/questionsale.png +0 -0
- images/ssprowizard-th.jpg +0 -0
- images/ssprowizard.jpg +0 -0
- images/unlink.png +0 -0
- images/wizbutton.png +0 -0
- images/wizbuttonoff.png +0 -0
- images/youtubeicon.png +0 -0
- images/youtubeicon16.png +0 -0
- images/youtubeicon16off.png +0 -0
- images/youtubewizard.png +0 -0
- readme.txt +131 -0
- screenshot-1.jpg +0 -0
- screenshot-2.jpg +0 -0
- screenshot-3.jpg +0 -0
- scripts/btn_embedplusstats.png +0 -0
- scripts/btn_embedplusstatsoff.png +0 -0
- scripts/embedplus_mce.css +23 -0
- scripts/embedplus_mce.js +42 -0
- scripts/embedplusstats_mce.js +29 -0
- scripts/ytprefs.min.js +1 -0
- youtube.php +975 -0
images/btn_embedplusstats.png
ADDED
Binary file
|
images/btn_embedplusstatsoff.png
ADDED
Binary file
|
images/btn_embedpluswiz.png
ADDED
Binary file
|
images/btn_embedpluswizoff.png
ADDED
Binary file
|
images/bulletgraph45.png
ADDED
Binary file
|
images/clickdashboard.png
ADDED
Binary file
|
images/epstats16.png
ADDED
Binary file
|
images/erase.png
ADDED
Binary file
|
images/hideget.jpg
ADDED
Binary file
|
images/html5.png
ADDED
Binary file
|
images/infinity.png
ADDED
Binary file
|
images/lock.png
ADDED
Binary file
|
images/ownline.jpg
ADDED
Binary file
|
images/prioritysupport.png
ADDED
Binary file
|
images/questionsale.png
ADDED
Binary file
|
images/ssprowizard-th.jpg
ADDED
Binary file
|
images/ssprowizard.jpg
ADDED
Binary file
|
images/unlink.png
ADDED
Binary file
|
images/wizbutton.png
ADDED
Binary file
|
images/wizbuttonoff.png
ADDED
Binary file
|
images/youtubeicon.png
ADDED
Binary file
|
images/youtubeicon16.png
ADDED
Binary file
|
images/youtubeicon16off.png
ADDED
Binary file
|
images/youtubewizard.png
ADDED
Binary file
|
readme.txt
ADDED
@@ -0,0 +1,131 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
=== YouTube ===
|
2 |
+
Contributors: embedplus
|
3 |
+
Plugin Name: YouTube Embed
|
4 |
+
Tags: hd, autohd, auto hd, seo, video analytics, basic analytics, google, google analytics, view count, vlog, vlogging, web videos, youtube analytics, youtube, youtube, youtube plugin, youtube shortcode, embed youtube, plugin, video, video shortcode, embed videos, plugin, youtube player, shortcode, simple, simple youtube, smart youtube playback, youtube embed, wordpress youtube embed, embedding youtube, youtube embedding, video plugin, https, ssl, secure, no-cookie, cookie, html5, youtube html5
|
5 |
+
Requires at least: 2.9
|
6 |
+
Tested up to: 3.6.1
|
7 |
+
Stable tag: 3.5
|
8 |
+
License: GPLv3 or later
|
9 |
+
|
10 |
+
YouTube embed plugin with basic features and convenient defaults. Upgrade now to add view tracking and access to your very own analytics dashboard.
|
11 |
+
|
12 |
+
== Description ==
|
13 |
+
|
14 |
+
This YouTube embed plugin for WordPress is simple, but it can be upgraded for enhanced performance, privacy and security for you and your visitors. It provides the basic features of the YouTube embedded player and will have you posting videos in seconds after installing it. **All you have to do is simply paste an unformatted YouTube link on its own line.** Your YouTube embed will then show up when you preview or publish the post. The settings page has plenty of default options that you can automatically apply to all your embedded YouTube videos. Customizations can be also made to each YouTube embed by adding more to the link as shown below:
|
15 |
+
|
16 |
+
* width - Sets the width of your player. If omitted, the default width will be the width of your theme's content. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350`
|
17 |
+
* height - Sets the height of your player. If omitted, this will be calculated for you automatically. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350`
|
18 |
+
* vq - Set this to `hd720` or `hd1080` to force the video to play in HD quality. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&vq=hd720`
|
19 |
+
* autoplay - Set this to 1 to autoplay the video (or 0 to play the video once). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&autoplay=1`
|
20 |
+
* cc_load_policy - Set this to 1 to turn on closed captioning (or 0 to leave them off). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&cc_load_policy=1`
|
21 |
+
* iv_load_policy - Set this to 3 to turn off annotations (or 1 to show them). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&iv_load_policy=3`
|
22 |
+
* loop - Set this to 1 to loop the video (or 0 to not loop). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&loop=1`
|
23 |
+
* modestbranding - Set this to 1 to remove the YouTube logo while playing (or 0 to show the logo). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&modestbranding=1`
|
24 |
+
* rel - Set this to 0 to not show related videos at the end of playing (or 1 to show them). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&rel=0`
|
25 |
+
* showinfo - Set this to 0 to hide the video title and other info (or 1 to show it). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&showinfo=0`
|
26 |
+
* theme - Set this to 'light' to make the player have the light-colored theme (or 'dark' for the dark theme). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&theme=light`
|
27 |
+
|
28 |
+
You can also start and end each individual video at particular times. Like the above, each option should begin with '&'
|
29 |
+
|
30 |
+
* start - Sets the time (in seconds) to start the video. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350&start=20`
|
31 |
+
* end - Sets the time (in seconds) to stop the video. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350&end=100`
|
32 |
+
|
33 |
+
Beyond the above features, you have the option of upgrading to PRO to add enhanced features like a visual embedding wizard (so you can avoid memorizing codes), priority support, and security/performance. You even get an embedder-centric analytics dashboard that adds view tracking to each of your embeds so that you can answers questions like:
|
34 |
+
|
35 |
+
* How much are your visitors actually watching the videos you post?
|
36 |
+
* How does the view activity on your site compare to other sites like it?
|
37 |
+
* What and when are your best and worst performing YouTube embeds?
|
38 |
+
* How much do the producers of the YouTube videos you embed rely on **your site**, versus other sites and YouTube.com, for views?
|
39 |
+
|
40 |
+
See more details after installing. Enjoy!
|
41 |
+
|
42 |
+
== Installation ==
|
43 |
+
|
44 |
+
1. Use the WordPress plugin installer to install the plugin. Alternatively, you can just extract the folder in our download package and upload it to your plugin directory.
|
45 |
+
1. Access the Plugins admin menu to activate the YouTube embed plugin.
|
46 |
+
1. Make your default settings after clicking the new YouTube menu item that shows up in your admin panel.
|
47 |
+
1. In your editor, start pasting the links with any desired additional codes needed for your YouTube embed. Make sure the link is on its own line.
|
48 |
+
1. To get an analytics dashboard, [sign up for one of the options here >>](https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx)
|
49 |
+
|
50 |
+
Additional codes (adding these will override the default settings in the admin):
|
51 |
+
|
52 |
+
* width - Sets the width of your player. If omitted, the default width will be the width of your theme's content. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350`
|
53 |
+
* height - Sets the height of your player. If omitted, this will be calculated for you automatically. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350`
|
54 |
+
* vq - Set this to `hd720` or `hd1080` to force the video to play in HD quality. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&vq=hd720`
|
55 |
+
* autoplay - Set this to 1 to autoplay the video (or 0 to play the video once). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&autoplay=1`
|
56 |
+
* cc_load_policy - Set this to 1 to turn on closed captioning (or 0 to leave them off). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&cc_load_policy=1`
|
57 |
+
* iv_load_policy - Set this to 3 to turn off annotations (or 1 to show them). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&iv_load_policy=3`
|
58 |
+
* loop - Set this to 1 to loop the video (or 0 to not loop). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&loop=1`
|
59 |
+
* modestbranding - Set this to 1 to remove the YouTube logo while playing (or 0 to show the logo). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&modestbranding=1`
|
60 |
+
* rel - Set this to 0 to not show related videos at the end of playing (or 1 to show them). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&rel=0`
|
61 |
+
* showinfo - Set this to 0 to hide the video title and other info (or 1 to show it). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&showinfo=0`
|
62 |
+
* theme - Set this to 'light' to make the player have the light-colored theme (or 'dark' for the dark theme). Example: `http://www.youtube.com/watch?v=quwebVjAEJA&theme=light`
|
63 |
+
|
64 |
+
You can also start and end each individual video at particular times. Like the above, each option should begin with '&'
|
65 |
+
|
66 |
+
* start - Sets the time (in seconds) to start the video. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350&start=20`
|
67 |
+
* end - Sets the time (in seconds) to stop the video. Example: `http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350&end=100`
|
68 |
+
|
69 |
+
== Screenshots ==
|
70 |
+
|
71 |
+
1. YouTube Embed Screenshot 1: Paste a YouTube link on its own line and it will become a YouTube embed on your website.
|
72 |
+
2. YouTube Embed Screenshot 2: YouTube's admin settings.
|
73 |
+
3. YouTube Embed Screenshot 3: PRO Visual YouTube Wizard
|
74 |
+
|
75 |
+
== Changelog ==
|
76 |
+
|
77 |
+
= YouTube Embed 3.5 =
|
78 |
+
Added ability to force HTML5 player for PRO users
|
79 |
+
Added ability to use "YouTube no cookie" player for PRO users
|
80 |
+
|
81 |
+
= YouTube Embed 3.3 =
|
82 |
+
HTTPS: Added secure YouTube embedding for PRO users
|
83 |
+
|
84 |
+
= YouTube Embed 3.2 =
|
85 |
+
Ensures video-specific height overrides defaults properly
|
86 |
+
|
87 |
+
= YouTube Embed 3.1 =
|
88 |
+
Fixed obscure height problem
|
89 |
+
|
90 |
+
= YouTube Embed 3.0 =
|
91 |
+
Added Visual YouTube Wizard for PRO users
|
92 |
+
Added autologin to analytics for PRO users
|
93 |
+
Added priority support form for PRO users
|
94 |
+
|
95 |
+
= YouTube Embed 2.6 =
|
96 |
+
Compatible with WP 3.6
|
97 |
+
|
98 |
+
= YouTube Embed 2.4 =
|
99 |
+
Added auto HD support
|
100 |
+
Support for shorthand (i.e. `http://www.youtu.be`)
|
101 |
+
Fixed editor issue
|
102 |
+
|
103 |
+
= YouTube Embed 2.3 =
|
104 |
+
Start/end time shortcut bug fix
|
105 |
+
|
106 |
+
= YouTube Embed 2.2 =
|
107 |
+
Minor changes
|
108 |
+
|
109 |
+
= YouTube Embed 2.1 =
|
110 |
+
By request from several users, we've added easier access to the video analytics dashboard
|
111 |
+
|
112 |
+
= YouTube Embed 2.0 =
|
113 |
+
|
114 |
+
This upgrade specifically integrates a user-friendly YouTube Analytics Dashboard to this plugin so you can learn a lot more about the videos you post. Download it if you would like it to use your site's YouTube-related activity to help answer questions like:
|
115 |
+
|
116 |
+
* How much are your visitors actually watching the videos you post?
|
117 |
+
* How does the view activity on your site compare to other sites like it?
|
118 |
+
* What and when are your best and worst performers?
|
119 |
+
* How much do the producers of the YouTube videos you embed rely on **your site** for views?
|
120 |
+
|
121 |
+
We think these are all interesting questions; however, note that there's no need to upgrade if you don't.
|
122 |
+
|
123 |
+
= YouTube Embed 1.1 =
|
124 |
+
Fixed minor bug.
|
125 |
+
|
126 |
+
= YouTube Embed 1.0 =
|
127 |
+
First release uploaded to the plugin repository.
|
128 |
+
|
129 |
+
== Other Notes ==
|
130 |
+
|
131 |
+
This YouTube plugin includes [YouTube embed analytics](https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx) to help you learn a lot about the videos you post.
|
screenshot-1.jpg
ADDED
Binary file
|
screenshot-2.jpg
ADDED
Binary file
|
screenshot-3.jpg
ADDED
Binary file
|
scripts/btn_embedplusstats.png
ADDED
Binary file
|
scripts/btn_embedplusstatsoff.png
ADDED
Binary file
|
scripts/embedplus_mce.css
ADDED
@@ -0,0 +1,23 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
.wp_themeSkin span.mce_embedpluswiz_youtubeprefs, span.mce_embedpluswiz_youtubeprefs
|
2 |
+
{
|
3 |
+
background: transparent url("../images/wizbuttonoff.png") no-repeat scroll center center !important;
|
4 |
+
}
|
5 |
+
|
6 |
+
.wp_themeSkin span.mce_embedpluswiz_youtubeprefs:hover, span.mce_embedpluswiz_youtubeprefs:hover
|
7 |
+
{
|
8 |
+
background-image: url("../images/wizbutton.png") !important;
|
9 |
+
}
|
10 |
+
|
11 |
+
.wp_themeSkin span.mce_embedplusstats, span.mce_embedplusstats,
|
12 |
+
.wp_themeSkin span.mce_embedplusstats_youtubeprefs, span.mce_embedplusstats_youtubeprefs
|
13 |
+
|
14 |
+
{
|
15 |
+
background: transparent url("../images/btn_embedplusstatsoff.png") no-repeat scroll center center !important;
|
16 |
+
}
|
17 |
+
|
18 |
+
.wp_themeSkin span.mce_embedplusstats:hover, span.mce_embedplusstats:hover,
|
19 |
+
.wp_themeSkin span.mce_embedplusstats_youtubeprefs:hover, span.mce_embedplusstats_youtubeprefs:hover
|
20 |
+
{
|
21 |
+
background-image: url("../images/btn_embedplusstats.png") !important;
|
22 |
+
}
|
23 |
+
|
scripts/embedplus_mce.js
ADDED
@@ -0,0 +1,42 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.Embedpluswiz_youtubeprefs', {
|
3 |
+
init : function(ed, url) {
|
4 |
+
var plep = new Image();
|
5 |
+
plep.src = url+'/../images/wizbutton.png';
|
6 |
+
ed.addButton('embedpluswiz_youtubeprefs', {
|
7 |
+
title : 'Visual YouTube Wizard - An easier embedding option',
|
8 |
+
onclick : function(ev) {
|
9 |
+
modalw = Math.round(jQuery(window).width() *.9);
|
10 |
+
modalh = Math.round(jQuery(window).height() *.8);
|
11 |
+
ed.windowManager.open({
|
12 |
+
title : "Visual YouTube Wizard - An easier embedding option",
|
13 |
+
file : epbasesite + '/wpembedcode-simple.aspx?blogwidth=' + epblogwidth + '&domain=' + escape(window.location.toString()) + '&prokey=' + escape(epprokey) + '&myytdefaults=' + escape(myytdefaults),
|
14 |
+
width : 950,
|
15 |
+
height : modalh,
|
16 |
+
inline : true,
|
17 |
+
resizable: true,
|
18 |
+
scrollbars: true
|
19 |
+
}, {
|
20 |
+
plugin_url : url, // Plugin absolute URL
|
21 |
+
some_custom_arg : '' // Custom argument
|
22 |
+
});
|
23 |
+
}
|
24 |
+
});
|
25 |
+
},
|
26 |
+
createControl : function(n, cm) {
|
27 |
+
return null;
|
28 |
+
},
|
29 |
+
getInfo : function() {
|
30 |
+
return {
|
31 |
+
longname : "Visual YouTube Wizard - An easier embedding option",
|
32 |
+
author : 'EmbedPlus',
|
33 |
+
authorurl : 'http://www.embedplus.com/',
|
34 |
+
infourl : 'http://www.embedplus.com/',
|
35 |
+
version : epversion
|
36 |
+
};
|
37 |
+
}
|
38 |
+
});
|
39 |
+
tinymce.PluginManager.add('embedpluswiz_youtubeprefs', tinymce.plugins.Embedpluswiz_youtubeprefs);
|
40 |
+
|
41 |
+
|
42 |
+
})();
|
scripts/embedplusstats_mce.js
ADDED
@@ -0,0 +1,29 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
(function() {
|
2 |
+
tinymce.create('tinymce.plugins.Embedplusstats_youtubeprefs', {
|
3 |
+
init : function(ed, url) {
|
4 |
+
var plep = new Image();
|
5 |
+
plep.src = url+'/../btn_embedplusstats.png';
|
6 |
+
ed.addButton('embedplusstats_youtubeprefs', {
|
7 |
+
title : 'How much are your visitors actually watching the videos you post? Click here to start using this popular feature from EmbedPlus Labs »',
|
8 |
+
onclick : function(ev) {
|
9 |
+
window.open(epbasesite + '/dashboard/pro-easy-video-analytics.aspx?ref=wysiwygbutton&prokey=' + epprokey + '&domain=' + escape(window.location.toString()), '_blank');
|
10 |
+
}
|
11 |
+
});
|
12 |
+
|
13 |
+
},
|
14 |
+
createControl : function(n, cm) {
|
15 |
+
return null;
|
16 |
+
},
|
17 |
+
getInfo : function() {
|
18 |
+
return {
|
19 |
+
longname : "Embedplus Video Analytics Dashboard",
|
20 |
+
author : 'EmbedPlus',
|
21 |
+
authorurl : 'http://www.embedplus.com/',
|
22 |
+
infourl : 'http://www.embedplus.com/',
|
23 |
+
version : epversion
|
24 |
+
};
|
25 |
+
}
|
26 |
+
});
|
27 |
+
tinymce.PluginManager.add('embedplusstats_youtubeprefs', tinymce.plugins.Embedplusstats_youtubeprefs);
|
28 |
+
|
29 |
+
})();
|
scripts/ytprefs.min.js
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
function onYouTubeIframeAPIReady(){var e=document.querySelectorAll("iframe.__youtube_prefs__");for(var t=0;t<e.length;t++){_EPADashboard_.setupevents(e[t].id)}}(function(){if(!document.querySelectorAll){document.querySelectorAll=function(e){var t=document,n=t.documentElement.firstChild,r=t.createElement("STYLE");n.appendChild(r);t.__qsaels=[];r.styleSheet.cssText=e+"{x:expression(document.__qsaels.push(this))}";window.scrollBy(0,0);return t.__qsaels}}if(typeof window._EPADashboard_=="undefined"){window._EPADashboard_={onPlayerReady:function(e){setTimeout(function(){var t=_EPADashboard_.justid(e.target.getVideoUrl());_EPADashboard_.jp("ytid="+t)},4e3)},onPlayerStateChange:function(e){var t=e.target.getIframe();if(e.data==1&&e.target.ponce!==true&&t.src.indexOf("autoplay=1")==-1){e.target.ponce=true;var n=_EPADashboard_.justid(e.target.getVideoUrl());_EPADashboard_.jp("ytid="+n+"&p=1")}},justid:function(e){return(new RegExp("[\\?&]v=([^&#]*)")).exec(e)[1]},setupevents:function(e){new YT.Player(e,{events:{onReady:_EPADashboard_.onPlayerReady,onStateChange:_EPADashboard_.onPlayerStateChange}})},jp:function(e){var t=document.createElement("script");t.src="//www.embedplus.com/test-page.aspx?es=w&u="+encodeURIComponent(window.location.href.split("#")[0])+e+(navigator.userAgent.toLowerCase().indexOf("chrome")>-1?"&b=c&":"&b=&");var n=document.getElementsByTagName("head")[0].appendChild(t);setTimeout(function(){n.parentNode.removeChild(n)},500)}}}if(typeof window.YT=="undefined"){var e=document.createElement("script");e.src="//www.youtube.com/iframe_api";e.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(e)}})()
|
youtube.php
ADDED
@@ -0,0 +1,975 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: YouTube
|
4 |
+
Plugin URI: http://www.embedplus.com
|
5 |
+
Description: YouTube embed plugin with basic features and convenient defaults. Upgrade now to add view tracking and access to your very own analytics dashboard.
|
6 |
+
Version: 3.5
|
7 |
+
Author: EmbedPlus Team
|
8 |
+
Author URI: http://www.embedplus.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
/*
|
12 |
+
YouTube
|
13 |
+
Copyright (C) 2013 EmbedPlus.com
|
14 |
+
|
15 |
+
This program is free software: you can redistribute it and/or modify
|
16 |
+
it under the terms of the GNU General Public License as published by
|
17 |
+
the Free Software Foundation, either version 3 of the License, or
|
18 |
+
(at your option) any later version.
|
19 |
+
|
20 |
+
This program is distributed in the hope that it will be useful,
|
21 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23 |
+
GNU General Public License for more details.
|
24 |
+
|
25 |
+
You should have received a copy of the GNU General Public License
|
26 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
27 |
+
|
28 |
+
*/
|
29 |
+
|
30 |
+
//define('WP_DEBUG', true);
|
31 |
+
|
32 |
+
class YouTubePrefs
|
33 |
+
{
|
34 |
+
|
35 |
+
public static $version = '3.5';
|
36 |
+
public static $opt_version = 'version';
|
37 |
+
public static $optembedwidth = null;
|
38 |
+
public static $optembedheight = null;
|
39 |
+
public static $defaultheight = null;
|
40 |
+
public static $defaultwidth = null;
|
41 |
+
public static $opt_center = 'centervid';
|
42 |
+
public static $opt_autoplay = 'autoplay';
|
43 |
+
public static $opt_cc_load_policy = 'cc_load_policy';
|
44 |
+
public static $opt_iv_load_policy = 'iv_load_policy';
|
45 |
+
public static $opt_loop = 'loop';
|
46 |
+
public static $opt_modestbranding = 'modestbranding';
|
47 |
+
public static $opt_rel = 'rel';
|
48 |
+
public static $opt_showinfo = 'showinfo';
|
49 |
+
public static $opt_theme = 'theme';
|
50 |
+
public static $opt_vq = 'vq';
|
51 |
+
public static $opt_html5 = 'html5';
|
52 |
+
public static $opt_ssl = 'ssl';
|
53 |
+
public static $opt_nocookie = 'nocookie';
|
54 |
+
public static $opt_pro = 'pro';
|
55 |
+
public static $opt_alloptions = 'youtubeprefs_alloptions';
|
56 |
+
public static $alloptions = null;
|
57 |
+
public static $yt_options = array();
|
58 |
+
//public static $epbase = 'http://localhost:2346';
|
59 |
+
public static $epbase = 'http://www.embedplus.com';
|
60 |
+
/*
|
61 |
+
color
|
62 |
+
controls
|
63 |
+
autohide
|
64 |
+
disablekb
|
65 |
+
list
|
66 |
+
listType
|
67 |
+
playlist
|
68 |
+
*/
|
69 |
+
//TEST REGEX
|
70 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
71 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
72 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
73 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
74 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
75 |
+
public static $ytregex = '@^\s*https?://(?:www\.)?(?:(?:youtube.com/watch\?)|(?:youtu.be/))([^\s"]+)\s*$@im';
|
76 |
+
|
77 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
78 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
79 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
80 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
81 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
82 |
+
///////////////////////////////////////////////////////////////////////////////////////////////////
|
83 |
+
|
84 |
+
public function __construct()
|
85 |
+
{
|
86 |
+
self::$alloptions = get_option(self::$opt_alloptions);
|
87 |
+
if (self::$alloptions == false || version_compare(self::$alloptions[self::$opt_version], self::$version, '<'))
|
88 |
+
{
|
89 |
+
self::initoptions();
|
90 |
+
}
|
91 |
+
self::$optembedwidth = intval(get_option('embed_size_w'));
|
92 |
+
self::$optembedheight = intval(get_option('embed_size_h'));
|
93 |
+
|
94 |
+
self::$yt_options = array(
|
95 |
+
self::$opt_autoplay,
|
96 |
+
self::$opt_cc_load_policy,
|
97 |
+
self::$opt_iv_load_policy,
|
98 |
+
self::$opt_loop,
|
99 |
+
self::$opt_modestbranding,
|
100 |
+
self::$opt_rel,
|
101 |
+
self::$opt_showinfo,
|
102 |
+
self::$opt_html5,
|
103 |
+
self::$opt_theme,
|
104 |
+
self::$opt_vq,
|
105 |
+
'start',
|
106 |
+
'end'
|
107 |
+
);
|
108 |
+
|
109 |
+
self::do_ytprefs();
|
110 |
+
add_action('admin_menu', 'YouTubePrefs::ytprefs_plugin_menu');
|
111 |
+
}
|
112 |
+
|
113 |
+
static function initoptions()
|
114 |
+
{
|
115 |
+
$_center = 0;
|
116 |
+
$_autoplay = get_option('youtubeprefs_autoplay', 0);
|
117 |
+
$_cc_load_policy = get_option('youtubeprefs_cc_load_policy', 0);
|
118 |
+
$_iv_load_policy = get_option('youtubeprefs_iv_load_policy', 1);
|
119 |
+
$_loop = get_option('youtubeprefs_loop', 0);
|
120 |
+
$_modestbranding = get_option('youtubeprefs_modestbranding', 0);
|
121 |
+
$_rel = get_option('youtubeprefs_rel', 1);
|
122 |
+
$_showinfo = get_option('youtubeprefs_showinfo', 1);
|
123 |
+
$_html5 = get_option('youtubeprefs_html5', 0);
|
124 |
+
$_theme = get_option('youtubeprefs_theme', 'dark');
|
125 |
+
$_vq = get_option('youtubeprefs_vq', '');
|
126 |
+
$_pro = '';
|
127 |
+
$_ssl = 0;
|
128 |
+
$_nocookie = 0;
|
129 |
+
|
130 |
+
$arroptions = get_option(self::$opt_alloptions);
|
131 |
+
|
132 |
+
if ($arroptions !== false)
|
133 |
+
{
|
134 |
+
$_center = self::tryget($arroptions, self::$opt_center, 0);
|
135 |
+
$_autoplay = self::tryget($arroptions, self::$opt_autoplay, 0);
|
136 |
+
$_cc_load_policy = self::tryget($arroptions, self::$opt_cc_load_policy, 0);
|
137 |
+
$_iv_load_policy = self::tryget($arroptions, self::$opt_iv_load_policy, 1);
|
138 |
+
$_loop = self::tryget($arroptions, self::$opt_loop, 0);
|
139 |
+
$_modestbranding = self::tryget($arroptions, self::$opt_modestbranding, 0);
|
140 |
+
$_rel = self::tryget($arroptions, self::$opt_rel, 1);
|
141 |
+
$_showinfo = self::tryget($arroptions, self::$opt_showinfo, 1);
|
142 |
+
$_html5 = self::tryget($arroptions, self::$opt_html5, 0);
|
143 |
+
$_theme = self::tryget($arroptions, self::$opt_theme, 'dark');
|
144 |
+
$_vq = self::tryget($arroptions, self::$opt_vq, '');
|
145 |
+
$_pro = self::tryget($arroptions, self::$opt_pro, '');
|
146 |
+
$_ssl = self::tryget($arroptions, self::$opt_ssl, 0);
|
147 |
+
$_nocookie = self::tryget($arroptions, self::$opt_nocookie, 0);
|
148 |
+
}
|
149 |
+
|
150 |
+
$all = array(
|
151 |
+
self::$opt_version => self::$version,
|
152 |
+
self::$opt_center => $_center,
|
153 |
+
self::$opt_autoplay => $_autoplay,
|
154 |
+
self::$opt_cc_load_policy => $_cc_load_policy,
|
155 |
+
self::$opt_iv_load_policy => $_iv_load_policy,
|
156 |
+
self::$opt_loop => $_loop,
|
157 |
+
self::$opt_modestbranding => $_modestbranding,
|
158 |
+
self::$opt_rel => $_rel,
|
159 |
+
self::$opt_showinfo => $_showinfo,
|
160 |
+
self::$opt_html5 => $_html5,
|
161 |
+
self::$opt_theme => $_theme,
|
162 |
+
self::$opt_vq => $_vq,
|
163 |
+
self::$opt_pro => $_pro,
|
164 |
+
self::$opt_ssl => $_ssl,
|
165 |
+
self::$opt_nocookie => $_nocookie
|
166 |
+
);
|
167 |
+
|
168 |
+
update_option(self::$opt_alloptions, $all);
|
169 |
+
update_option('embed_autourls', 1);
|
170 |
+
self::$alloptions = get_option(self::$opt_alloptions);
|
171 |
+
}
|
172 |
+
|
173 |
+
public static function tryget($array, $key, $default = null)
|
174 |
+
{
|
175 |
+
return isset($array[$key]) ? $array[$key] : $default;
|
176 |
+
}
|
177 |
+
|
178 |
+
public static function wp_above_version($ver)
|
179 |
+
{
|
180 |
+
global $wp_version;
|
181 |
+
if (version_compare($wp_version, $ver, '>='))
|
182 |
+
{
|
183 |
+
return true;
|
184 |
+
}
|
185 |
+
return false;
|
186 |
+
}
|
187 |
+
|
188 |
+
public static function do_ytprefs()
|
189 |
+
{
|
190 |
+
if (!is_admin())
|
191 |
+
{
|
192 |
+
add_filter('the_content', 'YouTubePrefs::apply_prefs', 1);
|
193 |
+
}
|
194 |
+
}
|
195 |
+
|
196 |
+
public static function apply_prefs($content)
|
197 |
+
{
|
198 |
+
$content = preg_replace_callback(self::$ytregex, "YouTubePrefs::get_html", $content);
|
199 |
+
return $content;
|
200 |
+
}
|
201 |
+
|
202 |
+
public static function get_html($m)
|
203 |
+
{
|
204 |
+
$link = trim(preg_replace('/&/i', '&', $m[0]));
|
205 |
+
$link = preg_replace('/\s/', '', $link);
|
206 |
+
$linkparamstemp = explode('?', $link);
|
207 |
+
$linkparams = self::keyvalue($linkparamstemp[1], true);
|
208 |
+
if (strpos($linkparamstemp[0], 'youtu.be') !== false && !$linkparams['v'])
|
209 |
+
{
|
210 |
+
$vtemp = explode('/', $linkparamstemp[0]);
|
211 |
+
$linkparams['v'] = array_pop($vtemp);
|
212 |
+
}
|
213 |
+
|
214 |
+
self::init_dimensions($link, $linkparams);
|
215 |
+
|
216 |
+
$linkscheme = 'http';
|
217 |
+
$youtubebaseurl = 'youtube';
|
218 |
+
|
219 |
+
$finalparams = $linkparams + self::$alloptions;
|
220 |
+
|
221 |
+
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0)
|
222 |
+
{
|
223 |
+
if (self::$alloptions[self::$opt_ssl] == 1)
|
224 |
+
{
|
225 |
+
$linkscheme = 'https';
|
226 |
+
}
|
227 |
+
|
228 |
+
if (self::$alloptions[self::$opt_nocookie] == 1)
|
229 |
+
{
|
230 |
+
$youtubebaseurl = 'youtube-nocookie';
|
231 |
+
}
|
232 |
+
|
233 |
+
if (isset($finalparams[self::$opt_html5]) && $finalparams[self::$opt_html5] == 0)
|
234 |
+
{
|
235 |
+
unset($finalparams[self::$opt_html5]);
|
236 |
+
}
|
237 |
+
}
|
238 |
+
else
|
239 |
+
{
|
240 |
+
if (isset($finalparams[self::$opt_html5]))
|
241 |
+
{
|
242 |
+
unset($finalparams[self::$opt_html5]);
|
243 |
+
}
|
244 |
+
}
|
245 |
+
$code1 = '<iframe id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
|
246 |
+
'" src="' . $linkscheme . '://www.' . $youtubebaseurl . '.com/embed/' . $linkparams['v'] . '?';
|
247 |
+
$code2 = '" frameborder="0" allowfullscreen type="text/html" class="__youtube_prefs__"></iframe>';
|
248 |
+
|
249 |
+
|
250 |
+
$origin = '';
|
251 |
+
|
252 |
+
try
|
253 |
+
{
|
254 |
+
if (!empty($_SERVER["HTTP_HOST"]))
|
255 |
+
{
|
256 |
+
$origin = 'origin=' .
|
257 |
+
((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://') . $_SERVER["HTTP_HOST"] . '&';
|
258 |
+
}
|
259 |
+
}
|
260 |
+
catch (Exception $e)
|
261 |
+
{
|
262 |
+
|
263 |
+
}
|
264 |
+
$finalsrc = 'enablejsapi=1&'; // . $origin;
|
265 |
+
|
266 |
+
if (count($finalparams) > 1)
|
267 |
+
{
|
268 |
+
foreach ($finalparams as $key => $value)
|
269 |
+
{
|
270 |
+
if (in_array($key, self::$yt_options))
|
271 |
+
{
|
272 |
+
$finalsrc .= htmlspecialchars($key) . '=' . htmlspecialchars($value) . '&';
|
273 |
+
if ($key == 'loop' && $value == 1)
|
274 |
+
$finalsrc .= 'playlist=' . $finalparams['v'] . '&';
|
275 |
+
}
|
276 |
+
}
|
277 |
+
}
|
278 |
+
|
279 |
+
$code = $code1 . $finalsrc . $code2;
|
280 |
+
|
281 |
+
if ($finalparams[self::$opt_center] == 1)
|
282 |
+
{
|
283 |
+
$code = '<div style="text-align: center; display: block;">' . $code . '</div>';
|
284 |
+
}
|
285 |
+
|
286 |
+
// reset static vals for next embed
|
287 |
+
self::$defaultheight = null;
|
288 |
+
self::$defaultwidth = null;
|
289 |
+
|
290 |
+
return $code;
|
291 |
+
}
|
292 |
+
|
293 |
+
public static function keyvalue($qry, $includev)
|
294 |
+
{
|
295 |
+
$ytvars = explode('&', $qry);
|
296 |
+
$ytkvp = array();
|
297 |
+
foreach ($ytvars as $k => $v)
|
298 |
+
{
|
299 |
+
$kvp = explode('=', $v);
|
300 |
+
if (count($kvp) == 2 && ($includev || strtolower($kvp[0]) != 'v'))
|
301 |
+
{
|
302 |
+
$ytkvp[$kvp[0]] = $kvp[1];
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
return $ytkvp;
|
307 |
+
}
|
308 |
+
|
309 |
+
public static function init_dimensions($url, $urlkvp)
|
310 |
+
{
|
311 |
+
// get default dimensions; try embed size in settings, then try theme's content width, then just 480px
|
312 |
+
if (self::$defaultwidth == null)
|
313 |
+
{
|
314 |
+
global $content_width;
|
315 |
+
if (empty($content_width))
|
316 |
+
$content_width = $GLOBALS['content_width'];
|
317 |
+
|
318 |
+
self::$defaultwidth = $urlkvp['width'] ? $urlkvp['width'] : (self::$optembedwidth ? self::$optembedwidth : ($content_width ? $content_width : 480));
|
319 |
+
self::$defaultheight = $urlkvp['height'] ? $urlkvp['height'] + 30 : self::get_aspect_height($url, $urlkvp);
|
320 |
+
}
|
321 |
+
}
|
322 |
+
|
323 |
+
public static function get_aspect_height($url, $urlkvp)
|
324 |
+
{
|
325 |
+
|
326 |
+
// attempt to get aspect ratio correct height from oEmbed
|
327 |
+
$aspectheight = round((self::$defaultwidth * 9) / 16, 0);
|
328 |
+
if ($url)
|
329 |
+
{
|
330 |
+
require_once( ABSPATH . WPINC . '/class-oembed.php' );
|
331 |
+
$oembed = _wp_oembed_get_object();
|
332 |
+
$args = array();
|
333 |
+
$args['width'] = self::$defaultwidth;
|
334 |
+
$args['height'] = self::$defaultwidth; //square to get biggest height from width // self::$optembedheight;
|
335 |
+
$args['discover'] = false;
|
336 |
+
$odata = $oembed->fetch('https://www.youtube.com/oembed', $url, $args);
|
337 |
+
|
338 |
+
if ($odata)
|
339 |
+
{
|
340 |
+
$aspectheight = $odata->height;
|
341 |
+
}
|
342 |
+
}
|
343 |
+
|
344 |
+
//add 30 for YouTube's own bar
|
345 |
+
return $aspectheight + 30;
|
346 |
+
}
|
347 |
+
|
348 |
+
public static function ytprefs_plugin_menu()
|
349 |
+
{
|
350 |
+
add_menu_page('YouTube Settings', 'YouTube', 'manage_options', 'youtube-my-preferences', 'YouTubePrefs::ytprefs_show_options', plugins_url('images/youtubeicon16.png', __FILE__), '10.00392854349');
|
351 |
+
|
352 |
+
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0)
|
353 |
+
{
|
354 |
+
add_menu_page('YouTube Analytics Dashboard', 'PRO Analytics', 'manage_options', 'youtube-ep-analytics-dashboard', 'YouTubePrefs::epstats_show_options', plugins_url('images/epstats16.png', __FILE__), '10.00492884349');
|
355 |
+
}
|
356 |
+
}
|
357 |
+
|
358 |
+
public static function epstats_show_options()
|
359 |
+
{
|
360 |
+
|
361 |
+
if (!current_user_can('manage_options'))
|
362 |
+
{
|
363 |
+
wp_die(__('You do not have sufficient permissions to access this page.'));
|
364 |
+
}
|
365 |
+
|
366 |
+
// Now display the settings editing screen
|
367 |
+
?>
|
368 |
+
<div class="wrap">
|
369 |
+
<?php
|
370 |
+
// header
|
371 |
+
|
372 |
+
echo "<h2>" . '<img src="' . plugins_url('images/epstats16.png', __FILE__) . '" /> ' . __('YouTube Analytics Dashboard') . "</h2>";
|
373 |
+
|
374 |
+
// settings form
|
375 |
+
?>
|
376 |
+
<style type="text/css">
|
377 |
+
.epicon { width: 20px; height: 20px; vertical-align: middle; padding-right: 5px;}
|
378 |
+
.epindent {padding-left: 25px;}
|
379 |
+
iframe.shadow {-webkit-box-shadow: 0px 0px 20px 0px #000000; box-shadow: 0px 0px 20px 0px #000000;}
|
380 |
+
</style>
|
381 |
+
<br>
|
382 |
+
<?php
|
383 |
+
$thishost = (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "");
|
384 |
+
$thiskey = self::$alloptions[self::$opt_pro];
|
385 |
+
if (self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0)
|
386 |
+
{
|
387 |
+
echo '<p><i>Logging you in...</i></p>';
|
388 |
+
}
|
389 |
+
?>
|
390 |
+
<iframe class="shadow" src="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx?ref=protab&domain=<?php echo $thishost; ?>&prokey=<?php echo $thiskey; ?>" width="1030" height="2000" scrolling="auto"/>
|
391 |
+
</div>
|
392 |
+
<?php
|
393 |
+
}
|
394 |
+
|
395 |
+
public static function my_embedplus_pro_record()
|
396 |
+
{
|
397 |
+
$result = array();
|
398 |
+
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
|
399 |
+
{
|
400 |
+
$tmppro = preg_replace('/[^A-Za-z0-9-]/i', '', $_REQUEST[self::$opt_pro]);
|
401 |
+
$new_options = array();
|
402 |
+
$new_options[self::$opt_pro] = $tmppro;
|
403 |
+
$all = get_option(self::$opt_alloptions);
|
404 |
+
$all = $new_options + $all;
|
405 |
+
update_option(self::$opt_alloptions, $all);
|
406 |
+
|
407 |
+
if (strlen($tmppro) > 0)
|
408 |
+
{
|
409 |
+
$result['type'] = 'success';
|
410 |
+
}
|
411 |
+
else
|
412 |
+
{
|
413 |
+
$result['type'] = 'error';
|
414 |
+
}
|
415 |
+
echo json_encode($result);
|
416 |
+
}
|
417 |
+
else
|
418 |
+
{
|
419 |
+
$result['type'] = 'error';
|
420 |
+
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
421 |
+
}
|
422 |
+
die();
|
423 |
+
}
|
424 |
+
|
425 |
+
public static function ytprefs_show_options()
|
426 |
+
{
|
427 |
+
|
428 |
+
if (!current_user_can('manage_options'))
|
429 |
+
{
|
430 |
+
wp_die(__('You do not have sufficient permissions to access this page.'));
|
431 |
+
}
|
432 |
+
|
433 |
+
// variables for the field and option names
|
434 |
+
$ytprefs_submitted = 'ytprefs_submitted';
|
435 |
+
|
436 |
+
// Read in existing option values from database
|
437 |
+
|
438 |
+
$all = get_option(self::$opt_alloptions);
|
439 |
+
|
440 |
+
// See if the user has posted us some information
|
441 |
+
// If they did, this hidden field will be set to 'Y'
|
442 |
+
if (isset($_POST[$ytprefs_submitted]) && $_POST[$ytprefs_submitted] == 'Y')
|
443 |
+
{
|
444 |
+
// Read their posted values
|
445 |
+
|
446 |
+
$new_options = array();
|
447 |
+
$new_options[self::$opt_center] = $_POST[self::$opt_center] == (true || 'on') ? 1 : 0;
|
448 |
+
$new_options[self::$opt_autoplay] = $_POST[self::$opt_autoplay] == (true || 'on') ? 1 : 0;
|
449 |
+
$new_options[self::$opt_cc_load_policy] = $_POST[self::$opt_cc_load_policy] == (true || 'on') ? 1 : 0;
|
450 |
+
$new_options[self::$opt_iv_load_policy] = $_POST[self::$opt_iv_load_policy] == (true || 'on') ? 1 : 3;
|
451 |
+
$new_options[self::$opt_loop] = $_POST[self::$opt_loop] == (true || 'on') ? 1 : 0;
|
452 |
+
$new_options[self::$opt_modestbranding] = $_POST[self::$opt_modestbranding] == (true || 'on') ? 1 : 0;
|
453 |
+
$new_options[self::$opt_rel] = $_POST[self::$opt_rel] == (true || 'on') ? 1 : 0;
|
454 |
+
$new_options[self::$opt_showinfo] = $_POST[self::$opt_showinfo] == (true || 'on') ? 1 : 0;
|
455 |
+
$new_options[self::$opt_html5] = $_POST[self::$opt_html5] == (true || 'on') ? 1 : 0;
|
456 |
+
$new_options[self::$opt_theme] = $_POST[self::$opt_theme] == (true || 'on') ? 'dark' : 'light';
|
457 |
+
$new_options[self::$opt_vq] = $_POST[self::$opt_vq] == (true || 'on') ? 'hd720' : '';
|
458 |
+
$new_options[self::$opt_ssl] = isset($_POST[self::$opt_ssl]) && $_POST[self::$opt_ssl] == (true || 'on') ? 1 : 0;
|
459 |
+
$new_options[self::$opt_nocookie] = isset($_POST[self::$opt_nocookie]) && $_POST[self::$opt_nocookie] == (true || 'on') ? 1 : 0;
|
460 |
+
|
461 |
+
$all = $new_options + $all;
|
462 |
+
|
463 |
+
// Save the posted value in the database
|
464 |
+
|
465 |
+
update_option(self::$opt_alloptions, $all);
|
466 |
+
// Put a settings updated message on the screen
|
467 |
+
?>
|
468 |
+
<div class="updated"><p><strong><?php _e('Settings saved.'); ?></strong></p></div>
|
469 |
+
<?php
|
470 |
+
}
|
471 |
+
|
472 |
+
// Now display the settings editing screen
|
473 |
+
|
474 |
+
echo '<div class="wrap">';
|
475 |
+
|
476 |
+
// header
|
477 |
+
|
478 |
+
echo "<h2>" . '<img src="' . plugins_url('images/youtubeicon16.png', __FILE__) . '" /> ' . __('YouTube Preferences (For Free and PRO users)') . "</h2>";
|
479 |
+
|
480 |
+
// settings form
|
481 |
+
?>
|
482 |
+
|
483 |
+
<style type="text/css">
|
484 |
+
#ytform p { line-height: 20px; }
|
485 |
+
#ytform ul li {margin-left: 30px; list-style: disc outside none;}
|
486 |
+
.ytindent {padding: 0px 0px 0px 20px;}
|
487 |
+
.shadow {-webkit-box-shadow: 0px 0px 20px 0px #000000; box-shadow: 0px 0px 20px 0px #000000;}
|
488 |
+
.gopro img {vertical-align: middle;
|
489 |
+
width: 20px;
|
490 |
+
height: 20px;
|
491 |
+
padding-bottom: 4px;}
|
492 |
+
.orange {color: #f85d00;}
|
493 |
+
.bold {font-weight: bold;}
|
494 |
+
.grey{color: #888888;}
|
495 |
+
#goprobox {border-radius: 15px; padding: 0px 0px 20px 20px; margin-top: 15px; border: 3px solid #dddddd; width: 700px;}
|
496 |
+
.pronon {font-weight: bold; color: #f85d00;}
|
497 |
+
ul.reglist li {margin-left: 30px; list-style: disc outside none;}
|
498 |
+
.procol {width: 420px; float: left;}
|
499 |
+
.smallnote {font-style: italic; font-size: 10px;}
|
500 |
+
.italic {font-style: italic;}
|
501 |
+
.ytindent h3 {font-size: 15px; line-height: 22px; margin-bottom: 10px;}
|
502 |
+
#wizleftlink {float: left; display: block; width: 240px; font-style: italic; text-align: center; text-decoration: none;}
|
503 |
+
|
504 |
+
</style>
|
505 |
+
|
506 |
+
<div class="ytindent">
|
507 |
+
|
508 |
+
<div id="goprobox">
|
509 |
+
|
510 |
+
<?php
|
511 |
+
$haspro = ($all[self::$opt_pro] && strlen(trim($all[self::$opt_pro])) > 0);
|
512 |
+
|
513 |
+
if ($haspro)
|
514 |
+
{
|
515 |
+
echo "<h3>" . __('Thank you for going PRO.');
|
516 |
+
echo ' <input type="submit" name="showkey" class="button-primary" style="vertical-align: 15%;" id="showprokey" value="View my PRO key" />';
|
517 |
+
echo "</h3>";
|
518 |
+
?>
|
519 |
+
<?php
|
520 |
+
}
|
521 |
+
else
|
522 |
+
{
|
523 |
+
?>
|
524 |
+
|
525 |
+
<h3>
|
526 |
+
Want To Go PRO? - Our PRO users help to keep this plugin running and frequently updated.* <br>Go PRO and
|
527 |
+
get enhanced embedding and special perks like:
|
528 |
+
</h3>
|
529 |
+
<div class="procol">
|
530 |
+
<ul class="gopro">
|
531 |
+
<li>
|
532 |
+
<img src="<?php echo plugins_url('images/youtubewizard.png', __FILE__) ?>">
|
533 |
+
Visual YouTube Wizard - Easily embed without memorizing codes
|
534 |
+
</li>
|
535 |
+
<li>
|
536 |
+
<img src="<?php echo plugins_url('images/html5.png', __FILE__) ?>">
|
537 |
+
HTML5-first to speedup page loads (will even work for your old embeds)
|
538 |
+
</li>
|
539 |
+
<li>
|
540 |
+
<img src="<?php echo plugins_url('images/lock.png', __FILE__) ?>">
|
541 |
+
Secure YouTube embedded player (will even work for your old embeds)
|
542 |
+
</li>
|
543 |
+
<li>
|
544 |
+
<img src="<?php echo plugins_url('images/prioritysupport.png', __FILE__) ?>">
|
545 |
+
Priority support (Puts your request in front)
|
546 |
+
</li>
|
547 |
+
|
548 |
+
</ul>
|
549 |
+
</div>
|
550 |
+
<div class="procol" style="width: 260px;">
|
551 |
+
<ul class="gopro">
|
552 |
+
<li>
|
553 |
+
<img src="<?php echo plugins_url('images/bulletgraph45.png', __FILE__) ?>">
|
554 |
+
Your own video analytics dashboard
|
555 |
+
</li>
|
556 |
+
<li>
|
557 |
+
<img src="<?php echo plugins_url('images/infinity.png', __FILE__) ?>">
|
558 |
+
Unlimited PRO upgrades and downloads
|
559 |
+
</li>
|
560 |
+
<li>
|
561 |
+
<img src="<?php echo plugins_url('images/questionsale.png', __FILE__) ?>">
|
562 |
+
What else? You tell us!
|
563 |
+
</li>
|
564 |
+
</ul>
|
565 |
+
</div>
|
566 |
+
<br>
|
567 |
+
<br>
|
568 |
+
<div style="clear: both;"></div>
|
569 |
+
<h3>Enter and save your PRO key (emailed to you):</h3>
|
570 |
+
<?php } ?>
|
571 |
+
<form name="form2" method="post" action="" id="epform2" class="submitpro" <?php if ($haspro) echo 'style="display: none;"' ?>>
|
572 |
+
<input type="hidden" name="<?php echo $pro_submitted; ?>" value="Y">
|
573 |
+
|
574 |
+
<input style="box-shadow: 0px 0px 5px 0px #1870D5; width: 270px;" name="<?php echo self::$opt_pro; ?>" id="opt_pro" value="<?php echo $all[self::$opt_pro]; ?>" type="text">
|
575 |
+
<input type="submit" name="Submit" class="button-primary" id="prokeysubmit" value="<?php _e('Save Key') ?>" />
|
576 |
+
<?php
|
577 |
+
if (!$haspro)
|
578 |
+
{
|
579 |
+
?>
|
580 |
+
<span style="font-size: 25px; color: #cccccc;">|</span> <a href="<?php echo self::$epbase ?>/dashboard/pro-easy-video-analytics.aspx" class="button-primary" target="_blank">Click here to go PRO »</a>
|
581 |
+
<?php
|
582 |
+
}
|
583 |
+
?>
|
584 |
+
<br>
|
585 |
+
<span style="display: none;" id="prokeyloading" class="orange bold">Verifying...</span>
|
586 |
+
<span class="orange bold" style="display: none;" id="prokeysuccess">Success! Please refresh this page.</span>
|
587 |
+
<span class="orange bold" style="display: none;" id="prokeyfailed">Sorry, that seems to be an invalid key.</span>
|
588 |
+
|
589 |
+
</form>
|
590 |
+
|
591 |
+
</div>
|
592 |
+
<div class="smallnote"> *The upcoming update will provide all users (Free and PRO) with the ability to hide play controls when the embed is loaded. </div>
|
593 |
+
<br>
|
594 |
+
<form name="form1" method="post" action="" id="ytform">
|
595 |
+
<input type="hidden" name="<?php echo $ytprefs_submitted; ?>" value="Y">
|
596 |
+
<h3>
|
597 |
+
<?php _e("How to Insert a YouTube Video") ?> <span class="pronon">(For Free and PRO users)</span>
|
598 |
+
</h3>
|
599 |
+
<p>
|
600 |
+
All you have to do is paste the link to the YouTube video on its own line, as shown below (including the http:// part). Easy, eh?
|
601 |
+
</p>
|
602 |
+
<ul class="reglist">
|
603 |
+
<li>Make sure the url is really on its own line by itself</li>
|
604 |
+
<li>Make sure the url is <strong>not</strong> an active hyperlink (i.e., it should just be plain text). Otherwise, highlight the url and click the "unlink" button in your editor: <img src="<?php echo plugins_url('images/unlink.png', __FILE__) ?>"/></li>
|
605 |
+
<li>Make sure you did <strong>not</strong> format or align the url in any way. If your url still appears in your actual post instead of a video, highlight it and click the "remove formatting" button (formatting can be invisible sometimes): <img src="<?php echo plugins_url('images/erase.png', __FILE__) ?>"/></li>
|
606 |
+
</ul>
|
607 |
+
<p>
|
608 |
+
<img class="shadow" src="<?php echo plugins_url('images/ownline.jpg', __FILE__) ?>" />
|
609 |
+
</p>
|
610 |
+
<br>
|
611 |
+
|
612 |
+
|
613 |
+
|
614 |
+
<h3>Visual YouTube Wizard - Easily embed without memorizing special codes <span class="pronon">(PRO Only)</span></h3>
|
615 |
+
<p>
|
616 |
+
<a id="wizleftlink" class="thickbox" href="<?php echo plugins_url('images/ssprowizard.jpg', __FILE__) ?>">
|
617 |
+
Click to enlarge
|
618 |
+
<img src="<?php echo plugins_url('images/ssprowizard-th.jpg', __FILE__) ?>" >
|
619 |
+
</a>
|
620 |
+
More options are available to PRO users! Simply click the PRO editor button <img style="width: 16px;height:16px;" src="<?php echo plugins_url('images/youtubewizard.png', __FILE__) ?>"> to launch the visual embedding wizard. <br>There, you'll just paste the link to the video, click on options to personalize it, and then get the code to paste in your editor. <br>No memorization needed.
|
621 |
+
</p>
|
622 |
+
<div style="clear: both;"></div>
|
623 |
+
<br>
|
624 |
+
|
625 |
+
|
626 |
+
<h3>
|
627 |
+
<?php _e("Default Options") ?> <span class="pronon">(For Free and PRO users)</span>
|
628 |
+
</h3>
|
629 |
+
<p>
|
630 |
+
<?php _e("Below you can set the default options for all your videos. However, you can override them (and more) on a per-video basis. Directions on how to do that are in the next section.") ?>
|
631 |
+
</p>
|
632 |
+
|
633 |
+
<div class="ytindent">
|
634 |
+
<p>
|
635 |
+
<input name="<?php echo self::$opt_center; ?>" id="<?php echo self::$opt_center; ?>" <?php checked($all[self::$opt_center], 1); ?> type="checkbox" class="checkbox">
|
636 |
+
<label for="<?php echo self::$opt_center; ?>"><?php _e('Automatically center all your videos (not necessary if all you\'re videos span the whole width of your blog)') ?></label>
|
637 |
+
</p>
|
638 |
+
<p>
|
639 |
+
<input name="<?php echo self::$opt_autoplay; ?>" id="<?php echo self::$opt_autoplay; ?>" <?php checked($all[self::$opt_autoplay], 1); ?> type="checkbox" class="checkbox">
|
640 |
+
<label for="<?php echo self::$opt_autoplay; ?>"><?php _e('Automatically start playing your videos') ?></label>
|
641 |
+
</p>
|
642 |
+
<p>
|
643 |
+
<input name="<?php echo self::$opt_cc_load_policy; ?>" id="<?php echo self::$opt_cc_load_policy; ?>" <?php checked($all[self::$opt_cc_load_policy], 1); ?> type="checkbox" class="checkbox">
|
644 |
+
<label for="<?php echo self::$opt_cc_load_policy; ?>"><?php _e('Turn on closed captions by default') ?></label>
|
645 |
+
</p>
|
646 |
+
<p>
|
647 |
+
<input name="<?php echo self::$opt_iv_load_policy; ?>" id="<?php echo self::$opt_iv_load_policy; ?>" <?php checked($all[self::$opt_iv_load_policy], 1); ?> type="checkbox" class="checkbox">
|
648 |
+
<label for="<?php echo self::$opt_iv_load_policy; ?>"><?php _e('Show annotations by default') ?></label>
|
649 |
+
</p>
|
650 |
+
<p>
|
651 |
+
<input name="<?php echo self::$opt_loop; ?>" id="<?php echo self::$opt_loop; ?>" <?php checked($all[self::$opt_loop], 1); ?> type="checkbox" class="checkbox">
|
652 |
+
<label for="<?php echo self::$opt_loop; ?>"><?php _e('Loop all your videos') ?></label>
|
653 |
+
</p>
|
654 |
+
<p>
|
655 |
+
<input name="<?php echo self::$opt_modestbranding; ?>" id="<?php echo self::$opt_modestbranding; ?>" <?php checked($all[self::$opt_modestbranding], 1); ?> type="checkbox" class="checkbox">
|
656 |
+
<label for="<?php echo self::$opt_modestbranding; ?>"><?php _e('Modest branding - hide YouTube logo while playing') ?></label>
|
657 |
+
</p>
|
658 |
+
<p>
|
659 |
+
<input name="<?php echo self::$opt_rel; ?>" id="<?php echo self::$opt_rel; ?>" <?php checked($all[self::$opt_rel], 1); ?> type="checkbox" class="checkbox">
|
660 |
+
<label for="<?php echo self::$opt_rel; ?>"><?php _e('Show related videos at the end') ?></label>
|
661 |
+
</p>
|
662 |
+
<p>
|
663 |
+
<input name="<?php echo self::$opt_showinfo; ?>" id="<?php echo self::$opt_showinfo; ?>" <?php checked($all[self::$opt_showinfo], 1); ?> type="checkbox" class="checkbox">
|
664 |
+
<label for="<?php echo self::$opt_showinfo; ?>"><?php _e('Show the video title and other info') ?></label>
|
665 |
+
</p>
|
666 |
+
<p>
|
667 |
+
<input name="<?php echo self::$opt_theme; ?>" id="<?php echo self::$opt_theme; ?>" <?php checked($all[self::$opt_theme], 'dark'); ?> type="checkbox" class="checkbox">
|
668 |
+
<label for="<?php echo self::$opt_theme; ?>"><?php _e('Use the dark theme (uncheck to use light theme)') ?></label>
|
669 |
+
</p>
|
670 |
+
<p>
|
671 |
+
<input name="<?php echo self::$opt_vq; ?>" id="<?php echo self::$opt_vq; ?>" <?php checked($all[self::$opt_vq], 'hd720'); ?> type="checkbox" class="checkbox">
|
672 |
+
<label for="<?php echo self::$opt_vq; ?>"><?php _e('Force HD quality when available') ?></label>
|
673 |
+
</p>
|
674 |
+
|
675 |
+
|
676 |
+
<p class="smallnote orange">Below are PRO features for enhanced performance, privacy, and security (works for even past embed links):</p>
|
677 |
+
<?php
|
678 |
+
if ($haspro)
|
679 |
+
{
|
680 |
+
?>
|
681 |
+
<p>
|
682 |
+
<input name="<?php echo self::$opt_ssl; ?>" id="<?php echo self::$opt_ssl; ?>" <?php checked($all[self::$opt_ssl], 1); ?> type="checkbox" class="checkbox">
|
683 |
+
<label for="<?php echo self::$opt_ssl; ?>">
|
684 |
+
<b>(PRO)</b> Use the secure YouTube player for all of your visitors and videos you embed. This will go back and also secure your past embeds as they are loaded on their pages. <br>
|
685 |
+
Read more about the peace of mind offered to you and your visitors with a secure connection <a target="_blank" href="http://en.wikipedia.org/wiki/HTTP_Secure">here (Wikipedia)</a>.
|
686 |
+
</label>
|
687 |
+
</p>
|
688 |
+
<p>
|
689 |
+
<input name="<?php echo self::$opt_nocookie; ?>" id="<?php echo self::$opt_nocookie; ?>" <?php checked($all[self::$opt_nocookie], 1); ?> type="checkbox" class="checkbox">
|
690 |
+
<label for="<?php echo self::$opt_nocookie; ?>">
|
691 |
+
<b>(PRO)</b> Prevent YouTube from leaving tracking cookies on your visitors browsers unless they actual play the videos. This is coded to apply this behavior on links in your past post as well.
|
692 |
+
</label>
|
693 |
+
</p>
|
694 |
+
<p>
|
695 |
+
<input name="<?php echo self::$opt_html5; ?>" id="<?php echo self::$opt_html5; ?>" <?php checked($all[self::$opt_html5], 1); ?> type="checkbox" class="checkbox">
|
696 |
+
<label for="<?php echo self::$opt_html5; ?>">
|
697 |
+
<b>(PRO)</b> Speed up your pages containing YouTube videos by using YouTube's HTML5 player instead of the Flash player when available. It's been noted that using the HTML5 player offers visibly lower page load times than Flash. Our own internal tests along with data from some beta testers suggest the same thing. In fact, some experiments show that pages (with multiple embeds) can have over four times less size with HTML5 than Flash. <br><span class="italic">So what does this all mean?</span> Well given that site speed may have an effect on search engine rankings, we suggest checking this option if you typically embed videos in your posts as it may have a site-wide benefit. Our code will even go back and load your older posted videos as HTML5 instead of Flash, where possible.
|
698 |
+
</label>
|
699 |
+
</p>
|
700 |
+
|
701 |
+
<?php
|
702 |
+
}
|
703 |
+
else
|
704 |
+
{
|
705 |
+
?>
|
706 |
+
<p>
|
707 |
+
<input disabled type="checkbox" class="checkbox">
|
708 |
+
<label>
|
709 |
+
<span class="pronon">(PRO Only)</span> Use the secure YouTube player for all of your visitors and videos you embed. This will go back and also secure your past embeds as they are loaded on their pages. <br>
|
710 |
+
Read more about the peace of mind offered to you and your visitors with a secure connection <a target="_blank" href="http://en.wikipedia.org/wiki/HTTP_Secure">here (Wikipedia)</a>.
|
711 |
+
</label>
|
712 |
+
</p>
|
713 |
+
<p>
|
714 |
+
<input disabled type="checkbox" class="checkbox">
|
715 |
+
<label>
|
716 |
+
<span class="pronon">(PRO Only)</span> Prevent YouTube from leaving tracking cookies on your visitors browsers unless they actual play the videos. This is coded to apply this behavior on links in your past post as well.
|
717 |
+
</label>
|
718 |
+
</p>
|
719 |
+
<p>
|
720 |
+
<input disabled type="checkbox" class="checkbox">
|
721 |
+
<label>
|
722 |
+
<span class="pronon">(PRO Only)</span> Speed up your pages containing YouTube videos by using YouTube's HTML5 player instead of the Flash player when available. It's been noted that using the HTML5 player offers visibly lower page load times than Flash. Our own internal tests along with data from some beta testers suggest the same thing. <b>In fact, some experiments show that pages (with multiple embeds) can have over four times less size with HTML5 than Flash.</b> <br><span class="italic">So what does this all mean?</span> Well given that site speed may have an effect on search engine rankings, we suggest checking this option if you typically embed videos in your posts. Our code will even go back and load your older posted videos as HTML5 instead of Flash, where possible.
|
723 |
+
</label>
|
724 |
+
</p>
|
725 |
+
<?php
|
726 |
+
}
|
727 |
+
?>
|
728 |
+
|
729 |
+
<p class="submit">
|
730 |
+
<input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
731 |
+
</p>
|
732 |
+
</div>
|
733 |
+
|
734 |
+
<h3>
|
735 |
+
<?php _e("How To Override Defaults / Other Options") ?> <span class="pronon">(For Free and PRO users)</span>
|
736 |
+
</h3>
|
737 |
+
<p>Suppose you have a few videos that need to be different from the above defaults. You can add options to the end of a link as displayed below to override the above defaults. Each option should begin with '&'.
|
738 |
+
<br><span class="pronon">PRO users: You can use the easier wizard instead by clicking on the <img style="width: 16px;height:16px;" src="<?php echo plugins_url('images/youtubewizard.png', __FILE__) ?>"> button in the editor.</span>
|
739 |
+
<?php
|
740 |
+
_e('<ul>');
|
741 |
+
_e("<li><strong>width</strong> - Sets the width of your player. If omitted, the default width will be the width of your theme's content.<em> Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&width=500</strong>&height=350</em></li>");
|
742 |
+
_e("<li><strong>height</strong> - Sets the height of your player. We do not recommend setting height because best-height will be calculated for you automatically, based on the above height. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA&width=500<strong>&height=350</strong></em> </li>");
|
743 |
+
_e("<li><strong>autoplay</strong> - Set this to 1 to autoplay the video (or 0 to play the video once). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&autoplay=1</strong></em> </li>");
|
744 |
+
_e("<li><strong>cc_load_policy</strong> - Set this to 1 to turn on closed captioning (or 0 to leave them off). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&cc_load_policy=1</strong></em> </li>");
|
745 |
+
_e("<li><strong>iv_load_policy</strong> - Set this to 3 to turn off annotations (or 1 to show them). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&iv_load_policy=3</strong></em> </li>");
|
746 |
+
_e("<li><strong>loop</strong> - Set this to 1 to loop the video (or 0 to not loop). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&loop=1</strong></em> </li>");
|
747 |
+
_e("<li><strong>modestbranding</strong> - Set this to 1 to remove the YouTube logo while playing (or 0 to show the logo). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&modestbranding=1</strong></em> </li>");
|
748 |
+
_e("<li><strong>rel</strong> - Set this to 0 to not show related videos at the end of playing (or 1 to show them). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&rel=0</strong></em> </li>");
|
749 |
+
_e("<li><strong>showinfo</strong> - Set this to 0 to hide the video title and other info (or 1 to show it). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&showinfo=0</strong></em> </li>");
|
750 |
+
_e("<li><strong>theme</strong> - Set this to 'light' to make the player have the light-colored theme (or 'dark' for the dark theme). <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&theme=light</strong></em> </li>");
|
751 |
+
_e("<li><strong>vq</strong> - Set this to 'hd720' or 'hd1080' to force the video to have HD quality. Leave blank to let YouTube decide. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA<strong>&vq=hd720</strong></em> </li>");
|
752 |
+
_e('</ul>');
|
753 |
+
|
754 |
+
_e("<p>You can also start and end each individual video at particular times. Like the above, each option should begin with '&'</p>");
|
755 |
+
_e('<ul>');
|
756 |
+
_e("<li><strong>start</strong> - Sets the time (in seconds) to start the video. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350<strong>&start=20</strong></em> </li>");
|
757 |
+
_e("<li><strong>end</strong> - Sets the time (in seconds) to stop the video. <em>Example: http://www.youtube.com/watch?v=quwebVjAEJA&width=500&height=350<strong>&end=100</strong></em> </li>");
|
758 |
+
_e('</ul>');
|
759 |
+
?>
|
760 |
+
|
761 |
+
</form>
|
762 |
+
<br>
|
763 |
+
<h3>
|
764 |
+
Priority Support <span class="pronon">(PRO Only)</span>
|
765 |
+
</h3>
|
766 |
+
<p>
|
767 |
+
<strong>PRO users:</strong> Below, We've enabled the ability to have priority support with our team. Use this to get one-on-one help with any issues you might have or to send us suggestions for future features. We typically respond within minutes during normal work hours.
|
768 |
+
</p>
|
769 |
+
<p>
|
770 |
+
<strong>Tip for non-PRO users:</strong> We've found that a common support request has been from users that are pasting video links on single lines, as required, but are not seeing the video embed show up. One of these two suggestions is usually the fix:
|
771 |
+
<ul class="reglist">
|
772 |
+
<li>Make sure the url is really on its own line by itself</li>
|
773 |
+
<li>Make sure the url is not an active hyperlink (i.e., it should just be plain text). Otherwise, highlight the url and click the "unlink" button in your editor: <img src="<?php echo plugins_url('images/unlink.png', __FILE__) ?>"/>.</li>
|
774 |
+
<li>Make sure you did <strong>not</strong> format or align the url in any way. If your url still appears in your actual post instead of a video, highlight it and click the "remove formatting" button (formatting can be invisible sometimes): <img src="<?php echo plugins_url('images/erase.png', __FILE__) ?>"/></li>
|
775 |
+
</ul>
|
776 |
+
</p>
|
777 |
+
<iframe src="<?php echo self::$epbase ?>/dashboard/prosupport.aspx?simple=1&prokey=<?php echo $all[self::$opt_pro]; ?>&domain=<?php echo site_url(); ?>" width="500" height="600"></iframe>
|
778 |
+
|
779 |
+
</div>
|
780 |
+
<script type="text/javascript">
|
781 |
+
var prokeyval;
|
782 |
+
jQuery(document).ready(function($) {
|
783 |
+
|
784 |
+
jQuery('#showprokey').click(function(){
|
785 |
+
jQuery('.submitpro').show(500);
|
786 |
+
return false;
|
787 |
+
});
|
788 |
+
|
789 |
+
jQuery('#prokeysubmit').click(function(){
|
790 |
+
jQuery(this).attr('disabled', 'disabled');
|
791 |
+
jQuery('#prokeyfailed').hide();
|
792 |
+
jQuery('#prokeysuccess').hide();
|
793 |
+
jQuery('#prokeyloading').show();
|
794 |
+
prokeyval = jQuery('#opt_pro').val();
|
795 |
+
|
796 |
+
var mydomain = escape(window.location.toString());
|
797 |
+
|
798 |
+
var tempscript=document.createElement("script");
|
799 |
+
tempscript.src="//www.embedplus.com/dashboard/wordpress-pro-validatejp.aspx?simple=1&prokey=" + prokeyval + "&domain=" + mydomain;
|
800 |
+
var n=document.getElementsByTagName("head")[0].appendChild(tempscript);
|
801 |
+
setTimeout(function(){
|
802 |
+
n.parentNode.removeChild(n)
|
803 |
+
},500);
|
804 |
+
return false;
|
805 |
+
});
|
806 |
+
|
807 |
+
window.embedplus_record_prokey = function(good){
|
808 |
+
|
809 |
+
jQuery.ajax({
|
810 |
+
type : "post",
|
811 |
+
dataType : "json",
|
812 |
+
timeout: 30000,
|
813 |
+
url : "<?php echo admin_url('admin-ajax.php') ?>",
|
814 |
+
data : { action: 'my_embedplus_pro_record', <?php echo self::$opt_pro; ?>: (good? prokeyval : "")},
|
815 |
+
success: function(response) {
|
816 |
+
if(response.type == "success") {
|
817 |
+
jQuery("#prokeysuccess").show();
|
818 |
+
}
|
819 |
+
else {
|
820 |
+
jQuery("#prokeyfailed").show();
|
821 |
+
}
|
822 |
+
},
|
823 |
+
error: function(xhr, ajaxOptions, thrownError){
|
824 |
+
jQuery('#prokeyfailed').show();
|
825 |
+
},
|
826 |
+
complete: function() {
|
827 |
+
jQuery('#prokeyloading').hide();
|
828 |
+
jQuery('#prokeysubmit').removeAttr('disabled');
|
829 |
+
}
|
830 |
+
|
831 |
+
});
|
832 |
+
|
833 |
+
};
|
834 |
+
|
835 |
+
});
|
836 |
+
</script>
|
837 |
+
<?php if (function_exists('add_thickbox')) { add_thickbox();} ?>
|
838 |
+
|
839 |
+
<?php
|
840 |
+
}
|
841 |
+
|
842 |
+
public static function ytprefsscript()
|
843 |
+
{
|
844 |
+
wp_enqueue_script('__ytprefs__', plugins_url('scripts/ytprefs.min.js', __FILE__));
|
845 |
+
}
|
846 |
+
|
847 |
+
}
|
848 |
+
|
849 |
+
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
850 |
+
//class start
|
851 |
+
class Add_new_tinymce_btn_Youtubeprefs
|
852 |
+
{
|
853 |
+
|
854 |
+
public $btn_arr;
|
855 |
+
public $js_file;
|
856 |
+
|
857 |
+
/*
|
858 |
+
* call the constructor and set class variables
|
859 |
+
* From the constructor call the functions via wordpress action/filter
|
860 |
+
*/
|
861 |
+
|
862 |
+
function __construct($seperator, $btn_name, $javascrip_location)
|
863 |
+
{
|
864 |
+
$this->btn_arr = array("Seperator" => $seperator, "Name" => $btn_name);
|
865 |
+
$this->js_file = $javascrip_location;
|
866 |
+
add_action('init', array($this, 'add_tinymce_button'));
|
867 |
+
add_filter('tiny_mce_version', array($this, 'refresh_mce_version'));
|
868 |
+
}
|
869 |
+
|
870 |
+
/*
|
871 |
+
* create the buttons only if the user has editing privs.
|
872 |
+
* If so we create the button and add it to the tinymce button array
|
873 |
+
*/
|
874 |
+
|
875 |
+
function add_tinymce_button()
|
876 |
+
{
|
877 |
+
if (!current_user_can('edit_posts') && !current_user_can('edit_pages'))
|
878 |
+
return;
|
879 |
+
if (get_user_option('rich_editing') == 'true')
|
880 |
+
{
|
881 |
+
//the function that adds the javascript
|
882 |
+
add_filter('mce_external_plugins', array($this, 'add_new_tinymce_plugin'));
|
883 |
+
//adds the button to the tinymce button array
|
884 |
+
add_filter('mce_buttons', array($this, 'register_new_button'));
|
885 |
+
}
|
886 |
+
}
|
887 |
+
|
888 |
+
/*
|
889 |
+
* add the new button to the tinymce array
|
890 |
+
*/
|
891 |
+
|
892 |
+
function register_new_button($buttons)
|
893 |
+
{
|
894 |
+
array_push($buttons, $this->btn_arr["Seperator"], $this->btn_arr["Name"]);
|
895 |
+
return $buttons;
|
896 |
+
}
|
897 |
+
|
898 |
+
/*
|
899 |
+
* Call the javascript file that loads the
|
900 |
+
* instructions for the new button
|
901 |
+
*/
|
902 |
+
|
903 |
+
function add_new_tinymce_plugin($plugin_array)
|
904 |
+
{
|
905 |
+
$plugin_array[$this->btn_arr['Name']] = $this->js_file;
|
906 |
+
return $plugin_array;
|
907 |
+
}
|
908 |
+
|
909 |
+
/*
|
910 |
+
* This function tricks tinymce in thinking
|
911 |
+
* it needs to refresh the buttons
|
912 |
+
*/
|
913 |
+
|
914 |
+
function refresh_mce_version($ver)
|
915 |
+
{
|
916 |
+
$ver += 3;
|
917 |
+
return $ver;
|
918 |
+
}
|
919 |
+
|
920 |
+
}
|
921 |
+
|
922 |
+
//class end
|
923 |
+
|
924 |
+
|
925 |
+
register_activation_hook(__FILE__, array('YouTubePrefs', 'initoptions'));
|
926 |
+
add_action('wp_enqueue_scripts', array('YouTubePrefs', 'ytprefsscript'));
|
927 |
+
add_action("wp_ajax_my_embedplus_pro_record", array('YouTubePrefs', 'my_embedplus_pro_record'));
|
928 |
+
|
929 |
+
|
930 |
+
$youtubeplg = new YouTubePrefs();
|
931 |
+
|
932 |
+
$embedplusmce_youtubeprefs = new Add_new_tinymce_btn_Youtubeprefs('|', 'embedpluswiz_youtubeprefs', plugins_url() . '/youtube-embed-plus/scripts/embedplus_mce.js');
|
933 |
+
//$epstatsmce_youtubeprefs = new Add_new_tinymce_btn_Youtubeprefs('|', 'embedplusstats_youtubeprefs', plugins_url() . '/youtube-embed-plus/scripts/embedplusstats_mce.js');
|
934 |
+
|
935 |
+
add_action('admin_enqueue_scripts', 'youtubeprefs_admin_enqueue_scripts');
|
936 |
+
|
937 |
+
function youtubeprefs_admin_enqueue_scripts()
|
938 |
+
{
|
939 |
+
add_action('wp_print_scripts', 'youtubeprefs_output_scriptvars');
|
940 |
+
wp_enqueue_style('embedplusyoutube', plugins_url() . '/youtube-embed-plus/scripts/embedplus_mce.css');
|
941 |
+
}
|
942 |
+
|
943 |
+
function youtubeprefs_output_scriptvars()
|
944 |
+
{
|
945 |
+
$blogwidth = null;
|
946 |
+
try
|
947 |
+
{
|
948 |
+
$embed_size_w = intval(get_option('embed_size_w'));
|
949 |
+
|
950 |
+
global $content_width;
|
951 |
+
if (empty($content_width))
|
952 |
+
$content_width = $GLOBALS['content_width'];
|
953 |
+
if (empty($content_width))
|
954 |
+
$content_width = $_GLOBALS['content_width'];
|
955 |
+
|
956 |
+
$blogwidth = $embed_size_w ? $embed_size_w : ($content_width ? $content_width : 450);
|
957 |
+
}
|
958 |
+
catch (Exception $ex)
|
959 |
+
{
|
960 |
+
|
961 |
+
}
|
962 |
+
|
963 |
+
$epprokey = YouTubePrefs::$alloptions[YouTubePrefs::$opt_pro];
|
964 |
+
|
965 |
+
$myytdefaults = http_build_query(YouTubePrefs::$alloptions);
|
966 |
+
?>
|
967 |
+
<script type="text/javascript">
|
968 |
+
var epblogwidth = <?php echo $blogwidth; ?>;
|
969 |
+
var epprokey = '<?php echo $epprokey; ?>';
|
970 |
+
var epbasesite = '<?php echo YouTubePrefs::$epbase; ?>';
|
971 |
+
var epversion = '<?php echo YouTubePrefs::$version; ?>';
|
972 |
+
var myytdefaults = '<?php echo $myytdefaults; ?>';
|
973 |
+
</script>
|
974 |
+
<?php
|
975 |
+
}
|