| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) exit; // Exit if accessed directly |
| 3 |
/** |
| 4 |
* Provide a admin area view for the plugin |
| 5 |
* |
| 6 |
* This file is used to markup the admin-facing aspects of the plugin. |
| 7 |
* |
| 8 |
* @link http://rextheme.com/ |
| 9 |
* @since 1.0.0 |
| 10 |
* |
| 11 |
* @package Wpvr |
| 12 |
* @subpackage Wpvr/admin/partials |
| 13 |
*/ |
| 14 |
?> |
| 15 |
<?php |
| 16 |
/** |
| 17 |
* get rollback version of WPVR |
| 18 |
* |
| 19 |
* @return array|mixed |
| 20 |
* |
| 21 |
* @src Inspired from Elementor roll back options |
| 22 |
*/ |
| 23 |
function rex_wpvr_get_roll_back_versions() |
| 24 |
{ |
| 25 |
$max_number = 5; |
| 26 |
$transient_key = 'rex_wpvr_rollback_versions_' . WPVR_VERSION; |
| 27 |
|
| 28 |
// Check cached version |
| 29 |
if ($rollback_versions = get_transient($transient_key)) { |
| 30 |
return $rollback_versions; |
| 31 |
} |
| 32 |
|
| 33 |
require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; |
| 34 |
$plugin_information = plugins_api('plugin_information', ['slug' => 'wpvr']); |
| 35 |
|
| 36 |
if (empty($plugin_information->versions) || !is_array($plugin_information->versions)) { |
| 37 |
return []; |
| 38 |
} |
| 39 |
|
| 40 |
$latest_version = $plugin_information->versions; |
| 41 |
unset($latest_version['trunk']); |
| 42 |
|
| 43 |
$valid_versions = []; |
| 44 |
|
| 45 |
foreach ($latest_version as $version => $download_link) { |
| 46 |
$lowercase_version = strtolower($version); |
| 47 |
$is_valid_rollback_version = |
| 48 |
preg_match('/^\d+\.\d+\.\d+$/', $version) && |
| 49 |
!preg_match('/(beta|rc|dev)/i', $lowercase_version) && |
| 50 |
version_compare($version, WPVR_VERSION, '<'); |
| 51 |
|
| 52 |
/** |
| 53 |
* Filters whether the rollback version is valid. |
| 54 |
* |
| 55 |
* @param bool $is_valid_rollback_version Whether the rollback version is valid. |
| 56 |
* @param string $lowercase_version The lowercase version string. |
| 57 |
*/ |
| 58 |
$is_valid_rollback_version = apply_filters( |
| 59 |
'rex_wpvr_is_valid_rollback_version', |
| 60 |
$is_valid_rollback_version, |
| 61 |
$lowercase_version |
| 62 |
); |
| 63 |
|
| 64 |
if ($is_valid_rollback_version) { |
| 65 |
$valid_versions[] = $version; |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
usort($valid_versions, function ($a, $b) { |
| 70 |
return version_compare($b, $a); |
| 71 |
}); |
| 72 |
|
| 73 |
$rollback_versions = array_slice($valid_versions, 0, $max_number); |
| 74 |
|
| 75 |
// Cache the results for a week |
| 76 |
set_transient($transient_key, $rollback_versions, WEEK_IN_SECONDS); |
| 77 |
|
| 78 |
return $rollback_versions; |
| 79 |
} |
| 80 |
|
| 81 |
|
| 82 |
$rollback_versions = function_exists( 'rex_wpvr_get_roll_back_versions' ) ? rex_wpvr_get_roll_back_versions() : array(); |
| 83 |
|
| 84 |
?> |
| 85 |
<!-- This file should display the admin pages --> |
| 86 |
<div class="wpvr-global-settings"> |
| 87 |
<ul class="tabs tabs-icon rex-tabs"> |
| 88 |
<li class="tab col s3 wpvr_tabs_row general-settigs"> |
| 89 |
<a href="#tab1"> |
| 90 |
<svg width="19" height="18" fill="none" viewBox="0 0 19 18" xmlns="http://www.w3.org/2000/svg"><path fill="#ABB4C2" stroke="#ABB4C2" stroke-width=".1" d="M17.71 10.43l-.75-.616a1.055 1.055 0 010-1.628l.75-.617c.532-.438.668-1.19.323-1.788L16.554 3.22a1.402 1.402 0 00-1.71-.614l-.909.34a1.055 1.055 0 01-1.41-.814l-.16-.957A1.402 1.402 0 0010.978 0H8.021c-.69 0-1.274.494-1.387 1.175l-.16.957a1.055 1.055 0 01-1.41.814l-.908-.34a1.402 1.402 0 00-1.711.614L.966 5.78a1.402 1.402 0 00.324 1.79l.749.616a1.055 1.055 0 010 1.628l-.749.617a1.402 1.402 0 00-.324 1.789l1.479 2.56a1.402 1.402 0 001.71.614l.91-.34a1.055 1.055 0 011.41.814l.159.957C6.747 17.505 7.33 18 8.02 18h2.957c.69 0 1.274-.494 1.387-1.175l.16-.957a1.054 1.054 0 011.41-.814l.908.34a1.402 1.402 0 001.712-.614l1.478-2.56a1.402 1.402 0 00-.324-1.79zm-2.373 3.647l-.909-.34a2.46 2.46 0 00-3.29 1.9l-.16.957H8.021l-.16-.957a2.46 2.46 0 00-3.29-1.9l-.909.34-1.478-2.56.749-.617a2.46 2.46 0 000-3.8l-.75-.616 1.48-2.561.908.34a2.46 2.46 0 003.29-1.9l.16-.957h2.957l.16.957a2.46 2.46 0 003.29 1.9l.909-.34 1.479 2.56s0 0 0 0l-.75.617a2.46 2.46 0 000 3.8l.75.616-1.48 2.561zM9.5 5.531A3.473 3.473 0 006.03 9a3.473 3.473 0 003.47 3.469A3.473 3.473 0 0012.968 9 3.473 3.473 0 009.5 5.531zm0 5.532A2.065 2.065 0 017.437 9c0-1.137.925-2.063 2.063-2.063 1.137 0 2.062.926 2.062 2.063A2.065 2.065 0 019.5 11.063z"/></svg> |
| 91 |
|
| 92 |
<?php _e('General Settings', 'wpvr'); ?> |
| 93 |
</a> |
| 94 |
</li> |
| 95 |
</ul> |
| 96 |
|
| 97 |
<div class="wpvr-global-settings-tab-content"> |
| 98 |
<div id="tab1" class="block-wrapper"> |
| 99 |
<h3 class="tab-content-title"><?php _e('General Settings', 'wpvr'); ?></h3> |
| 100 |
<div class="rex-upgrade wpvr-settings <?php echo is_plugin_active('wpvr-pro/wpvr-pro.php') ? 'pro-active' : ''; ?>"> |
| 101 |
<h4 class="settings-box-title"><?php _e('Setup Options', 'wpvr'); ?></h4> |
| 102 |
<div class="parent settings-wrapper"> |
| 103 |
<div class="wpvr_role-container"> |
| 104 |
<ul class="settings-ul"> |
| 105 |
<?php |
| 106 |
$is_wpvr_premium = apply_filters('is_wpvr_premium', false); |
| 107 |
$is_integration_module = apply_filters('is_integration_module', false); |
| 108 |
$editor_active = get_option('wpvr_editor_active'); |
| 109 |
$author_active = get_option('wpvr_author_active'); |
| 110 |
$fontawesome_disable = get_option('wpvr_fontawesome_disable'); |
| 111 |
$cardboard_disable = get_option('wpvr_cardboard_disable'); |
| 112 |
$wpvr_webp_conversion = get_option('wpvr_webp_conversion'); |
| 113 |
$mobile_media_resize = get_option('mobile_media_resize'); |
| 114 |
$wpvr_script_control = get_option('wpvr_script_control'); |
| 115 |
$wpvr_script_list = get_option('wpvr_script_list'); |
| 116 |
$wpvr_video_script_control = get_option('wpvr_video_script_control'); |
| 117 |
$wpvr_video_script_list = get_option('wpvr_video_script_list'); |
| 118 |
$high_res_image = get_option('high_res_image'); |
| 119 |
$dis_on_hover = get_option('dis_on_hover'); |
| 120 |
$enable_woocommerce = get_option('wpvr_enable_woocommerce', false); |
| 121 |
$dokan_vendor_active = get_option('dokan_vendor_active', false); |
| 122 |
?> |
| 123 |
<li> |
| 124 |
<p class="single-settings-title"> |
| 125 |
<?php echo __("Allow the Editors of your site to Create, Edit, Update, and Delete virtual tours (They can access other users' tours):", "wpvr"); ?> |
| 126 |
</p> |
| 127 |
|
| 128 |
<span class="wpvr-switcher"> |
| 129 |
<?php |
| 130 |
if ($editor_active == "true") { |
| 131 |
?> |
| 132 |
<input id="wpvr_editor_active" type="checkbox" checked> |
| 133 |
<?php |
| 134 |
} else { |
| 135 |
?> |
| 136 |
<input id="wpvr_editor_active" type="checkbox"> |
| 137 |
<?php |
| 138 |
} |
| 139 |
?> |
| 140 |
<label for="wpvr_editor_active"></label> |
| 141 |
</span> |
| 142 |
|
| 143 |
<span class="wpvr-tooltip"> |
| 144 |
<span class="icon"> |
| 145 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 146 |
</span> |
| 147 |
|
| 148 |
<p> |
| 149 |
<?php |
| 150 |
echo wp_kses( |
| 151 |
sprintf( |
| 152 |
__('Enable editors to manage all virtual tours on your site, including those created by other users. <a href="%s" target="_blank" rel="noopener noreferrer">View Doc</a>', 'wpvr'), |
| 153 |
esc_url('https://rextheme.com/docs/wp-vr-exclusive-settings/#1s') |
| 154 |
), |
| 155 |
array( |
| 156 |
'a' => array('href' => array(), 'target' => array(), 'rel' => array()) |
| 157 |
) |
| 158 |
); |
| 159 |
?> |
| 160 |
</p> |
| 161 |
</span> |
| 162 |
|
| 163 |
</li> |
| 164 |
|
| 165 |
<li> |
| 166 |
<p class="single-settings-title"> |
| 167 |
<?php echo __("Allow the Authors of your site to Create, Edit, Update, and Delete virtual tours (They can access their own tours only):", "wpvr"); ?> |
| 168 |
</p> |
| 169 |
|
| 170 |
<span class="wpvr-switcher"> |
| 171 |
<?php |
| 172 |
if ($author_active == "true") { |
| 173 |
?> |
| 174 |
<input id="wpvr_author_active" type="checkbox" checked> |
| 175 |
<?php |
| 176 |
} else { |
| 177 |
?> |
| 178 |
<input id="wpvr_author_active" type="checkbox"> |
| 179 |
<?php |
| 180 |
} |
| 181 |
?> |
| 182 |
<label for="wpvr_author_active"></label> |
| 183 |
</span> |
| 184 |
|
| 185 |
<span class="wpvr-tooltip"> |
| 186 |
<span class="icon"> |
| 187 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 188 |
</span> |
| 189 |
<p> |
| 190 |
<?php |
| 191 |
echo wp_kses( |
| 192 |
sprintf( |
| 193 |
__('Grant authors permission to manage only their own virtual tours without accessing others\' tours. <a href="%s" target="_blank" rel="noopener noreferrer">View Doc</a>', 'wpvr'), |
| 194 |
esc_url('https://rextheme.com/docs/wp-vr-exclusive-settings/#2s') |
| 195 |
), |
| 196 |
array( |
| 197 |
'a' => array('href' => array(), 'target' => array(), 'rel' => array()) |
| 198 |
) |
| 199 |
); |
| 200 |
?> |
| 201 |
</p> |
| 202 |
|
| 203 |
</span> |
| 204 |
</li> |
| 205 |
<?php if(is_plugin_active( 'dokan-lite/dokan.php' ) || is_plugin_active( 'dokan-pro/dokan.php' )) { ?> |
| 206 |
<li> |
| 207 |
<p class="single-settings-title"> |
| 208 |
<?php echo __("Allow Dokan Vendors of your site to Create, Edit, Update, and Delete virtual tours (They can access their own tours only):", "wpvr"); ?> |
| 209 |
</p> |
| 210 |
|
| 211 |
<span class="wpvr-switcher"> |
| 212 |
<?php |
| 213 |
if ($dokan_vendor_active == "true") { |
| 214 |
?> |
| 215 |
<input id="wpvr_dokan_vendor_active" type="checkbox" checked> |
| 216 |
<?php |
| 217 |
} else { |
| 218 |
?> |
| 219 |
<input id="wpvr_dokan_vendor_active" type="checkbox"> |
| 220 |
<?php |
| 221 |
} |
| 222 |
?> |
| 223 |
<label for="wpvr_dokan_vendor_active"></label> |
| 224 |
</span> |
| 225 |
|
| 226 |
<span class="wpvr-tooltip"> |
| 227 |
<span class="icon"> |
| 228 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 229 |
</span> |
| 230 |
<p><?php echo __('Dokan vendor will be able to Create, Edit, Update, and Delete their own virtual tours only.', 'wpvr'); ?></p> |
| 231 |
</span> |
| 232 |
</li> |
| 233 |
|
| 234 |
<?php } ?> |
| 235 |
|
| 236 |
<li> |
| 237 |
<p class="single-settings-title"> |
| 238 |
<?php echo __("Disable Fontawesome from WP VR:", "wpvr"); ?> |
| 239 |
</p> |
| 240 |
|
| 241 |
<span class="wpvr-switcher"> |
| 242 |
<?php |
| 243 |
if ($fontawesome_disable == "true") { |
| 244 |
?> |
| 245 |
<input id="wpvr_fontawesome_disable" type="checkbox" checked> |
| 246 |
<?php |
| 247 |
} else { |
| 248 |
?> |
| 249 |
<input id="wpvr_fontawesome_disable" type="checkbox"> |
| 250 |
<?php |
| 251 |
} |
| 252 |
?> |
| 253 |
<label for="wpvr_fontawesome_disable"></label> |
| 254 |
</span> |
| 255 |
|
| 256 |
<span class="wpvr-tooltip"> |
| 257 |
<span class="icon"> |
| 258 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 259 |
</span> |
| 260 |
|
| 261 |
<p> |
| 262 |
<?php |
| 263 |
echo wp_kses( |
| 264 |
sprintf( |
| 265 |
__('Turn off the Fontawesome icon library in WP VR if you prefer to use custom icons or other icon libraries. <a href="%s" target="_blank" rel="noopener noreferrer">View Doc</a>', 'wpvr'), |
| 266 |
esc_url('https://rextheme.com/docs/wp-vr-exclusive-settings/#3s') |
| 267 |
), |
| 268 |
array( |
| 269 |
'a' => array('href' => array(), 'target' => array(), 'rel' => array()) |
| 270 |
) |
| 271 |
); |
| 272 |
?> |
| 273 |
</p> |
| 274 |
</span> |
| 275 |
</li> |
| 276 |
|
| 277 |
<li> |
| 278 |
<p class="single-settings-title"> |
| 279 |
<?php echo __("Enable mobile media resizer:", "wpvr"); ?> |
| 280 |
</p> |
| 281 |
|
| 282 |
<span class="wpvr-switcher"> |
| 283 |
<?php |
| 284 |
if ($mobile_media_resize == "true") { |
| 285 |
?> |
| 286 |
<input id="mobile_media_resize" type="checkbox" checked> |
| 287 |
<?php |
| 288 |
} else { |
| 289 |
?> |
| 290 |
<input id="mobile_media_resize" type="checkbox"> |
| 291 |
<?php |
| 292 |
} |
| 293 |
?> |
| 294 |
<label for="mobile_media_resize"></label> |
| 295 |
</span> |
| 296 |
|
| 297 |
<span class="wpvr-tooltip"> |
| 298 |
<span class="icon"> |
| 299 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 300 |
</span> |
| 301 |
<p><?php echo __(' Automatically adjust media sizes for mobile devices to ensure optimal viewing performance.', 'wpvr'); ?></p> |
| 302 |
</span> |
| 303 |
</li> |
| 304 |
|
| 305 |
<li> |
| 306 |
<p class="single-settings-title"> |
| 307 |
<?php echo __("Disable WordPress Large Image Handler on WP VR:", "wpvr"); ?> |
| 308 |
</p> |
| 309 |
|
| 310 |
<span class="wpvr-switcher"> |
| 311 |
<?php |
| 312 |
if ($high_res_image == "true") { |
| 313 |
?> |
| 314 |
<input id="high_res_image" type="checkbox" checked> |
| 315 |
<?php |
| 316 |
} else { |
| 317 |
?> |
| 318 |
<input id="high_res_image" type="checkbox"> |
| 319 |
<?php |
| 320 |
} |
| 321 |
?> |
| 322 |
<label for="high_res_image"></label> |
| 323 |
</span> |
| 324 |
|
| 325 |
<span class="wpvr-tooltip"> |
| 326 |
<span class="icon"> |
| 327 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 328 |
</span> |
| 329 |
|
| 330 |
<p> |
| 331 |
<?php |
| 332 |
echo wp_kses( |
| 333 |
sprintf( |
| 334 |
__('Prevent WordPress from resizing large images, keeping the original size for better quality in tours. <a href="%s" target="_blank" rel="noopener noreferrer">View Doc</a>', 'wpvr'), |
| 335 |
esc_url('https://rextheme.com/docs/wp-vr-disable-wordpress-large-image-handler/') |
| 336 |
), |
| 337 |
array( |
| 338 |
'a' => array('href' => array(), 'target' => array(), 'rel' => array()) |
| 339 |
) |
| 340 |
); |
| 341 |
?> |
| 342 |
</p> |
| 343 |
|
| 344 |
|
| 345 |
</span> |
| 346 |
</li> |
| 347 |
|
| 348 |
<li> |
| 349 |
<p class="single-settings-title"> |
| 350 |
<?php echo __("Disable On Hover Content for Mobile:", "wpvr"); ?> |
| 351 |
</p> |
| 352 |
|
| 353 |
<span class="wpvr-switcher"> |
| 354 |
<?php |
| 355 |
if ($dis_on_hover == "true") { |
| 356 |
?> |
| 357 |
<input id="dis_on_hover" type="checkbox" checked> |
| 358 |
<?php |
| 359 |
} else { |
| 360 |
?> |
| 361 |
<input id="dis_on_hover" type="checkbox"> |
| 362 |
<?php |
| 363 |
} |
| 364 |
?> |
| 365 |
<label for="dis_on_hover"></label> |
| 366 |
</span> |
| 367 |
|
| 368 |
<span class="wpvr-tooltip"> |
| 369 |
<span class="icon"> |
| 370 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 371 |
</span> |
| 372 |
|
| 373 |
<p> |
| 374 |
<?php |
| 375 |
echo wp_kses( |
| 376 |
sprintf( |
| 377 |
__('Turn off hover-based content interactions on mobile devices to enhance usability on touch screens. <a href="%s" target="_blank" rel="noopener noreferrer">View Doc</a>', 'wpvr'), |
| 378 |
esc_url('https://rextheme.com/docs/wp-vr-auto-resize-images-mobile-devices/') |
| 379 |
), |
| 380 |
array( |
| 381 |
'a' => array('href' => array(), 'target' => array(), 'rel' => array()) |
| 382 |
) |
| 383 |
); |
| 384 |
?> |
| 385 |
</p> |
| 386 |
</span> |
| 387 |
</li> |
| 388 |
|
| 389 |
<li> |
| 390 |
<p class="single-settings-title"> |
| 391 |
<?php echo __("Enable script control (It will load the WP VR scripts on the pages with virtual tours only):", "wpvr"); ?> |
| 392 |
</p> |
| 393 |
|
| 394 |
<span class="wpvr-switcher"> |
| 395 |
<?php |
| 396 |
if ($wpvr_script_control == "true") { |
| 397 |
?> |
| 398 |
<input id="wpvr_script_control" type="checkbox" checked> |
| 399 |
<?php |
| 400 |
} else { |
| 401 |
?> |
| 402 |
<input id="wpvr_script_control" type="checkbox"> |
| 403 |
<?php |
| 404 |
} |
| 405 |
?> |
| 406 |
<label for="wpvr_script_control"></label> |
| 407 |
</span> |
| 408 |
|
| 409 |
<span class="wpvr-tooltip"> |
| 410 |
<span class="icon"> |
| 411 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 412 |
</span> |
| 413 |
|
| 414 |
<p> |
| 415 |
<?php |
| 416 |
echo wp_kses( |
| 417 |
sprintf( |
| 418 |
__('Load WP VR scripts only on pages with virtual tours, improving page load times on other pages. <a href="%s" target="_blank" rel="noopener noreferrer">View Doc</a>', 'wpvr'), |
| 419 |
esc_url('https://rextheme.com/docs/wp-vr-exclusive-settings/#5s') |
| 420 |
), |
| 421 |
array( |
| 422 |
'a' => array('href' => array(), 'target' => array(), 'rel' => array()) |
| 423 |
) |
| 424 |
); |
| 425 |
?> |
| 426 |
</p> |
| 427 |
|
| 428 |
</span> |
| 429 |
|
| 430 |
<div class="inner-settings-wrapper enqueue-script wpvr_enqueue_script_list"> |
| 431 |
<p class="single-settings-inner-title"> |
| 432 |
<?php echo __('List of allowed pages to load WP VR scripts (The URLs of the pages on your site with virtual tours):', 'wpvr'); ?> |
| 433 |
</p> |
| 434 |
|
| 435 |
<div class="settings-input-wrapper"> |
| 436 |
<input type="text" id="wpvr_script_list" class="materialize-textarea" placeholder="https://example.com/tour1/,https://example.com/tour2/" value="<?php echo $wpvr_script_list; ?>" > |
| 437 |
<span class="hints"><?php echo __("List the pages with virtual tours like this: https://example.com/tour1/, https://example.com/tour2/", 'wpvr'); ?></span> |
| 438 |
</div> |
| 439 |
</div> |
| 440 |
</li> |
| 441 |
|
| 442 |
<li> |
| 443 |
<p class="single-settings-title"> |
| 444 |
<?php echo __("Enable Video JS control (It will load the WP VR Video JS library in the listed pages only):", "wpvr"); ?> |
| 445 |
</p> |
| 446 |
|
| 447 |
<span class="wpvr-switcher"> |
| 448 |
<?php |
| 449 |
if ($wpvr_video_script_control == "true") { |
| 450 |
?> |
| 451 |
<input id="wpvr_video_script_control" type="checkbox" checked> |
| 452 |
<?php |
| 453 |
} else { |
| 454 |
?> |
| 455 |
<input id="wpvr_video_script_control" type="checkbox"> |
| 456 |
<?php |
| 457 |
} |
| 458 |
?> |
| 459 |
<label for="wpvr_video_script_control"></label> |
| 460 |
</span> |
| 461 |
|
| 462 |
<span class="wpvr-tooltip"> |
| 463 |
<span class="icon"> |
| 464 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 465 |
</span> |
| 466 |
|
| 467 |
<p> |
| 468 |
<?php |
| 469 |
echo wp_kses( |
| 470 |
sprintf( |
| 471 |
__('Activate the Video.js library only on pages that contain virtual video tours, optimizing resources. <a href="%s" target="_blank" rel="noopener noreferrer">View Doc</a>', 'wpvr'), |
| 472 |
esc_url('https://rextheme.com/docs/wp-vr-exclusive-settings/#5s') |
| 473 |
), |
| 474 |
array( |
| 475 |
'a' => array('href' => array(), 'target' => array(), 'rel' => array()) |
| 476 |
) |
| 477 |
); |
| 478 |
?> |
| 479 |
</p> |
| 480 |
|
| 481 |
</span> |
| 482 |
|
| 483 |
<div class="inner-settings-wrapper enqueue-video-script enqueue-script wpvr_enqueue_video_script_list"> |
| 484 |
<p class="single-settings-inner-title"> |
| 485 |
<?php echo __('List of allowed pages to load WP VR Video JS library (The URLs of the pages on your site, You want to load Video JS):', 'wpvr'); ?> |
| 486 |
</p> |
| 487 |
|
| 488 |
<div class="settings-input-wrapper"> |
| 489 |
<input type="text" id="wpvr_video_script_list" class="materialize-textarea" placeholder="https://example.com/video-tour1/,https://example.com/video-tour2/" value="<?php echo $wpvr_video_script_list; ?>"> |
| 490 |
<span class="hints"><?php echo __("List the pages like this: https://example.com/tour1/, https://example.com/tour2/", 'wpvr'); ?></span> |
| 491 |
</div> |
| 492 |
</div> |
| 493 |
</li> |
| 494 |
|
| 495 |
<!-- WPVR front-end notice --> |
| 496 |
<li class="enqueue-script front-notice"> |
| 497 |
<?php |
| 498 |
$wpvr_frontend_notice = false; |
| 499 |
$wpvr_frontend_notice_area = ''; |
| 500 |
$wpvr_frontend_notice = get_option('wpvr_frontend_notice'); |
| 501 |
$wpvr_frontend_notice_area = get_option('wpvr_frontend_notice_area'); |
| 502 |
if (!$wpvr_frontend_notice_area) { |
| 503 |
$wpvr_frontend_notice_area = __("Flip the phone to landscape mode for a better experience of the tour.", "wpvr"); |
| 504 |
} |
| 505 |
?> |
| 506 |
<p class="single-settings-title"> |
| 507 |
<?php echo __("Front-End Notice for Mobile Visitors:", "wpvr"); ?> |
| 508 |
</p> |
| 509 |
|
| 510 |
<span class="wpvr-switcher"> |
| 511 |
<?php |
| 512 |
if ($wpvr_frontend_notice == "true") { |
| 513 |
?> |
| 514 |
<input id="wpvr_frontend_notice" type="checkbox" checked> |
| 515 |
<?php |
| 516 |
} else { |
| 517 |
?> |
| 518 |
<input id="wpvr_frontend_notice" type="checkbox"> |
| 519 |
<?php |
| 520 |
} |
| 521 |
?> |
| 522 |
<label for="wpvr_frontend_notice"></label> |
| 523 |
</span> |
| 524 |
|
| 525 |
<span class="wpvr-tooltip"> |
| 526 |
<span class="icon"> |
| 527 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 528 |
</span> |
| 529 |
<p><?php echo __("Display a message on the front end to inform mobile visitors about virtual tour capabilities or requirements.", 'wpvr'); ?></p> |
| 530 |
</span> |
| 531 |
|
| 532 |
<input type="text" id="wpvr_frontend_notice_area" class="materialize-textarea" placeholder="Add your notice here" value="<?php echo $wpvr_frontend_notice_area; ?>"> |
| 533 |
</li> |
| 534 |
|
| 535 |
<li> |
| 536 |
<p class="single-settings-title"> |
| 537 |
<?php echo __("VR GLass Support:", "wpvr"); ?> |
| 538 |
</p> |
| 539 |
|
| 540 |
<span class="wpvr-switcher"> |
| 541 |
<?php |
| 542 |
if(is_plugin_active('wpvr-pro/wpvr-pro.php')){ |
| 543 |
if ($cardboard_disable == 'true') { |
| 544 |
?> |
| 545 |
<input id="wpvr_cardboard_disable" type="checkbox" checked> |
| 546 |
<?php |
| 547 |
} else { |
| 548 |
?> |
| 549 |
<input id="wpvr_cardboard_disable" type="checkbox" > |
| 550 |
<?php |
| 551 |
} |
| 552 |
} |
| 553 |
?> |
| 554 |
<?php if(is_plugin_active('wpvr-pro/wpvr-pro.php')){ ?> |
| 555 |
<label for="wpvr_cardboard_disable"></label> |
| 556 |
<?php }else{ ?> |
| 557 |
|
| 558 |
<div class='wpvr_cardboard_disable_is_pro'> |
| 559 |
<span>Pro</span> |
| 560 |
<label for="wpvr_cardboard_disable" class='wpvr_cardboard_disable_label'></label> |
| 561 |
</div> |
| 562 |
<?php } ?> |
| 563 |
</span> |
| 564 |
|
| 565 |
<span class="wpvr-tooltip"> |
| 566 |
<span class="icon"> |
| 567 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 568 |
</span> |
| 569 |
|
| 570 |
<p> |
| 571 |
<?php |
| 572 |
echo wp_kses( |
| 573 |
sprintf( |
| 574 |
__('Enable compatibility with VR glasses for immersive viewing of virtual tours on supported devices. <a href="%s" target="_blank" rel="noopener noreferrer">View Doc</a>', 'wpvr'), |
| 575 |
esc_url('https://rextheme.com/docs/enable-vr-headset-for-phones-wordpress/') |
| 576 |
), |
| 577 |
array( |
| 578 |
'a' => array('href' => array(), 'target' => array(), 'rel' => array()) |
| 579 |
) |
| 580 |
); |
| 581 |
?> |
| 582 |
</p> |
| 583 |
</span> |
| 584 |
</li> |
| 585 |
|
| 586 |
<li> |
| 587 |
<p class="single-settings-title"> |
| 588 |
<?php echo __("Convert any jpeg or png format image to WebP on media upload:", "wpvr"); ?> |
| 589 |
</p> |
| 590 |
|
| 591 |
<span class="wpvr-switcher"> |
| 592 |
<!-- WPVR front-end notice --> |
| 593 |
<?php if (is_plugin_active('wpvr-pro/wpvr-pro.php')) { ?> |
| 594 |
|
| 595 |
<?php |
| 596 |
if ($wpvr_webp_conversion == 'true') { |
| 597 |
?> |
| 598 |
<input id="wpvr_webp_conversion" type="checkbox" checked> |
| 599 |
<?php |
| 600 |
} else { |
| 601 |
?> |
| 602 |
<input id="wpvr_webp_conversion" type="checkbox" > |
| 603 |
<?php |
| 604 |
} |
| 605 |
?> |
| 606 |
<?php } ?> |
| 607 |
|
| 608 |
<?php if(is_plugin_active('wpvr-pro/wpvr-pro.php')){ ?> |
| 609 |
<label for="wpvr_webp_conversion"></label> |
| 610 |
<?php }else{ ?> |
| 611 |
|
| 612 |
<div class='wpvr_cardboard_disable_is_pro'> |
| 613 |
<span>Pro</span> |
| 614 |
<label for="wpvr_cardboard_disable" class='wpvr_cardboard_disable_label'></label> |
| 615 |
</div> |
| 616 |
<?php } ?> |
| 617 |
</span> |
| 618 |
|
| 619 |
<span class="wpvr-tooltip"> |
| 620 |
<span class="icon"> |
| 621 |
<svg width="15" height="16" fill="none" viewBox="0 0 15 16" xmlns="http://www.w3.org/2000/svg"><path stroke="#73707D" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.333" d="M5.56 5.9a2.08 2.08 0 01.873-1.114 1.92 1.92 0 011.351-.259 1.98 1.98 0 011.192.717c.305.38.471.86.47 1.356 0 1.4-2 2.1-2 2.1m.054 2.8h.006m6.66-3.5c0 3.866-2.984 7-6.666 7C3.818 15 .833 11.866.833 8S3.818 1 7.5 1s6.666 3.134 6.666 7z"/></svg> |
| 622 |
</span> |
| 623 |
|
| 624 |
<p><?php echo __('Automatically convert JPEG or PNG images to the WebP format when uploading, improving load times and image quality.', 'wpvr'); ?></p> |
| 625 |
</span> |
| 626 |
</li> |
| 627 |
|
| 628 |
<li> |
| 629 |
<form class="wpvr-version" id="trigger-rollback"> |
| 630 |
<?php wp_nonce_field( 'wpvr_rollback','wpvr_rollback' ); ?> |
| 631 |
<p class="single-settings-title"> |
| 632 |
<?php _e('Select a Version to Rollback', 'wpvr'); ?> |
| 633 |
</p> |
| 634 |
<select class="wpvr-version-select" name="wpvr_version"> |
| 635 |
<?php |
| 636 |
foreach ( $rollback_versions as $version ) { |
| 637 |
echo "<option value='".esc_attr( $version )."'>".esc_html($version)."</option>"; |
| 638 |
} |
| 639 |
?> |
| 640 |
</select> |
| 641 |
|
| 642 |
<input class="wpvr-btn" type="submit" value="Rollback"> |
| 643 |
</form> |
| 644 |
</li> |
| 645 |
</ul> |
| 646 |
|
| 647 |
</div> |
| 648 |
|
| 649 |
</div> |
| 650 |
</div> |
| 651 |
|
| 652 |
<div class="settings-footer-area"> |
| 653 |
<span class="wpvr-alert box wpvr-success"> |
| 654 |
<?php echo __('Succesfully Saved', 'wpvr'); ?> |
| 655 |
</span> |
| 656 |
|
| 657 |
<button class="wpvr-btn reset" type="button" id="wpvr_role_reset"> |
| 658 |
<?php echo __('Reset Defaults', 'wpvr'); ?> |
| 659 |
</button> |
| 660 |
|
| 661 |
<button class="wpvr-btn" type="submit" id="wpvr_role_submit"> |
| 662 |
<?php echo __('Save Settings', 'wpvr'); ?> |
| 663 |
<span class="wpvr-loader"></span> |
| 664 |
</button> |
| 665 |
</div> |
| 666 |
</div> |
| 667 |
</div> |
| 668 |
</div> |
| 669 |
|
| 670 |
<?php |
| 671 |
|
| 672 |
if(is_plugin_active('divi-builder/divi-builder.php')){ |
| 673 |
?> |
| 674 |
<script> |
| 675 |
(function ($) { |
| 676 |
$(".wpvr-global-settings .block-wrapper:not(#tab1)").hide() |
| 677 |
$('.wpvr-global-settings li.tab a').first().addClass("active"); |
| 678 |
$('.wpvr-global-settings li.tab').on('click', function(){ |
| 679 |
var target_id = $(this).find("a").attr('href'); |
| 680 |
$(".wpvr-global-settings li.tab a").removeClass('active'); |
| 681 |
$(this).find("a").addClass('active'); |
| 682 |
$(target_id).show(); |
| 683 |
$(target_id).siblings('.block-wrapper').hide(); |
| 684 |
}) |
| 685 |
})(jQuery); |
| 686 |
</script> |
| 687 |
<?php |
| 688 |
} |
| 689 |
|
| 690 |
?> |