PluginProbe
VdoCipher: Secure Video Player and Hosting / 1.17
VdoCipher: Secure Video Player and Hosting v1.17
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 +38 -37 1.131.17 View file →
@@ -2,9 +2,9 @@
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.13
6 + * Version: 1.17
7 7 * Author: VdoCipher
8 8 * Author URI: http://www.vdocipher.com
9 9 * License: GPL2
10 10 */
@@ -113,12 +113,12 @@
113 113 $version = 0;
114 114 if (isset($atts['version'])) {
115 115 $version = $atts['version'];
116 116 }
117 - if (empty(get_option('vdo_embed_version'))) {
117 + if ((get_option('vdo_embed_version')) == false) {
118 118 update_option('vdo_embed_version', '0.5');
119 119 }
120 - if (empty(get_option('vdo_player_theme'))) {
120 + if ((get_option('vdo_player_theme')) == false) {
121 121 update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a');
122 122 }
123 123 $vdo_embed_version_str = get_option('vdo_embed_version');
124 124 $vdo_player_theme = get_option('vdo_player_theme');
@@ -124,38 +124,38 @@
124 124 $vdo_player_theme = get_option('vdo_player_theme');
125 125
126 126 // Old Embed Code
127 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 - }
157 - return $output;
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 + }
157 + return $output;
158 158 }
159 159
160 160 add_shortcode('vdo', 'vdo_shortcode');
161 161
@@ -226,18 +226,19 @@
226 226 delete_option('vdo_player_theme');
227 227 }
228 228 function vdo_activate()
229 229 {
230 - if (!get_option('vdo_default_height')) {
230 + if ((get_option('vdo_default_height')) == false) {
231 231 update_option('vdo_default_height', '360');
232 232 }
233 - if (!get_option('vdo_default_width')) {
233 + if ((get_option('vdo_default_width')) == false) {
234 234 update_option('vdo_default_width', '640');
235 235 }
236 - if (empty(get_option('vdo_embed_version'))) {
236 + //https://stackoverflow.com/a/2173318/5022684
237 + if ((get_option('vdo_embed_version')) == false) {
237 238 update_option('vdo_embed_version', '0.5');
238 239 }
239 - if (empty(get_option('vdo_player_theme'))) {
240 + if ((get_option('vdo_player_theme')) == false) {
240 241 update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a');
241 242 }
242 243 }
243 244 register_activation_hook(__FILE__, 'vdo_activate');