PluginProbe
Super Video player – Fully Customizable Video Player with Playlist / trunk
Super Video player – Fully Customizable Video Player with Playlist vtrunk
1.8.10 1.8.9 1.4.0 1.4.1 1.6.10 1.6.12 1.6.14 1.7.0 1.7.2 1.7.3 1.7.4 1.7.5 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 trunk 1.0 1.1 1.2 All 28 releases
super-video-player / super-video-player.php

super-video-player.php in Super Video player – Fully Customizable Video Player with Playlist trunk, at super-video-player.php

132 lines 5.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * Plugin Name: Super Video Player
5 * Plugin URI: https://bplugins.com/super-video-player
6 * Description: A fully customizable video player for wordpress.
7 * Version: 1.8.10
8 * Requires at least: 6.5
9 * Requires PHP: 7.4
10 * Author: bPlugins
11 * Author URI: http://bplugins.com
12 * License: GPLv2 or later
13 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
14 * Text Domain: svp
15 * Domain Path: /languages
16 */
17 if ( !defined( 'ABSPATH' ) ) {
18 exit;
19 }
20 if ( function_exists( 'svp_fs' ) ) {
21 svp_fs()->set_basename( false, __FILE__ );
22 } else {
23 if ( !function_exists( 'svp_fs' ) ) {
24 // Create a helper function for easy SDK access.
25 function svp_fs() {
26 global $svp_fs;
27 if ( !isset( $svp_fs ) ) {
28 // Activate multisite network integration.
29 if ( !defined( 'WP_FS__PRODUCT_6749_MULTISITE' ) ) {
30 define( 'WP_FS__PRODUCT_6749_MULTISITE', true );
31 }
32 // Include Freemius SDK.
33 require_once dirname( __FILE__ ) . '/vendor/freemius/start.php';
34 $svp_fs = fs_dynamic_init( array(
35 'id' => '6749',
36 'slug' => 'super-video-player',
37 'type' => 'plugin',
38 'public_key' => 'pk_ebfc28616ca46b064866ea36660e0',
39 'is_premium' => false,
40 'premium_suffix' => 'Pro',
41 'has_addons' => false,
42 'has_paid_plans' => true,
43 'trial' => array(
44 'days' => 7,
45 'is_require_payment' => false,
46 ),
47 'menu' => array(
48 'slug' => 'edit.php?post_type=svplayer&page=svplayer#/welcome',
49 'first-path' => 'edit.php?post_type=svplayer&page=svplayer#/welcome',
50 'network' => true,
51 ),
52 'is_live' => true,
53 'is_org_compliant' => true,
54 ) );
55 }
56 return $svp_fs;
57 }
58
59 // Init Freemius.
60 svp_fs();
61 // Signal that SDK was initiated.
62 do_action( 'svp_fs_loaded' );
63 }
64 require_once __DIR__ . '/upgrade.php';
65 require_once __DIR__ . '/inc/functions.php';
66 require_once plugin_dir_path( __FILE__ ) . '/video-player-block.php';
67 add_action( 'init', 'svp_load_textdomain' );
68 function svp_load_textdomain() {
69 load_plugin_textdomain( 'svp', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
70 if ( svp_fs()->is_free_plan() ) {
71 require_once __DIR__ . '/inc/metabox-free.php';
72 require_once __DIR__ . '/inc/shortcode-free.php';
73 }
74 if ( svp_fs()->can_use_premium_code() ) {
75 require_once __DIR__ . '/premium-files/metabox-pro.php';
76 }
77 }
78
79 /*Some Set-up*/
80 define( 'SVP_PLUGIN_DIR', plugin_dir_url( __FILE__ ) );
81 define( 'SVP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
82 define( 'SVP_VERSION', '1.8.10' );
83 define( 'SVP_HAS_PRO', 'super-video-player-premium/super-video-player.php' === plugin_basename( __FILE__ ) );
84 /* JS*/
85 // Inc common
86 require_once __DIR__ . '/inc/init.php';
87 require_once __DIR__ . '/vendor/codestar-framework/codestar-framework.php';
88 require_once __DIR__ . '/inc/Dashboard.php';
89 if ( SVP_HAS_PRO ) {
90 require_once __DIR__ . '/premium-files/LicenseActivation.php';
91 }
92 if ( svp_fs()->can_use_premium_code() ) {
93 require_once __DIR__ . '/premium-files/shortcode-pro.php';
94 require_once __DIR__ . '/premium-files/settings-fields.php';
95 require_once __DIR__ . '/premium-files/widgets.php';
96 function svp_block_admin_script() {
97 // Plyr CSS
98 wp_enqueue_style(
99 'plyrIoCSS',
100 SVP_PLUGIN_DIR . 'assets/css/plyr.css',
101 array(),
102 SVP_VERSION
103 );
104 // Plyr JS
105 wp_enqueue_script(
106 'plyrIoJS',
107 SVP_PLUGIN_DIR . 'assets/js/plyr.js',
108 array(),
109 SVP_VERSION,
110 true
111 );
112 $is_premium = svp_fs()->can_use_premium_code();
113 $GLOBALS['svp_is_premium'] = $is_premium;
114 wp_localize_script( 'plyrIoJS', 'SVP_DATA', array(
115 'isPremium' => $is_premium,
116 'iconUrl' => SVP_PLUGIN_DIR . 'assets/images/plyr.svg',
117 ) );
118 }
119
120 /*
121 * Editor only.
122 *
123 * This was also hooked to wp_enqueue_scripts, which loaded Plyr on every
124 * front-end page of a Pro site even when no player was present -- and a
125 * second time, because block.json already lists plyrIoJS in viewScript.
126 * The block registration handles the front end (including the shortcode
127 * and widget paths, which render through render_block()), and localises
128 * SVP_DATA onto the same handle in video-player-block.php.
129 */
130 add_action( 'enqueue_block_editor_assets', 'svp_block_admin_script' );
131 }
132 }