PluginProbe
StreamCast – bring live radio to your site with a sleek player / 2.4.2
StreamCast – bring live radio to your site with a sleek player v2.4.2
2.4.5 2.4.4 trunk 1.0 1.1 2.0.0 2.1.10 2.1.2 2.1.4 2.1.5 2.1.8 2.2.1 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 All 29 releases
← All changes | streamcast.php +51 -230 2.1.42.4.2 View file →
@@ -1,251 +1,72 @@
1 1 <?php
2 2
3 3 /*
4 - * Plugin Name: StreamCast
4 + * Plugin Name: StreamCast – Live Radio Streaming Player
5 5 * Plugin URI: https://wordpress.org/plugins/streamcast
6 6 * Description: Play iceCast, Shoutcast, Radioco, Radionomy Live stream in Wordpress.
7 - * Version: 2.1.4
7 + * Version: 2.4.2
8 8 * Author: bPlugins
9 9 * Author URI: http://bPlugins.com
10 - * License: GPLv3
10 + * License: GPLv2
11 + * License URI: https://www.gnu.org/licenses/gpl-2.0.html
12 + * Requires at least: 6.2
13 + * Tested up to: 7.0
11 14 * Text Domain: streamcast
12 15 * Domain Path: /languages
13 16 */
14 17
15 -if ( function_exists( 'str_fs' ) ) {
16 - str_fs()->set_basename( false, __FILE__ );
18 +// ABS PATH
19 +if (!defined('ABSPATH'))
20 + exit;
21 +
22 +
23 +if (function_exists('str_fs')) {
24 + str_fs()->set_basename(false, __FILE__);
17 25 } else {
18 - // DO NOT REMOVE THIS IF, IT IS ESSENTIAL FOR THE `function_exists` CALL ABOVE TO PROPERLY WORK.
19 - if ( !function_exists( 'str_fs' ) ) {
20 - // ... Freemius integration snippet ...
21 - }
22 - // ... Your plugin's main file logic ...
23 -}
26 + // Some Setup
27 + define('STREAMCAST_PLUGIN_DIR', plugin_dir_url(__FILE__));
28 + define('STREAMCAST_PLUGIN_PATH', plugin_dir_path(__FILE__));
29 + define('STREAMCAST_PLUGIN_VERSION', '2.4.2');
30 + define('STREAMCAST_PLUGIN_FILE', __FILE__);
31 + define('STREAMCAST_HAS_PRO', 'streamcast-premium/streamcast.php' === plugin_basename(__FILE__));
24 32
33 + if (!function_exists('str_fs')) {
34 + function str_fs()
35 + {
36 + global $str_fs;
37 + if (!isset($str_fs)) {
25 38
26 -if ( !function_exists( 'str_fs' ) ) {
27 - // Create a helper function for easy SDK access.
28 - function str_fs()
29 - {
30 - global $str_fs ;
31 -
32 - if ( !isset( $str_fs ) ) {
33 - // Activate multisite network integration.
34 - if ( !defined( 'WP_FS__PRODUCT_6433_MULTISITE' ) ) {
35 - define( 'WP_FS__PRODUCT_6433_MULTISITE', true );
39 + // Include Freemius SDK.
40 + require_once dirname(__FILE__) . '/vendor/freemius/start.php';
41 + $str_fs = fs_dynamic_init(array(
42 + 'id' => '6433',
43 + 'slug' => 'streamcast',
44 + 'type' => 'plugin',
45 + 'public_key' => 'pk_a19d159db561c020210345da466f1',
46 + 'is_premium' => false,
47 + 'menu' => array(
48 + 'slug' => 'edit.php?post_type=streamcast',
49 + 'first-path' => 'edit.php?post_type=streamcast&page=streamcast#/dashboard',
50 + 'support' => false,
51 + 'affiliation' => false,
52 + ),
53 + 'is_live' => true,
54 + ));
36 55 }
37 - // Include Freemius SDK.
38 - require_once dirname( __FILE__ ) . '/freemius/start.php';
39 - $str_fs = fs_dynamic_init( array(
40 - 'id' => '6433',
41 - 'slug' => 'streamcast',
42 - 'type' => 'plugin',
43 - 'public_key' => 'pk_a19d159db561c020210345da466f1',
44 - 'is_premium' => false,
45 - 'premium_suffix' => 'Pro',
46 - 'has_addons' => false,
47 - 'has_paid_plans' => true,
48 - 'trial' => array(
49 - 'days' => 7,
50 - 'is_require_payment' => true,
51 - ),
52 - 'menu' => array(
53 - 'slug' => 'edit.php?post_type=streamcast',
54 - 'first-path' => 'edit.php?post_type=streamcast&page=help',
55 - 'support' => false,
56 - ),
57 - 'is_live' => true,
58 - ) );
56 + return $str_fs;
59 57 }
60 -
61 - return $str_fs;
58 +
59 + // Init Freemius.
60 + str_fs();
61 + // Signal that SDK was initiated.
62 + do_action('str_fs_loaded');
62 63 }
63 -
64 - // Init Freemius.
65 - str_fs();
66 - // Signal that SDK was initiated.
67 - do_action( 'str_fs_loaded' );
68 - /*Some Set-up*/
69 - define( 'STP_PLUGIN_DIR', plugin_dir_url( __FILE__ ) );
70 - define( 'STP_PLUGIN_VERSION', '2.1.4' );
71 - // load custom mimes
72 - require_once 'mimes/enable-mime-type.php';
73 - function stp_load_textdomain()
74 - {
75 - load_plugin_textdomain( 'streamcast', false, dirname( __FILE__ ) . "/languages" );
76 - }
77 -
78 - add_action( "plugins_loaded", 'stp_load_textdomain' );
79 - //Script and style
80 - function stp_style_and_scripts()
81 - {
82 - wp_enqueue_style(
83 - 'stp-style',
84 - plugin_dir_url( __FILE__ ) . 'public/css/radio.css',
85 - array(),
86 - STP_PLUGIN_VERSION,
87 - 'all'
88 - );
89 - wp_enqueue_style(
90 - 'stp-player-style',
91 - plugin_dir_url( __FILE__ ) . 'public/css/styles.css',
92 - array(),
93 - STP_PLUGIN_VERSION,
94 - 'all'
95 - );
96 - wp_enqueue_script(
97 - 'ultimate-script',
98 - plugin_dir_url( __FILE__ ) . 'public/js/ultimate.js',
99 - array( 'jquery' ),
100 - STP_PLUGIN_VERSION,
101 - true
102 - );
103 - wp_enqueue_script(
104 - 'stp-script',
105 - STP_PLUGIN_DIR . 'public/js/streamcast-final.js',
106 - array( 'jquery' ),
107 - STP_PLUGIN_VERSION,
108 - false
109 - );
110 - }
111 -
112 - add_action( 'wp_enqueue_scripts', 'stp_style_and_scripts' );
113 - function stp_admin_style_and_scripts( $screen )
114 - {
115 - if ( 'streamcast_page_help' == $screen ) {
116 - wp_enqueue_style(
117 - 'stp-admin',
118 - plugin_dir_url( __FILE__ ) . 'admin/css/admin.css',
119 - array(),
120 - STP_PLUGIN_VERSION,
121 - 'all'
122 - );
123 - }
124 - }
125 -
126 - add_action( 'admin_enqueue_scripts', 'stp_admin_style_and_scripts' );
127 - // Help page and after activation redirect
128 - add_action( 'admin_menu', 'stp_howto_page' );
129 - function stp_howto_page()
130 - {
131 - add_submenu_page(
132 - 'edit.php?post_type=streamcast',
133 - 'Getting Started',
134 - 'Getting Started',
135 - 'manage_options',
136 - 'help',
137 - 'stp_help_page_callback'
138 - );
139 - }
140 -
141 - function stp_help_page_callback()
142 - {
143 - include_once 'admin/whats-new.php';
144 - }
145 -
146 - // Footer Review Request
147 - add_filter( 'admin_footer_text', 'stp_admin_footer' );
148 - function stp_admin_footer( $text )
149 - {
150 -
151 - if ( 'streamcast' == get_post_type() ) {
152 - $url = 'https://wordpress.org/support/plugin/streamcast/reviews/?filter=5#new-post';
153 - $text = sprintf( __( 'If you like <strong>StreamCast Radio Player</strong> plugin please leave us a <a href="%s" target="_blank">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating. Your Review is very important to us as it helps us to grow more. ', 'streamcast' ), $url );
154 - }
155 -
156 - return $text;
157 - }
158 -
159 - //Common ShortCode
160 - function stp_stream_sc_cb( $atts )
161 - {
162 - extract( shortcode_atts( array(
163 - 'url' => null,
164 - 'background' => null,
165 - ), $atts ) );
166 - ob_start();
167 - ?>
168 64
169 - <div style="width:200px;">
170 - <audio id="player" controls>
171 - <source src="<?php
172 - echo esc_url( $url ) ;
173 - ?>" type="audio/mp3" />
174 - </audio>
175 - </div>
176 - <style>
177 - .plyr__control{margin-right:0 !important;}
178 65
179 - .plyr--audio .plyr__controls {
180 - <?php
181 -
182 - if ( !empty($background) ) {
183 - echo 'background:' . esc_html( $background ) . '!important;border-radius:3px !important;' ;
184 - } else {
185 - echo 'background: transparent!important; border-radius:3px !important;' ;
186 - }
187 -
188 - ?> }
189 66
190 - </style>
67 + // Load main plugin class
68 + require_once plugin_dir_path(__FILE__) . 'inc/class-streamcast-main.php';
69 + // Initialize
70 + new \StreamCast\STREAMCAST_Main();
191 71
192 - <script>
193 - const player = new Plyr('#player', {
194 - controls: [ 'play', 'mute', 'volume']
195 - });
196 - </script>
197 -
198 - <?php
199 - $output = ob_get_clean();
200 - return $output;
201 - ?>
202 -
203 - <?php
204 - }
205 -
206 - add_shortcode( 'stream', 'stp_stream_sc_cb' );
207 - //Live Demo In menu
208 -
209 - if ( str_fs()->is_free_plan() ) {
210 - add_action( 'admin_menu', 'stp_add_custom_link_into_cpt_menu' );
211 - function stp_add_custom_link_into_cpt_menu()
212 - {
213 - global $submenu ;
214 - $link = 'http://wpradioplayer.com/';
215 - $submenu['edit.php?post_type=streamcast'][] = array(
216 - 'PRO Version Demo',
217 - 'manage_options',
218 - $link,
219 - 'meta' => 'target="_blank"'
220 - );
221 - }
222 -
223 - }
224 -
225 - function stp_my_custom_script()
226 - {
227 - ?>
228 - <script type="text/javascript">
229 - jQuery(document).ready( function($) {
230 - $( "ul#adminmenu a[href$='https://bplugins.page.link/demo']" ).attr( 'target', '_blank' );
231 - });
232 - </script>
233 - <?php
234 - }
235 -
236 - add_action( 'admin_head', 'stp_my_custom_script' );
237 - /*-------------------------------------------------------------------------------*/
238 - /* FRAMEWORK + OTHER INC
239 - /*-------------------------------------------------------------------------------*/
240 - require_once 'inc/cpt.php';
241 - if ( !class_exists( 'CSF' ) ) {
242 - require_once 'admin/codestar-framework/codestar-framework.php';
243 - }
244 -
245 - if ( str_fs()->is_free_plan() ) {
246 - // free version code
247 - require_once 'admin/inc/metabox-free.php';
248 - require_once 'public/shortcode-free.php';
249 - }
250 -
251 -}
72 +}