| @@ -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.19 | |
| 6 | + * Version: 1.13 | |
| 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 ((get_option('vdo_embed_version')) == false) { | |
| 117 | + if (empty(get_option('vdo_embed_version'))) { | |
| 118 | 118 | update_option('vdo_embed_version', '0.5'); |
| 119 | 119 | } |
| 120 | - if ((get_option('vdo_player_theme')) == false) { | |
| 120 | + if (empty(get_option('vdo_player_theme'))) { | |
| 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,19 +226,18 @@ | ||
| 226 | 226 | delete_option('vdo_player_theme'); |
| 227 | 227 | } |
| 228 | 228 | function vdo_activate() |
| 229 | 229 | { |
| 230 | - if ((get_option('vdo_default_height')) == false) { | |
| 230 | + if (!get_option('vdo_default_height')) { | |
| 231 | 231 | update_option('vdo_default_height', '360'); |
| 232 | 232 | } |
| 233 | - if ((get_option('vdo_default_width')) == false) { | |
| 233 | + if (!get_option('vdo_default_width')) { | |
| 234 | 234 | update_option('vdo_default_width', '640'); |
| 235 | 235 | } |
| 236 | - //https://stackoverflow.com/a/2173318/5022684 | |
| 237 | - if ((get_option('vdo_embed_version')) == false) { | |
| 236 | + if (empty(get_option('vdo_embed_version'))) { | |
| 238 | 237 | update_option('vdo_embed_version', '0.5'); |
| 239 | 238 | } |
| 240 | - if ((get_option('vdo_player_theme')) == false) { | |
| 239 | + if (empty(get_option('vdo_player_theme'))) { | |
| 241 | 240 | update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a'); |
| 242 | 241 | } |
| 243 | 242 | } |
| 244 | 243 | register_activation_hook(__FILE__, 'vdo_activate'); |