PluginProbe
VdoCipher: Secure Video Player and Hosting / 1.26
VdoCipher: Secure Video Player and Hosting v1.26
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 +201 -192 1.291.26 View file →
@@ -1,10 +1,10 @@
1 1 <?php
2 2 /**
3 3 * Plugin Name: VdoCipher
4 4 * Plugin URI: https://www.vdocipher.com
5 - * Description: Secured video hosting for WordPress
6 - * Version: 1.29
5 + * Description: Secured video hosting for wordpress
6 + * Version: 1.26
7 7 * Author: VdoCipher
8 8 * Author URI: https://www.vdocipher.com
9 9 * License: GPL2
10 10 */
@@ -10,28 +10,24 @@
10 10 */
11 11
12 12 if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) {
13 13 header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
14 - exit("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n<html lang='en'><head>\r\n<title>404 Not Found</title>\r\n".
14 + exit("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n<html><head>\r\n<title>404 Not Found</title>\r\n".
15 15 "</head><body>\r\n<h1>Not Found</h1>\r\n<p>The requested URL " . $_SERVER['SCRIPT_NAME'] . " was not found on ".
16 16 "this server.</p>\r\n</body></html>");
17 17 }
18 18
19 19 if (!defined('VDOCIPHER_PLUGIN_VERSION')) {
20 - define('VDOCIPHER_PLUGIN_VERSION', '1.29');
20 + define('VDOCIPHER_PLUGIN_VERSION', '1.25');
21 21 }
22 22
23 23 if (!defined('VDOCIPHER_PLAYER_VERSION')) {
24 - define('VDOCIPHER_PLAYER_VERSION', 'v2');
24 + define('VDOCIPHER_PLAYER_VERSION', '1.6.10');
25 25 }
26 26
27 -if (!defined('VDOCIPHER_DEFAULT_THEME')) {
28 - define('VDOCIPHER_DEFAULT_THEME', '');
29 -}
30 -
31 27 function vdo_plugin_check_version()
32 28 {
33 - // This applies only for installs 1.24 and below
29 +// This applies only for installs 1.24 and below
34 30 if (!get_option('vdo_plugin_version')) {
35 31 if (preg_match('/^1\.[0123456]\.[0-9]{1,2}$/', get_option('vdo_embed_version'))) {
36 32 update_option('vdo_embed_version', VDOCIPHER_PLAYER_VERSION);
37 33 }
@@ -40,27 +36,58 @@
40 36 }
41 37 update_option('vdo_plugin_version', VDOCIPHER_PLUGIN_VERSION);
42 38 return ;
43 39 }
44 - // This applies for all new installations after 1.25
40 + // This applies for all new installs after 1.25
45 41 if (VDOCIPHER_PLUGIN_VERSION !== get_option('vdo_plugin_version')) {
46 42 if (preg_match('/^1\.[0-9]{1,2}\.[0-9]{1,2}$/', get_option('vdo_embed_version'))) {
47 43 update_option('vdo_embed_version', VDOCIPHER_PLAYER_VERSION);
48 44 }
49 45 update_option('vdo_plugin_version', VDOCIPHER_PLUGIN_VERSION);
46 + return ;
50 47 }
48 + return ;
51 49 }
52 50
53 51 add_action('plugins_loaded', 'vdo_plugin_check_version');
54 52
53 +// Function called to retrieve id for when title given, starts
54 +function vdo_retrieve_id($title)
55 +{
56 + $client_key = get_option('vdo_client_key');
57 + if ($client_key == false || $client_key == "") {
58 + return "Plugin not configured. Please set the API key to embed videos.";
59 + }
60 + $url = "https://dev.vdocipher.com/api/videos?q=$title";
61 + $headers = array(
62 + 'Authorization'=>'Apisecret '.$client_key,
63 + 'Content-Type'=>'application/json',
64 + 'Accept'=>'application/json'
65 + );
66 + $response = wp_remote_post($url, array(
67 + 'method' => 'GET',
68 + 'headers' => $headers
69 + ));
70 + if (is_wp_error($response)) {
71 + $error_message = $response->get_error_message();
72 + echo "VdoCipher: Something went wrong: $error_message";
73 + return "";
74 + }
75 + $video_json_response = $response['body'];
76 + $video_list_object = json_decode($video_json_response);
77 + $video_list = $video_list_object->rows;
78 + $video_object = $video_list[0];
79 + $video_id = $video_object->id;
80 + return $video_id;
81 +}
82 +// Function called to retrieve id for when title given, ends
83 +
55 84 // Function called to get OTP, starts
56 85 function vdo_otp($video, $otp_post_array = array())
57 86 {
58 87 $client_key = get_option('vdo_client_key');
59 88 if ($client_key == false || $client_key == "") {
60 - return (object)['message' => 'Plugin not configured. API Key missing.'];
61 - } else if (strlen($client_key) !== 64) {
62 - return (object)["message" => "Invalid API Key."];
89 + return "Plugin not configured. Please set the API key to embed videos.";
63 90 }
64 91 $url = "https://dev.vdocipher.com/api/videos/$video/otp";
65 92 $headers = array(
66 93 'Authorization'=>'Apisecret '.$client_key,
@@ -77,28 +104,13 @@
77 104 )
78 105 );
79 106 if (is_wp_error($response)) {
80 107 $error_message = $response->get_error_message();
81 - if (false !== stripos($error_message, 'Operation timed out')) {
82 - $error_message = 'Operation timed out. Check your firewall at web host or try after sometime.';
83 - } else if (false !== stripos($error_message, 'Could not resolve host')) {
84 - $error_message = 'Connectivity issue. Check firewall at web host.';
85 - }
86 - return ["message" => $error_message];
108 + echo "VdoCipher: Something went wrong: $error_message";
109 + return "";
87 110 }
88 -
89 - $responseCode = $response['response']['code'];
90 - if ($responseCode === 404) {
91 - return (object)["message" => "Video ID not found"];
92 - }
93 - else if ($responseCode === 403) {
94 - return (object)["message" => "API key does not have OTP creator permission"];
95 - }
96 - else if ($responseCode === 400 || $responseCode === 401) {
97 - return (object)["message" => "Incorrect API key"];
98 - } else {
99 - return json_decode($response['body']);
100 - }
111 + $OTP_Response = $response['body'];
112 + return json_decode($OTP_Response);
101 113 }
102 114 // Function called to get OTP, ends
103 115
104 116 // VdoCipher Shortcode starts
@@ -105,26 +117,29 @@
105 117 function vdo_shortcode($atts)
106 118 {
107 119 $vdo_args = shortcode_atts(
108 120 array(
121 + 'title' => 'TITLE_OF_VIDEO',
109 122 'width' => get_option('vdo_default_width'),
110 123 'height' => get_option('vdo_default_height'),
111 124 'id' => 'id',
112 125 'no_annotate'=> false,
126 + 'version'=> 0,
113 127 'vdo_theme'=> false,
114 - 'autoplay'=> false,
115 - 'loop'=> false,
116 - 'controls'=> 'on',
117 - 'cc_language'=> false,
118 - 'litemode'=> false,
128 + 'vdo_version'=> false,
129 + 'player_tech'=> ''
119 130 ),
120 131 $atts
121 132 );
133 + $title = $vdo_args['title'];
122 134 $width = $vdo_args['width'];
123 135 $height = $vdo_args['height'];
124 136 $id = $vdo_args['id'];
125 137 $no_annotate = $vdo_args['no_annotate'];
138 + $version = $vdo_args['version'];
126 139 $vdo_theme = $vdo_args['vdo_theme'];
140 + $vdo_version = $vdo_args['vdo_version'];
141 + $player_tech = $vdo_args['player_tech'];
127 142
128 143 if (!preg_match('/.*px$/', $width)) {
129 144 $width = $width."px";
130 145 }
@@ -133,9 +148,16 @@
133 148 $height = $height."px";
134 149 }
135 150 }
136 151 if (!$atts['id']) {
137 - return "Required argument id for embedded video not found.";
152 + if (!$atts['title']) {
153 + return "Required argument id for embedded video not found.";
154 + } else {
155 + $video = vdo_retrieve_id($title);
156 + if ($video == null) {
157 + return "404. Video not found.";
158 + }
159 + }
138 160 } else {
139 161 $video = $id;
140 162 }
141 163
@@ -157,9 +179,9 @@
157 179 $vdo_annotate_code = str_replace('{username}', $current_user->user_login, $vdo_annotate_code);
158 180 $vdo_annotate_code = str_replace('{id}', $current_user->ID, $vdo_annotate_code);
159 181 }
160 182 $vdo_annotate_code = str_replace('{ip}', $_SERVER['REMOTE_ADDR'], $vdo_annotate_code);
161 - $vdo_annotate_code = preg_replace_callback('/{date\.([^}]+)}/', "eval_date", $vdo_annotate_code);
183 + $vdo_annotate_code = preg_replace_callback('/\{date\.([^\}]+)\}/', "eval_date", $vdo_annotate_code);
162 184 $vdo_annotate_code = apply_filters('vdocipher_annotate_postprocess', $vdo_annotate_code);
163 185 // Add annotate code to $otp_post_array, which will be
164 186 // converted to Json and then sent as POST body to API endpoint
165 187 if (!$no_annotate) {
@@ -167,16 +189,14 @@
167 189 }
168 190 }
169 191 // OTP is requested via vdo_otp function
170 192 $OTP_Response = vdo_otp($video, $otp_post_array);
193 + $OTP = $OTP_Response->otp;
194 + $playbackInfo = $OTP_Response->playbackInfo;
171 195
172 - // https://www.php.net/manual/en/function.isset.php#86313
173 - $message = (isset($OTP_Response->message)) ? $OTP_Response->message : null;
174 - $OTP = (isset($OTP_Response->otp)) ? $OTP_Response->otp : null;
175 - $playbackInfo = (isset($OTP_Response->playbackInfo)) ? $OTP_Response->playbackInfo : null;
176 -
177 196 if (is_null($OTP)) {
178 - return "<div id='vdo$OTP'><strong>VdoCipher Error: $message</strong></div>";
197 + $output = "<span id='vdo$OTP' style='background:#555555;color:#FFFFFF'><h4>Video not found</h4></span>";
198 + return $output;
179 199 }
180 200
181 201 // Version, legacy, for flash only
182 202 $version = 0;
@@ -184,144 +204,105 @@
184 204 $version = $atts['version'];
185 205 }
186 206
187 207 // Video Embed version is retrieved from options table or from shortcode attribute
188 - $vdo_embed_version_str = get_option('vdo_embed_version');
208 + if ((get_option('vdo_embed_version')) == false) {
209 + update_option('vdo_embed_version', VDOCIPHER_PLAYER_VERSION);
210 + }
211 + if (!$vdo_version) {
212 + $vdo_embed_version_str = get_option('vdo_embed_version');
213 + } else {
214 + $vdo_embed_version_str = $vdo_version;
215 + }
189 216
190 217 // Video Player theme, update and as shortcode attribute
218 + if ((get_option('vdo_player_theme')) == false) {
219 + update_option('vdo_player_theme', '9ae8bbe8dd964ddc9bdb932cca1cb59a');
220 + }
191 221 if (!$vdo_theme) {
192 222 $vdo_player_theme = get_option('vdo_player_theme');
193 223 } else {
194 224 $vdo_player_theme = $vdo_theme;
195 225 }
196 - if (strpos($vdo_player_theme, 'v1/') === 0 || strlen($vdo_player_theme) === 32) {
197 - $vdo_embed_version_str = '1.6.10';
198 - } else if (strlen($vdo_player_theme) === 16) {
199 - $vdo_embed_version_str = 'v2';
226 +
227 + // tech override custom names
228 + switch ($player_tech) {
229 + case "flash":
230 + $player_tech = "*,-dash";
231 + break;
232 + case "nohtml5":
233 + $player_tech = "*,-dash";
234 + break;
235 + case "noflash":
236 + $player_tech = "*,-hss";
237 + break;
238 + case "nozen":
239 + $player_tech = "*,-zen";
240 + break;
241 + case "noios":
242 + $player_tech = "*,-hlse";
243 + break;
244 + default:
245 + break;
200 246 }
201 - $speedOptions = esc_attr(get_option('vdo_player_speed'));
202 - $speedPattern = '/^\d.\d{1,2}(,\d.\d{1,2})+$/';
203 247
204 248 // Old Embed Code
205 - if ($vdo_embed_version_str === '1.6.10') {
206 - //Old embed code
207 - $output = <<<END
208 - <div id='vdo$OTP' style='height:$height;width:$width;max-width:100%' ></div>
209 - <script>(function(v,i,d,e,o){v[o]=v[o]||{}; v[o].add = v[o].add || function V(a){
210 - (v[o].d=v[o].d||[]).push(a);};
211 - if(!v[o].l) { v[o].l=1*new Date(); a=i.createElement(d), m=i.getElementsByTagName(d)[0];
212 - a.async=1; a.src=e; m.parentNode.insertBefore(a,m);}
213 - })(window,document,'script','https://d1z78r8i505acl.cloudfront.net/playerAssets/1.6.10/vdo.js','vdo');
214 - vdo.add({
215 - otp: '$OTP',
216 - playbackInfo: '$playbackInfo',
217 - theme: '$vdo_player_theme',
218 - plugins: [{
219 - name: 'keyboard',
220 - options: {
221 - preset: 'default',
222 - bindings: {
223 - 'Left' : (player) => player.seek(player.currentTime - 15),
224 - 'Right' : (player) => player.seek(player.currentTime + 15),
225 - },
226 - }
227 - }],
228 - container: document.querySelector('#vdo$OTP'),
229 - })
230 - </script>
231 -END;
232 -
233 - if ($speedOptions !== false && preg_match($speedPattern, $speedOptions)) {
234 - $output .= <<<END
235 - <script>
236 - (function () {
237 - var originalReadyFunction = window.onVdoCipherAPIReady;
238 - // private API; do not use anywhere else; might change without notice
239 - var index = vdo.d.length - 1;
240 - window.onVdoCipherAPIReady = () => {
241 - if (originalReadyFunction) originalReadyFunction();
242 - var v_ = vdo.getObjects()[index];
243 - v_.addEventListener('load', () => {
244 - v_.availablePlaybackRates = [$speedOptions]
245 - });
246 - }
247 - })()
248 - </script>
249 -END;
249 + if ($vdo_embed_version_str === '0.5') {
250 + $output = "<div id='vdo$OTP' style='height:$height;width:$width;max-width:100%' ></div>";
251 + $output .= "<script> (function(v,i,d,e,o){v[o]=v[o]||{}; v[o].add = v[o].add || function V(a){".
252 + " (v[o].d=v[o].d||[]).push(a);};";
253 + $output .= "if(!v[o].l) { v[o].l=1*new Date();a=i.createElement(d),m=i.getElementsByTagName(d)[0];a.async=1;".
254 + "a.src=e; m.parentNode.insertBefore(a,m);}";
255 + $output .= " })(window,document,'script','//de122v0opjemw.cloudfront.net/vdo.js','vdo'); vdo.add({ ";
256 + $output .= "o: '$OTP', ";
257 + if ($version == 32) {
258 + $output .= "version: '$version' ";
250 259 }
251 - } else if ($vdo_embed_version_str === 'v2') {
252 - $uniq = 'u' . rand();
253 - $url = "https://player.vdocipher.com/v2/?otp=$OTP&playbackInfo=$playbackInfo";
254 - if (strlen($vdo_player_theme) === 16) {
255 - $url .= "&player=$vdo_player_theme";
260 + $output .= "}); </script>";
261 + } else {
262 + //New embed code
263 + if ($player_tech === '') {
264 + if (get_option('vdo_watermark_flash_html') === 'flash') {
265 + $player_tech = "*,-dash";
266 + }
256 267 }
257 - if ($vdo_args['autoplay']) {
258 - $url .= "&autoplay=true";
268 + $output = "<div id='vdo$OTP' style='height:$height;width:$width;max-width:100%' ></div>";
269 + $output .= "<script>(function(v,i,d,e,o){v[o]=v[o]||{}; v[o].add = v[o].add || function V(a){".
270 + "(v[o].d=v[o].d||[]).push(a);};";
271 + $output .= "if(!v[o].l) { v[o].l=1*new Date(); a=i.createElement(d), m=i.getElementsByTagName(d)[0];";
272 + $output .= "a.async=1; a.src=e; m.parentNode.insertBefore(a,m);}";
273 + $output .= "})(window,document,'script','https://d1z78r8i505acl.cloudfront.net/playerAssets/";
274 + $output .= "$vdo_embed_version_str";
275 + $output .= "/vdo.js','vdo');";
276 + $output .= "vdo.add({";
277 + $output .= "otp: '$OTP',";
278 + $output .= "playbackInfo: '$playbackInfo',";
279 + $output .= "theme: '$vdo_player_theme',";
280 + $output .= "plugins: [{";
281 + $output .= "name: 'keyboard',";
282 + $output .= "options: {";
283 + $output .= "preset: 'default',";
284 + $output .= "bindings: {";
285 + $output .= "'Left' : (player) => player.seek(player.currentTime - 15),";
286 + $output .= "'Right' : (player) => player.seek(player.currentTime + 15),";
287 + $output .= "},";
288 + $output .= "}";
289 + $output .= "}],";
290 + if ($player_tech !== '') {
291 + $output .= "techoverride: [" ;
292 + $techarray = explode(',', $player_tech);
293 + for ($i = 0; $i < sizeof($techarray); $i++) {
294 + $techStr = $techarray[$i];
295 + $output .= "'$techStr'";
296 + if ($i !== sizeof($techarray)-1) {
297 + $output .= ", ";
298 + }
299 + }
300 + $output .= "],";
259 301 }
260 - if ($vdo_args['loop']) {
261 - $url .= "&loop=true";
262 - }
263 - if (in_array($vdo_args['controls'], ['off', 'native'])) {
264 - $url .= "&controls=" . $vdo_args['controls'];
265 - }
266 - if ($vdo_args['cc_language']) {
267 - $url .= "&ccLanguage=" . $vdo_args['cc_language'];
268 - }
269 - if ($vdo_args['litemode'] === 'true') {
270 - $url .= "&litemode=true";
271 - }
272 - $output = <<<END
273 -<script src="https://player.vdocipher.com/v2/api.js"></script>
274 -<iframe
275 - src="$url"
276 - id="$uniq"
277 - style="height:$height;width:$width;max-width:100%;border:0;display: block;"
278 - allow="encrypted-media"
279 - allowfullscreen
280 -></iframe>
281 -<script>
282 -(function() {
283 - const iframe = document.querySelector('#$uniq');
284 - const player = VdoPlayer.getInstance(iframe);
285 - const isAutoHeight = () => iframe.style.height === 'auto' && iframe.style.width.endsWith('px');
286 - const setAspectRatio = (ratio) => {
287 - iframe.style.maxHeight = '100vh';
288 - if (CSS.supports('aspect-ratio', 1)) {
289 - iframe.style.aspectRatio = ratio;
290 - } else {
291 - const offsetWidth = iframe.offsetWidth;
292 - iframe.style.height = Math.round(offsetWidth / ratio) + 'px';
293 - }
294 - }
295 - if (isAutoHeight()) {
296 - if (iframe.src.includes('litemode')) {
297 - setAspectRatio(16/9);
302 + $output .= "container: document.querySelector('#vdo$OTP'),});";
303 + $output .= "</script>";
298 304 }
299 - player.video.addEventListener('loadstart', async () => {
300 - const aspectRatio = (await player.api.getMetaData()).aspectRatio;
301 - setAspectRatio(aspectRatio);
302 - });
303 - }
304 -})();
305 -</script>
306 -END;
307 - if ($speedOptions !== false && preg_match($speedPattern, $speedOptions)) {
308 - $output .= <<<END
309 -<script>
310 -(function() {
311 - const iframe = document.querySelector('#$uniq')
312 - const player = VdoPlayer.getInstance(iframe);
313 - player.video.addEventListener('loadstart', async () => {
314 - player.api.updatePlayerConfig({playbackSpeedOptions: [$speedOptions]});
315 - });
316 -})();
317 -</script>
318 -END;
319 - }
320 -
321 - } else {
322 - $output = 'Invalid player selection: ' . $vdo_embed_version_str;
323 - }
324 305 return $output;
325 306 }
326 307 add_shortcode('vdo', 'vdo_shortcode');
327 308 // VdoCipher Shortcode ends
@@ -341,20 +322,13 @@
341 322 // add the menu item and register settings (3 functions), starts
342 323 if (is_admin()) { // admin actions
343 324 add_action('admin_init', 'register_vdo_settings');
344 325 add_action('admin_menu', 'vdo_menu');
326 +} else {
327 + // non-admin enqueues, actions, and filters
345 328 }
346 329 function vdo_menu()
347 330 {
348 - if (get_option('vdo_show_plugin_in_sidebar') === "") {
349 - add_options_page(
350 - 'VdoCipher Options',
351 - 'VdoCipher',
352 - 'manage_options',
353 - 'vdocipher',
354 - 'vdo_options'
355 - );
356 - } else {
357 331 add_menu_page(
358 332 'VdoCipher Options',
359 333 'VdoCipher',
360 334 'manage_options',
@@ -361,11 +335,23 @@
361 335 'vdocipher',
362 336 'vdo_options',
363 337 plugin_dir_url(__FILE__).'images/logo.png'
364 338 );
365 - }
339 + add_submenu_page(
340 + null,
341 + 'Video Player Themes',
342 + 'CustomPlayer',
343 + 'manage_options',
344 + 'themesvdo',
345 + 'themesvdo'
346 + );
366 347 }
367 348
349 +function themesvdo()
350 +{
351 + include('include/player_themes.php');
352 +}
353 +
368 354 function vdo_options()
369 355 {
370 356 if (!get_option('vdo_default_height')) {
371 357 update_option('vdo_default_height', 'auto');
@@ -372,15 +358,18 @@
372 358 }
373 359 if (!get_option('vdo_default_width')) {
374 360 update_option('vdo_default_width', '1280');
375 361 }
362 + $vdo_client_key = get_option('vdo_client_key');
363 + if (!$vdo_client_key && strlen($vdo_client_key) != 64) {
364 + vdo_show_form_client_key();
365 + return "";
366 + }
376 367 if (!current_user_can('manage_options')) {
377 - wp_die(__('You do not have sufficient permissions to access this page.'));
368 + wp_die(__('You do not have sufficient permissions to access this page.'));
378 369 }
379 370 include('include/options.php');
380 - return "";
381 371 }
382 -
383 372 function register_vdo_settings()
384 373 {
385 374 // whitelist options
386 375 register_setting('vdo_option-group', 'vdo_client_key');
@@ -388,22 +377,42 @@
388 377 register_setting('vdo_option-group', 'vdo_default_width');
389 378 register_setting('vdo_option-group', 'vdo_annotate_code');
390 379 register_setting('vdo_option-group', 'vdo_embed_version');
391 380 register_setting('vdo_option-group', 'vdo_player_theme');
381 + register_setting('vdo_option-group', 'vdo_watermark_flash_html');
392 382 register_setting('vdo_option-group', 'vdo_plugin_version');
393 - register_setting('vdo_option-group', 'vdo_player_speed');
394 - register_setting('vdo_option-group', 'vdo_show_plugin_in_sidebar');
383 + register_setting('vdo_custom_theme', 'vdo_player_theme_options');
395 384 }
396 385 // add the menu item and register settings (3 functions), ends
397 386
387 +// section for client key for new users
388 +function vdo_show_form_client_key()
389 +{
390 + include('include/setting_form.php');
391 +}
392 +
398 393 // Activation Hook starts
399 394 function vdo_activate()
400 395 {
401 - add_option('vdo_default_height', 'auto');
402 - add_option('vdo_default_width', 1280);
403 - add_option('vdo_embed_version', VDOCIPHER_PLAYER_VERSION);
404 - add_option('vdo_player_theme', VDOCIPHER_DEFAULT_THEME);
405 - add_option('vdo_show_plugin_in_sidebar', 'true');
396 + if ((get_option('vdo_default_height')) == false) {
397 + update_option('vdo_default_height', 'auto');
398 + }
399 + if ((get_option('vdo_default_width')) == false) {
400 + update_option('vdo_default_width', '1280');
401 + }
402 + //https://stackoverflow.com/a/2173318/5022684
403 + if ((get_option('vdo_embed_version')) == false) {
404 + update_option('vdo_embed_version', VDOCIPHER_PLAYER_VERSION);
405 + }
406 + if ((get_option('vdo_player_theme')) == false) {
407 + update_option('vdo_player_theme', '9ae8bbe8dd964ddc9bdb932cca1cb59a');
408 + }
409 + if ((get_option('vdo_watermark_flash_html')) == false) {
410 + update_option('vdo_watermark_flash_html', 'html5');
411 + }
412 + if ((get_option('vdo_plugin_version')) == false) {
413 + update_option('vdo_plugin_version', VDOCIPHER_PLUGIN_VERSION);
414 + }
406 415 }
407 416 register_activation_hook(__FILE__, 'vdo_activate');
408 417
409 418 // Registering and specifying Gutenberg block
@@ -461,9 +470,9 @@
461 470
462 471 add_action('init', 'vdo_register_block');
463 472
464 473 // Deactivation Hook starts
465 -function vdo_uninstall()
474 +function vdo_deactivate()
466 475 {
467 476 delete_option('vdo_client_key');
468 477 delete_option('vdo_default_width');
469 478 delete_option('vdo_default_height');
@@ -469,13 +478,13 @@
469 478 delete_option('vdo_default_height');
470 479 delete_option('vdo_annotate_code');
471 480 delete_option('vdo_embed_version');
472 481 delete_option('vdo_player_theme');
482 + delete_option('vdo_watermark_flash_html');
483 + delete_option('vdo_player_theme_options');
473 484 delete_option('vdo_plugin_version');
474 - delete_option('vdo_player_speed');
475 - delete_option('vdo_show_plugin_in_sidebar');
476 485 }
477 -register_uninstall_hook(__FILE__, 'vdo_uninstall');
486 +register_deactivation_hook(__FILE__, 'vdo_deactivate');
478 487
479 488 // Admin notice to configure plugin for new installs, starts
480 489 function vdo_admin_notice()
481 490 {