PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 9.1.3
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v9.1.3
9.1.3 9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 8.5.38 8.5.39 All 222 releases
← All changes | src/Admin/Admin.php +76 -3 9.0.39.1.3 View file →
@@ -178,8 +178,15 @@
178 178 wp_enqueue_style( 'wpvr-pannellum-css', $pano_base . 'css/pannellum.css', [], WPVR_VERSION );
179 179 wp_enqueue_script( 'wpvr-libpannellum', $pano_base . 'js/libpannellum.js', [], WPVR_VERSION, true );
180 180 wp_enqueue_script( 'wpvr-pannellum', $pano_base . 'js/pannellum.js', [ 'wpvr-libpannellum' ], WPVR_VERSION, true );
181 181
182 + // Load Video.js & VideoJS-VR (for 360 video tours).
183 + $public_base = $plugin_url . 'legacy/public/';
184 + wp_enqueue_style( 'wpvr-videojs-css', $public_base . 'lib/pannellum/src/css/video-js.css', [], WPVR_VERSION );
185 + wp_enqueue_style( 'wpvr-videojs-vr-css', $public_base . 'lib/videojs-vr/videojs-vr.css', [], WPVR_VERSION );
186 + wp_enqueue_script( 'wpvr-videojs', $public_base . 'js/video.js', [], WPVR_VERSION, true );
187 + wp_enqueue_script( 'wpvr-videojs-vr', $public_base . 'lib/videojs-vr/videojs-vr.js', [ 'wpvr-videojs' ], WPVR_VERSION, true );
188 +
182 189 wp_enqueue_style( 'wpvr-fontawesome', $plugin_url . 'legacy/admin/lib/fontawesome/css/all.min.css', [], WPVR_VERSION );
183 190
184 191 // Tour editor React bundle.
185 192 $js_file = $build_dir . 'index.js';
@@ -196,9 +203,9 @@
196 203
197 204 wp_enqueue_script(
198 205 'wpvr-tour-editor',
199 206 $plugin_url . 'build/tour-editor/index.js',
200 - array_merge( $asset['dependencies'], [ 'wpvr-pannellum' ] ),
207 + array_merge( $asset['dependencies'], [ 'wpvr-pannellum', 'wpvr-videojs-vr' ] ),
201 208 $asset['version'],
202 209 true
203 210 );
204 211
@@ -209,11 +216,67 @@
209 216 if ( class_exists( 'Wpvr_fontawesome_icons' ) ) {
210 217 $fa_icons = ( new \Wpvr_fontawesome_icons() )->icon;
211 218 }
212 219
220 + $raw_hotspot_types = apply_filters( 'wpvr_hotspot_types', [
221 + 'info' => __( 'Info', 'wpvr' ),
222 + 'scene' => __( 'Scene', 'wpvr' ),
223 + ] );
224 +
225 + $hotspot_types = [];
226 + if ( isset( $raw_hotspot_types['info'] ) ) {
227 + $hotspot_types[] = [ 'value' => 'info', 'label' => $raw_hotspot_types['info'] ];
228 + unset( $raw_hotspot_types['info'] );
229 + } else {
230 + $hotspot_types[] = [ 'value' => 'info', 'label' => __( 'Info', 'wpvr' ) ];
231 + }
232 +
233 + if ( isset( $raw_hotspot_types['scene'] ) ) {
234 + $hotspot_types[] = [ 'value' => 'scene', 'label' => $raw_hotspot_types['scene'] ];
235 + unset( $raw_hotspot_types['scene'] );
236 + } else {
237 + $hotspot_types[] = [ 'value' => 'scene', 'label' => __( 'Scene', 'wpvr' ) ];
238 + }
239 +
240 + $hotspot_types[] = [ 'value' => 'url', 'label' => __( 'External URL', 'wpvr' ) ];
241 + if ( isset( $raw_hotspot_types['url'] ) ) {
242 + unset( $raw_hotspot_types['url'] );
243 + }
244 +
245 + foreach ( $raw_hotspot_types as $type_key => $type_label ) {
246 + $hotspot_types[] = [ 'value' => $type_key, 'label' => $type_label ];
247 + }
248 +
249 + $fluent_forms = [];
250 + if ( defined( 'FLUENTFORM' ) ) {
251 + global $wpdb;
252 + $fluent_form_table = $wpdb->prefix . 'fluentform_forms';
253 + $forms = $wpdb->get_results( "SELECT id, title FROM {$fluent_form_table} WHERE status = 'published' ORDER BY title ASC" );
254 + if ( ! empty( $forms ) && is_array( $forms ) ) {
255 + foreach ( $forms as $form ) {
256 + $fluent_forms[] = [
257 + 'id' => (string) $form->id,
258 + 'title' => $form->title,
259 + ];
260 + }
261 + }
262 + }
263 +
264 + $is_embed_addon_active = apply_filters( 'is_wpvr_embed_addon_premium', false );
265 + if ( $is_embed_addon_active ) {
266 + if ( wp_script_is( 'custom-qrcode', 'registered' ) ) {
267 + wp_enqueue_script( 'custom-qrcode' );
268 + } elseif ( defined( 'WPVR_PRO_PLUGIN_DIR_URL' ) ) {
269 + wp_enqueue_script( 'custom-qrcode', trailingslashit( WPVR_PRO_PLUGIN_DIR_URL ) . 'admin/lib/qr-code/custom-qrcode.js', [ 'jquery' ], null, true );
270 + }
271 + }
272 +
213 273 wp_localize_script( 'wpvr-tour-editor', 'wpvrTourEditor', [
214 274 'tourId' => $tour_id_cfg ?: null,
215 275 'tourStatus' => $tour_status,
276 + 'tourTitle' => $tour_id_cfg ? get_the_title( $tour_id_cfg ) : '',
277 + 'homeUrl' => home_url( '/' ),
278 + 'isEmbedAddonActive' => $is_embed_addon_active,
216 279 'nonce' => wp_create_nonce( 'wp_rest' ),
217 280 'apiBase' => rest_url( 'wpvr/v1' ),
218 281 'mediaUrl' => rest_url( 'wp/v2/media' ),
219 282 'isPro' => wpvr_is_pro_active(),
@@ -222,8 +285,12 @@
222 285 'postEditUrl' => admin_url( 'post.php' ),
223 286 'faIcons' => $fa_icons,
224 287 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
225 288 'exportNonce' => wp_create_nonce( 'wpvr_export_tour' ),
289 + 'hotspotTypes' => $hotspot_types,
290 + 'fluentForms' => $fluent_forms,
291 + 'isFluentFormActive' => defined( 'FLUENTFORM' ),
292 + 'isWcActive' => class_exists( 'WooCommerce' ),
226 293 'imageResizeWarning' => [
227 294 'ajaxNonce' => wp_create_nonce( 'wpvr' ),
228 295 'canManageSettings' => current_user_can( 'manage_options' ),
229 296 'settingEnabled' => get_option( 'high_res_image' ) === 'true',
@@ -473,13 +540,19 @@
473 540 $style_dependencies[] = 'wpvr-create-tour-modal';
474 541 $script_dependencies[] = 'wpvr-create-tour-modal';
475 542 }
476 543
544 + $tour_listing_css = plugin_dir_path( WPVR_FILE ) . 'app/admin/tour-listing.css';
545 + $tour_listing_css_ver = file_exists( $tour_listing_css ) ? (string) filemtime( $tour_listing_css ) : WPVR_VERSION;
546 +
547 + $tour_listing_js = plugin_dir_path( WPVR_FILE ) . 'app/admin/tour-listing.js';
548 + $tour_listing_js_ver = file_exists( $tour_listing_js ) ? (string) filemtime( $tour_listing_js ) : WPVR_VERSION;
549 +
477 550 wp_enqueue_style(
478 551 'wpvr-tour-listing',
479 552 $plugin_url . 'app/admin/tour-listing.css',
480 553 $style_dependencies,
481 - WPVR_VERSION
554 + $tour_listing_css_ver
482 555 );
483 556
484 557 wp_enqueue_script(
485 558 'wpvr-tour-listing',
@@ -484,9 +557,9 @@
484 557 wp_enqueue_script(
485 558 'wpvr-tour-listing',
486 559 $plugin_url . 'app/admin/tour-listing.js',
487 560 $script_dependencies,
488 - WPVR_VERSION,
561 + $tour_listing_js_ver,
489 562 true
490 563 );
491 564 }
492 565