PluginProbe
VdoCipher: Secure Video Player and Hosting / 1.13
VdoCipher: Secure Video Player and Hosting v1.13
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 | include/options.php +59 -177 1.271.13 View file →
@@ -1,8 +1,8 @@
1 1 <?php
2 2 if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) {
3 3 header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
4 - 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".
4 + exit("<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n<html><head>\r\n<title>404 Not Found</title>\r\n".
5 5 "</head><body>\r\n<h1>Not Found</h1>\r\n<p>The requested URL " . $_SERVER['SCRIPT_NAME'] . " was not found on ".
6 6 "this server.</p>\r\n</body></html>");
7 7 }
8 8 ?>
@@ -9,217 +9,99 @@
9 9
10 10 <div class="wrap">
11 11 <h2>VdoCipher Options</h2>
12 12
13 -<form name="vdoOptionForm" method="post" action="options.php">
13 +<form method="post" action="options.php">
14 14 <?php
15 15 settings_fields('vdo_option-group');
16 16 do_settings_sections('vdo_option-group');
17 17 ?>
18 - <?php
19 - $existingKey = get_option('vdo_client_key');
20 - $keyIsValid = $existingKey && strlen($existingKey) == 64;
21 - $keyDescriptionDisplay = $keyIsValid ? 'none' : 'block';
22 - $restElementDisplay = $keyIsValid ? 'table-row-group' : 'none';
23 - ?>
18 + <div class="updated">
19 + <p><strong>Status : </strong> Ready to use. You can now embed your videos inside posts and pages.</p>
20 + </div>
24 21 <table class="form-table">
25 - <tbody>
26 22 <tr valign="top">
27 - <th scope="row"><label for="vdo_client_key">API Secret Key</label></th>
28 - <td>
29 - <div style="display: inline-flex;">
30 - <input id="vdo_client_key" name="vdo_client_key" style="width: 640px"
31 - type="password" required minlength="64" maxlength="64"
32 - value="<?php echo esc_attr(get_option('vdo_client_key')); ?>"/>
33 - <button id="toggle_API_visibility" data-protected="On" class="button" type="button">Show API Secret Key</button>
34 - </div>
35 - <p class="description" style="display: <?= $keyDescriptionDisplay ?>">
36 - API Key is a shared secret between your website servers and vdocipher dashboard. To generate this,
37 - login to vdocipher dashboard, go to "Config" > "API Keys". Generate a new key and copy-paste it here.
38 - </p>
39 - </td>
23 + <th scope="row">Client Secret Key</th>
24 + <td><input type="text" name="vdo_client_key"
25 + value="<?php echo esc_attr(get_option('vdo_client_key')); ?>"
26 + max-length="64" style="width: 640px" id="vdo_client_key" /></td>
40 27 </tr>
41 - </tbody>
42 28
43 - <tbody style="display: <?= $restElementDisplay ?>">
44 29 <tr valign="top">
45 - <th scope="row"><label for="vdo_default_width">Default Width</label></th>
46 - <td>
47 - <input id="vdo_default_width" name="vdo_default_width"
48 - type="number" required
49 - value="<?php echo esc_attr(get_option('vdo_default_width')); ?>"
30 + <th scope="row">Default Width</th>
31 + <td><input type="text" name="vdo_default_width"
32 + value="<?php echo esc_attr(get_option('vdo_default_width')); ?>"
50 33 /></td>
51 34 </tr>
52 35
53 36 <tr valign="top">
54 - <th scope="row"><label for="vdo_default_height">Default Height</label></th>
55 - <td>
56 - <input type="text" id="vdo_default_height" name="vdo_default_height"
57 - required pattern="^auto|\d+$"
58 - value="<?php echo esc_attr(get_option('vdo_default_height')); ?>"/>
59 - <p class="description">Can be either "auto" or a number. Set to "auto" height and max width for responsive layout.</p>
60 - </td>
37 + <th scope="row">Default Height</th>
38 + <td><input type="text" name="vdo_default_height"
39 + value="<?php echo esc_attr(get_option('vdo_default_height')); ?>"
40 + /></td>
61 41 </tr>
62 42
63 - <tr>
64 - <th scope="row"><label for="vdo_player_speed">Playback speed</label></th>
43 + <!-- Version Number -->
44 + <?php
45 + if (empty(get_option('vdo_embed_version'))) {
46 + update_option('vdo_embed_version', '0.5');
47 + }
48 + ?>
49 + <tr valign="top">
50 + <th scope="row">Player Version</th>
65 51 <td>
66 - <input type="text" id="vdo_player_speed" name="vdo_player_speed"
67 - pattern="^\d.\d{1,2}(,\d.\d{1,2})+$"
68 - value="<?php echo esc_attr(get_option('vdo_player_speed')); ?>"
69 - />
70 - <p class="description">Speed can be defined as comma separated decimal values e.g. 0.75,1.0,1.25,1.5,1.75,2.0</p>
52 + <?php $vdo_embed_version_vars = array('0.5', '1.0.0'); ?>
53 + <select name="vdo_embed_version" id="vdo_embed_version">
54 + <?php
55 + $vdo_embed_version_str = get_option('vdo_embed_version');
56 + ?>
57 + <?php
58 + foreach($vdo_embed_version_vars as $vdo_embed_version_var) {
59 + if ($vdo_embed_version_str == $vdo_embed_version_var) {
60 + $selected = 'selected="selected"'; }
61 + else { $selected = ''; }
62 +
63 + if($vdo_embed_version_var == '0.5') {
64 + $version_old_new = ' (old player)' ; }
65 + elseif ($vdo_embed_version_var == '1.0.0') {
66 + $version_old_new = ' (new player)' ; }
67 + else {'' ; }
68 + ?>
69 + <option value="<?php echo $vdo_embed_version_var; ?>" <?php echo $selected; ?> >
70 + <?php echo $vdo_embed_version_var . $version_old_new ; ?>
71 + </option>
72 + <?php } ?>
73 + </select>
71 74 </td>
72 75 </tr>
73 76
74 - <!-- Version Number -->
75 - <?php
76 - $existingVersion = get_option('vdo_embed_version');
77 - $embedVersionDisplay = 'none';
78 - if ($existingVersion !== false && $existingVersion !== VDOCIPHER_PLAYER_VERSION) {
79 - $embedVersionDisplay = 'table-row';
80 - } ?>
81 - <tr valign="top" style="display: <?= $embedVersionDisplay ?>">
82 - <th scope="row"><label for="vdo_embed_version">Player Version</label></th>
83 - <td>
84 - <div style="display: inline-flex">
85 - <input type="text" name="vdo_embed_version"
86 - id="vdo_embed_version"
87 - value="<?= $existingVersion ?>"
88 - readonly />
89 - <p class="vdo_saveChangeMessage" style="display: none; font-style: italic">Click on "save changes" below to confirm</p>
90 - <button id="vdo_setDefaultVersionBtn" class="button" type="button">Use latest player version 1.6.10</button><br/>
91 - <script>
92 - document.querySelector('#vdo_setDefaultVersionBtn').addEventListener('click', (e) => {
93 - e.preventDefault();
94 - e.target.parentElement.querySelector('input').value = '<?= VDOCIPHER_PLAYER_VERSION ?>'
95 - e.target.style.display = 'none';
96 - e.target.parentElement.querySelector('.vdo_saveChangeMessage').style.display = '';
97 - });
98 - </script>
99 - </div>
100 - <p class="description">
101 - It is recommended to use the latest player version for best video playback. This action
102 - can not be reverted.
103 - </p>
104 - </td>
105 - </tr>
106 -
107 77 <!-- Player Theme Options -->
108 78 <?php
109 - $defaultThemeId = '9ae8bbe8dd964ddc9bdb932cca1cb59a';
110 - $existingTheme = get_option('vdo_player_theme');
111 - $themeSettingDisplay = 'none';
112 - if ($existingTheme !== false && $existingTheme !== $defaultThemeId) {
113 - $themeSettingDisplay = 'table-row';
114 - } ?>
115 - <tr valign="top" style="display: <?= $themeSettingDisplay ?>">
116 - <th scope="row"><label for="vdo_player_theme">Player Theme</label></th>
79 + if (empty(get_option('vdo_player_theme'))) {
80 + update_option('vdo_player_theme','9ae8bbe8dd964ddc9bdb932cca1cb59a');
81 + }
82 + ?>
83 + <tr valign="top">
84 + <th scope="row">Player Theme</th>
117 85 <td>
118 - <div style="display:inline-flex; margin-bottom:10px;">
119 - <input
120 - type="text"
121 - name="vdo_player_theme"
122 - id="vdo_player_theme"
123 - value="<?php echo $existingTheme; ?>"
124 - maxlength="32"
125 - style="width: 320px"
126 - readonly
127 - />
128 - <p class="vdo_saveChangeMessage" style="display: none; font-style: italic">Click on "save changes" below to confirm</p>
129 - <button id="vdo_setDefaultThemeBtn" class="button" type="button">Revert to default theme</button><br/>
130 - <script>
131 - document.querySelector('#vdo_setDefaultThemeBtn').addEventListener('click', (e) => {
132 - e.preventDefault();
133 - e.target.parentElement.querySelector('input').value = '<?= $defaultThemeId ?>'
134 - e.target.style.display = 'none';
135 - e.target.parentElement.querySelector('.vdo_saveChangeMessage').style.display = '';
136 - });
137 - </script>
138 - </div>
139 - <p class="description">
140 - We have reverted player themes in preparation for something better. If you are having any styling
141 - issues in your player, please use the button above to revert to the default theme. Once you revert
142 - to the default theme, there is no way to undo the selection. The default theme is the one that is
143 - on your vdocipher dashboard when previewing any video.
144 - </p>
145 - <figure style="margin: 0">
146 - <img src="<?php echo plugin_dir_url(__FILE__).'img/default1.png' ?>"
147 - style="width: 300px" alt="preview of default player">
148 - <figcaption>Screenshot of the default player theme</figcaption>
149 - </figure>
86 + <input type="text" name="vdo_player_theme"
87 + value="<?php echo esc_attr(get_option('vdo_player_theme')); ?>" max-length = "32" style="width: 320px"
88 + />
89 + <p class="description">Player theme is not available for old player version(0.5). The default theme will be applied for old player.</p>
150 90 </td>
151 91 </tr>
152 - <!-- Player Theme Options end-->
153 92
154 - <!-- Player Watermark option - Flash/ HTML5 starts -->
155 - <?php
156 - $existingFlashSetting = get_option('vdo_watermark_flash_html');
157 - if ($existingFlashSetting === 'flash') { ?>
158 - <tr id="vdo_watermark_html_flash" valign="top">
159 - <th scope="row"> Choice of Watermark </th>
160 - <td>
161 - <input type="radio" class="vdo-htmlflash"
162 - value="html5" name="vdo_watermark_flash_html"
163 - id="vdo_html5">
164 - <label for="vdo_html5">HTML5 (Overlay)</label>
165 - &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
166 - <input type="radio" class="vdo-htmlflash"
167 - value="flash" name="vdo_watermark_flash_html"
168 - id="vdo_flash" checked >
169 - <label for="vdo_flash">Flash (Hard-Coded)</label>
170 - <p class="description">
171 - IMPORTANT: Flash player is no longer supported by any modern browser. Selecting "Flash" here is
172 - causing playback issues for your users. Please select HTML5 and "save changes" to use HTML5
173 - playback. This change will be irreversible.
174 - </p>
175 - </td>
176 - </tr>
177 -
178 - <?php } ?>
179 -
180 - <!-- Player Watermark option - Flash/ HTML5 ends -->
181 93 <tr valign="top">
182 - <th scope="row"><label for="vdo_watermarkjson">Annotation Statement</label></th>
94 + <th scope="row">Annotation Statement</th>
183 95 <td>
184 - <div style="display: inline-flex;">
185 - <textarea name="vdo_annotate_code" id="vdo_watermarkjson" rows="6" cols="55"
186 - ><?php
96 + <textarea name="vdo_annotate_code" type="textarea" rows="5" cols="60"><?php
187 97 if (get_option('vdo_annotate_code') != "") {
188 98 echo get_option('vdo_annotate_code');
189 - $vdo_annotation_code = get_option('vdo_annotate_code');
190 99 }
191 100 ?></textarea>
192 - <p class="description" style="margin-left:20px; position: relative">
193 - <span style="color:purple"><b>Sample Code for Dynamic Watermark</b></span><br/>
194 - [{'type':'rtext', 'text':' {name}', 'alpha':'0.60', 'color':'0xFF0000','size':'15','interval':'5000'}] <br/>
195 - <span style="color:purple"><b>Sample Code for Static Watermark</b></span><br/>
196 - [{'type':'text', 'text':'{ip}', 'alpha':'0.5' , 'x':'10', 'y':'100', 'color':'0xFF0000', 'size':'12'}] <br/>
197 - </p>
198 - </div>
199 - <p class="description" id="vdojsonvalidator"></p>
200 - <p class="description">
201 - Leave this text blank in case you do not need watermark over all
202 - videos. For details on writing the annotation code
203 - <a href="https://www.vdocipher.com/blog/2014/12/add-text-to-videos-with-watermark/" target="_blank">
204 - check this out
205 - </a>
206 - </p>
101 + <p class="description">Leave this text blank in case you do not need watermark over all Videos. For details on writing the annotation code <a href="https://www.vdocipher.com/blog/2014/12/add-text-to-videos-with-watermark/" target="_blank">check this out</a></p>
207 102 </td>
208 103 </tr>
209 - <tr style="display:none;">
210 - <td>Plugin version no.: </td>
211 - <td><input
212 - id="vdo_plugin_version" name="vdo_plugin_version" type="hidden"
213 - value="<?php echo esc_attr(get_option('vdo_plugin_version')); ?>" readonly>
214 - </td>
215 - </tr>
216 -
217 - </tbody>
218 104 </table>
219 - <?php
220 - wp_enqueue_script('vdo_validate_watermark', plugin_dir_url(__FILE__).'js/validatewatermark.js');
221 - wp_enqueue_script('vdo_hide_key', plugin_dir_url(__FILE__).'js/showkey.js');
222 - ?>
223 105 <?php submit_button(); ?>
224 106 </form>
225 107 </div>