Music Player for WooCommerce - Version 1.0.174

Version Description

Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Music Player for WooCommerce
Version 1.0.174
Comparing to
See all releases

Code changes from version 1.0.173 to 1.0.174

Files changed (3) hide show
  1. readme.txt +2 -1
  2. views/global_options.php +161 -149
  3. wcmp.php +4 -4
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wcmp.dwbooster.com
4
  Tags:WooCommerce,music player,audio,music,song,player,audio player,media player,mp3,m3u,m3u8,wav,oga,ogg,dokan,wcfm
5
  Requires at least: 3.5.0
6
  Tested up to: 6.0
7
- Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -226,6 +226,7 @@ Each time save the data of a product, the files for demo are deleted and generat
226
 
227
  == Changelog ==
228
 
 
229
  = 1.0.173 =
230
 
231
  * Improves the plugin's code and its security.
4
  Tags:WooCommerce,music player,audio,music,song,player,audio player,media player,mp3,m3u,m3u8,wav,oga,ogg,dokan,wcfm
5
  Requires at least: 3.5.0
6
  Tested up to: 6.0
7
+ Stable tag: 1.0.174
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
226
 
227
  == Changelog ==
228
 
229
+ = 1.0.174 =
230
  = 1.0.173 =
231
 
232
  * Improves the plugin's code and its security.
views/global_options.php CHANGED
@@ -1,46 +1,48 @@
1
  <?php
2
- if( !defined( 'WCMP_PLUGIN_URL' ) ) { echo 'Direct access not allowed.'; exit; }
 
 
3
 
4
  // include resources
5
- wp_enqueue_style( 'wcmp-admin-style', plugin_dir_url(__FILE__).'../css/style.admin.css', array(), '5.0.23' );
6
- wp_enqueue_script( 'wcmp-admin-js', plugin_dir_url(__FILE__).'../js/admin.js' );
7
 
8
- $ffmpeg_system_path = defined('PHP_OS') && strtolower(PHP_OS) == 'linux' ? @shell_exec('which ffmpeg') : '';
9
 
10
- $troubleshoot_default_extension = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_default_extension', false );
11
- $force_main_player_in_title = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_force_main_player_in_title', 1 );
12
- $ios_controls = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_ios_controls', false );
13
- $troubleshoot_onload = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_onload', false );
14
- $include_main_player_hook = trim($GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr('_wcmp_main_player_hook', ''));
15
- $main_player_hook_title = trim($GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr('_wcmp_main_player_hook_title', 1));
16
- $include_all_players_hook = trim($GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr('_wcmp_all_players_hook', ''));
17
 
18
- $enable_player = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_enable_player', false );
19
- $show_in = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_show_in', 'all' );
20
- $players_in_cart = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_players_in_cart', false );
21
- $player_style = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_player_layout', WCMP_DEFAULT_PLAYER_LAYOUT );
22
- $volume = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_player_volume', WCMP_DEFAULT_PLAYER_VOLUME );
23
- $player_controls= $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_player_controls', WCMP_DEFAULT_PLAYER_CONTROLS );
24
- $player_title = intval( $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_player_title',1 ) );
25
- $merge_grouped = intval( $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_merge_in_grouped',0 ) );
26
- $preload = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr(
27
- '_wcmp_preload',
28
- // This option is only for compatibility with versions previous to 1.0.28
29
- $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( 'preload', 'none' )
30
- );
31
- $play_simultaneously = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr('_wcmp_play_simultaneously', 0);
32
- $play_all = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr(
33
- '_wcmp_play_all',
34
- // This option is only for compatibility with versions previous to 1.0.28
35
- $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( 'play_all', 0 )
36
- );
37
- $on_cover = intval( $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_on_cover', 0 ) );
38
- $analytics_property = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_analytics_property', '' );
39
- $registered_only = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_registered_only', 0 );
40
- $fade_out = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_fade_out', 1 );
41
- $purchased_times_text = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' );
42
  ?>
43
- <h1><?php _e('Music Player for WooCommerce - Global Settings', 'music-player-for-woocommerce'); ?></h1>
44
  <div style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;">
45
  <?php
46
  _e(
@@ -53,15 +55,15 @@ _e(
53
  </div>
54
  <form method="post">
55
  <div class="postbox">
56
- <h2 class="hndle" style="padding:5px;color:#DDDDDD;"><?php _e('Registering of Plugin', 'music-player-for-woocommerce'); ?></h2>
57
  <div class="inside">
58
- <label style="color:#DDDDDD;"><?php _e('Enter the email address of buyer', 'music-player-for-woocommerce'); ?>:</label>
59
- <br><input aria-label="<?php print esc_attr(__('Buyer email','music-player-for-woocommerce')); ?>" type="text" disabled> <input value="<?php esc_attr_e(__('Register', 'music-player-for-woocommerce')); ?>" disabled class="button-primary">
60
  </div>
61
  </div>
62
  </form>
63
  <form method="post">
64
- <input type="hidden" name="wcmp_nonce" value="<?php echo wp_create_nonce( 'wcmp_updating_plugin_settings' ); ?>" />
65
  <table class="widefat" style="border-left:0;border-right:0;border-bottom:0;padding-bottom:0;">
66
  <tr>
67
  <td>
@@ -79,71 +81,71 @@ _e(
79
  <td>
80
  <table class="widefat" style="border:1px solid #e1e1e1;margin-bottom:20px;">
81
  <tr>
82
- <td colspan="2"><h2><?php _e( 'General Settings', 'music-player-for-woocommerce' ); ?></h2></td>
83
  </tr>
84
  <tr>
85
- <td width="30%"><?php _e( 'Include the players only for registered users', 'music-player-for-woocommerce' ); ?></td>
86
- <td><input aria-label="<?php print esc_attr(__('Include the players only for registered users','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_registered_only" <?php print(($registered_only) ? 'CHECKED' : '' ); ?> /></td>
87
  </tr>
88
  <tr>
89
- <td width="30%"><?php _e( 'Apply fade out to playing audio when possible', 'music-player-for-woocommerce' ); ?></td>
90
- <td><input aria-label="<?php print esc_attr(__('Apply fade out to playing audio when possible', 'music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_fade_out" <?php print(($fade_out) ? 'CHECKED' : '' ); ?> /></td>
91
  </tr>
92
  <tr>
93
- <td width="30%"><?php _e( 'Text for product purchased times in playlists', 'music-player-for-woocommerce' ); ?></td>
94
- <td><input aria-label="<?php print esc_attr(__('Purchased times text', 'music-player-for-woocommerce')); ?>" type="text" name="_wcmp_purchased_times_text" value="<?php print esc_attr($purchased_times_text);?>" style="width:100%;" /><br>
95
- <i><?php _e('Texts to display when the playlist shortcode includes the purchased_times attribute.<br>Ex.', 'music-player-for-woocommerce'); ?>[wcmp-playlist products_ids="*" controls="track" purchased_times="1"]</i>
96
- </td>
97
  </tr>
98
  <tr>
99
- <td colspan="2" style="color:red;"><?php _e( 'The general settings affect only the PRO version of the plugin', 'music-player-for-woocommerce'); ?>. <a target="_blank" href="https://wcmp.dwbooster.com"><?php _e('CLICK HERE TO GET THE PRO VERSION OF THE PLUGIN', 'music-player-for-woocommerce'); ?></a></td>
100
  </tr>
101
  <tr>
102
- <td width="30%" style="color:#DDDDDD;"><?php _e( 'For buyers, play the purchased audio files instead of the truncated files for demo', 'music-player-for-woocommerce' ); ?></td>
103
  <td style="color:#DDDDDD;">
104
- <input aria-label="<?php print esc_attr(__('For buyers, play the purchased audio files instead of the truncated files for demo','music-player-for-woocommerce')); ?>" type="checkbox" DISABLED />
105
- <?php _e( 'Reset the files', 'music-player-for-woocommerce' ); ?>
106
- <select aria-label="<?php esc_attr_e('Reset files interval', 'music-player-for-woocommerce'); ?>" DISABLED>
107
- <option><?php print esc_html(__('daily', 'music-player-for-woocommerce')); ?></option>
108
- </select>
109
- </td>
110
  </tr>
111
  <tr>
112
  <td colspan="2"><hr /></td>
113
  </tr>
114
  <tr>
115
- <td width="30%" style="color:#DDDDDD;"><?php _e( 'Truncate the audio files for demo with ffmpeg', 'music-player-for-woocommerce' ); ?></td>
116
- <td><input aria-label="<?php print esc_attr(__('Truncate the audio files for demo with ffmpeg','music-player-for-woocommerce')); ?>" type="checkbox" DISABLED /></td>
117
  </tr>
118
  <tr>
119
- <td width="30%" style="color:#DDDDDD;"><?php _e( 'ffmpeg path', 'music-player-for-woocommerce' ); ?></td>
120
- <td><input aria-label="<?php print esc_attr(__('ffmpeg path','music-player-for-woocommerce')); ?>" type="text" value="<?php print esc_attr(!empty($ffmpeg_system_path) ? $ffmpeg_system_path : ''); ?>" DISABLED style="width:100%;" /></td>
121
  </tr>
122
  <tr>
123
- <td width="30%" style="color:#DDDDDD"><?php _e( 'Watermark audio', 'music-player-for-woocommerce' ); ?></td>
124
  <td>
125
- <input aria-label="<?php print esc_attr(__('Watermark audio', 'music-player-for-woocommerce')); ?>" type="text" DISABLED style="width: calc( 100% - 60px );"/><input type="button" class="button-secondary" value="<?php print esc_attr(__('Select', 'music-player-for-woocommerce'));?>" style="float:right;" DISABLED /><br />
126
- <i style="color:#DDDDDD;"><?php _e('Select an audio file if you want to apply a watermark to the audio files for demos. The watermark will be applied to the protected demos (Experimental feature).', 'music-player-for-woocommerce');?></i>
127
  </td>
128
  </tr>
129
  <tr>
130
  <td colspan="2"><hr /></td>
131
  </tr>
132
  <tr>
133
- <td width="30%" style="color:#DDDDDD;"><?php _e( 'Delete the demo files generated previously', 'music-player-for-woocommerce' ); ?></td>
134
- <td><input aria-label="<?php print esc_attr(__('Delete the demo files generated previously','music-player-for-woocommerce')); ?>" type="checkbox" DISABLED /></td>
135
  </tr>
136
  <tr>
137
  <td colspan="2"><hr /></td>
138
  </tr>
139
  <tr>
140
- <td width="30%" style="color:#DDDDDD;"><?php _e( 'Store demo files on Google Drive', 'music-player-for-woocommerce' ); ?></td>
141
- <td><input aria-label="<?php print esc_attr(__('Store demo files on Google Drive','music-player-for-woocommerce')); ?>" type="checkbox" disabled /></td>
142
  </tr>
143
  <tr>
144
- <td width="30%" style="color:#DDDDDD;"><?php _e( 'Import a JSON Key file', 'music-player-for-woocommerce' ); ?></td>
145
  <td>
146
- <input aria-label="<?php print esc_attr(__('JSON Key file','music-player-for-woocommerce')); ?>" type="file" disabled />
147
  <br /><br />
148
  <div style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;">
149
  <h3>Turn on the Drive API</h3>
@@ -187,196 +189,206 @@ _e(
187
  <td colspan="2"><hr /></td>
188
  </tr>
189
  <tr>
190
- <td colspan="2"><h2><?php _e('Troubleshoot Area', 'music-player-for-woocommerce'); ?></h2></td>
191
  </tr>
192
  <tr>
193
  <td width="30%">
194
- <?php _e( 'On iPads and iPhones, use native controls', 'music-player-for-woocommerce' ); ?>
195
  </td>
196
  <td>
197
- <input aria-label="<?php print esc_attr(__('On iPads and iPhones, use native controls','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_ios_controls" <?php if($ios_controls) print 'CHECKED'; ?>/>
198
- <?php _e( 'tick the checkbox if the players do not work properly on iPads or iPhones', 'music-player-for-woocommerce' ); ?>
 
199
  </td>
200
  </tr>
201
  <tr>
202
  <td width="30%">
203
- <?php _e( 'Loading players in the onload event', 'music-player-for-woocommerce' ); ?>
204
  </td>
205
  <td>
206
- <input aria-label="<?php print esc_attr(__('Loading placeholder in the onload event','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_onload" <?php if($troubleshoot_onload) print 'CHECKED'; ?>/>
207
- <?php _e( 'tick the checkbox if the players are not being loaded properly', 'music-player-for-woocommerce' ); ?>
 
208
  </td>
209
  </tr>
210
  <tr>
211
  <td width="30%">
212
- <?php _e( 'For files whose extensions cannot be determined', 'music-player-for-woocommerce' ); ?>
213
  </td>
214
  <td>
215
- <input aria-label="<?php print esc_attr(__('For files whose extensions cannot be determined, handle them as mp3 files','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_default_extension" <?php if($troubleshoot_default_extension) print 'CHECKED'; ?>/>
216
- <?php _e( 'handle them as mp3 files', 'music-player-for-woocommerce' ); ?>
 
217
  </td>
218
  </tr>
219
  <tr>
220
  <td width="30%">
221
- <?php _e( 'For the WooCommerce Gutenberg Blocks, include the main player in the products titles', 'music-player-for-woocommerce' ); ?>
222
  </td>
223
  <td>
224
- <input aria-label="<?php print esc_attr(__('For the WooCommerce Gutenberg Blocks, include the main player in the products titles','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_force_main_player_in_title" <?php if($force_main_player_in_title) print 'CHECKED'; ?>/>
225
- <?php _e( 'Includes the main player in front of products titles', 'music-player-for-woocommerce' ); ?>
 
226
  </td>
227
  </tr>
228
  <tr>
229
  <td width="30%">
230
- <?php _e( 'WooCommerce hook used to display the players in the shop pages', 'music-player-for-woocommerce' ); ?>
231
  </td>
232
  <td>
233
- <input aria-label="<?php print esc_attr(__('WooCommerce hook used to display the players in the shop pages','music-player-for-woocommerce')); ?>" type="text" name="_wcmp_main_player_hook" value="<?php esc_attr_e($include_main_player_hook); ?>" style="width:100%" /><br />
234
  <?php _e( 'The plugin uses by default the <b>woocommerce_shop_loop_item_title</b> hook. If the player is not being displayed, enter the hook used by the theme active on your website.', 'music-player-for-woocommerce' ); ?><br>
235
- <input type="checkbox" name="_wcmp_main_player_hook_title" aria-label="<?php print esc_attr(__('Force the player in the title', 'music-player-for-woocommerce')); ?>" <?php if($main_player_hook_title) print 'checked'; ?>> <?php _e( 'Forces the audio player to be displayed in the product title.', 'music-player-for-woocommerce' ); ?>
 
236
  </td>
237
  </tr>
238
  <tr>
239
  <td width="30%">
240
- <?php _e( 'WooCommerce hook used to display the players in the products pages', 'music-player-for-woocommerce' ); ?>
241
  </td>
242
  <td>
243
- <input aria-label="<?php print esc_attr(__('WooCommerce hook used to display the players in the products pages','music-player-for-woocommerce')); ?>" type="text" name="_wcmp_all_players_hook" value="<?php esc_attr_e($include_all_players_hook); ?>" style="width:100%" /><br />
244
  <?php _e( 'The plugin uses by default the <b>woocommerce_single_product_summary</b> hook. If the player is not being displayed, enter the hook used by the theme active on your website.', 'music-player-for-woocommerce' ); ?>
245
  </td>
246
  </tr>
247
  <tr>
248
  <td></td>
249
- <td><?php _e('Click on the <a href="https://docs.woocommerce.com/wc-apidocs/hook-docs.html" target="_blank">THIS LINK</a> for the list of available <a href="https://docs.woocommerce.com/wc-apidocs/hook-docs.html" target="_blank" style="font-weight:bold;font-size:1.3em;">WooCommerce Hooks</a>', 'music-player-for-woocommerce'); ?></td>
250
  </tr>
251
  </table>
252
  <table class="widefat wcmp-player-settings" style="border:1px solid #e1e1e1;">
253
  <tr>
254
- <td width="30%"><?php _e( 'Include music player in all products', 'music-player-for-woocommerce' ); ?></td>
255
- <td><div class="wcmp-tooltip"><span class="wcmp-tooltiptext"><?php _e('The player is shown only if the product is "downloadable" with at least an audio file between the "Downloadable files", or you have selected your own audio files', 'music-player-for-woocommerce'); ?></span><input aria-label="<?php print esc_attr(__('Enable player','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_enable_player" <?php echo (( $enable_player ) ? 'checked' : '' ); ?> /></div></td>
256
  </tr>
257
  <tr>
258
- <td width="30%"><?php _e( 'Include in', 'music-player-for-woocommerce' ); ?></td>
259
  <td>
260
- <input aria-label="<?php print esc_attr(__('Products pages only','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_show_in" value="single" <?php echo (( $show_in == 'single' ) ? 'checked' : '' ); ?> />
261
- <?php _e('single-entry pages <i>(Product\'s page only)</i>', 'music-player-for-woocommerce'); ?><br />
262
 
263
- <input aria-label="<?php print esc_attr(__('Multiple-entry pages','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_show_in" value="multiple" <?php echo (( $show_in == 'multiple' ) ? 'checked' : '' ); ?> />
264
- <?php _e('multiple entries pages <i>(Shop pages, archive pages, but not in the product\'s page)</i>', 'music-player-for-woocommerce'); ?><br />
265
 
266
- <input aria-label="<?php print esc_attr(__('Product and multiple-entry pages','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_show_in" value="all" <?php echo (( $show_in == 'all' ) ? 'checked' : '' ); ?> />
267
- <?php _e('all pages <i>(with single or multiple-entries)</i>', 'music-player-for-woocommerce'); ?>
268
  </td>
269
  </tr>
270
  <tr>
271
- <td width="30%"><?php _e( 'Include players in cart', 'music-player-for-woocommerce' ); ?></td>
272
  <td>
273
- <input aria-label="<?php print esc_attr(__('Include players in cart','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_players_in_cart" <?php echo (( $players_in_cart ) ? 'checked' : '' ); ?> />
274
  </td>
275
  </tr>
276
  <tr>
277
- <td width="30%"><?php _e( 'Merge in grouped products', 'music-player-for-woocommerce' ); ?></td>
278
- <td><input aria-label="<?php print esc_attr(__('Merge in grouped products','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_merge_in_grouped" <?php echo (( $merge_grouped ) ? 'checked' : '' ); ?> /><br /><em><?php _e( 'In grouped products, display the "Add to cart" buttons and quantity fields in the players rows', 'music-player-for-woocommerce' ); ?></em></td>
279
  </tr>
280
  <tr>
281
- <td valign="top" width="30%"><?php _e( 'Player layout', 'music-player-for-woocommerce' ); ?></td>
282
  <td>
283
  <table>
284
  <tr>
285
- <td><input aria-label="<?php print esc_attr(__('Skin 1','music-player-for-woocommerce')); ?>" name="_wcmp_player_layout" type="radio" value="mejs-classic" <?php echo (($player_style == 'mejs-classic') ? 'checked' : '') ;?> /></td>
286
- <td><img alt="<?php print esc_attr(__('Skin 1','music-player-for-woocommerce')); ?>" src="<?php print esc_url(WCMP_PLUGIN_URL); ?>/views/assets/skin1.png" /></td>
287
  </tr>
288
 
289
  <tr>
290
- <td><input aria-label="<?php print esc_attr(__('skin 2','music-player-for-woocommerce')); ?>" name="_wcmp_player_layout" type="radio" value="mejs-ted" <?php echo (($player_style == 'mejs-ted') ? 'checked' : '') ;?> /></td>
291
- <td><img alt="<?php print esc_attr(__('Skin 2','music-player-for-woocommerce')); ?>" src="<?php print esc_url(WCMP_PLUGIN_URL); ?>/views/assets/skin2.png" /></td>
292
  </tr>
293
 
294
  <tr>
295
- <td><input aria-label="<?php print esc_attr(__('Skin 3','music-player-for-woocommerce')); ?>" name="_wcmp_player_layout" type="radio" value="mejs-wmp" <?php echo (($player_style == 'mejs-wmp') ? 'checked' : '') ;?> /></td>
296
- <td><img alt="<?php print esc_attr(__('Skin 3','music-player-for-woocommerce')); ?>" src="<?php print esc_url(WCMP_PLUGIN_URL); ?>/views/assets/skin3.png" /></td>
297
  </tr>
298
  </table>
299
  </td>
300
  </tr>
301
  <tr>
302
  <td width="30%">
303
- <?php _e( 'Preload', 'music-player-for-woocommerce' ); ?>
304
  </td>
305
  <td>
306
- <label><input aria-label="<?php print esc_attr(__('Preload - none','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_preload" value="none" <?php if($preload == 'none') echo 'CHECKED'; ?> /> None</label><br />
307
- <label><input aria-label="<?php print esc_attr(__('Preload - metadata','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_preload" value="metadata" <?php if($preload == 'metadata') echo 'CHECKED'; ?> /> Metadata</label><br />
308
- <label><input aria-label="<?php print esc_attr(__('Preload - auto','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_preload" value="auto" <?php if($preload == 'auto') echo 'CHECKED'; ?> /> Auto</label><br />
 
 
 
309
  </td>
310
  </tr>
311
  <tr>
312
  <td width="30%">
313
- <?php _e( 'Play all', 'music-player-for-woocommerce' ); ?>
314
  </td>
315
  <td>
316
- <input aria-label="<?php print esc_attr(__('Play all','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_play_all" <?php if($play_all) echo 'CHECKED'; ?> />
 
317
  </td>
318
  </tr>
319
  <tr>
320
  <td width="30%">
321
- <?php _e( 'Allow multiple players to play simultaneously', 'music-player-for-woocommerce' ); ?>
322
  </td>
323
  <td>
324
- <input aria-label="<?php print esc_attr(__('Allow multiple players to play simultaneously', 'music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_play_simultaneously" <?php if($play_simultaneously) echo 'CHECKED'; ?> /><br />
 
325
  <i><?php
326
- _e('By default, only one player would be playing at once. By pressing the play button of a player, the other players would stop. By ticking the checkbox, multiple players could play simultaneously.', 'music-player-for-woocommerce');
327
  ?></i>
328
  </td>
329
  </tr>
330
  <tr>
331
- <td><?php _e( 'Player volume (from 0 to 1)', 'music-player-for-woocommerce' ); ?></td>
332
  <td>
333
- <input aria-label="<?php print esc_attr(__('Player volume','music-player-for-woocommerce')); ?>" type="number" name="_wcmp_player_volume" min="0" max="1" step="0.01" value="<?php echo esc_attr($volume); ?>" />
334
  </td>
335
  </tr>
336
  <tr>
337
- <td width="30%"><?php _e( 'Player controls', 'music-player-for-woocommerce' ); ?></td>
338
  <td>
339
- <input aria-label="<?php print esc_attr(__('Play/pause button','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_player_controls" value="button" <?php echo (( $player_controls == 'button' ) ? 'checked' : ''); ?> /> <?php _e( 'the play/pause button only', 'music-player-for-woocommerce' ); ?><br />
340
- <input aria-label="<?php print esc_attr(__('All controls','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_player_controls" value="all" <?php echo (( $player_controls == 'all' ) ? 'checked' : ''); ?> /> <?php _e( 'all controls', 'music-player-for-woocommerce' ); ?><br />
341
- <input aria-label="<?php print esc_attr(__('Depending on context','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_player_controls" value="default" <?php echo (( $player_controls == 'default' ) ? 'checked' : ''); ?> /> <?php _e( 'the play/pause button only, or all controls depending on context', 'music-player-for-woocommerce' ); ?>
342
  <div class="wcmp-on-cover" style="margin-top:10px;">
343
- <input aria-label="<?php print esc_attr(__('On cover', 'music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_player_on_cover" value="default" <?php
344
- echo ((!empty($on_cover) && ( $player_controls == 'button' || $player_controls == 'default')) ? 'checked' : '');
345
  ?> />
346
- <?php _e( 'for play/pause button players display them on cover images.', 'music-player-for-woocommerce' ); ?>
347
  <i>
348
  <?php
349
- _e('(This feature is experimental, and will depend on the theme active on the website.)', 'music-player-for-woocommerce');
350
  ?>
351
  </i>
352
  </div>
353
  </td>
354
  </tr>
355
  <tr>
356
- <td width="30%"><?php _e( 'Display the player\'s title', 'music-player-for-woocommerce' ); ?></td>
357
  <td>
358
- <input aria-label="<?php print esc_attr(__('Display the player title','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_player_title" <?php echo (( !empty($player_title) ) ? 'checked' : ''); ?> />
359
  </td>
360
  </tr>
361
  <tr>
362
- <td colspan="2" style="color:red;"><?php _e( 'The security feature is only available in the PRO version of the plugin', 'music-player-for-woocommerce'); ?>. <a target="_blank" href="https://wcmp.dwbooster.com"><?php _e('CLICK HERE TO GET THE PRO VERSION OF THE PLUGIN', 'music-player-for-woocommerce'); ?></a></td>
363
  </tr>
364
  <tr>
365
- <td style="color:#DDDDDD;" width="30%"><?php _e( 'Protect the file', 'music-player-for-woocommerce' ); ?></td>
366
- <td><input aria-label="<?php print esc_attr(__('Protect the file', 'music-player-for-woocommerce')); ?>" type="checkbox" DISABLED /></td>
367
  </tr>
368
  <tr valign="top">
369
- <td style="color:#DDDDDD;" width="30%"><?php _e('Percent of audio used for protected playbacks', 'music-player-for-woocommerce'); ?></td>
370
  <td style="color:#DDDDDD;">
371
- <input aria-label="<?php print esc_attr(__('Percent of audio used for protected playbacks','music-player-for-woocommerce')); ?>" type="number" DISABLED /> % <br />
372
- <em><?php _e('To prevent unauthorized copying of audio files, the files will be partially accessible', 'music-player-for-woocommerce'); ?></em>
373
  </td>
374
  </tr>
375
  <tr valign="top">
376
  <td style="color:#DDDDDD;" width="30%">
377
- <?php _e('Text to display beside the player explaining that demos are partial versions of the original files', 'music-player-for-woocommerce'); ?>
378
  <td style="color:#DDDDDD;">
379
- <textarea aria-label="<?php print esc_attr(__('Explaining that demos are partial versions of the original files','music-player-for-woocommerce')); ?>" style="width:100%;" rows="4" disabled></textarea>
380
  </td>
381
  </tr>
382
 
@@ -390,8 +402,8 @@ _e(
390
  <table class="widefat" style="border:1px solid #e1e1e1;">
391
  <tr>
392
  <td>
393
- <div><?php _e('Scope', 'music-player-for-woocommerce'); ?></div>
394
- <div><div class="wcmp-tooltip"><span class="wcmp-tooltiptext"><?php _e('Ticking the checkbox the previous settings are applied to all products, even if they have a player enabled.', 'music-player-for-woocommerce');?></span><input aria-label="<?php print esc_attr(__('Apply the previous settings to all products','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_apply_to_all_players" /></div> <?php _e('Apply the previous settings to all products pages in the website.', 'music-player-for-woocommerce'); ?></div>
395
  </td>
396
  </tr>
397
  </table>
@@ -403,18 +415,18 @@ _e(
403
  <td>
404
  <table class="widefat" style="border:1px solid #e1e1e1;">
405
  <tr>
406
- <td><h2><?php _e('Analytics', 'music-player-for-woocommerce'); ?></h2></td>
407
  </tr>
408
  <tr>
409
  <td>
410
- <p><?php _e('Allows the integration with Google Analytics for registering new events when the songs are played. The event information would include: the URL to the audio file as the event label and the product\'s id as its value.', 'music-player-for-woocommerce'); ?></p>
411
- <p style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;"><b><?php _e('Note', 'music-player-for-woocommerce')?></b>: <?php _e('If the preload option is configured as Metadata or Auto in the players settings, the event would be registered when the audio file is loaded by the player and not exactly when they are playing.', 'music-player-for-woocommerce');?></p>
412
  </td>
413
  </tr>
414
  <tr>
415
  <td>
416
- <div><?php _e('Tracking Id', 'music-player-for-woocommerce'); ?></div>
417
- <div><input aria-label="<?php print esc_attr(__('Tracking Id','music-player-for-woocommerce')); ?>" type="text" name="_wcmp_analytics_property" value="<?php print esc_attr($analytics_property); ?>" style="width:100%;" placeholder="UA-XXXXX-Y"></div>
418
  </td>
419
  </tr>
420
  </table>
@@ -426,14 +438,14 @@ _e(
426
  <td>
427
  <table class="widefat" style="border:1px solid #e1e1e1;">
428
  <tr>
429
- <td colspan="2"><h2><?php _e('Add ons', 'music-player-for-woocommerce'); ?></h2></td>
430
  </tr>
431
- <?php do_action('wcmp_addon_general_settings'); ?>
432
  </table>
433
  </td>
434
  </tr>
435
  </table>
436
- <div style="margin-top:20px;"><input type="submit" value="<?php _e('Save settings', 'music-player-for-woocommerce'); ?>" class="button-primary" /></div>
437
  </form>
438
  <script>jQuery(window).on('load', function(){
439
  var $ = jQuery;
@@ -449,4 +461,4 @@ _e(
449
  });
450
  coverSection();
451
  });</script>
452
- <style>.wcmp-player-settings tr td:first-child{width:225px;}</style>
1
  <?php
2
+ if ( ! defined( 'WCMP_PLUGIN_URL' ) ) {
3
+ echo 'Direct access not allowed.';
4
+ exit; }
5
 
6
  // include resources
7
+ wp_enqueue_style( 'wcmp-admin-style', plugin_dir_url( __FILE__ ) . '../css/style.admin.css', array(), '1.0.174' );
8
+ wp_enqueue_script( 'wcmp-admin-js', plugin_dir_url( __FILE__ ) . '../js/admin.js', array(), '1.0.174' );
9
 
10
+ $ffmpeg_system_path = defined( 'PHP_OS' ) && strtolower( PHP_OS ) == 'linux' ? @shell_exec( 'which ffmpeg' ) : '';
11
 
12
+ $troubleshoot_default_extension = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_default_extension', false );
13
+ $force_main_player_in_title = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_force_main_player_in_title', 1 );
14
+ $ios_controls = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_ios_controls', false );
15
+ $troubleshoot_onload = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_onload', false );
16
+ $include_main_player_hook = trim( $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_main_player_hook', '' ) );
17
+ $main_player_hook_title = trim( $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_main_player_hook_title', 1 ) );
18
+ $include_all_players_hook = trim( $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_all_players_hook', '' ) );
19
 
20
+ $enable_player = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_enable_player', false );
21
+ $show_in = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_show_in', 'all' );
22
+ $players_in_cart = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_players_in_cart', false );
23
+ $player_style = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_player_layout', WCMP_DEFAULT_PLAYER_LAYOUT );
24
+ $volume = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_player_volume', WCMP_DEFAULT_PLAYER_VOLUME );
25
+ $player_controls = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_player_controls', WCMP_DEFAULT_PLAYER_CONTROLS );
26
+ $player_title = intval( $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_player_title', 1 ) );
27
+ $merge_grouped = intval( $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_merge_in_grouped', 0 ) );
28
+ $preload = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
29
+ '_wcmp_preload',
30
+ // This option is only for compatibility with versions previous to 1.0.28
31
+ $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( 'preload', 'none' )
32
+ );
33
+ $play_simultaneously = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_play_simultaneously', 0 );
34
+ $play_all = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
35
+ '_wcmp_play_all',
36
+ // This option is only for compatibility with versions previous to 1.0.28
37
+ $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( 'play_all', 0 )
38
+ );
39
+ $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_on_cover', 0 ) );
40
+ $analytics_property = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_analytics_property', '' );
41
+ $registered_only = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_registered_only', 0 );
42
+ $fade_out = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_fade_out', 1 );
43
+ $purchased_times_text = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' );
44
  ?>
45
+ <h1><?php esc_html_e( 'Music Player for WooCommerce - Global Settings', 'music-player-for-woocommerce' ); ?></h1>
46
  <div style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;">
47
  <?php
48
  _e(
55
  </div>
56
  <form method="post">
57
  <div class="postbox">
58
+ <h2 class="hndle" style="padding:5px;color:#DDDDDD;"><?php esc_html_e( 'Registering of Plugin', 'music-player-for-woocommerce' ); ?></h2>
59
  <div class="inside">
60
+ <label style="color:#DDDDDD;"><?php esc_html_e( 'Enter the email address of buyer', 'music-player-for-woocommerce' ); ?>:</label>
61
+ <br><input aria-label="<?php esc_attr_e( 'Buyer email', 'music-player-for-woocommerce' ); ?>" type="text" disabled> <input value="<?php esc_attr_e( 'Register', 'music-player-for-woocommerce' ); ?>" disabled class="button-primary">
62
  </div>
63
  </div>
64
  </form>
65
  <form method="post">
66
+ <input type="hidden" name="wcmp_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wcmp_updating_plugin_settings' ) ); ?>" />
67
  <table class="widefat" style="border-left:0;border-right:0;border-bottom:0;padding-bottom:0;">
68
  <tr>
69
  <td>
81
  <td>
82
  <table class="widefat" style="border:1px solid #e1e1e1;margin-bottom:20px;">
83
  <tr>
84
+ <td colspan="2"><h2><?php esc_html_e( 'General Settings', 'music-player-for-woocommerce' ); ?></h2></td>
85
  </tr>
86
  <tr>
87
+ <td width="30%"><?php esc_html_e( 'Include the players only for registered users', 'music-player-for-woocommerce' ); ?></td>
88
+ <td><input aria-label="<?php esc_attr_e( 'Include the players only for registered users', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_registered_only" <?php print( ( $registered_only ) ? 'CHECKED' : '' ); ?> /></td>
89
  </tr>
90
  <tr>
91
+ <td width="30%"><?php esc_html_e( 'Apply fade out to playing audio when possible', 'music-player-for-woocommerce' ); ?></td>
92
+ <td><input aria-label="<?php esc_attr_e( 'Apply fade out to playing audio when possible', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_fade_out" <?php print( ( $fade_out ) ? 'CHECKED' : '' ); ?> /></td>
93
  </tr>
94
  <tr>
95
+ <td width="30%"><?php esc_html_e( 'Text for product purchased times in playlists', 'music-player-for-woocommerce' ); ?></td>
96
+ <td><input aria-label="<?php esc_attr_e( 'Purchased times text', 'music-player-for-woocommerce' ); ?>" type="text" name="_wcmp_purchased_times_text" value="<?php print esc_attr( $purchased_times_text ); ?>" style="width:100%;" /><br>
97
+ <i><?php esc_html_e( 'Texts to display when the playlist shortcode includes the purchased_times attribute.<br>Ex.', 'music-player-for-woocommerce' ); ?>[wcmp-playlist products_ids="*" controls="track" purchased_times="1"]</i>
98
+ </td>
99
  </tr>
100
  <tr>
101
+ <td colspan="2" style="color:red;"><?php esc_html_e( 'The general settings affect only the PRO version of the plugin', 'music-player-for-woocommerce' ); ?>. <a target="_blank" href="https://wcmp.dwbooster.com"><?php esc_html_e( 'CLICK HERE TO GET THE PRO VERSION OF THE PLUGIN', 'music-player-for-woocommerce' ); ?></a></td>
102
  </tr>
103
  <tr>
104
+ <td width="30%" style="color:#DDDDDD;"><?php esc_html_e( 'For buyers, play the purchased audio files instead of the truncated files for demo', 'music-player-for-woocommerce' ); ?></td>
105
  <td style="color:#DDDDDD;">
106
+ <input aria-label="<?php esc_attr_e( 'For buyers, play the purchased audio files instead of the truncated files for demo', 'music-player-for-woocommerce' ); ?>" type="checkbox" DISABLED />
107
+ <?php esc_html_e( 'Reset the files', 'music-player-for-woocommerce' ); ?>
108
+ <select aria-label="<?php esc_attr_e( 'Reset files interval', 'music-player-for-woocommerce' ); ?>" DISABLED>
109
+ <option><?php esc_html_e( 'daily', 'music-player-for-woocommerce' ); ?></option>
110
+ </select>
111
+ </td>
112
  </tr>
113
  <tr>
114
  <td colspan="2"><hr /></td>
115
  </tr>
116
  <tr>
117
+ <td width="30%" style="color:#DDDDDD;"><?php esc_html_e( 'Truncate the audio files for demo with ffmpeg', 'music-player-for-woocommerce' ); ?></td>
118
+ <td><input aria-label="<?php esc_attr_e( 'Truncate the audio files for demo with ffmpeg', 'music-player-for-woocommerce' ); ?>" type="checkbox" DISABLED /></td>
119
  </tr>
120
  <tr>
121
+ <td width="30%" style="color:#DDDDDD;"><?php esc_html_e( 'ffmpeg path', 'music-player-for-woocommerce' ); ?></td>
122
+ <td><input aria-label="<?php esc_attr_e( 'ffmpeg path', 'music-player-for-woocommerce' ); ?>" type="text" value="<?php print esc_attr( ! empty( $ffmpeg_system_path ) ? $ffmpeg_system_path : '' ); ?>" DISABLED style="width:100%;" /></td>
123
  </tr>
124
  <tr>
125
+ <td width="30%" style="color:#DDDDDD"><?php esc_html_e( 'Watermark audio', 'music-player-for-woocommerce' ); ?></td>
126
  <td>
127
+ <input aria-label="<?php esc_attr_e( 'Watermark audio', 'music-player-for-woocommerce' ); ?>" type="text" DISABLED style="width: calc( 100% - 60px );"/><input type="button" class="button-secondary" value="<?php esc_attr_e( 'Select', 'music-player-for-woocommerce' ); ?>" style="float:right;" DISABLED /><br />
128
+ <i style="color:#DDDDDD;"><?php esc_html_e( 'Select an audio file if you want to apply a watermark to the audio files for demos. The watermark will be applied to the protected demos (Experimental feature).', 'music-player-for-woocommerce' ); ?></i>
129
  </td>
130
  </tr>
131
  <tr>
132
  <td colspan="2"><hr /></td>
133
  </tr>
134
  <tr>
135
+ <td width="30%" style="color:#DDDDDD;"><?php esc_html_e( 'Delete the demo files generated previously', 'music-player-for-woocommerce' ); ?></td>
136
+ <td><input aria-label="<?php esc_attr_e( 'Delete the demo files generated previously', 'music-player-for-woocommerce' ); ?>" type="checkbox" DISABLED /></td>
137
  </tr>
138
  <tr>
139
  <td colspan="2"><hr /></td>
140
  </tr>
141
  <tr>
142
+ <td width="30%" style="color:#DDDDDD;"><?php esc_html_e( 'Store demo files on Google Drive', 'music-player-for-woocommerce' ); ?></td>
143
+ <td><input aria-label="<?php esc_attr_e( 'Store demo files on Google Drive', 'music-player-for-woocommerce' ); ?>" type="checkbox" disabled /></td>
144
  </tr>
145
  <tr>
146
+ <td width="30%" style="color:#DDDDDD;"><?php esc_html_e( 'Import a JSON Key file', 'music-player-for-woocommerce' ); ?></td>
147
  <td>
148
+ <input aria-label="<?php esc_attr_e( 'JSON Key file', 'music-player-for-woocommerce' ); ?>" type="file" disabled />
149
  <br /><br />
150
  <div style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;">
151
  <h3>Turn on the Drive API</h3>
189
  <td colspan="2"><hr /></td>
190
  </tr>
191
  <tr>
192
+ <td colspan="2"><h2><?php esc_html_e( 'Troubleshoot Area', 'music-player-for-woocommerce' ); ?></h2></td>
193
  </tr>
194
  <tr>
195
  <td width="30%">
196
+ <?php esc_html_e( 'On iPads and iPhones, use native controls', 'music-player-for-woocommerce' ); ?>
197
  </td>
198
  <td>
199
+ <input aria-label="<?php esc_attr_e( 'On iPads and iPhones, use native controls', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_ios_controls" <?php if ( $ios_controls ) {
200
+ print 'CHECKED';} ?>/>
201
+ <?php esc_html_e( 'tick the checkbox if the players do not work properly on iPads or iPhones', 'music-player-for-woocommerce' ); ?>
202
  </td>
203
  </tr>
204
  <tr>
205
  <td width="30%">
206
+ <?php esc_html_e( 'Loading players in the onload event', 'music-player-for-woocommerce' ); ?>
207
  </td>
208
  <td>
209
+ <input aria-label="<?php esc_attr_e( 'Loading placeholder in the onload event', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_onload" <?php if ( $troubleshoot_onload ) {
210
+ print 'CHECKED';} ?>/>
211
+ <?php esc_html_e( 'tick the checkbox if the players are not being loaded properly', 'music-player-for-woocommerce' ); ?>
212
  </td>
213
  </tr>
214
  <tr>
215
  <td width="30%">
216
+ <?php esc_html_e( 'For files whose extensions cannot be determined', 'music-player-for-woocommerce' ); ?>
217
  </td>
218
  <td>
219
+ <input aria-label="<?php esc_attr_e( 'For files whose extensions cannot be determined, handle them as mp3 files', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_default_extension" <?php if ( $troubleshoot_default_extension ) {
220
+ print 'CHECKED';} ?>/>
221
+ <?php esc_html_e( 'handle them as mp3 files', 'music-player-for-woocommerce' ); ?>
222
  </td>
223
  </tr>
224
  <tr>
225
  <td width="30%">
226
+ <?php esc_html_e( 'For the WooCommerce Gutenberg Blocks, include the main player in the products titles', 'music-player-for-woocommerce' ); ?>
227
  </td>
228
  <td>
229
+ <input aria-label="<?php esc_attr_e( 'For the WooCommerce Gutenberg Blocks, include the main player in the products titles', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_force_main_player_in_title" <?php if ( $force_main_player_in_title ) {
230
+ print 'CHECKED';} ?>/>
231
+ <?php esc_html_e( 'Includes the main player in front of products titles', 'music-player-for-woocommerce' ); ?>
232
  </td>
233
  </tr>
234
  <tr>
235
  <td width="30%">
236
+ <?php esc_html_e( 'WooCommerce hook used to display the players in the shop pages', 'music-player-for-woocommerce' ); ?>
237
  </td>
238
  <td>
239
+ <input aria-label="<?php esc_attr_e( 'WooCommerce hook used to display the players in the shop pages', 'music-player-for-woocommerce' ); ?>" type="text" name="_wcmp_main_player_hook" value="<?php print esc_attr( $include_main_player_hook ); ?>" style="width:100%" /><br />
240
  <?php _e( 'The plugin uses by default the <b>woocommerce_shop_loop_item_title</b> hook. If the player is not being displayed, enter the hook used by the theme active on your website.', 'music-player-for-woocommerce' ); ?><br>
241
+ <input type="checkbox" name="_wcmp_main_player_hook_title" aria-label="<?php esc_attr_e( 'Force the player in the title', 'music-player-for-woocommerce' ); ?>" <?php if ( $main_player_hook_title ) {
242
+ print 'checked';} ?>> <?php esc_html_e( 'Forces the audio player to be displayed in the product title.', 'music-player-for-woocommerce' ); ?>
243
  </td>
244
  </tr>
245
  <tr>
246
  <td width="30%">
247
+ <?php esc_html_e( 'WooCommerce hook used to display the players in the products pages', 'music-player-for-woocommerce' ); ?>
248
  </td>
249
  <td>
250
+ <input aria-label="<?php esc_attr_e( 'WooCommerce hook used to display the players in the products pages', 'music-player-for-woocommerce' ); ?>" type="text" name="_wcmp_all_players_hook" value="<?php print esc_attr( $include_all_players_hook ); ?>" style="width:100%" /><br />
251
  <?php _e( 'The plugin uses by default the <b>woocommerce_single_product_summary</b> hook. If the player is not being displayed, enter the hook used by the theme active on your website.', 'music-player-for-woocommerce' ); ?>
252
  </td>
253
  </tr>
254
  <tr>
255
  <td></td>
256
+ <td><?php _e( 'Click on the <a href="https://docs.woocommerce.com/wc-apidocs/hook-docs.html" target="_blank">THIS LINK</a> for the list of available <a href="https://docs.woocommerce.com/wc-apidocs/hook-docs.html" target="_blank" style="font-weight:bold;font-size:1.3em;">WooCommerce Hooks</a>', 'music-player-for-woocommerce' ); ?></td>
257
  </tr>
258
  </table>
259
  <table class="widefat wcmp-player-settings" style="border:1px solid #e1e1e1;">
260
  <tr>
261
+ <td width="30%"><?php esc_html_e( 'Include music player in all products', 'music-player-for-woocommerce' ); ?></td>
262
+ <td><div class="wcmp-tooltip"><span class="wcmp-tooltiptext"><?php esc_html_e( 'The player is shown only if the product is "downloadable" with at least an audio file between the "Downloadable files", or you have selected your own audio files', 'music-player-for-woocommerce' ); ?></span><input aria-label="<?php esc_attr_e( 'Enable player', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_enable_player" <?php echo ( ( $enable_player ) ? 'checked' : '' ); ?> /></div></td>
263
  </tr>
264
  <tr>
265
+ <td width="30%"><?php esc_html_e( 'Include in', 'music-player-for-woocommerce' ); ?></td>
266
  <td>
267
+ <input aria-label="<?php esc_attr_e( 'Products pages only', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="single" <?php echo ( ( 'single' == $show_in ) ? 'checked' : '' ); ?> />
268
+ <?php _e( 'single-entry pages <i>(Product\'s page only)</i>', 'music-player-for-woocommerce' ); ?><br />
269
 
270
+ <input aria-label="<?php esc_attr_e( 'Multiple-entry pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="multiple" <?php echo ( ( 'multiple' == $show_in ) ? 'checked' : '' ); ?> />
271
+ <?php _e( 'multiple entries pages <i>(Shop pages, archive pages, but not in the product\'s page)</i>', 'music-player-for-woocommerce' ); ?><br />
272
 
273
+ <input aria-label="<?php esc_attr_e( 'Product and multiple-entry pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="all" <?php echo ( ( 'all' == $show_in ) ? 'checked' : '' ); ?> />
274
+ <?php _e( 'all pages <i>(with single or multiple-entries)</i>', 'music-player-for-woocommerce' ); ?>
275
  </td>
276
  </tr>
277
  <tr>
278
+ <td width="30%"><?php esc_html_e( 'Include players in cart', 'music-player-for-woocommerce' ); ?></td>
279
  <td>
280
+ <input aria-label="<?php esc_attr_e( 'Include players in cart', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_players_in_cart" <?php echo ( ( $players_in_cart ) ? 'checked' : '' ); ?> />
281
  </td>
282
  </tr>
283
  <tr>
284
+ <td width="30%"><?php esc_html_e( 'Merge in grouped products', 'music-player-for-woocommerce' ); ?></td>
285
+ <td><input aria-label="<?php esc_attr_e( 'Merge in grouped products', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_merge_in_grouped" <?php echo ( ( $merge_grouped ) ? 'checked' : '' ); ?> /><br /><em><?php esc_html_e( 'In grouped products, display the "Add to cart" buttons and quantity fields in the players rows', 'music-player-for-woocommerce' ); ?></em></td>
286
  </tr>
287
  <tr>
288
+ <td valign="top" width="30%"><?php esc_html_e( 'Player layout', 'music-player-for-woocommerce' ); ?></td>
289
  <td>
290
  <table>
291
  <tr>
292
+ <td><input aria-label="<?php esc_attr_e( 'Skin 1', 'music-player-for-woocommerce' ); ?>" name="_wcmp_player_layout" type="radio" value="mejs-classic" <?php echo ( ( 'mejs-classic' == $player_style ) ? 'checked' : '' ); ?> /></td>
293
+ <td><img alt="<?php esc_attr_e( 'Skin 1', 'music-player-for-woocommerce' ); ?>" src="<?php print esc_url( WCMP_PLUGIN_URL ); ?>/views/assets/skin1.png" /></td>
294
  </tr>
295
 
296
  <tr>
297
+ <td><input aria-label="<?php esc_attr_e( 'skin 2', 'music-player-for-woocommerce' ); ?>" name="_wcmp_player_layout" type="radio" value="mejs-ted" <?php echo ( ( 'mejs-ted' == $player_style ) ? 'checked' : '' ); ?> /></td>
298
+ <td><img alt="<?php esc_attr_e( 'Skin 2', 'music-player-for-woocommerce' ); ?>" src="<?php print esc_url( WCMP_PLUGIN_URL ); ?>/views/assets/skin2.png" /></td>
299
  </tr>
300
 
301
  <tr>
302
+ <td><input aria-label="<?php esc_attr_e( 'Skin 3', 'music-player-for-woocommerce' ); ?>" name="_wcmp_player_layout" type="radio" value="mejs-wmp" <?php echo ( ( 'mejs-wmp' == $player_style ) ? 'checked' : '' ); ?> /></td>
303
+ <td><img alt="<?php esc_attr_e( 'Skin 3', 'music-player-for-woocommerce' ); ?>" src="<?php print esc_url( WCMP_PLUGIN_URL ); ?>/views/assets/skin3.png" /></td>
304
  </tr>
305
  </table>
306
  </td>
307
  </tr>
308
  <tr>
309
  <td width="30%">
310
+ <?php esc_html_e( 'Preload', 'music-player-for-woocommerce' ); ?>
311
  </td>
312
  <td>
313
+ <label><input aria-label="<?php esc_attr_e( 'Preload - none', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_preload" value="none" <?php if ( 'none' == $preload ) {
314
+ echo 'CHECKED';} ?> /> None</label><br />
315
+ <label><input aria-label="<?php esc_attr_e( 'Preload - metadata', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_preload" value="metadata" <?php if ( 'metadata' == $preload ) {
316
+ echo 'CHECKED';} ?> /> Metadata</label><br />
317
+ <label><input aria-label="<?php esc_attr_e( 'Preload - auto', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_preload" value="auto" <?php if ( 'auto' == $preload ) {
318
+ echo 'CHECKED';} ?> /> Auto</label><br />
319
  </td>
320
  </tr>
321
  <tr>
322
  <td width="30%">
323
+ <?php esc_html_e( 'Play all', 'music-player-for-woocommerce' ); ?>
324
  </td>
325
  <td>
326
+ <input aria-label="<?php esc_attr_e( 'Play all', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_play_all" <?php if ( $play_all ) {
327
+ echo 'CHECKED';} ?> />
328
  </td>
329
  </tr>
330
  <tr>
331
  <td width="30%">
332
+ <?php esc_html_e( 'Allow multiple players to play simultaneously', 'music-player-for-woocommerce' ); ?>
333
  </td>
334
  <td>
335
+ <input aria-label="<?php esc_attr_e( 'Allow multiple players to play simultaneously', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_play_simultaneously" <?php if ( $play_simultaneously ) {
336
+ echo 'CHECKED';} ?> /><br />
337
  <i><?php
338
+ esc_html_e( 'By default, only one player would be playing at once. By pressing the play button of a player, the other players would stop. By ticking the checkbox, multiple players could play simultaneously.', 'music-player-for-woocommerce' );
339
  ?></i>
340
  </td>
341
  </tr>
342
  <tr>
343
+ <td><?php esc_html_e( 'Player volume (from 0 to 1)', 'music-player-for-woocommerce' ); ?></td>
344
  <td>
345
+ <input aria-label="<?php esc_attr_e( 'Player volume', 'music-player-for-woocommerce' ); ?>" type="number" name="_wcmp_player_volume" min="0" max="1" step="0.01" value="<?php echo esc_attr( $volume ); ?>" />
346
  </td>
347
  </tr>
348
  <tr>
349
+ <td width="30%"><?php esc_html_e( 'Player controls', 'music-player-for-woocommerce' ); ?></td>
350
  <td>
351
+ <input aria-label="<?php esc_attr_e( 'Play/pause button', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_player_controls" value="button" <?php echo ( ( 'button' == $player_controls ) ? 'checked' : '' ); ?> /> <?php esc_html_e( 'the play/pause button only', 'music-player-for-woocommerce' ); ?><br />
352
+ <input aria-label="<?php esc_attr_e( 'All controls', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_player_controls" value="all" <?php echo ( ( 'all' == $player_controls ) ? 'checked' : '' ); ?> /> <?php esc_html_e( 'all controls', 'music-player-for-woocommerce' ); ?><br />
353
+ <input aria-label="<?php esc_attr_e( 'Depending on context', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_player_controls" value="default" <?php echo ( ( 'default' == $player_controls ) ? 'checked' : '' ); ?> /> <?php esc_html_e( 'the play/pause button only, or all controls depending on context', 'music-player-for-woocommerce' ); ?>
354
  <div class="wcmp-on-cover" style="margin-top:10px;">
355
+ <input aria-label="<?php esc_attr_e( 'On cover', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_player_on_cover" value="default" <?php
356
+ echo ( ( ! empty( $on_cover ) && ( 'button' == $player_controls || 'default' == $player_controls ) ) ? 'checked' : '' );
357
  ?> />
358
+ <?php esc_html_e( 'for play/pause button players display them on cover images.', 'music-player-for-woocommerce' ); ?>
359
  <i>
360
  <?php
361
+ esc_html_e( '(This feature is experimental, and will depend on the theme active on the website.)', 'music-player-for-woocommerce' );
362
  ?>
363
  </i>
364
  </div>
365
  </td>
366
  </tr>
367
  <tr>
368
+ <td width="30%"><?php esc_html_e( 'Display the player\'s title', 'music-player-for-woocommerce' ); ?></td>
369
  <td>
370
+ <input aria-label="<?php esc_attr_e( 'Display the player title', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_player_title" <?php echo ( ( ! empty( $player_title ) ) ? 'checked' : '' ); ?> />
371
  </td>
372
  </tr>
373
  <tr>
374
+ <td colspan="2" style="color:red;"><?php esc_html_e( 'The security feature is only available in the PRO version of the plugin', 'music-player-for-woocommerce' ); ?>. <a target="_blank" href="https://wcmp.dwbooster.com"><?php esc_html_e( 'CLICK HERE TO GET THE PRO VERSION OF THE PLUGIN', 'music-player-for-woocommerce' ); ?></a></td>
375
  </tr>
376
  <tr>
377
+ <td style="color:#DDDDDD;" width="30%"><?php esc_html_e( 'Protect the file', 'music-player-for-woocommerce' ); ?></td>
378
+ <td><input aria-label="<?php esc_attr_e( 'Protect the file', 'music-player-for-woocommerce' ); ?>" type="checkbox" DISABLED /></td>
379
  </tr>
380
  <tr valign="top">
381
+ <td style="color:#DDDDDD;" width="30%"><?php esc_html_e( 'Percent of audio used for protected playbacks', 'music-player-for-woocommerce' ); ?></td>
382
  <td style="color:#DDDDDD;">
383
+ <input aria-label="<?php esc_attr_e( 'Percent of audio used for protected playbacks', 'music-player-for-woocommerce' ); ?>" type="number" DISABLED /> % <br />
384
+ <em><?php esc_html_e( 'To prevent unauthorized copying of audio files, the files will be partially accessible', 'music-player-for-woocommerce' ); ?></em>
385
  </td>
386
  </tr>
387
  <tr valign="top">
388
  <td style="color:#DDDDDD;" width="30%">
389
+ <?php esc_html_e( 'Text to display beside the player explaining that demos are partial versions of the original files', 'music-player-for-woocommerce' ); ?>
390
  <td style="color:#DDDDDD;">
391
+ <textarea aria-label="<?php esc_attr_e( 'Explaining that demos are partial versions of the original files', 'music-player-for-woocommerce' ); ?>" style="width:100%;" rows="4" disabled></textarea>
392
  </td>
393
  </tr>
394
 
402
  <table class="widefat" style="border:1px solid #e1e1e1;">
403
  <tr>
404
  <td>
405
+ <div><?php esc_html_e( 'Scope', 'music-player-for-woocommerce' ); ?></div>
406
+ <div><div class="wcmp-tooltip"><span class="wcmp-tooltiptext"><?php esc_html_e( 'Ticking the checkbox the previous settings are applied to all products, even if they have a player enabled.', 'music-player-for-woocommerce' ); ?></span><input aria-label="<?php esc_attr_e( 'Apply the previous settings to all products', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_apply_to_all_players" /></div> <?php esc_html_e( 'Apply the previous settings to all products pages in the website.', 'music-player-for-woocommerce' ); ?></div>
407
  </td>
408
  </tr>
409
  </table>
415
  <td>
416
  <table class="widefat" style="border:1px solid #e1e1e1;">
417
  <tr>
418
+ <td><h2><?php esc_html_e( 'Analytics', 'music-player-for-woocommerce' ); ?></h2></td>
419
  </tr>
420
  <tr>
421
  <td>
422
+ <p><?php esc_html_e( 'Allows the integration with Google Analytics for registering new events when the songs are played. The event information would include: the URL to the audio file as the event label and the product\'s id as its value.', 'music-player-for-woocommerce' ); ?></p>
423
+ <p style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;"><b><?php esc_html_e( 'Note', 'music-player-for-woocommerce' ); ?></b>: <?php esc_html_e( 'If the preload option is configured as Metadata or Auto in the players settings, the event would be registered when the audio file is loaded by the player and not exactly when they are playing.', 'music-player-for-woocommerce' ); ?></p>
424
  </td>
425
  </tr>
426
  <tr>
427
  <td>
428
+ <div><?php esc_html_e( 'Tracking Id', 'music-player-for-woocommerce' ); ?></div>
429
+ <div><input aria-label="<?php esc_attr_e( 'Tracking Id', 'music-player-for-woocommerce' ); ?>" type="text" name="_wcmp_analytics_property" value="<?php print esc_attr( $analytics_property ); ?>" style="width:100%;" placeholder="UA-XXXXX-Y"></div>
430
  </td>
431
  </tr>
432
  </table>
438
  <td>
439
  <table class="widefat" style="border:1px solid #e1e1e1;">
440
  <tr>
441
+ <td colspan="2"><h2><?php esc_html_e( 'Add ons', 'music-player-for-woocommerce' ); ?></h2></td>
442
  </tr>
443
+ <?php do_action( 'wcmp_addon_general_settings' ); ?>
444
  </table>
445
  </td>
446
  </tr>
447
  </table>
448
+ <div style="margin-top:20px;"><input type="submit" value="<?php esc_attr_e( 'Save settings', 'music-player-for-woocommerce' ); ?>" class="button-primary" /></div>
449
  </form>
450
  <script>jQuery(window).on('load', function(){
451
  var $ = jQuery;
461
  });
462
  coverSection();
463
  });</script>
464
+ <style>.wcmp-player-settings tr td:first-child{width:225px;}</style>
wcmp.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Music Player for WooCommerce
4
  Plugin URI: https://wcmp.dwbooster.com
5
- Version: 1.0.173
6
  Text Domain: music-player-for-woocommerce
7
  Author: CodePeople
8
  Author URI: https://wcmp.dwbooster.com
@@ -431,7 +431,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
431
  wp_enqueue_style( 'wcmp-style', plugin_dir_url( __FILE__ ) . 'css/style.css' );
432
  wp_enqueue_script( 'jquery' );
433
  wp_enqueue_script( 'wp-mediaelement' );
434
- wp_enqueue_script( 'wcmp-script', plugin_dir_url( __FILE__ ) . 'js/public.js', array( 'jquery', 'wp-mediaelement' ), '1.0.173' );
435
 
436
  $play_all = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
437
  '_wcmp_play_all',
@@ -652,8 +652,8 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
652
  // Enqueue resources
653
 
654
  $this->enqueue_resources();
655
- wp_enqueue_style( 'wcmp-playlist-widget-style', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/css/style.css', array(), '1.0.173' );
656
- wp_enqueue_script( 'wcmp-playlist-widget-script', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/js/public.js', array(), '1.0.173' );
657
  wp_localize_script(
658
  'wcmp-playlist-widget-script',
659
  'wcmp_widget_settings',
2
  /*
3
  Plugin Name: Music Player for WooCommerce
4
  Plugin URI: https://wcmp.dwbooster.com
5
+ Version: 1.0.174
6
  Text Domain: music-player-for-woocommerce
7
  Author: CodePeople
8
  Author URI: https://wcmp.dwbooster.com
431
  wp_enqueue_style( 'wcmp-style', plugin_dir_url( __FILE__ ) . 'css/style.css' );
432
  wp_enqueue_script( 'jquery' );
433
  wp_enqueue_script( 'wp-mediaelement' );
434
+ wp_enqueue_script( 'wcmp-script', plugin_dir_url( __FILE__ ) . 'js/public.js', array( 'jquery', 'wp-mediaelement' ), '1.0.174' );
435
 
436
  $play_all = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
437
  '_wcmp_play_all',
652
  // Enqueue resources
653
 
654
  $this->enqueue_resources();
655
+ wp_enqueue_style( 'wcmp-playlist-widget-style', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/css/style.css', array(), '1.0.174' );
656
+ wp_enqueue_script( 'wcmp-playlist-widget-script', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/js/public.js', array(), '1.0.174' );
657
  wp_localize_script(
658
  'wcmp-playlist-widget-script',
659
  'wcmp_widget_settings',