PluginProbe
StreamCast – bring live radio to your site with a sleek player / 2.1.10
StreamCast – bring live radio to your site with a sleek player v2.1.10
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
streamcast / streamcast.php

streamcast.php in StreamCast – bring live radio to your site with a sleek player 2.1.10, at streamcast.php

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