PluginProbe
VdoCipher: Secure Video Player and Hosting / 1.9
VdoCipher: Secure Video Player and Hosting v1.9
trunk 1.10 1.11 1.12 1.13 1.14 1.15 1.17 1.18 1.19 1.20 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 1.3 1.30 1.4 1.5 1.6 All 28 releases
← All changes | vdocipher.php +21 -56 1.191.9 View file →
@@ -2,14 +2,17 @@
2 2 /**
3 3 * Plugin Name: VdoCipher
4 4 * Plugin URI: http://www.vdocipher.com
5 5 * Description: Secured video hosting for wordpress
6 - * Version: 1.19
6 + * Version: 1.9
7 7 * Author: VdoCipher
8 8 * Author URI: http://www.vdocipher.com
9 9 * License: GPL2
10 10 */
11 11
12 +error_reporting(E_ALL);
13 +ini_set('display_errors', 1);
14 +
12 15 if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) {
13 16 header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
14 17 exit("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n<html><head>\r\n<title>404 Not Found</title>\r\n".
15 18 "</head><body>\r\n<h1>Not Found</h1>\r\n<p>The requested URL " . $_SERVER['SCRIPT_NAME'] . " was not found on ".
@@ -113,53 +116,25 @@
113 116 $version = 0;
114 117 if (isset($atts['version'])) {
115 118 $version = $atts['version'];
116 119 }
117 - if ((get_option('vdo_embed_version')) == false) {
118 - update_option('vdo_embed_version', '0.5');
120 + $output = "<div id='vdo$OTP' style='height:$height;width:$width;max-width:100%' ></div>";
121 + $output .= "<script> (function(v,i,d,e,o){v[o]=v[o]||{}; v[o].add = v[o].add || function V(a){".
122 + " (v[o].d=v[o].d||[]).push(a);};";
123 + $output .= "if(!v[o].l) { v[o].l=1*new Date(); a=i.createElement(d), m=i.getElementsByTagName(d)[0]; a.async=1; ".
124 + "a.src=e; m.parentNode.insertBefore(a,m);}";
125 + $output .= " })(window,document,'script','//de122v0opjemw.cloudfront.net/vdo.js','vdo'); vdo.add({ ";
126 + $output .= "o: '$OTP', ";
127 + if ($version == 32) {
128 + $output .= "version: '$version' ";
119 129 }
120 - if ((get_option('vdo_player_theme')) == false) {
121 - update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a');
122 - }
123 - $vdo_embed_version_str = get_option('vdo_embed_version');
124 - $vdo_player_theme = get_option('vdo_player_theme');
125 -
126 - // Old Embed Code
127 - if($vdo_embed_version_str === '0.5') {
128 - $output = "<div id='vdo$OTP' style='height:$height;width:$width;max-width:100%' ></div>";
129 - $output .= "<script> (function(v,i,d,e,o){v[o]=v[o]||{}; v[o].add = v[o].add || function V(a){".
130 - " (v[o].d=v[o].d||[]).push(a);};";
131 - $output .= "if(!v[o].l) { v[o].l=1*new Date(); a=i.createElement(d), m=i.getElementsByTagName(d)[0]; a.async=1; ".
132 - "a.src=e; m.parentNode.insertBefore(a,m);}";
133 - $output .= " })(window,document,'script','//de122v0opjemw.cloudfront.net/vdo.js','vdo'); vdo.add({ ";
134 - $output .= "o: '$OTP', ";
135 - if ($version == 32) {
136 - $output .= "version: '$version' ";
137 - }
138 - $output .= "}); </script>";
139 - }
140 - //New embed code
141 - else {
142 - $output .= "<div id='vdo$OTP' style='height:$height;width:$width;max-width:100%' ></div>";
143 - $output .= "<script>(function(v,i,d,e,o){v[o]=v[o]||{}; v[o].add = v[o].add || function V(a){ (v[o].d=v[o].d||[]).push(a);};";
144 - $output .= "if(!v[o].l) { v[o].l=1*new Date(); a=i.createElement(d), m=i.getElementsByTagName(d)[0];";
145 - $output .= "a.async=1; a.src=e; m.parentNode.insertBefore(a,m);}";
146 - $output .= "})(window,document,'script','https://d1z78r8i505acl.cloudfront.net/playerAssets/";
147 - $output .= "$vdo_embed_version_str";
148 - $output .= "/vdo.js','vdo');";
149 - $output .= "vdo.add({";
150 - $output .= "otp: '$OTP',";
151 - $output .= "playbackInfo: btoa(JSON.stringify({";
152 - $output .= "videoId: '$video'})),";
153 - $output .= "theme: '$vdo_player_theme',";
154 - $output .= "container: document.querySelector('#vdo$OTP'),});";
155 - $output .= "</script>";
156 - }
130 + $output .= "}); </script>";
157 131 return $output;
158 132 }
159 133
160 134 add_shortcode('vdo', 'vdo_shortcode');
161 135
136 +
162 137 /// adding the settings link
163 138 $plugin = plugin_basename(__FILE__);
164 139 add_filter("plugin_action_links_$plugin", 'vdo_settings_link');
165 140
@@ -164,13 +139,14 @@
164 139 add_filter("plugin_action_links_$plugin", 'vdo_settings_link');
165 140
166 141 function vdo_settings_link($links)
167 142 {
168 - $settings_link = '<a href="options-general.php?page=vdocipher">Settings</a>';
143 + $settings_link = '<a href="options-general.php?page=vdocipher.php">Settings</a>';
169 144 array_unshift($links, $settings_link);
170 145 return $links;
171 146 }
172 147
148 +
173 149 /// add the menu item and register settings
174 150 if (is_admin()) { // admin actions
175 151 add_action('admin_menu', 'vdo_menu');
176 152 add_action('admin_init', 'register_vdo_settings');
@@ -178,9 +154,9 @@
178 154 // non-admin enqueues, actions, and filters
179 155 }
180 156 function vdo_menu()
181 157 {
182 - add_menu_page('VdoCipher Options', 'VdoCipher', 'manage_options', 'vdocipher', 'vdo_options');
158 + add_options_page('VdoCipher Options', 'VdoCipher', 'manage_options', 'vdocipher', 'vdo_options');
183 159 }
184 160 function vdo_options()
185 161 {
186 162 if (!get_option('vdo_default_height')) {
@@ -205,10 +181,8 @@
205 181 register_setting('vdo_option-group', 'vdo_client_key');
206 182 register_setting('vdo_option-group', 'vdo_default_height');
207 183 register_setting('vdo_option-group', 'vdo_default_width');
208 184 register_setting('vdo_option-group', 'vdo_annotate_code');
209 - register_setting('vdo_option-group', 'vdo_embed_version');
210 - register_setting('vdo_option-group', 'vdo_player_theme');
211 185 }
212 186
213 187 /// adding a section for asking for the client key
214 188 function vdo_show_form_client_key()
@@ -221,25 +195,16 @@
221 195 delete_option('vdo_client_key');
222 196 delete_option('vdo_default_width');
223 197 delete_option('vdo_default_height');
224 198 delete_option('vdo_annotate_code');
225 - delete_option('vdo_embed_version');
226 - delete_option('vdo_player_theme');
227 199 }
228 200 function vdo_activate()
229 201 {
230 - if ((get_option('vdo_default_height')) == false) {
231 - update_option('vdo_default_height', '360');
202 + if (!get_option('vdo_default_height')) {
203 + update_option('vdo_default_height', '400');
232 204 }
233 - if ((get_option('vdo_default_width')) == false) {
205 + if (!get_option('vdo_default_width')) {
234 206 update_option('vdo_default_width', '640');
235 - }
236 - //https://stackoverflow.com/a/2173318/5022684
237 - if ((get_option('vdo_embed_version')) == false) {
238 - update_option('vdo_embed_version', '0.5');
239 - }
240 - if ((get_option('vdo_player_theme')) == false) {
241 - update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a');
242 207 }
243 208 }
244 209 register_activation_hook(__FILE__, 'vdo_activate');
245 210 function vdo_admin_notice()