Music Player for WooCommerce - Version 1.0.179

Version Description

  • Improves the plugin code.
Download this release

Release Info

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

Code changes from version 1.0.178 to 1.0.179

addons/ap-compact-audio-player.addon.php CHANGED
@@ -27,7 +27,7 @@ if ( ! class_exists( 'WCMP_COMPACTAUDIOPLAYER_ADDON' ) ) {
27
 
28
  print '<tr><td><input aria-label="' . esc_attr__( 'Use Compact Audio Player instead of the current plugin players', 'music-player-for-woocommerce' ) . '" type="radio" value="compactaudioplayer" name="wcmp_addon_player" ' . ( $enabled ? 'CHECKED' : '' ) . ( $this->_player_exists() ? '' : ' DISABLED' ) . ' class="wcmp_radio"></td><td width="100%"><b>' . esc_html__( 'Use "Compact Audio Player" instead of the current plugin players', 'music-player-for-woocommerce' ) . '</b><br><i>' .
29
  ( $this->_player_exists()
30
- ? __( 'The player functions configured above do not apply, except for audio protection if applicable.<br>This player <b>will take precedence</b> over the player configured in the products\' settings.', 'music-player-for-woocommerce' )
31
  : esc_html__( 'The "Compact WP Audio Player" plugin is not installed on your WordPress.', 'music-player-for-woocommerce' )
32
  )
33
  . '</i></td></tr>';
@@ -35,8 +35,8 @@ if ( ! class_exists( 'WCMP_COMPACTAUDIOPLAYER_ADDON' ) ) {
35
 
36
  public function save_general_settings() {
37
  if ( $this->_player_exists() ) {
38
- if ( isset( $_POST['wcmp_addon_player'] ) ) {
39
- update_option( 'wcmp_addon_player', sanitize_text_field( wp_unslash( $_POST['wcmp_addon_player'] ) ) );
40
  } else {
41
  delete_option( 'wcmp_addon_player' );
42
  }
27
 
28
  print '<tr><td><input aria-label="' . esc_attr__( 'Use Compact Audio Player instead of the current plugin players', 'music-player-for-woocommerce' ) . '" type="radio" value="compactaudioplayer" name="wcmp_addon_player" ' . ( $enabled ? 'CHECKED' : '' ) . ( $this->_player_exists() ? '' : ' DISABLED' ) . ' class="wcmp_radio"></td><td width="100%"><b>' . esc_html__( 'Use "Compact Audio Player" instead of the current plugin players', 'music-player-for-woocommerce' ) . '</b><br><i>' .
29
  ( $this->_player_exists()
30
+ ? __( 'The player functions configured above do not apply, except for audio protection if applicable.<br>This player <b>will take precedence</b> over the player configured in the products\' settings.', 'music-player-for-woocommerce' ) // phpcs:ignore WordPress.Security.EscapeOutput
31
  : esc_html__( 'The "Compact WP Audio Player" plugin is not installed on your WordPress.', 'music-player-for-woocommerce' )
32
  )
33
  . '</i></td></tr>';
35
 
36
  public function save_general_settings() {
37
  if ( $this->_player_exists() ) {
38
+ if ( isset( $_POST['wcmp_addon_player'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
39
+ update_option( 'wcmp_addon_player', sanitize_text_field( wp_unslash( $_POST['wcmp_addon_player'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification
40
  } else {
41
  delete_option( 'wcmp_addon_player' );
42
  }
addons/ap-cp-media-player.addon.php CHANGED
@@ -60,7 +60,7 @@ if ( ! class_exists( 'WCMP_CPMEDIAPLAYER_ADDON' ) ) {
60
  ' . esc_html__( 'Select player skin', 'music-player-for-woocommerce' ) . ': <select name="wcmp_cpmediaplayer_addon_skin" ' . ( $this->_player_exists() ? '' : ' DISABLED' ) . '>' . esc_html( $this->_load_skins( $this->_get_skin() ) ) . '</select>
61
  <br><i>' .
62
  ( $this->_player_exists()
63
- ? __( 'The player functions configured above do not apply, except for audio protection if applicable.<br>This player <b>will take precedence</b> over the player configured in the products\' settings.', 'music-player-for-woocommerce' )
64
  : esc_html__( 'The "CP Media Player" plugin is not installed on your WordPress.', 'music-player-for-woocommerce' )
65
  )
66
  . '</i></td></tr>';
@@ -68,21 +68,21 @@ if ( ! class_exists( 'WCMP_CPMEDIAPLAYER_ADDON' ) ) {
68
 
69
  public function save_general_settings() {
70
  if ( $this->_player_exists() ) {
71
- if ( isset( $_POST['wcmp_addon_player'] ) ) {
72
- update_option( 'wcmp_addon_player', sanitize_text_field( wp_unslash( $_POST['wcmp_addon_player'] ) ) );
73
  } else {
74
  delete_option( 'wcmp_addon_player' );
75
  }
76
 
77
- if ( isset( $_POST['wcmp_cpmediaplayer_addon_skin'] ) ) {
78
- $this->_set_skin( sanitize_text_field( wp_unslash( $_POST['wcmp_cpmediaplayer_addon_skin'] ) ) );
79
  }
80
  }
81
  } // End save_general_settings
82
 
83
  public function generate_player( $player, $product_id, $file_index, $url ) {
84
  if ( $this->_player_exists() && $this->_is_enabled() ) {
85
- wp_enqueue_style( 'wcmp-ap-cp-media-player-style', plugin_dir_url( __FILE__ ) . 'ap-cp-media-player/style.css', array(), '1.0.178' );
86
  return do_shortcode( '[cpm-player skin="' . esc_attr( $this->_get_skin() ) . '" playlist="false" type="audio"][cpm-item file="' . esc_attr( $url ) . '"][/cpm-player]' );
87
  }
88
  return $player;
60
  ' . esc_html__( 'Select player skin', 'music-player-for-woocommerce' ) . ': <select name="wcmp_cpmediaplayer_addon_skin" ' . ( $this->_player_exists() ? '' : ' DISABLED' ) . '>' . esc_html( $this->_load_skins( $this->_get_skin() ) ) . '</select>
61
  <br><i>' .
62
  ( $this->_player_exists()
63
+ ? __( 'The player functions configured above do not apply, except for audio protection if applicable.<br>This player <b>will take precedence</b> over the player configured in the products\' settings.', 'music-player-for-woocommerce' ) // phpcs:ignore WordPress.Security.EscapeOutput
64
  : esc_html__( 'The "CP Media Player" plugin is not installed on your WordPress.', 'music-player-for-woocommerce' )
65
  )
66
  . '</i></td></tr>';
68
 
69
  public function save_general_settings() {
70
  if ( $this->_player_exists() ) {
71
+ if ( isset( $_POST['wcmp_addon_player'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
72
+ update_option( 'wcmp_addon_player', sanitize_text_field( wp_unslash( $_POST['wcmp_addon_player'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification
73
  } else {
74
  delete_option( 'wcmp_addon_player' );
75
  }
76
 
77
+ if ( isset( $_POST['wcmp_cpmediaplayer_addon_skin'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
78
+ $this->_set_skin( sanitize_text_field( wp_unslash( $_POST['wcmp_cpmediaplayer_addon_skin'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification
79
  }
80
  }
81
  } // End save_general_settings
82
 
83
  public function generate_player( $player, $product_id, $file_index, $url ) {
84
  if ( $this->_player_exists() && $this->_is_enabled() ) {
85
+ wp_enqueue_style( 'wcmp-ap-cp-media-player-style', plugin_dir_url( __FILE__ ) . 'ap-cp-media-player/style.css', array(), WCMP_VERSION );
86
  return do_shortcode( '[cpm-player skin="' . esc_attr( $this->_get_skin() ) . '" playlist="false" type="audio"][cpm-item file="' . esc_attr( $url ) . '"][/cpm-player]' );
87
  }
88
  return $player;
addons/ap-html5-audio-player.addon.php CHANGED
@@ -29,7 +29,7 @@ if ( ! class_exists( 'WCMP_HTML5AUDIOPLAYER_ADDON' ) ) {
29
 
30
  print '<tr><td><input aria-label="' . esc_attr__( 'Use HTML5 Audio Player instead of the current plugin players', 'music-player-for-woocommerce' ) . '" type="radio" value="html5audioplayer" name="wcmp_addon_player" ' . ( $enabled ? 'CHECKED' : '' ) . ( $this->_player_exists() ? '' : ' DISABLED' ) . ' class="wcmp_radio"></td><td width="100%"><b>' . esc_html__( 'Use "HTML5 Audio Player" instead of the current plugin players', 'music-player-for-woocommerce' ) . '</b><br><i>' .
31
  ( $this->_player_exists()
32
- ? __( 'The player functions configured above do not apply, except for audio protection if applicable.<br>This player <b>will take precedence</b> over the player configured in the products\' settings.', 'music-player-for-woocommerce' )
33
  : esc_html__( 'The "HTML5 Audio Player" plugin is not installed on your WordPress.', 'music-player-for-woocommerce' )
34
  )
35
  . '</i></td></tr>';
@@ -37,8 +37,8 @@ if ( ! class_exists( 'WCMP_HTML5AUDIOPLAYER_ADDON' ) ) {
37
 
38
  public function save_general_settings() {
39
  if ( $this->_player_exists() ) {
40
- if ( isset( $_POST['wcmp_addon_player'] ) ) {
41
- update_option( 'wcmp_addon_player', sanitize_text_field( wp_unslash( $_POST['wcmp_addon_player'] ) ) );
42
  } else {
43
  delete_option( 'wcmp_addon_player' );
44
  }
@@ -47,7 +47,7 @@ if ( ! class_exists( 'WCMP_HTML5AUDIOPLAYER_ADDON' ) ) {
47
 
48
  public function generate_player( $player, $product_id, $file_index, $url ) {
49
  if ( $this->_player_exists() && $this->_is_enabled() ) {
50
- wp_enqueue_style( 'wcmp-ap-html5-audio-player-style', plugin_dir_url( __FILE__ ) . 'ap-html5-audio-player/style.css', array(), '1.0.178' );
51
  $this->_player_flag = true;
52
  $d = '';
53
  if ( preg_match( '/data-duration="[^"]+"/', $player, $matches ) ) {
29
 
30
  print '<tr><td><input aria-label="' . esc_attr__( 'Use HTML5 Audio Player instead of the current plugin players', 'music-player-for-woocommerce' ) . '" type="radio" value="html5audioplayer" name="wcmp_addon_player" ' . ( $enabled ? 'CHECKED' : '' ) . ( $this->_player_exists() ? '' : ' DISABLED' ) . ' class="wcmp_radio"></td><td width="100%"><b>' . esc_html__( 'Use "HTML5 Audio Player" instead of the current plugin players', 'music-player-for-woocommerce' ) . '</b><br><i>' .
31
  ( $this->_player_exists()
32
+ ? __( 'The player functions configured above do not apply, except for audio protection if applicable.<br>This player <b>will take precedence</b> over the player configured in the products\' settings.', 'music-player-for-woocommerce' ) // phpcs:ignore WordPress.Security.EscapeOutput
33
  : esc_html__( 'The "HTML5 Audio Player" plugin is not installed on your WordPress.', 'music-player-for-woocommerce' )
34
  )
35
  . '</i></td></tr>';
37
 
38
  public function save_general_settings() {
39
  if ( $this->_player_exists() ) {
40
+ if ( isset( $_POST['wcmp_addon_player'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
41
+ update_option( 'wcmp_addon_player', sanitize_text_field( wp_unslash( $_POST['wcmp_addon_player'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification
42
  } else {
43
  delete_option( 'wcmp_addon_player' );
44
  }
47
 
48
  public function generate_player( $player, $product_id, $file_index, $url ) {
49
  if ( $this->_player_exists() && $this->_is_enabled() ) {
50
+ wp_enqueue_style( 'wcmp-ap-html5-audio-player-style', plugin_dir_url( __FILE__ ) . 'ap-html5-audio-player/style.css', array(), WCMP_VERSION );
51
  $this->_player_flag = true;
52
  $d = '';
53
  if ( preg_match( '/data-duration="[^"]+"/', $player, $matches ) ) {
addons/ap-mp3-jplayer.addon.php CHANGED
@@ -27,7 +27,7 @@ if ( ! class_exists( 'WCMP_MP3JPLAYER_ADDON' ) ) {
27
 
28
  print '<tr><td><input aria-label="' . esc_attr__( 'Use MP3 jPlayer instead of the current plugin players', 'music-player-for-woocommerce' ) . '" type="radio" value="mp3jplayer" name="wcmp_addon_player" ' . ( $enabled ? 'CHECKED' : '' ) . ( $this->_player_exists() ? '' : ' DISABLED' ) . ' class="wcmp_radio"></td><td width="100%"><b>' . esc_html__( 'Use "MP3 jPlayer" instead of the current plugin players', 'music-player-for-woocommerce' ) . '</b><br><i>' .
29
  ( $this->_player_exists()
30
- ? __( 'The player functions configured above do not apply, except for audio protection if applicable.<br>This player <b>will take precedence</b> over the player configured in the products\' settings.', 'music-player-for-woocommerce' )
31
  : esc_html__( 'The "MP3 jPlayer" plugin is not installed on your WordPress.', 'music-player-for-woocommerce' )
32
  )
33
  . '</i></td></tr>';
@@ -35,8 +35,8 @@ if ( ! class_exists( 'WCMP_MP3JPLAYER_ADDON' ) ) {
35
 
36
  public function save_general_settings() {
37
  if ( $this->_player_exists() ) {
38
- if ( isset( $_POST['wcmp_addon_player'] ) ) {
39
- update_option( 'wcmp_addon_player', sanitize_text_field( wp_unslash( $_POST['wcmp_addon_player'] ) ) );
40
  } else {
41
  delete_option( 'wcmp_addon_player' );
42
  }
@@ -45,7 +45,7 @@ if ( ! class_exists( 'WCMP_MP3JPLAYER_ADDON' ) ) {
45
 
46
  public function generate_player( $player, $product_id, $file_index, $url ) {
47
  if ( $this->_player_exists() && $this->_is_enabled() ) {
48
- wp_enqueue_style( 'wcmp-ap-mp3-jplayer-style', plugin_dir_url( __FILE__ ) . 'ap-mp3-jplayer/style.css', array(), '1.0.178' );
49
  if ( ! preg_match( '/^http(s?)\:/i', $url ) && isset( $_SERVER['HTTP_HOST'] ) ) {
50
  $url = 'http' . ( is_ssl() ? 's' : '' ) . '://' . sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) . $url;
51
  }
27
 
28
  print '<tr><td><input aria-label="' . esc_attr__( 'Use MP3 jPlayer instead of the current plugin players', 'music-player-for-woocommerce' ) . '" type="radio" value="mp3jplayer" name="wcmp_addon_player" ' . ( $enabled ? 'CHECKED' : '' ) . ( $this->_player_exists() ? '' : ' DISABLED' ) . ' class="wcmp_radio"></td><td width="100%"><b>' . esc_html__( 'Use "MP3 jPlayer" instead of the current plugin players', 'music-player-for-woocommerce' ) . '</b><br><i>' .
29
  ( $this->_player_exists()
30
+ ? __( 'The player functions configured above do not apply, except for audio protection if applicable.<br>This player <b>will take precedence</b> over the player configured in the products\' settings.', 'music-player-for-woocommerce' ) // phpcs:ignore WordPress.Security.EscapeOutput
31
  : esc_html__( 'The "MP3 jPlayer" plugin is not installed on your WordPress.', 'music-player-for-woocommerce' )
32
  )
33
  . '</i></td></tr>';
35
 
36
  public function save_general_settings() {
37
  if ( $this->_player_exists() ) {
38
+ if ( isset( $_POST['wcmp_addon_player'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
39
+ update_option( 'wcmp_addon_player', sanitize_text_field( wp_unslash( $_POST['wcmp_addon_player'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification
40
  } else {
41
  delete_option( 'wcmp_addon_player' );
42
  }
45
 
46
  public function generate_player( $player, $product_id, $file_index, $url ) {
47
  if ( $this->_player_exists() && $this->_is_enabled() ) {
48
+ wp_enqueue_style( 'wcmp-ap-mp3-jplayer-style', plugin_dir_url( __FILE__ ) . 'ap-mp3-jplayer/style.css', array(), WCMP_VERSION );
49
  if ( ! preg_match( '/^http(s?)\:/i', $url ) && isset( $_SERVER['HTTP_HOST'] ) ) {
50
  $url = 'http' . ( is_ssl() ? 's' : '' ) . '://' . sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) . $url;
51
  }
addons/dokan.addon.php CHANGED
@@ -24,15 +24,15 @@ if ( ! class_exists( 'WCMP_DOKAN_ADDON' ) ) {
24
  } // End general_setting
25
 
26
  public function save_general_settings() {
27
- update_option( 'wcmp_dokan_enabled', ( ! empty( $_POST['wcmp_dokan_enabled'] ) ) ? 1 : 0 );
28
- update_option( 'wcmp_dokan_hide_settings', ( ! empty( $_POST['wcmp_dokan_hide_settings'] ) ) ? 1 : 0 );
29
  } // End save_general_settings
30
 
31
  public function product_settings() {
32
  global $wcmp_dokan_flag;
33
  $wcmp_dokan_flag = true;
34
 
35
- wp_enqueue_style( 'wcmp-dokan', plugin_dir_url( __FILE__ ) . 'dokan/style.css', array(), '1.0.178' );
36
  include dirname( __FILE__ ) . '/dokan/player_options.php';
37
  } // End product_settings
38
 
24
  } // End general_setting
25
 
26
  public function save_general_settings() {
27
+ update_option( 'wcmp_dokan_enabled', ( ! empty( $_POST['wcmp_dokan_enabled'] ) ) ? 1 : 0 ); // phpcs:ignore WordPress.Security.NonceVerification
28
+ update_option( 'wcmp_dokan_hide_settings', ( ! empty( $_POST['wcmp_dokan_hide_settings'] ) ) ? 1 : 0 ); // phpcs:ignore WordPress.Security.NonceVerification
29
  } // End save_general_settings
30
 
31
  public function product_settings() {
32
  global $wcmp_dokan_flag;
33
  $wcmp_dokan_flag = true;
34
 
35
+ wp_enqueue_style( 'wcmp-dokan', plugin_dir_url( __FILE__ ) . 'dokan/style.css', array(), WCMP_VERSION );
36
  include dirname( __FILE__ ) . '/dokan/player_options.php';
37
  } // End product_settings
38
 
addons/dokan/player_options.php CHANGED
@@ -1,174 +1,129 @@
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.34' );
6
- wp_enqueue_script( 'wcmp-admin-js', plugin_dir_url(__FILE__).'../../js/admin.js' );
7
 
8
  $wcmp_js = array(
9
- 'File Name' => __( 'File Name', 'music-player-for-woocommerce' ),
10
- 'Choose file' => __( 'Choose file', 'music-player-for-woocommerce' ),
11
- 'Delete' => __( 'Delete', 'music-player-for-woocommerce' ),
12
- 'Select audio file' => __( 'Select audio file', 'music-player-for-woocommerce' ),
13
- 'Select Item' => __( 'Select Item', 'music-player-for-woocommerce' )
14
  );
15
- wp_localize_script('wcmp-admin-js', 'wcmp', $wcmp_js);
16
 
17
  global $post;
18
- $enable_player = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr( $post->ID, '_wcmp_enable_player', false );
19
- $show_in = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr( $post->ID, '_wcmp_show_in', 'all' );
20
- $player_style = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr( $post->ID, '_wcmp_player_layout', WCMP_DEFAULT_PLAYER_LAYOUT );
21
- $player_controls= $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr( $post->ID, '_wcmp_player_controls', WCMP_DEFAULT_PLAYER_CONTROLS );
22
- $player_title = intval( $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr( $post->ID, '_wcmp_player_title',1 ) );
23
- $merge_grouped = intval( $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr( $post->ID, '_wcmp_merge_in_grouped',0 ) );
24
- $play_all = intval( $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr(
25
- $post->ID,
26
- '_wcmp_play_all',
27
- // This option is only for compatibility with versions previous to 1.0.28
28
- $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr(
 
29
  $post->ID,
30
  'play_all',
31
  0
32
  )
33
- )
34
- );
35
- $preload = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr(
36
- $post->ID,
37
- '_wcmp_preload',
38
- $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr(
39
- $post->ID,
40
- 'preload',
41
- 'none'
42
- )
43
- );
44
- $on_cover = intval( $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr( $post->ID, '_wcmp_on_cover', 0 ) );
45
  ?>
46
  <div class="dokan-edit-row wcmp-section">
47
- <input type="hidden" name="wcmp_nonce" value="<?php echo wp_create_nonce('wcmp_updating_product'); ?>" />
48
- <div class="dokan-section-heading"><h2><?php _e('Music Player Settings', 'music-player-for-woocommerce'); ?></h2></div>
49
  <div class="dokan-section-content">
50
  <div class="wcmp-highlight-box">
51
- <?php
52
- _e(
53
- '<p>The player uses the audio files associated to the product.</b></p>',
54
- 'music-player-for-woocommerce'
55
- );
56
- ?>
 
 
57
  </div>
58
  <div class="wcmp-highlight-box">
59
  <div id="wcmp_tips_header">
60
  <div style="margin-top:2px;margin-bottom:5px;cursor:pointer;font-weight:bold;" onclick="jQuery('#wcmp_tips_body').toggle();">
61
- <?php _e('[+|-] Tips', 'music-player-for-woocommerce'); ?>
62
  </div>
63
  </div>
64
  <div id="wcmp_tips_body">
65
  <div class="wcmp-highlight-box">
66
  <a class="wcmp-tip"href="javascript:void(0);" onclick="jQuery(this).next('.wcmp-tip-text').toggle();">
67
- <?php _e('[+|-] Using the audio files stored on Google Drive', 'music-player-for-woocommerce'); ?>
68
  </a>
69
  <div class="wcmp-tip-text">
70
  <ul>
71
  <li>
72
  <p> -
73
- <?php
74
- _e(
75
- 'Go to Drive, press the right click on the file to use, and select the option: <b>"Get Shareable Link"</b>',
76
- 'music-player-for-woocommerce'
77
- );
78
- ?>
79
  </p>
80
  <p>
81
- <?php
82
- _e(
83
- 'The previous action will generate an url with the structure: <b>https://drive.google.com/open?id=FILE_ID</b>',
84
- 'music-player-for-woocommerce'
85
- );
86
- ?>
87
  </p>
88
  </li>
89
  <li>
90
  <p> -
91
- <?php
92
- _e(
93
- 'Knowing the FILE_ID, extracted from the previous URL, enter the URL below, into the WooCommerce product, to allow the Music Player accessing to it:',
94
- 'music-player-for-woocommerce'
95
- );
96
- ?>
97
  </p>
98
  <p>
99
  <b>https://drive.google.com/uc?export=download&id=FILE_ID&.mp3</b>
100
  </p>
101
  <p>
102
- <?php
103
- _e(
104
- '<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as the last one in the URL',
105
- 'music-player-for-woocommerce'
106
- );
107
- ?>
108
  </p>
109
  </li>
110
  </div>
111
  </div>
112
  <div class="wcmp-highlight-box">
113
  <a class="wcmp-tip"href="javascript:void(0);" onclick="jQuery(this).next('.wcmp-tip-text').toggle();">
114
- <?php _e('[+|-] Using the audio files stored on DropBox', 'music-player-for-woocommerce'); ?>
115
  </a>
116
  <div class="wcmp-tip-text">
117
  <ul>
118
  <li>
119
  <p> -
120
- <?php
121
- _e(
122
- 'Sign in to <a href="https://www.dropbox.com/login" target="_blank">dropbox.com </a>',
123
- 'music-player-for-woocommerce'
124
- );
125
- ?>
126
  </p>
127
  </li>
128
  <li>
129
  <p> -
130
- <?php
131
- _e(
132
- "Hover your cursor over the file or folder you'd like to share and click <b>Share</b> when it appears.",
133
- 'music-player-for-woocommerce'
134
- );
135
- ?>
136
  </p>
137
  </li>
138
  <li>
139
  <p> -
140
- <?php
141
- _e(
142
- "If a link hasn't been created, click Create a link. (If a link was already created, click Copy link.",
143
- 'music-player-for-woocommerce'
144
- );
145
- ?>
146
  </p>
147
  <p>
148
- <?php
149
- _e(
150
- 'The link structure would be similar to:<br> https://www.dropbox.com/s/rycvgn8iokfedmo/file.mp3?dl=0',
151
- 'music-player-for-woocommerce'
152
- );
153
- ?>
154
  </p>
155
  </li>
156
  <li>
157
  <p> -
158
- <?php
159
- _e(
160
- 'Enter the URL into the WooCommerce product with the following structure:<br> https://www.dropbox.com/s/rycvgn8iokfedmo/file.mp3?dl=1&.mp3',
161
- 'music-player-for-woocommerce'
162
- );
163
- ?>
164
  </p>
165
  <p>
166
- <?php
167
- _e(
168
- '<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as the last one in the URL. Furthermore, the parameter <b>dl=0</b>, has been modified as <b>dl=1</b>',
169
- 'music-player-for-woocommerce'
170
- );
171
- ?>
172
  </p>
173
  </li>
174
  </div>
@@ -178,73 +133,77 @@ $on_cover = intval( $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr( $p
178
  <div>
179
  <div class="wcmp-dokan-attr">
180
  <label class="wcmp-dokan-attr-label">
181
- <input aria-label="<?php print esc_attr(__('Enable player','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_enable_player" <?php echo (( $enable_player ) ? 'checked' : '' ); ?> title="<?php print esc_attr(__('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')); ?>" /> <?php _e( 'Include music player', 'music-player-for-woocommerce' ); ?>
182
  </label>
183
  </div>
184
  <div class="wcmp-dokan-attr">
185
- <label for="_wcmp_show_in" class="wcmp-dokan-attr-label"><?php _e( 'Include in', 'music-player-for-woocommerce' ); ?></label>
186
  <div>
187
- <label><input aria-label="<?php print esc_attr(__('Include on products pages only','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_show_in" value="single" <?php echo (( $show_in == 'single' ) ? 'checked' : '' ); ?> />
188
- <?php _e('single-entry pages <i>(Product\'s page only)</i>', 'music-player-for-woocommerce'); ?></label>
189
 
190
- <label><input aria-label="<?php print esc_attr(__('Include on multiple-entry pages','music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_show_in" value="multiple" <?php echo (( $show_in == 'multiple' ) ? 'checked' : '' ); ?> />
191
- <?php _e('multiple entries pages <i>(Shop pages, archive pages, but not in the product\'s page)</i>', 'music-player-for-woocommerce'); ?></label>
192
 
193
- <label><input aria-label="<?php print esc_attr(__('Include on products and multiple-entry pages', 'music-player-for-woocommerce')); ?>" type="radio" name="_wcmp_show_in" value="all" <?php echo (( $show_in == 'all' ) ? 'checked' : '' ); ?> />
194
- <?php _e('all pages <i>(with single or multiple-entries)</i>', 'music-player-for-woocommerce'); ?></label>
195
  </div>
196
  </div>
197
  <div class="wcmp-dokan-attr">
198
- <label class="wcmp-dokan-attr-label"><?php _e( 'Merge in grouped products', 'music-player-for-woocommerce' ); ?>
199
- <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' : '' ); ?> /></label>
200
- <div><em><?php _e( 'In grouped products, display the "Add to cart" buttons and quantity fields in the players rows', 'music-player-for-woocommerce' ); ?></em></div>
201
  </div>
202
  <div class="wcmp-dokan-attr">
203
- <label class="wcmp-dokan-attr-label"><?php _e( 'Player layout', 'music-player-for-woocommerce' ); ?></label>
204
  <table border="0" width="100%">
205
  <tr>
206
- <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>
207
- <td><img src="<?php print esc_url(WCMP_PLUGIN_URL); ?>/views/assets/skin1.png" /></td>
208
  </tr>
209
 
210
  <tr>
211
- <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>
212
- <td><img src="<?php print esc_url(WCMP_PLUGIN_URL); ?>/views/assets/skin2.png" /></td>
213
  </tr>
214
 
215
  <tr>
216
- <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>
217
- <td><img src="<?php print esc_url(WCMP_PLUGIN_URL); ?>/views/assets/skin3.png" /></td>
218
  </tr>
219
  </table>
220
  </div>
221
  <div class="wcmp-dokan-attr">
222
- <label for="_wcmp_preload" class="wcmp-dokan-attr-label"><?php _e( 'Preload', 'music-player-for-woocommerce' ); ?></label>
223
  <div>
224
- <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>
225
- <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>
226
- <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>
 
 
 
227
  </div>
228
  </div>
229
  <div class="wcmp-dokan-attr">
230
- <label><?php _e( 'Play all', 'music-player-for-woocommerce' ); ?> <input aria-label="<?php print esc_attr(__('Play all', 'music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_play_all" <?php if(!empty($play_all)) echo 'CHECKED'; ?> /></label>
 
231
  </div>
232
  <div class="wcmp-dokan-attr">
233
- <label class="wcmp-dokan-attr-label"><?php _e( 'Player controls', 'music-player-for-woocommerce' ); ?></label>
234
  <div>
235
- <label><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' ); ?></label>
236
- <label><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' ); ?></label>
237
- <label><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' ); ?></label>
238
  <div class="wcmp-on-cover" style="margin-top:10px;">
239
- <label><input aria-label="<?php print esc_attr(__('Player on cover','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_player_on_cover" value="default" <?php
240
- echo ((!empty($on_cover) && ( $player_controls == 'button' || $player_controls == 'default')) ? 'checked' : '');
241
- ?> /> <?php _e( 'for play/pause button players display them on cover images.', 'music-player-for-woocommerce' ); ?></label>
242
- <div><em><?php _e('(This feature is experimental, and will depend on the theme active on the website.)', 'music-player-for-woocommerce'); ?></em></div>
243
  </div>
244
  </div>
245
  </div>
246
  <div class="wcmp-dokan-attr">
247
- <label><?php _e( 'Display the player\'s title', 'music-player-for-woocommerce' ); ?> <input aria-label="<?php print esc_attr(__('Display player title','music-player-for-woocommerce')); ?>" type="checkbox" name="_wcmp_player_title" <?php echo (( !empty($player_title) ) ? 'checked' : ''); ?> /></label>
248
  </div>
249
  </div>
250
  </div>
@@ -255,11 +214,11 @@ $on_cover = intval( $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_product_attr( $p
255
  {
256
  var v = $('[name="_wcmp_player_controls"]:checked').val(),
257
  c = $('.wcmp-on-cover');
258
- if(v == 'default' || v == 'button') c.show();
259
  else c.hide();
260
  };
261
  $(document).on('change', '[name="_wcmp_player_controls"]', function(){
262
  coverSection();
263
  });
264
  coverSection();
265
- });</script>
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(), WCMP_VERSION );
8
+ wp_enqueue_script( 'wcmp-admin-js', plugin_dir_url( __FILE__ ) . '../../js/admin.js', array(), WCMP_VERSION );
9
 
10
  $wcmp_js = array(
11
+ 'File Name' => __( 'File Name', 'music-player-for-woocommerce' ),
12
+ 'Choose file' => __( 'Choose file', 'music-player-for-woocommerce' ),
13
+ 'Delete' => __( 'Delete', 'music-player-for-woocommerce' ),
14
+ 'Select audio file' => __( 'Select audio file', 'music-player-for-woocommerce' ),
15
+ 'Select Item' => __( 'Select Item', 'music-player-for-woocommerce' ),
16
  );
17
+ wp_localize_script( 'wcmp-admin-js', 'wcmp', $wcmp_js );
18
 
19
  global $post;
20
+ $enable_player = $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post->ID, '_wcmp_enable_player', false );
21
+ $show_in = $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post->ID, '_wcmp_show_in', 'all' );
22
+ $player_style = $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post->ID, '_wcmp_player_layout', WCMP_DEFAULT_PLAYER_LAYOUT );
23
+ $player_controls = $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post->ID, '_wcmp_player_controls', WCMP_DEFAULT_PLAYER_CONTROLS );
24
+ $player_title = intval( $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post->ID, '_wcmp_player_title', 1 ) );
25
+ $merge_grouped = intval( $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post->ID, '_wcmp_merge_in_grouped', 0 ) );
26
+ $play_all = intval(
27
+ $GLOBALS['WooCommerceMusicPlayer']->get_product_attr(
28
+ $post->ID,
29
+ '_wcmp_play_all',
30
+ // This option is only for compatibility with versions previous to 1.0.28
31
+ $GLOBALS['WooCommerceMusicPlayer']->get_product_attr(
32
  $post->ID,
33
  'play_all',
34
  0
35
  )
36
+ )
37
+ );
38
+ $preload = $GLOBALS['WooCommerceMusicPlayer']->get_product_attr(
39
+ $post->ID,
40
+ '_wcmp_preload',
41
+ $GLOBALS['WooCommerceMusicPlayer']->get_product_attr(
42
+ $post->ID,
43
+ 'preload',
44
+ 'none'
45
+ )
46
+ );
47
+ $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post->ID, '_wcmp_on_cover', 0 ) );
48
  ?>
49
  <div class="dokan-edit-row wcmp-section">
50
+ <input type="hidden" name="wcmp_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wcmp_updating_product' ) ); ?>" />
51
+ <div class="dokan-section-heading"><h2><?php esc_html_e( 'Music Player Settings', 'music-player-for-woocommerce' ); ?></h2></div>
52
  <div class="dokan-section-content">
53
  <div class="wcmp-highlight-box">
54
+ <p>
55
+ <?php
56
+ esc_html_e(
57
+ 'The player uses the audio files associated to the product.',
58
+ 'music-player-for-woocommerce'
59
+ );
60
+ ?>
61
+ </p>
62
  </div>
63
  <div class="wcmp-highlight-box">
64
  <div id="wcmp_tips_header">
65
  <div style="margin-top:2px;margin-bottom:5px;cursor:pointer;font-weight:bold;" onclick="jQuery('#wcmp_tips_body').toggle();">
66
+ <?php esc_html_e( '[+|-] Tips', 'music-player-for-woocommerce' ); ?>
67
  </div>
68
  </div>
69
  <div id="wcmp_tips_body">
70
  <div class="wcmp-highlight-box">
71
  <a class="wcmp-tip"href="javascript:void(0);" onclick="jQuery(this).next('.wcmp-tip-text').toggle();">
72
+ <?php esc_html_e( '[+|-] Using the audio files stored on Google Drive', 'music-player-for-woocommerce' ); ?>
73
  </a>
74
  <div class="wcmp-tip-text">
75
  <ul>
76
  <li>
77
  <p> -
78
+ <?php _e( 'Go to Drive, press the right click on the file to use, and select the option: <b>"Get Shareable Link"</b>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
 
 
 
 
 
79
  </p>
80
  <p>
81
+ <?php _e( 'The previous action will generate an url with the structure: <b>https://drive.google.com/open?id=FILE_ID</b>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
 
 
 
 
 
82
  </p>
83
  </li>
84
  <li>
85
  <p> -
86
+ <?php esc_html_e( 'Knowing the FILE_ID, extracted from the previous URL, enter the URL below, into the WooCommerce product, to allow the Music Player accessing to it:', 'music-player-for-woocommerce' ); ?>
 
 
 
 
 
87
  </p>
88
  <p>
89
  <b>https://drive.google.com/uc?export=download&id=FILE_ID&.mp3</b>
90
  </p>
91
  <p>
92
+ <?php _e( '<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as the last one in the URL', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
 
 
 
 
 
93
  </p>
94
  </li>
95
  </div>
96
  </div>
97
  <div class="wcmp-highlight-box">
98
  <a class="wcmp-tip"href="javascript:void(0);" onclick="jQuery(this).next('.wcmp-tip-text').toggle();">
99
+ <?php esc_html_e( '[+|-] Using the audio files stored on DropBox', 'music-player-for-woocommerce' ); ?>
100
  </a>
101
  <div class="wcmp-tip-text">
102
  <ul>
103
  <li>
104
  <p> -
105
+ <?php _e( 'Sign in to <a href="https://www.dropbox.com/login" target="_blank">dropbox.com </a>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
 
 
 
 
 
106
  </p>
107
  </li>
108
  <li>
109
  <p> -
110
+ <?php _e( "Hover your cursor over the file or folder you'd like to share and click <b>Share</b> when it appears.", 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
 
 
 
 
 
111
  </p>
112
  </li>
113
  <li>
114
  <p> -
115
+ <?php esc_html_e( "If a link hasn't been created, click Create a link. (If a link was already created, click Copy link.", 'music-player-for-woocommerce' ); ?>
 
 
 
 
 
116
  </p>
117
  <p>
118
+ <?php esc_html_e( 'The link structure would be similar to:', 'music-player-for-woocommerce' ); ?><br> https://www.dropbox.com/s/rycvgn8iokfedmo/file.mp3?dl=0
 
 
 
 
 
119
  </p>
120
  </li>
121
  <li>
122
  <p> -
123
+ <?php esc_html_e( 'Enter the URL into the WooCommerce product with the following structure:', 'music-player-for-woocommerce' ); ?><br> https://www.dropbox.com/s/rycvgn8iokfedmo/file.mp3?dl=1&.mp3
 
 
 
 
 
124
  </p>
125
  <p>
126
+ <?php _e( '<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as the last one in the URL. Furthermore, the parameter <b>dl=0</b>, has been modified as <b>dl=1</b>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
 
 
 
 
 
127
  </p>
128
  </li>
129
  </div>
133
  <div>
134
  <div class="wcmp-dokan-attr">
135
  <label class="wcmp-dokan-attr-label">
136
+ <input aria-label="<?php esc_attr_e( 'Enable player', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_enable_player" <?php echo ( ( $enable_player ) ? 'checked' : '' ); ?> title="<?php esc_attr_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' ); ?>" /> <?php esc_html_e( 'Include music player', 'music-player-for-woocommerce' ); ?>
137
  </label>
138
  </div>
139
  <div class="wcmp-dokan-attr">
140
+ <label for="_wcmp_show_in" class="wcmp-dokan-attr-label"><?php esc_html_e( 'Include in', 'music-player-for-woocommerce' ); ?></label>
141
  <div>
142
+ <label><input aria-label="<?php esc_attr_e( 'Include on products pages only', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="single" <?php echo ( ( 'single' == $show_in ) ? 'checked' : '' ); ?> />
143
+ <?php _e( 'single-entry pages <i>(Product\'s page only)</i>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></label>
144
 
145
+ <label><input aria-label="<?php esc_attr_e( 'Include on multiple-entry pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="multiple" <?php echo ( ( 'multiple' == $show_in ) ? 'checked' : '' ); ?> />
146
+ <?php _e( 'multiple entries pages <i>(Shop pages, archive pages, but not in the product\'s page)</i>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></label>
147
 
148
+ <label><input aria-label="<?php esc_attr_e( 'Include on products and multiple-entry pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="all" <?php echo ( ( 'all' == $show_in ) ? 'checked' : '' ); ?> />
149
+ <?php _e( 'all pages <i>(with single or multiple-entries)</i>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></label>
150
  </div>
151
  </div>
152
  <div class="wcmp-dokan-attr">
153
+ <label class="wcmp-dokan-attr-label"><?php esc_html_e( 'Merge in grouped products', 'music-player-for-woocommerce' ); ?>
154
+ <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' : '' ); ?> /></label>
155
+ <div><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></div>
156
  </div>
157
  <div class="wcmp-dokan-attr">
158
+ <label class="wcmp-dokan-attr-label"><?php esc_html_e( 'Player layout', 'music-player-for-woocommerce' ); ?></label>
159
  <table border="0" width="100%">
160
  <tr>
161
+ <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>
162
+ <td><img src="<?php print esc_url( WCMP_PLUGIN_URL ); ?>/views/assets/skin1.png" /></td>
163
  </tr>
164
 
165
  <tr>
166
+ <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>
167
+ <td><img src="<?php print esc_url( WCMP_PLUGIN_URL ); ?>/views/assets/skin2.png" /></td>
168
  </tr>
169
 
170
  <tr>
171
+ <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>
172
+ <td><img src="<?php print esc_url( WCMP_PLUGIN_URL ); ?>/views/assets/skin3.png" /></td>
173
  </tr>
174
  </table>
175
  </div>
176
  <div class="wcmp-dokan-attr">
177
+ <label for="_wcmp_preload" class="wcmp-dokan-attr-label"><?php esc_html_e( 'Preload', 'music-player-for-woocommerce' ); ?></label>
178
  <div>
179
+ <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 ) {
180
+ echo 'CHECKED';} ?> /> None</label>
181
+ <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 ) {
182
+ echo 'CHECKED';} ?> /> Metadata</label>
183
+ <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 ) {
184
+ echo 'CHECKED';} ?> /> Auto</label>
185
  </div>
186
  </div>
187
  <div class="wcmp-dokan-attr">
188
+ <label><?php esc_html_e( 'Play all', 'music-player-for-woocommerce' ); ?> <input aria-label="<?php esc_attr_e( 'Play all', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_play_all" <?php if ( ! empty( $play_all ) ) {
189
+ echo 'CHECKED';} ?> /></label>
190
  </div>
191
  <div class="wcmp-dokan-attr">
192
+ <label class="wcmp-dokan-attr-label"><?php esc_html_e( 'Player controls', 'music-player-for-woocommerce' ); ?></label>
193
  <div>
194
+ <label><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' ); ?></label>
195
+ <label><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' ); ?></label>
196
+ <label><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' ); ?></label>
197
  <div class="wcmp-on-cover" style="margin-top:10px;">
198
+ <label><input aria-label="<?php esc_attr_e( 'Player on cover', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_player_on_cover" value="default" <?php
199
+ echo ( ( ! empty( $on_cover ) && ( 'button' == $player_controls || 'default' == $player_controls ) ) ? 'checked' : '' );
200
+ ?> /> <?php esc_html_e( 'for play/pause button players display them on cover images.', 'music-player-for-woocommerce' ); ?></label>
201
+ <div><em><?php esc_html_e( '(This feature is experimental, and will depend on the theme active on the website.)', 'music-player-for-woocommerce' ); ?></em></div>
202
  </div>
203
  </div>
204
  </div>
205
  <div class="wcmp-dokan-attr">
206
+ <label><?php esc_attr_e( 'Display the player\'s title', 'music-player-for-woocommerce' ); ?> <input aria-label="<?php esc_attr_e( 'Display player title', 'music-player-for-woocommerce' ); ?>" type="checkbox" name="_wcmp_player_title" <?php echo ( ( ! empty( $player_title ) ) ? 'checked' : '' ); ?> /></label>
207
  </div>
208
  </div>
209
  </div>
214
  {
215
  var v = $('[name="_wcmp_player_controls"]:checked').val(),
216
  c = $('.wcmp-on-cover');
217
+ if('default' == v || 'button' == v) c.show();
218
  else c.hide();
219
  };
220
  $(document).on('change', '[name="_wcmp_player_controls"]', function(){
221
  coverSection();
222
  });
223
  coverSection();
224
+ });</script>
addons/wcfm.addon.php CHANGED
@@ -36,8 +36,8 @@ if ( ! class_exists( 'WCMP_WCFM_ADDON' ) ) {
36
  } // End general_settings
37
 
38
  public function save_general_settings() {
39
- update_option( 'wcmp_wcfm_enabled', ( ! empty( $_POST['wcmp_wcfm_enabled'] ) ) ? 1 : 0 );
40
- update_option( 'wcmp_wcfm_hide_settings', ( ! empty( $_POST['wcmp_wcfm_hide_settings'] ) ) ? 1 : 0 );
41
  } // End save_general_settings
42
 
43
  public function product_settings( $product_id, $product_type ) {
@@ -45,8 +45,8 @@ if ( ! class_exists( 'WCMP_WCFM_ADDON' ) ) {
45
  $wcmp_wcfm_flag = true;
46
 
47
  $post = get_post( $product_id );
48
- wp_enqueue_style( 'wcmp-wcfm-css', plugin_dir_url( __FILE__ ) . 'wcfm/style.css', array(), '1.0.178' );
49
- wp_enqueue_script( 'wcmp-wcfm-js', plugin_dir_url( __FILE__ ) . 'wcfm/script.js', array(), '1.0.178' );
50
  ?>
51
  <div class="page_collapsible simple variable grouped" id="wcfm_products_manage_form_wcmp_head"><label class="wcfmfa fa-object-group"></label><?php esc_html_e( 'Music Player', 'music-player-for-woocommerce' ); ?><span></span></div>
52
  <div class="wcfm-container simple variable grouped">
@@ -63,12 +63,12 @@ if ( ! class_exists( 'WCMP_WCFM_ADDON' ) ) {
63
  } // End product_settings
64
 
65
  public function save_product_settings( $post_id, $post, $update ) {
66
- if ( ! empty( $_POST['wcfm_products_manage_form'] ) ) {
67
  global $wcmp_wcfm_flag;
68
  $wcmp_wcfm_flag = true;
69
- $arr = wp_parse_args( is_array( $_POST['wcfm_products_manage_form'] ) ? $this->recursive_sanitize_text_field( $_POST['wcfm_products_manage_form'] ) : sanitize_text_field( wp_unslash( $_POST['wcfm_products_manage_form'] ) ) );
70
  if ( ! empty( $arr ) ) {
71
- $_POST = array_replace_recursive( $_POST, $arr );
72
  $_REQUEST = array_replace_recursive( $_REQUEST, $arr );
73
 
74
  $post = wc_get_product( $post_id );
36
  } // End general_settings
37
 
38
  public function save_general_settings() {
39
+ update_option( 'wcmp_wcfm_enabled', ( ! empty( $_POST['wcmp_wcfm_enabled'] ) ) ? 1 : 0 ); // phpcs:ignore WordPress.Security.NonceVerification
40
+ update_option( 'wcmp_wcfm_hide_settings', ( ! empty( $_POST['wcmp_wcfm_hide_settings'] ) ) ? 1 : 0 ); // phpcs:ignore WordPress.Security.NonceVerification
41
  } // End save_general_settings
42
 
43
  public function product_settings( $product_id, $product_type ) {
45
  $wcmp_wcfm_flag = true;
46
 
47
  $post = get_post( $product_id );
48
+ wp_enqueue_style( 'wcmp-wcfm-css', plugin_dir_url( __FILE__ ) . 'wcfm/style.css', array(), WCMP_VERSION );
49
+ wp_enqueue_script( 'wcmp-wcfm-js', plugin_dir_url( __FILE__ ) . 'wcfm/script.js', array(), WCMP_VERSION );
50
  ?>
51
  <div class="page_collapsible simple variable grouped" id="wcfm_products_manage_form_wcmp_head"><label class="wcfmfa fa-object-group"></label><?php esc_html_e( 'Music Player', 'music-player-for-woocommerce' ); ?><span></span></div>
52
  <div class="wcfm-container simple variable grouped">
63
  } // End product_settings
64
 
65
  public function save_product_settings( $post_id, $post, $update ) {
66
+ if ( ! empty( $_POST['wcfm_products_manage_form'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification
67
  global $wcmp_wcfm_flag;
68
  $wcmp_wcfm_flag = true;
69
+ $arr = wp_parse_args( is_array( $_POST['wcfm_products_manage_form'] ) ? $this->recursive_sanitize_text_field( $_POST['wcfm_products_manage_form'] ) : sanitize_text_field( wp_unslash( $_POST['wcfm_products_manage_form'] ) ) ); // @codingStandardsIgnoreLine
70
  if ( ! empty( $arr ) ) {
71
+ $_POST = array_replace_recursive( $_POST, $arr ); // phpcs:ignore WordPress.Security.NonceVerification
72
  $_REQUEST = array_replace_recursive( $_REQUEST, $arr );
73
 
74
  $post = wc_get_product( $post_id );
addons/wcv.addon.php CHANGED
@@ -37,8 +37,8 @@ if ( ! class_exists( 'WCMP_WCVENDORS_ADDON' ) ) {
37
  } // End general_settings
38
 
39
  public function save_general_settings() {
40
- update_option( 'wcmp_wcv_enabled', ( ! empty( $_POST['wcmp_wcv_enabled'] ) ) ? 1 : 0 );
41
- update_option( 'wcmp_wcv_hide_settings', ( ! empty( $_POST['wcmp_wcv_hide_settings'] ) ) ? 1 : 0 );
42
  } // End save_general_settings
43
 
44
  public function delete_product( $post_id ) {
37
  } // End general_settings
38
 
39
  public function save_general_settings() {
40
+ update_option( 'wcmp_wcv_enabled', ( ! empty( $_POST['wcmp_wcv_enabled'] ) ) ? 1 : 0 ); // phpcs:ignore WordPress.Security.NonceVerification
41
+ update_option( 'wcmp_wcv_hide_settings', ( ! empty( $_POST['wcmp_wcv_hide_settings'] ) ) ? 1 : 0 ); // phpcs:ignore WordPress.Security.NonceVerification
42
  } // End save_general_settings
43
 
44
  public function delete_product( $post_id ) {
banner.php CHANGED
@@ -1,108 +1,105 @@
1
- <?php
2
- global $codepeople_promote_banner_plugins;
3
- if(empty($codepeople_promote_banner_plugins)) $codepeople_promote_banner_plugins = array();
4
- if(!function_exists( 'codepeople_add_promote_banner' ))
5
- {
6
- function codepeople_add_promote_banner($wp_admin_bar)
7
- {
8
- global $codepeople_promote_banner_plugins;
9
-
10
- if(
11
- empty($codepeople_promote_banner_plugins) ||
12
- !is_admin() ||
13
- !current_user_can( 'manage_options' )
14
- ) return;
15
-
16
- $screen = get_current_screen();
17
- if ( $screen->post_type == 'post' || $screen->post_type == 'page' ) return;
18
-
19
- // Take action over the banner
20
- if(isset($_POST['codepeople_promote_banner_nonce']) && wp_verify_nonce($_POST['codepeople_promote_banner_nonce'], __FILE__))
21
- {
22
- if(
23
- !empty($_POST['codepeople_promote_banner_plugin']) &&
24
- !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']])
25
- )
26
- {
27
- set_transient( 'codepeople_promote_banner_'.sanitize_text_field($_POST['codepeople_promote_banner_plugin']), -1, 0);
28
- if(
29
- !empty($_POST['codepeople_promote_banner_action']) &&
30
- $_POST['codepeople_promote_banner_action'] == 'set-review' &&
31
- !empty($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url'])
32
- )
33
- {
34
- print '<script>document.location.href="'.str_replace('&amp;', '&', esc_js($codepeople_promote_banner_plugins[$_POST['codepeople_promote_banner_plugin']]['plugin_url'])).'";</script>';
35
- }
36
- }
37
- }
38
-
39
- $minimum_days = 86400*7;
40
- $now = time();
41
-
42
- foreach($codepeople_promote_banner_plugins as $plugin_slug => $plugin_data )
43
- {
44
- $value = get_transient( 'codepeople_promote_banner_'.$plugin_slug );
45
- if( $value === false )
46
- {
47
- $value = $now;
48
- set_transient( 'codepeople_promote_banner_'.$plugin_slug, $value, 0 );
49
- }
50
-
51
- if($minimum_days <= abs($now-$value) && 0<$value*1)
52
- {
53
- ?>
54
- <style>
55
- #codepeople-review-banner{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );border:10px solid #1582AB;background:#FFF;display:table;}
56
- #codepeople-review-banner form{float:left; padding:0 5px;}
57
- #codepeople-review-banner .codepeople-review-banner-picture{width:120px;padding:10px 10px 10px 10px;float:left;text-align:center;}
58
- #codepeople-review-banner .codepeople-review-banner-content{float: left;padding:10px;width: calc( 100% - 160px );width: -webkit-calc( 100% - 160px );width: -moz-calc( 100% - 160px );width: -o-calc( 100% - 160px );}
59
- #codepeople-review-banner .codepeople-review-banner-buttons{padding-top:20px;}
60
- #codepeople-review-banner .no-thank-button,
61
- #codepeople-review-banner .main-button{height: 28px;border-width:1px;border-style:solid;border-radius:5px;text-decoration: none;}
62
- #codepeople-review-banner .main-button{background: #0085ba;border-color: #0073aa #006799 #006799;-webkit-box-shadow: 0 1px 0 #006799;box-shadow: 0 1px 0 #006799;color: #fff;text-decoration: none;text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799;}
63
- #codepeople-review-banner .no-thank-button {color: #555;border-color: #cccccc;background: #f7f7f7;-webkit-box-shadow: 0 1px 0 #cccccc;box-shadow: 0 1px 0 #cccccc;vertical-align: top;}
64
- #codepeople-review-banner .main-button:hover,#codepeople-review-banner .main-button:focus{background: #008ec2;border-color: #006799;color: #fff;}
65
- #codepeople-review-banner .no-thank-button:hover,
66
- #codepeople-review-banner .no-thank-button:focus{background: #fafafa;border-color: #999;color: #23282d;}
67
- @media screen AND (max-width:760px)
68
- {
69
- #codepeople-review-banner{position:relative;top:50px;}
70
- #codepeople-review-banner .codepeople-review-banner-picture{display:none;}
71
- #codepeople-review-banner .codepeople-review-banner-content{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );}
72
- }
73
- </style>
74
- <div id="codepeople-review-banner">
75
- <div class="codepeople-review-banner-picture">
76
- <img alt="" src="https://secure.gravatar.com/avatar/c0662edcefb5a4e2ab12803856ba2358?s=150&amp;d=mm&amp;r=g" style="width:80px;">
77
- </div>
78
- <div class="codepeople-review-banner-content">
79
- <div class="codepeople-review-banner-text">
80
- <p><strong>Want to help to the development of the "<?php print $plugin_data[ 'plugin_name' ]; ?>" plugin?</strong> The main features of this plugin are provided free of charge. We need your help to continue developing it and adding new features. If you want to help with the development please <span style="color:#1582AB;font-weight:bold;">add a review to support it</span>. Thank you!</p>
81
- </div>
82
- <div class="codepeople-review-banner-buttons">
83
- <form method="post" target="_blank">
84
- <button class="main-button" onclick="jQuery(this).closest('[id=\'codepeople-review-banner\']').hide();">Publish a Review</button>
85
- <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr($plugin_slug); ?>" />
86
- <input type="hidden" name="codepeople_promote_banner_action" value="set-review" />
87
- <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo wp_create_nonce(__FILE__); ?>" />
88
- </form>
89
- <form method="post">
90
- <button class="no-thank-button">No Thanks</button>
91
- <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr($plugin_slug); ?>" />
92
- <input type="hidden" name="codepeople_promote_banner_action" value="not-thanks" />
93
- <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo wp_create_nonce(__FILE__); ?>" />
94
- </form>
95
- <div style="clear:both;display:block;"></div>
96
- </div>
97
- <div style="clear:both;"></div>
98
- </div>
99
- <div style="clear:both;"></div>
100
- </div>
101
- <?php
102
- return;
103
- }
104
- }
105
- }
106
- add_action( 'admin_bar_menu', 'codepeople_add_promote_banner' );
107
- } // End codepeople_promote_banner block
108
- ?>
1
+ <?php
2
+ global $codepeople_promote_banner_plugins;
3
+ if ( empty( $codepeople_promote_banner_plugins ) ) {
4
+ $codepeople_promote_banner_plugins = array();
5
+ }
6
+ if ( ! function_exists( 'codepeople_add_promote_banner' ) ) {
7
+ function codepeople_add_promote_banner( $wp_admin_bar ) {
8
+ global $codepeople_promote_banner_plugins;
9
+
10
+ if (
11
+ empty( $codepeople_promote_banner_plugins ) ||
12
+ ! is_admin() ||
13
+ ! current_user_can( 'manage_options' )
14
+ ) {
15
+ return;
16
+ }
17
+
18
+ $screen = get_current_screen();
19
+ if ( 'post' == $screen->post_type || 'page' == $screen->post_type ) {
20
+ return;
21
+ }
22
+
23
+ // Take action over the banner
24
+ if ( isset( $_POST['codepeople_promote_banner_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['codepeople_promote_banner_nonce'] ) ), __FILE__ ) ) {
25
+ if ( ! empty( $_POST['codepeople_promote_banner_plugin'] ) ) {
26
+ $_codepeople_promote_banner_plugin = sanitize_text_field( wp_unslash( $_POST['codepeople_promote_banner_plugin'] ) );
27
+ if ( ! empty( $codepeople_promote_banner_plugins[ $_codepeople_promote_banner_plugin ] ) ) {
28
+ set_transient( 'codepeople_promote_banner_' . $_codepeople_promote_banner_plugin, -1, 0 );
29
+ if (
30
+ ! empty( $_POST['codepeople_promote_banner_action'] ) &&
31
+ 'set-review' == $_POST['codepeople_promote_banner_action'] &&
32
+ ! empty( $codepeople_promote_banner_plugins[ $_codepeople_promote_banner_plugin ]['plugin_url'] )
33
+ ) {
34
+ print '<script>document.location.href="' . str_replace( '&amp;', '&', esc_js( $codepeople_promote_banner_plugins[ $_codepeople_promote_banner_plugin ]['plugin_url'] ) ) . '";</script>'; // phpcs:ignore WordPress.Security.EscapeOutput
35
+ }
36
+ }
37
+ }
38
+ }
39
+
40
+ $minimum_days = 86400 * 7;
41
+ $now = time();
42
+
43
+ foreach ( $codepeople_promote_banner_plugins as $plugin_slug => $plugin_data ) {
44
+ $value = get_transient( 'codepeople_promote_banner_' . $plugin_slug );
45
+ if ( false === $value ) {
46
+ $value = $now;
47
+ set_transient( 'codepeople_promote_banner_' . $plugin_slug, $value, 0 );
48
+ }
49
+
50
+ if ( $minimum_days <= abs( $now - $value ) && 0 < $value * 1 ) {
51
+ ?>
52
+ <style>
53
+ #codepeople-review-banner{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );border:10px solid #1582AB;background:#FFF;display:table;}
54
+ #codepeople-review-banner form{float:left; padding:0 5px;}
55
+ #codepeople-review-banner .codepeople-review-banner-picture{width:120px;padding:10px 10px 10px 10px;float:left;text-align:center;}
56
+ #codepeople-review-banner .codepeople-review-banner-content{float: left;padding:10px;width: calc( 100% - 160px );width: -webkit-calc( 100% - 160px );width: -moz-calc( 100% - 160px );width: -o-calc( 100% - 160px );}
57
+ #codepeople-review-banner .codepeople-review-banner-buttons{padding-top:20px;}
58
+ #codepeople-review-banner .no-thank-button,
59
+ #codepeople-review-banner .main-button{height: 28px;border-width:1px;border-style:solid;border-radius:5px;text-decoration: none;}
60
+ #codepeople-review-banner .main-button{background: #0085ba;border-color: #0073aa #006799 #006799;-webkit-box-shadow: 0 1px 0 #006799;box-shadow: 0 1px 0 #006799;color: #fff;text-decoration: none;text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799;}
61
+ #codepeople-review-banner .no-thank-button {color: #555;border-color: #cccccc;background: #f7f7f7;-webkit-box-shadow: 0 1px 0 #cccccc;box-shadow: 0 1px 0 #cccccc;vertical-align: top;}
62
+ #codepeople-review-banner .main-button:hover,#codepeople-review-banner .main-button:focus{background: #008ec2;border-color: #006799;color: #fff;}
63
+ #codepeople-review-banner .no-thank-button:hover,
64
+ #codepeople-review-banner .no-thank-button:focus{background: #fafafa;border-color: #999;color: #23282d;}
65
+ @media screen AND (max-width:760px)
66
+ {
67
+ #codepeople-review-banner{position:relative;top:50px;}
68
+ #codepeople-review-banner .codepeople-review-banner-picture{display:none;}
69
+ #codepeople-review-banner .codepeople-review-banner-content{width:calc( 100% - 20px );width:-webkit-calc( 100% - 20px );width:-moz-calc( 100% - 20px );width:-o-calc( 100% - 20px );}
70
+ }
71
+ </style>
72
+ <div id="codepeople-review-banner">
73
+ <div class="codepeople-review-banner-picture">
74
+ <img alt="" src="https://secure.gravatar.com/avatar/c0662edcefb5a4e2ab12803856ba2358?s=150&amp;d=mm&amp;r=g" style="width:80px;">
75
+ </div>
76
+ <div class="codepeople-review-banner-content">
77
+ <div class="codepeople-review-banner-text">
78
+ <p><strong>Want to help to the development of the "<?php print esc_html( $plugin_data['plugin_name'] ); ?>" plugin?</strong> The main features of this plugin are provided free of charge. We need your help to continue developing it and adding new features. If you want to help with the development please <span style="color:#1582AB;font-weight:bold;">add a review to support it</span>. Thank you!</p>
79
+ </div>
80
+ <div class="codepeople-review-banner-buttons">
81
+ <form method="post" target="_blank">
82
+ <button class="main-button" onclick="jQuery(this).closest('[id=\'codepeople-review-banner\']').hide();">Publish a Review</button>
83
+ <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr( $plugin_slug ); ?>" />
84
+ <input type="hidden" name="codepeople_promote_banner_action" value="set-review" />
85
+ <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo esc_attr( wp_create_nonce( __FILE__ ) ); ?>" />
86
+ </form>
87
+ <form method="post">
88
+ <button class="no-thank-button">No Thanks</button>
89
+ <input type="hidden" name="codepeople_promote_banner_plugin" value="<?php echo esc_attr( $plugin_slug ); ?>" />
90
+ <input type="hidden" name="codepeople_promote_banner_action" value="not-thanks" />
91
+ <input type="hidden" name="codepeople_promote_banner_nonce" value="<?php echo esc_attr( wp_create_nonce( __FILE__ ) ); ?>" />
92
+ </form>
93
+ <div style="clear:both;display:block;"></div>
94
+ </div>
95
+ <div style="clear:both;"></div>
96
+ </div>
97
+ <div style="clear:both;"></div>
98
+ </div>
99
+ <?php
100
+ return;
101
+ }
102
+ }
103
+ }
104
+ add_action( 'admin_bar_menu', 'codepeople_add_promote_banner' );
105
+ } // End codepeople_promote_banner block
 
 
 
languages/music-player-for-woocommerce-en_US.mo CHANGED
Binary file
languages/music-player-for-woocommerce-en_US.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: music-player-for-woocommerce\n"
4
- "POT-Creation-Date: 2022-08-06 02:02+0200\n"
5
- "PO-Revision-Date: 2022-08-06 02:02+0200\n"
6
  "Last-Translator: CodePeople\n"
7
  "Language-Team: CodePeople\n"
8
  "Language: en_US\n"
@@ -12,371 +12,381 @@ msgstr ""
12
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
  "X-Generator: Poedit 3.1.1\n"
14
  "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-KeywordsList: __;_e;esc_attr__;esc_attr_e\n"
16
  "X-Poedit-SearchPath-0: .\n"
17
 
18
- #: addons/ap-compact-audio-player.addon.php:33
19
  msgid "Use Compact Audio Player instead of the current plugin players"
20
  msgstr ""
21
 
22
- #: addons/ap-compact-audio-player.addon.php:33
23
  msgid "Use \"Compact Audio Player\" instead of the current plugin players"
24
  msgstr ""
25
 
26
- #: addons/ap-compact-audio-player.addon.php:35
27
- #: addons/ap-cp-media-player.addon.php:76
28
- #: addons/ap-html5-audio-player.addon.php:37 addons/ap-mp3-jplayer.addon.php:35
29
  msgid ""
30
  "The player functions configured above do not apply, except for audio "
31
  "protection if applicable.<br>This player <b>will take precedence</b> over "
32
  "the player configured in the products' settings."
33
  msgstr ""
34
 
35
- #: addons/ap-compact-audio-player.addon.php:36
36
  msgid ""
37
  "The \"Compact WP Audio Player\" plugin is not installed on your WordPress."
38
  msgstr ""
39
 
40
- #: addons/ap-cp-media-player.addon.php:72
41
  msgid "Use CP Media Player instead of the current plugin players"
42
  msgstr ""
43
 
44
- #: addons/ap-cp-media-player.addon.php:72
45
  msgid "Use \"CP Media Player\" instead of the current plugin players"
46
  msgstr ""
47
 
48
- #: addons/ap-cp-media-player.addon.php:73
49
  msgid "Select player skin"
50
  msgstr ""
51
 
52
- #: addons/ap-cp-media-player.addon.php:77
53
  msgid "The \"CP Media Player\" plugin is not installed on your WordPress."
54
  msgstr ""
55
 
56
- #: addons/ap-html5-audio-player.addon.php:35
57
  msgid "Use HTML5 Audio Player instead of the current plugin players"
58
  msgstr ""
59
 
60
- #: addons/ap-html5-audio-player.addon.php:35
61
  msgid "Use \"HTML5 Audio Player\" instead of the current plugin players"
62
  msgstr ""
63
 
64
- #: addons/ap-html5-audio-player.addon.php:38
65
  msgid "The \"HTML5 Audio Player\" plugin is not installed on your WordPress."
66
  msgstr ""
67
 
68
- #: addons/ap-mp3-jplayer.addon.php:33
69
  msgid "Use MP3 jPlayer instead of the current plugin players"
70
  msgstr ""
71
 
72
- #: addons/ap-mp3-jplayer.addon.php:33
73
  msgid "Use \"MP3 jPlayer\" instead of the current plugin players"
74
  msgstr ""
75
 
76
- #: addons/ap-mp3-jplayer.addon.php:36
77
  msgid "The \"MP3 jPlayer\" plugin is not installed on your WordPress."
78
  msgstr ""
79
 
80
- #: addons/dokan.addon.php:26
81
  msgid "Activate the Dokan add-on"
82
  msgstr ""
83
 
84
- #: addons/dokan.addon.php:26
85
  msgid ""
86
  "If the \"Dokan Multivendor\" plugin is installed on the website, check the "
87
  "checkbox to allow vendors to configure their music players."
88
  msgstr ""
89
 
90
- #: addons/dokan.addon.php:27 addons/wcfm.addon.php:27 addons/wcv.addon.php:37
91
  msgid "Hide settings"
92
  msgstr ""
93
 
94
- #: addons/dokan.addon.php:27 addons/wcfm.addon.php:27 addons/wcv.addon.php:37
95
  msgid "Hides the players settings from vendors interface."
96
  msgstr ""
97
 
98
- #: addons/dokan/player_options.php:9 views/player_options.php:318
99
  msgid "File Name"
100
  msgstr ""
101
 
102
- #: addons/dokan/player_options.php:10
103
  msgid "Choose file"
104
  msgstr ""
105
 
106
- #: addons/dokan/player_options.php:11
107
  msgid "Delete"
108
  msgstr ""
109
 
110
- #: addons/dokan/player_options.php:12
111
  msgid "Select audio file"
112
  msgstr ""
113
 
114
- #: addons/dokan/player_options.php:13
115
  msgid "Select Item"
116
  msgstr ""
117
 
118
- #: addons/dokan/player_options.php:48
119
  msgid "Music Player Settings"
120
  msgstr ""
121
 
122
- #: addons/dokan/player_options.php:53
123
- msgid "<p>The player uses the audio files associated to the product.</b></p>"
124
  msgstr ""
125
 
126
- #: addons/dokan/player_options.php:61
127
  msgid "[+|-] Tips"
128
  msgstr ""
129
 
130
- #: addons/dokan/player_options.php:67
131
  msgid "[+|-] Using the audio files stored on Google Drive"
132
  msgstr ""
133
 
134
- #: addons/dokan/player_options.php:75 views/player_options.php:76
135
  msgid ""
136
  "Go to Drive, press the right click on the file to use, and select the "
137
  "option: <b>\"Get Shareable Link\"</b>"
138
  msgstr ""
139
 
140
- #: addons/dokan/player_options.php:83 views/player_options.php:84
141
  msgid ""
142
  "The previous action will generate an url with the structure: <b>https://"
143
  "drive.google.com/open?id=FILE_ID</b>"
144
  msgstr ""
145
 
146
- #: addons/dokan/player_options.php:93
147
  msgid ""
148
  "Knowing the FILE_ID, extracted from the previous URL, enter the URL below, "
149
  "into the WooCommerce product, to allow the Music Player accessing to it:"
150
  msgstr ""
151
 
152
- #: addons/dokan/player_options.php:104 views/player_options.php:105
153
  msgid ""
154
  "<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as "
155
  "the last one in the URL"
156
  msgstr ""
157
 
158
- #: addons/dokan/player_options.php:114
159
  msgid "[+|-] Using the audio files stored on DropBox"
160
  msgstr ""
161
 
162
- #: addons/dokan/player_options.php:122 views/player_options.php:123
163
  msgid ""
164
  "Sign in to <a href=\"https://www.dropbox.com/login\" target=\"_blank"
165
  "\">dropbox.com </a>"
166
  msgstr ""
167
 
168
- #: addons/dokan/player_options.php:132 views/player_options.php:133
169
  msgid ""
170
  "Hover your cursor over the file or folder you'd like to share and click "
171
  "<b>Share</b> when it appears."
172
  msgstr ""
173
 
174
- #: addons/dokan/player_options.php:142
175
  msgid ""
176
  "If a link hasn't been created, click Create a link. (If a link was already "
177
  "created, click Copy link."
178
  msgstr ""
179
 
180
- #: addons/dokan/player_options.php:150 views/player_options.php:151
181
- msgid ""
182
- "The link structure would be similar to:<br> https://www.dropbox.com/s/"
183
- "rycvgn8iokfedmo/file.mp3?dl=0"
184
  msgstr ""
185
 
186
- #: addons/dokan/player_options.php:160 views/player_options.php:161
187
  msgid ""
188
- "Enter the URL into the WooCommerce product with the following structure:<br> "
189
- "https://www.dropbox.com/s/rycvgn8iokfedmo/file.mp3?dl=1&.mp3"
190
  msgstr ""
191
 
192
- #: addons/dokan/player_options.php:168 views/player_options.php:169
193
  msgid ""
194
  "<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as "
195
  "the last one in the URL. Furthermore, the parameter <b>dl=0</b>, has been "
196
  "modified as <b>dl=1</b>"
197
  msgstr ""
198
 
199
- #: addons/dokan/player_options.php:181 views/global_options.php:264
200
- #: views/player_options.php:186
201
  msgid "Enable player"
202
  msgstr ""
203
 
204
- #: addons/dokan/player_options.php:181
205
  msgid ""
206
  "The player is shown only if the product is \"downloadable\" with at least an "
207
  "audio file between the \"Downloadable files\", or you have selected your own "
208
  "audio files"
209
  msgstr ""
210
 
211
- #: addons/dokan/player_options.php:181
212
  msgid "Include music player"
213
  msgstr ""
214
 
215
- #: addons/dokan/player_options.php:185
 
216
  msgid "Include in"
217
  msgstr ""
218
 
219
- #: addons/dokan/player_options.php:187
220
  msgid "Include on products pages only"
221
  msgstr ""
222
 
223
- #: addons/dokan/player_options.php:188 views/global_options.php:270
224
- #: views/player_options.php:192
225
  msgid "single-entry pages <i>(Product's page only)</i>"
226
  msgstr ""
227
 
228
- #: addons/dokan/player_options.php:190 views/player_options.php:194
229
  msgid "Include on multiple-entry pages"
230
  msgstr ""
231
 
232
- #: addons/dokan/player_options.php:191 views/global_options.php:273
233
- #: views/player_options.php:195
234
  msgid ""
235
  "multiple entries pages <i>(Shop pages, archive pages, but not in the "
236
  "product's page)</i>"
237
  msgstr ""
238
 
239
- #: addons/dokan/player_options.php:193
240
  msgid "Include on products and multiple-entry pages"
241
  msgstr ""
242
 
243
- #: addons/dokan/player_options.php:194 views/global_options.php:276
244
- #: views/player_options.php:198
245
  msgid "all pages <i>(with single or multiple-entries)</i>"
246
  msgstr ""
247
 
248
- #: addons/dokan/player_options.php:198 addons/dokan/player_options.php:199
249
- #: views/global_options.php:287 views/player_options.php:203
 
250
  msgid "Merge in grouped products"
251
  msgstr ""
252
 
253
- #: addons/dokan/player_options.php:200
 
254
  msgid ""
255
  "In grouped products, display the \"Add to cart\" buttons and quantity fields "
256
  "in the players rows"
257
  msgstr ""
258
 
259
- #: addons/dokan/player_options.php:203 widgets/playlist_widget.php:76
 
260
  msgid "Player layout"
261
  msgstr ""
262
 
263
- #: addons/dokan/player_options.php:206 views/global_options.php:294
264
- #: views/global_options.php:295 views/player_options.php:210
265
- #: views/player_options.php:211
266
  msgid "Skin 1"
267
  msgstr ""
268
 
269
- #: addons/dokan/player_options.php:211 views/global_options.php:300
270
- #: views/player_options.php:215 views/player_options.php:216
271
  msgid "Skin 2"
272
  msgstr ""
273
 
274
- #: addons/dokan/player_options.php:216 views/global_options.php:304
275
- #: views/global_options.php:305 views/player_options.php:220
276
- #: views/player_options.php:221
277
  msgid "Skin 3"
278
  msgstr ""
279
 
280
- #: addons/dokan/player_options.php:222 widgets/playlist_widget.php:92
 
281
  msgid "Preload"
282
  msgstr ""
283
 
284
- #: addons/dokan/player_options.php:224 views/global_options.php:315
285
- #: views/player_options.php:231
286
  msgid "Preload - none"
287
  msgstr ""
288
 
289
- #: addons/dokan/player_options.php:225 views/global_options.php:317
290
- #: views/player_options.php:233
291
  msgid "Preload - metadata"
292
  msgstr ""
293
 
294
- #: addons/dokan/player_options.php:226 views/global_options.php:319
295
- #: views/player_options.php:235
296
  msgid "Preload - auto"
297
  msgstr ""
298
 
299
- #: addons/dokan/player_options.php:230 views/global_options.php:328
300
- #: views/player_options.php:244 widgets/playlist_widget.php:88
 
301
  msgid "Play all"
302
  msgstr ""
303
 
304
- #: addons/dokan/player_options.php:233
 
305
  msgid "Player controls"
306
  msgstr ""
307
 
308
- #: addons/dokan/player_options.php:235 views/global_options.php:353
309
- #: views/player_options.php:257
310
  msgid "Play/pause button"
311
  msgstr ""
312
 
313
- #: addons/dokan/player_options.php:235
 
314
  msgid "the play/pause button only"
315
  msgstr ""
316
 
317
- #: addons/dokan/player_options.php:236 views/global_options.php:354
318
- #: views/player_options.php:258
319
  msgid "All controls"
320
  msgstr ""
321
 
322
- #: addons/dokan/player_options.php:236
 
323
  msgid "all controls"
324
  msgstr ""
325
 
326
- #: addons/dokan/player_options.php:237 views/global_options.php:355
327
- #: views/player_options.php:259
328
  msgid "Depending on context"
329
  msgstr ""
330
 
331
- #: addons/dokan/player_options.php:237
 
332
  msgid "the play/pause button only, or all controls depending on context"
333
  msgstr ""
334
 
335
- #: addons/dokan/player_options.php:239
336
  msgid "Player on cover"
337
  msgstr ""
338
 
339
- #: addons/dokan/player_options.php:241
 
340
  msgid "for play/pause button players display them on cover images."
341
  msgstr ""
342
 
343
- #: addons/dokan/player_options.php:242
 
344
  msgid ""
345
  "(This feature is experimental, and will depend on the theme active on the "
346
  "website.)"
347
  msgstr ""
348
 
349
- #: addons/dokan/player_options.php:247
 
350
  msgid "Display the player's title"
351
  msgstr ""
352
 
353
- #: addons/dokan/player_options.php:247
354
  msgid "Display player title"
355
  msgstr ""
356
 
357
- #: addons/wcfm.addon.php:26
358
  msgid "Activate the WCFM add-on"
359
  msgstr ""
360
 
361
- #: addons/wcfm.addon.php:26
362
  msgid ""
363
  "If the \"WCFM - Marketplace\" plugin is installed on the website, check the "
364
  "checkbox to allow vendors to configure their music players."
365
  msgstr ""
366
 
367
- #: addons/wcfm.addon.php:45
368
  msgid "Music Player"
369
  msgstr ""
370
 
371
- #: addons/wcv.addon.php:36
372
  msgid "Activate the WC Vendors add-on"
373
  msgstr ""
374
 
375
- #: addons/wcv.addon.php:36
376
  msgid "Activate the WC Vendors add-on (Experimental add-on)"
377
  msgstr ""
378
 
379
- #: addons/wcv.addon.php:36
380
  msgid ""
381
  "If the \"WC Vendors\" plugin is installed on the website, check the checkbox "
382
  "to allow vendors to configure their music players."
@@ -394,14 +404,15 @@ msgstr ""
394
  msgid "Products ids separated by comma (* represents all products)"
395
  msgstr ""
396
 
397
- #: pagebuilders/beaverbuilder/wcmp.inc.php:19
398
  msgid "Additional attributes"
399
  msgstr ""
400
 
401
  #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:9
402
  #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:11
403
- #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:12 pagebuilders/builders.php:130
404
- #: pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:17 wcmp.php:227
 
405
  msgid "Music Player for WooCommerce"
406
  msgstr ""
407
 
@@ -409,57 +420,83 @@ msgstr ""
409
  msgid "Insert the playlist shortcode"
410
  msgstr ""
411
 
412
- #: pagebuilders/elementor/elementor.pb.php:42
413
- #: pagebuilders/elementor/elementor.pb.php:49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
414
  msgid "Music Player For WooCommerce"
415
  msgstr ""
416
 
417
- #: pagebuilders/elementor/elementor.pb.php:52
418
- #: pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:27
419
  msgid ""
420
  "To include specific products in the playlist enter their IDs in the "
421
  "products_ids attributes, separated by comma symbols (,)"
422
  msgstr ""
423
 
424
- #: pagebuilders/elementor/elementor.pb.php:52
425
  msgid ""
426
  "If you are editing the products template, to load the player of the current "
427
  "product, delete the products_ids attribute from the shortcode"
428
  msgstr ""
429
 
430
- #: pagebuilders/elementor/elementor.pb.php:52
431
  msgid "More information visiting the follwing link: "
432
  msgstr ""
433
 
434
- #: pagebuilders/elementor/elementor.pb.php:52
435
  msgid "CLICK HERE"
436
  msgstr ""
437
 
438
- #: pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:19
439
  msgid "Insert a playlist with the products players"
440
  msgstr ""
441
 
442
- #: views/global_options.php:51
 
 
 
 
443
  msgid ""
444
  "For reporting any issue or to request a customization, <a href=\"https://"
445
- "wordpress.dwbooster.com/contact-us\" target=\"_blank\">CLICK HERE</a><br />\n"
446
- "\tFor testing the premium version of the plugin, visit the online demo:<br/> "
447
  "<a href=\"https://demos.dwbooster.com/music-player-for-woocommerce/wp-login."
448
  "php\" target=\"_blank\">Administration area: Click to access the "
449
- "administration area demo</a><br/>\n"
450
- "\t<a href=\"https://demos.dwbooster.com/music-player-for-woocommerce/\" "
451
- "target=\"_blank\">Public page: Click to visit the WooCommerce Store</a>"
 
 
 
 
452
  msgstr ""
453
 
454
- #: views/global_options.php:63
 
 
 
 
455
  msgid "Buyer email"
456
  msgstr ""
457
 
458
- #: views/global_options.php:63
459
  msgid "Register"
460
  msgstr ""
461
 
462
- #: views/global_options.php:75 views/player_options.php:51
463
  msgid ""
464
  "<p>The player uses the audio files associated to the product. If you want "
465
  "protecting the audio files for selling, tick the checkbox: <b>\"Protect the "
@@ -471,102 +508,177 @@ msgid ""
471
  "pay for them.</b></p>"
472
  msgstr ""
473
 
474
- #: views/global_options.php:90
 
 
 
 
475
  msgid "Include the players only for registered users"
476
  msgstr ""
477
 
478
- #: views/global_options.php:94
479
  msgid "Apply fade out to playing audio when possible"
480
  msgstr ""
481
 
482
- #: views/global_options.php:98
 
 
 
 
483
  msgid "Purchased times text"
484
  msgstr ""
485
 
486
- #: views/global_options.php:108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
487
  msgid ""
488
  "For buyers, play the purchased audio files instead of the truncated files "
489
  "for demo"
490
  msgstr ""
491
 
492
- #: views/global_options.php:110
 
 
 
 
493
  msgid "Reset files interval"
494
  msgstr ""
495
 
496
- #: views/global_options.php:120
 
 
 
 
497
  msgid "Truncate the audio files for demo with ffmpeg"
498
  msgstr ""
499
 
500
- #: views/global_options.php:124
501
  msgid "ffmpeg path"
502
  msgstr ""
503
 
504
- #: views/global_options.php:129
505
  msgid "Watermark audio"
506
  msgstr ""
507
 
508
- #: views/global_options.php:129
509
  msgid "Select"
510
  msgstr ""
511
 
512
- #: views/global_options.php:138
 
 
 
 
 
 
 
513
  msgid "Delete the demo files generated previously"
514
  msgstr ""
515
 
516
- #: views/global_options.php:145
517
  msgid "Store demo files on Google Drive"
518
  msgstr ""
519
 
520
- #: views/global_options.php:150
 
 
 
 
521
  msgid "JSON Key file"
522
  msgstr ""
523
 
524
- #: views/global_options.php:201
 
 
 
 
525
  msgid "On iPads and iPhones, use native controls"
526
  msgstr ""
527
 
528
- #: views/global_options.php:211
 
 
 
 
 
 
 
 
 
529
  msgid "Loading placeholder in the onload event"
530
  msgstr ""
531
 
532
- #: views/global_options.php:221
 
 
 
 
 
 
 
 
533
  msgid ""
534
  "For files whose extensions cannot be determined, handle them as mp3 files"
535
  msgstr ""
536
 
537
- #: views/global_options.php:231
 
 
 
 
538
  msgid ""
539
  "For the WooCommerce Gutenberg Blocks, include the main player in the "
540
  "products titles"
541
  msgstr ""
542
 
543
- #: views/global_options.php:241
 
 
 
 
544
  msgid "WooCommerce hook used to display the players in the shop pages"
545
  msgstr ""
546
 
547
- #: views/global_options.php:242
548
  msgid ""
549
  "The plugin uses by default the <b>woocommerce_shop_loop_item_title</b> hook. "
550
  "If the player is not being displayed, enter the hook used by the theme "
551
  "active on your website."
552
  msgstr ""
553
 
554
- #: views/global_options.php:243
555
  msgid "Force the player in the title"
556
  msgstr ""
557
 
558
- #: views/global_options.php:252
 
 
 
 
559
  msgid "WooCommerce hook used to display the players in the products pages"
560
  msgstr ""
561
 
562
- #: views/global_options.php:253
563
  msgid ""
564
  "The plugin uses by default the <b>woocommerce_single_product_summary</b> "
565
  "hook. If the player is not being displayed, enter the hook used by the theme "
566
  "active on your website."
567
  msgstr ""
568
 
569
- #: views/global_options.php:258
570
  msgid ""
571
  "Click on the <a href=\"https://docs.woocommerce.com/wc-apidocs/hook-docs.html"
572
  "\" target=\"_blank\">THIS LINK</a> for the list of available <a href="
@@ -574,71 +686,158 @@ msgid ""
574
  "style=\"font-weight:bold;font-size:1.3em;\">WooCommerce Hooks</a>"
575
  msgstr ""
576
 
577
- #: views/global_options.php:269
 
 
 
 
578
  msgid "Products pages only"
579
  msgstr ""
580
 
581
- #: views/global_options.php:272
582
  msgid "Multiple-entry pages"
583
  msgstr ""
584
 
585
- #: views/global_options.php:275
586
  msgid "Product and multiple-entry pages"
587
  msgstr ""
588
 
589
- #: views/global_options.php:282
590
  msgid "Include players in cart"
591
  msgstr ""
592
 
593
- #: views/global_options.php:299
594
  msgid "skin 2"
595
  msgstr ""
596
 
597
- #: views/global_options.php:337
598
  msgid "Allow multiple players to play simultaneously"
599
  msgstr ""
600
 
601
- #: views/global_options.php:347 views/player_options.php:251
 
 
 
 
 
 
 
 
 
 
 
602
  msgid "Player volume"
603
  msgstr ""
604
 
605
- #: views/global_options.php:357 views/player_options.php:261
606
  msgid "On cover"
607
  msgstr ""
608
 
609
- #: views/global_options.php:372 views/player_options.php:276
610
  msgid "Display the player title"
611
  msgstr ""
612
 
613
- #: views/global_options.php:380 views/player_options.php:284
 
 
 
 
 
614
  msgid "Protect the file"
615
  msgstr ""
616
 
617
- #: views/global_options.php:385 views/player_options.php:289
 
618
  msgid "Percent of audio used for protected playbacks"
619
  msgstr ""
620
 
621
- #: views/global_options.php:393
 
 
 
 
 
 
 
 
 
 
 
 
622
  msgid "Explaining that demos are partial versions of the original files"
623
  msgstr ""
624
 
625
- #: views/global_options.php:408
 
 
 
 
 
 
 
 
 
 
626
  msgid "Apply the previous settings to all products"
627
  msgstr ""
628
 
629
- #: views/global_options.php:437
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
630
  msgid "Measurement Id"
631
  msgstr ""
632
 
633
- #: views/global_options.php:443
634
  msgid "API Secret"
635
  msgstr ""
636
 
637
- #: views/global_options.php:462
 
 
 
 
638
  msgid "Save settings"
639
  msgstr ""
640
 
641
- #: views/player_options.php:56
 
 
 
 
 
 
642
  msgid ""
643
  "For testing the premium version of the plugin, visit the online demo:<br/> "
644
  "<a href=\"https://demos.dwbooster.com/music-player-for-woocommerce/wp-login."
@@ -648,77 +847,119 @@ msgid ""
648
  "WooCommerce Store</a>"
649
  msgstr ""
650
 
651
- #: views/player_options.php:191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
652
  msgid "Include on products pages"
653
  msgstr ""
654
 
655
- #: views/player_options.php:197
656
  msgid "Include on product and multiple-entry pages"
657
  msgstr ""
658
 
659
- #: views/player_options.php:302
660
  msgid "Own demo files"
661
  msgstr ""
662
 
663
- #: views/player_options.php:318
664
- msgid "File name"
 
 
 
 
665
  msgstr ""
666
 
667
- #: views/player_options.php:321
 
 
 
 
668
  msgid "File URL"
669
  msgstr ""
670
 
671
- #: wcmp.php:236
 
 
 
 
 
 
 
 
672
  msgid "Help"
673
  msgstr ""
674
 
675
- #: wcmp.php:1177
676
  msgid "There are no products that satisfy the block's settings"
677
  msgstr ""
678
 
679
- #: widgets/playlist_widget.php:53
680
  msgid "Title"
681
  msgstr ""
682
 
683
- #: widgets/playlist_widget.php:56
684
  msgid "Products IDs"
685
  msgstr ""
686
 
687
- #: widgets/playlist_widget.php:56
688
  msgid "Products IDs separated by comma, or a * for all"
689
  msgstr ""
690
 
691
- #: widgets/playlist_widget.php:60
692
  msgid ""
693
  "Enter the ID of products separated by comma, or a * symbol to includes all "
694
  "products in the playlist."
695
  msgstr ""
696
 
697
- #: widgets/playlist_widget.php:64
698
  msgid "Volume (enter a number between 0 and 1)"
699
  msgstr ""
700
 
701
- #: widgets/playlist_widget.php:67
702
  msgid "Playlist layout"
703
  msgstr ""
704
 
705
- #: widgets/playlist_widget.php:70
706
  msgid "New layout"
707
  msgstr ""
708
 
709
- #: widgets/playlist_widget.php:73
710
  msgid "Original layout"
711
  msgstr ""
712
 
713
- #: widgets/playlist_widget.php:98
714
  msgid "Highlight the current product"
715
  msgstr ""
716
 
717
- #: widgets/playlist_widget.php:101
718
  msgid "Continue playing after navigate"
719
  msgstr ""
720
 
721
- #: widgets/playlist_widget.php:105
722
  msgid ""
723
  "Continue playing the same song at same position after navigate. You can "
724
  "experiment some delay because the music player should to load the audio file "
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: music-player-for-woocommerce\n"
4
+ "POT-Creation-Date: 2022-09-13 20:49+0200\n"
5
+ "PO-Revision-Date: 2022-09-13 20:49+0200\n"
6
  "Last-Translator: CodePeople\n"
7
  "Language-Team: CodePeople\n"
8
  "Language: en_US\n"
12
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
  "X-Generator: Poedit 3.1.1\n"
14
  "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-KeywordsList: __;_e;esc_attr__;esc_attr_e;esc_html__;esc_html_e\n"
16
  "X-Poedit-SearchPath-0: .\n"
17
 
18
+ #: addons/ap-compact-audio-player.addon.php:28
19
  msgid "Use Compact Audio Player instead of the current plugin players"
20
  msgstr ""
21
 
22
+ #: addons/ap-compact-audio-player.addon.php:28
23
  msgid "Use \"Compact Audio Player\" instead of the current plugin players"
24
  msgstr ""
25
 
26
+ #: addons/ap-compact-audio-player.addon.php:30
27
+ #: addons/ap-cp-media-player.addon.php:63
28
+ #: addons/ap-html5-audio-player.addon.php:32 addons/ap-mp3-jplayer.addon.php:30
29
  msgid ""
30
  "The player functions configured above do not apply, except for audio "
31
  "protection if applicable.<br>This player <b>will take precedence</b> over "
32
  "the player configured in the products' settings."
33
  msgstr ""
34
 
35
+ #: addons/ap-compact-audio-player.addon.php:31
36
  msgid ""
37
  "The \"Compact WP Audio Player\" plugin is not installed on your WordPress."
38
  msgstr ""
39
 
40
+ #: addons/ap-cp-media-player.addon.php:59
41
  msgid "Use CP Media Player instead of the current plugin players"
42
  msgstr ""
43
 
44
+ #: addons/ap-cp-media-player.addon.php:59
45
  msgid "Use \"CP Media Player\" instead of the current plugin players"
46
  msgstr ""
47
 
48
+ #: addons/ap-cp-media-player.addon.php:60
49
  msgid "Select player skin"
50
  msgstr ""
51
 
52
+ #: addons/ap-cp-media-player.addon.php:64
53
  msgid "The \"CP Media Player\" plugin is not installed on your WordPress."
54
  msgstr ""
55
 
56
+ #: addons/ap-html5-audio-player.addon.php:30
57
  msgid "Use HTML5 Audio Player instead of the current plugin players"
58
  msgstr ""
59
 
60
+ #: addons/ap-html5-audio-player.addon.php:30
61
  msgid "Use \"HTML5 Audio Player\" instead of the current plugin players"
62
  msgstr ""
63
 
64
+ #: addons/ap-html5-audio-player.addon.php:33
65
  msgid "The \"HTML5 Audio Player\" plugin is not installed on your WordPress."
66
  msgstr ""
67
 
68
+ #: addons/ap-mp3-jplayer.addon.php:28
69
  msgid "Use MP3 jPlayer instead of the current plugin players"
70
  msgstr ""
71
 
72
+ #: addons/ap-mp3-jplayer.addon.php:28
73
  msgid "Use \"MP3 jPlayer\" instead of the current plugin players"
74
  msgstr ""
75
 
76
+ #: addons/ap-mp3-jplayer.addon.php:31
77
  msgid "The \"MP3 jPlayer\" plugin is not installed on your WordPress."
78
  msgstr ""
79
 
80
+ #: addons/dokan.addon.php:22
81
  msgid "Activate the Dokan add-on"
82
  msgstr ""
83
 
84
+ #: addons/dokan.addon.php:22
85
  msgid ""
86
  "If the \"Dokan Multivendor\" plugin is installed on the website, check the "
87
  "checkbox to allow vendors to configure their music players."
88
  msgstr ""
89
 
90
+ #: addons/dokan.addon.php:23 addons/wcfm.addon.php:35 addons/wcv.addon.php:36
91
  msgid "Hide settings"
92
  msgstr ""
93
 
94
+ #: addons/dokan.addon.php:23 addons/wcfm.addon.php:35 addons/wcv.addon.php:36
95
  msgid "Hides the players settings from vendors interface."
96
  msgstr ""
97
 
98
+ #: addons/dokan/player_options.php:11 views/player_options.php:303
99
  msgid "File Name"
100
  msgstr ""
101
 
102
+ #: addons/dokan/player_options.php:12 views/player_options.php:309
103
  msgid "Choose file"
104
  msgstr ""
105
 
106
+ #: addons/dokan/player_options.php:13 views/player_options.php:312
107
  msgid "Delete"
108
  msgstr ""
109
 
110
+ #: addons/dokan/player_options.php:14
111
  msgid "Select audio file"
112
  msgstr ""
113
 
114
+ #: addons/dokan/player_options.php:15
115
  msgid "Select Item"
116
  msgstr ""
117
 
118
+ #: addons/dokan/player_options.php:51
119
  msgid "Music Player Settings"
120
  msgstr ""
121
 
122
+ #: addons/dokan/player_options.php:57
123
+ msgid "The player uses the audio files associated to the product."
124
  msgstr ""
125
 
126
+ #: addons/dokan/player_options.php:66 views/player_options.php:59
127
  msgid "[+|-] Tips"
128
  msgstr ""
129
 
130
+ #: addons/dokan/player_options.php:72 views/player_options.php:65
131
  msgid "[+|-] Using the audio files stored on Google Drive"
132
  msgstr ""
133
 
134
+ #: addons/dokan/player_options.php:78
135
  msgid ""
136
  "Go to Drive, press the right click on the file to use, and select the "
137
  "option: <b>\"Get Shareable Link\"</b>"
138
  msgstr ""
139
 
140
+ #: addons/dokan/player_options.php:81
141
  msgid ""
142
  "The previous action will generate an url with the structure: <b>https://"
143
  "drive.google.com/open?id=FILE_ID</b>"
144
  msgstr ""
145
 
146
+ #: addons/dokan/player_options.php:86 views/player_options.php:91
147
  msgid ""
148
  "Knowing the FILE_ID, extracted from the previous URL, enter the URL below, "
149
  "into the WooCommerce product, to allow the Music Player accessing to it:"
150
  msgstr ""
151
 
152
+ #: addons/dokan/player_options.php:92 views/player_options.php:101
153
  msgid ""
154
  "<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as "
155
  "the last one in the URL"
156
  msgstr ""
157
 
158
+ #: addons/dokan/player_options.php:99 views/player_options.php:109
159
  msgid "[+|-] Using the audio files stored on DropBox"
160
  msgstr ""
161
 
162
+ #: addons/dokan/player_options.php:105
163
  msgid ""
164
  "Sign in to <a href=\"https://www.dropbox.com/login\" target=\"_blank"
165
  "\">dropbox.com </a>"
166
  msgstr ""
167
 
168
+ #: addons/dokan/player_options.php:110 views/player_options.php:126
169
  msgid ""
170
  "Hover your cursor over the file or folder you'd like to share and click "
171
  "<b>Share</b> when it appears."
172
  msgstr ""
173
 
174
+ #: addons/dokan/player_options.php:115
175
  msgid ""
176
  "If a link hasn't been created, click Create a link. (If a link was already "
177
  "created, click Copy link."
178
  msgstr ""
179
 
180
+ #: addons/dokan/player_options.php:118 views/player_options.php:142
181
+ msgid "The link structure would be similar to:"
 
 
182
  msgstr ""
183
 
184
+ #: addons/dokan/player_options.php:123 views/player_options.php:151
185
  msgid ""
186
+ "Enter the URL into the WooCommerce product with the following structure:"
 
187
  msgstr ""
188
 
189
+ #: addons/dokan/player_options.php:126 views/player_options.php:156
190
  msgid ""
191
  "<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as "
192
  "the last one in the URL. Furthermore, the parameter <b>dl=0</b>, has been "
193
  "modified as <b>dl=1</b>"
194
  msgstr ""
195
 
196
+ #: addons/dokan/player_options.php:136 views/global_options.php:256
197
+ #: views/player_options.php:171
198
  msgid "Enable player"
199
  msgstr ""
200
 
201
+ #: addons/dokan/player_options.php:136 views/global_options.php:256
202
  msgid ""
203
  "The player is shown only if the product is \"downloadable\" with at least an "
204
  "audio file between the \"Downloadable files\", or you have selected your own "
205
  "audio files"
206
  msgstr ""
207
 
208
+ #: addons/dokan/player_options.php:136 views/player_options.php:170
209
  msgid "Include music player"
210
  msgstr ""
211
 
212
+ #: addons/dokan/player_options.php:140 views/global_options.php:259
213
+ #: views/player_options.php:174
214
  msgid "Include in"
215
  msgstr ""
216
 
217
+ #: addons/dokan/player_options.php:142
218
  msgid "Include on products pages only"
219
  msgstr ""
220
 
221
+ #: addons/dokan/player_options.php:143 views/global_options.php:262
222
+ #: views/player_options.php:177
223
  msgid "single-entry pages <i>(Product's page only)</i>"
224
  msgstr ""
225
 
226
+ #: addons/dokan/player_options.php:145 views/player_options.php:179
227
  msgid "Include on multiple-entry pages"
228
  msgstr ""
229
 
230
+ #: addons/dokan/player_options.php:146 views/global_options.php:265
231
+ #: views/player_options.php:180
232
  msgid ""
233
  "multiple entries pages <i>(Shop pages, archive pages, but not in the "
234
  "product's page)</i>"
235
  msgstr ""
236
 
237
+ #: addons/dokan/player_options.php:148
238
  msgid "Include on products and multiple-entry pages"
239
  msgstr ""
240
 
241
+ #: addons/dokan/player_options.php:149 views/global_options.php:268
242
+ #: views/player_options.php:183
243
  msgid "all pages <i>(with single or multiple-entries)</i>"
244
  msgstr ""
245
 
246
+ #: addons/dokan/player_options.php:153 addons/dokan/player_options.php:154
247
+ #: views/global_options.php:278 views/global_options.php:279
248
+ #: views/player_options.php:187 views/player_options.php:188
249
  msgid "Merge in grouped products"
250
  msgstr ""
251
 
252
+ #: addons/dokan/player_options.php:155 views/global_options.php:279
253
+ #: views/player_options.php:188
254
  msgid ""
255
  "In grouped products, display the \"Add to cart\" buttons and quantity fields "
256
  "in the players rows"
257
  msgstr ""
258
 
259
+ #: addons/dokan/player_options.php:158 views/global_options.php:282
260
+ #: views/player_options.php:191 widgets/playlist_widget.php:90
261
  msgid "Player layout"
262
  msgstr ""
263
 
264
+ #: addons/dokan/player_options.php:161 views/global_options.php:286
265
+ #: views/global_options.php:287 views/player_options.php:195
266
+ #: views/player_options.php:196
267
  msgid "Skin 1"
268
  msgstr ""
269
 
270
+ #: addons/dokan/player_options.php:166 views/global_options.php:292
271
+ #: views/player_options.php:200 views/player_options.php:201
272
  msgid "Skin 2"
273
  msgstr ""
274
 
275
+ #: addons/dokan/player_options.php:171 views/global_options.php:296
276
+ #: views/global_options.php:297 views/player_options.php:205
277
+ #: views/player_options.php:206
278
  msgid "Skin 3"
279
  msgstr ""
280
 
281
+ #: addons/dokan/player_options.php:177 views/global_options.php:304
282
+ #: views/player_options.php:213 widgets/playlist_widget.php:106
283
  msgid "Preload"
284
  msgstr ""
285
 
286
+ #: addons/dokan/player_options.php:179 views/global_options.php:307
287
+ #: views/player_options.php:216
288
  msgid "Preload - none"
289
  msgstr ""
290
 
291
+ #: addons/dokan/player_options.php:181 views/global_options.php:309
292
+ #: views/player_options.php:218
293
  msgid "Preload - metadata"
294
  msgstr ""
295
 
296
+ #: addons/dokan/player_options.php:183 views/global_options.php:311
297
+ #: views/player_options.php:220
298
  msgid "Preload - auto"
299
  msgstr ""
300
 
301
+ #: addons/dokan/player_options.php:188 views/global_options.php:317
302
+ #: views/global_options.php:320 views/player_options.php:226
303
+ #: views/player_options.php:229 widgets/playlist_widget.php:102
304
  msgid "Play all"
305
  msgstr ""
306
 
307
+ #: addons/dokan/player_options.php:192 views/global_options.php:343
308
+ #: views/player_options.php:240
309
  msgid "Player controls"
310
  msgstr ""
311
 
312
+ #: addons/dokan/player_options.php:194 views/global_options.php:345
313
+ #: views/player_options.php:242
314
  msgid "Play/pause button"
315
  msgstr ""
316
 
317
+ #: addons/dokan/player_options.php:194 views/global_options.php:345
318
+ #: views/player_options.php:242
319
  msgid "the play/pause button only"
320
  msgstr ""
321
 
322
+ #: addons/dokan/player_options.php:195 views/global_options.php:346
323
+ #: views/player_options.php:243
324
  msgid "All controls"
325
  msgstr ""
326
 
327
+ #: addons/dokan/player_options.php:195 views/global_options.php:346
328
+ #: views/player_options.php:243
329
  msgid "all controls"
330
  msgstr ""
331
 
332
+ #: addons/dokan/player_options.php:196 views/global_options.php:347
333
+ #: views/player_options.php:244
334
  msgid "Depending on context"
335
  msgstr ""
336
 
337
+ #: addons/dokan/player_options.php:196 views/global_options.php:347
338
+ #: views/player_options.php:244
339
  msgid "the play/pause button only, or all controls depending on context"
340
  msgstr ""
341
 
342
+ #: addons/dokan/player_options.php:198
343
  msgid "Player on cover"
344
  msgstr ""
345
 
346
+ #: addons/dokan/player_options.php:200 views/global_options.php:352
347
+ #: views/player_options.php:249
348
  msgid "for play/pause button players display them on cover images."
349
  msgstr ""
350
 
351
+ #: addons/dokan/player_options.php:201 views/global_options.php:355
352
+ #: views/player_options.php:252
353
  msgid ""
354
  "(This feature is experimental, and will depend on the theme active on the "
355
  "website.)"
356
  msgstr ""
357
 
358
+ #: addons/dokan/player_options.php:206 views/global_options.php:362
359
+ #: views/player_options.php:259
360
  msgid "Display the player's title"
361
  msgstr ""
362
 
363
+ #: addons/dokan/player_options.php:206
364
  msgid "Display player title"
365
  msgstr ""
366
 
367
+ #: addons/wcfm.addon.php:34
368
  msgid "Activate the WCFM add-on"
369
  msgstr ""
370
 
371
+ #: addons/wcfm.addon.php:34
372
  msgid ""
373
  "If the \"WCFM - Marketplace\" plugin is installed on the website, check the "
374
  "checkbox to allow vendors to configure their music players."
375
  msgstr ""
376
 
377
+ #: addons/wcfm.addon.php:51
378
  msgid "Music Player"
379
  msgstr ""
380
 
381
+ #: addons/wcv.addon.php:35
382
  msgid "Activate the WC Vendors add-on"
383
  msgstr ""
384
 
385
+ #: addons/wcv.addon.php:35
386
  msgid "Activate the WC Vendors add-on (Experimental add-on)"
387
  msgstr ""
388
 
389
+ #: addons/wcv.addon.php:35
390
  msgid ""
391
  "If the \"WC Vendors\" plugin is installed on the website, check the checkbox "
392
  "to allow vendors to configure their music players."
404
  msgid "Products ids separated by comma (* represents all products)"
405
  msgstr ""
406
 
407
+ #: pagebuilders/beaverbuilder/wcmp.inc.php:19 pagebuilders/divi/divi.pb.php:31
408
  msgid "Additional attributes"
409
  msgstr ""
410
 
411
  #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:9
412
  #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:11
413
+ #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:12 pagebuilders/builders.php:115
414
+ #: pagebuilders/divi/divi.pb.php:9
415
+ #: pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:16 wcmp.php:232
416
  msgid "Music Player for WooCommerce"
417
  msgstr ""
418
 
420
  msgid "Insert the playlist shortcode"
421
  msgstr ""
422
 
423
+ #: pagebuilders/divi/divi.pb.php:13
424
+ msgid "Playlist"
425
+ msgstr ""
426
+
427
+ #: pagebuilders/divi/divi.pb.php:23
428
+ msgid "Products ids"
429
+ msgstr ""
430
+
431
+ #: pagebuilders/divi/divi.pb.php:27
432
+ msgid ""
433
+ "Enter the products ids separated by comma, or the * sign to include all "
434
+ "products."
435
+ msgstr ""
436
+
437
+ #: pagebuilders/elementor/elementor.pb.php:36
438
+ #: pagebuilders/elementor/elementor.pb.php:43
439
  msgid "Music Player For WooCommerce"
440
  msgstr ""
441
 
442
+ #: pagebuilders/elementor/elementor.pb.php:46
443
+ #: pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:26
444
  msgid ""
445
  "To include specific products in the playlist enter their IDs in the "
446
  "products_ids attributes, separated by comma symbols (,)"
447
  msgstr ""
448
 
449
+ #: pagebuilders/elementor/elementor.pb.php:46
450
  msgid ""
451
  "If you are editing the products template, to load the player of the current "
452
  "product, delete the products_ids attribute from the shortcode"
453
  msgstr ""
454
 
455
+ #: pagebuilders/elementor/elementor.pb.php:46
456
  msgid "More information visiting the follwing link: "
457
  msgstr ""
458
 
459
+ #: pagebuilders/elementor/elementor.pb.php:46
460
  msgid "CLICK HERE"
461
  msgstr ""
462
 
463
+ #: pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:18
464
  msgid "Insert a playlist with the products players"
465
  msgstr ""
466
 
467
+ #: views/global_options.php:47
468
+ msgid "Music Player for WooCommerce - Global Settings"
469
+ msgstr ""
470
+
471
+ #: views/global_options.php:50
472
  msgid ""
473
  "For reporting any issue or to request a customization, <a href=\"https://"
474
+ "wordpress.dwbooster.com/contact-us\" target=\"_blank\">CLICK HERE</a><br /"
475
+ ">For testing the premium version of the plugin, visit the online demo:<br/> "
476
  "<a href=\"https://demos.dwbooster.com/music-player-for-woocommerce/wp-login."
477
  "php\" target=\"_blank\">Administration area: Click to access the "
478
+ "administration area demo</a><br/> <a href=\"https://demos.dwbooster.com/"
479
+ "music-player-for-woocommerce/\" target=\"_blank\">Public page: Click to "
480
+ "visit the WooCommerce Store</a>"
481
+ msgstr ""
482
+
483
+ #: views/global_options.php:55
484
+ msgid "Registering of Plugin"
485
  msgstr ""
486
 
487
+ #: views/global_options.php:57
488
+ msgid "Enter the email address of buyer"
489
+ msgstr ""
490
+
491
+ #: views/global_options.php:58
492
  msgid "Buyer email"
493
  msgstr ""
494
 
495
+ #: views/global_options.php:58
496
  msgid "Register"
497
  msgstr ""
498
 
499
+ #: views/global_options.php:69 views/player_options.php:50
500
  msgid ""
501
  "<p>The player uses the audio files associated to the product. If you want "
502
  "protecting the audio files for selling, tick the checkbox: <b>\"Protect the "
508
  "pay for them.</b></p>"
509
  msgstr ""
510
 
511
+ #: views/global_options.php:78
512
+ msgid "General Settings"
513
+ msgstr ""
514
+
515
+ #: views/global_options.php:81 views/global_options.php:82
516
  msgid "Include the players only for registered users"
517
  msgstr ""
518
 
519
+ #: views/global_options.php:85 views/global_options.php:86
520
  msgid "Apply fade out to playing audio when possible"
521
  msgstr ""
522
 
523
+ #: views/global_options.php:89
524
+ msgid "Text for product purchased times in playlists"
525
+ msgstr ""
526
+
527
+ #: views/global_options.php:90
528
  msgid "Purchased times text"
529
  msgstr ""
530
 
531
+ #: views/global_options.php:91
532
+ msgid ""
533
+ "Texts to display when the playlist shortcode includes the purchased_times "
534
+ "attribute.<br>Ex."
535
+ msgstr ""
536
+
537
+ #: views/global_options.php:95
538
+ msgid "The general settings affect only the PRO version of the plugin"
539
+ msgstr ""
540
+
541
+ #: views/global_options.php:95 views/global_options.php:368
542
+ #: views/player_options.php:52 views/player_options.php:265
543
+ msgid "CLICK HERE TO GET THE PRO VERSION OF THE PLUGIN"
544
+ msgstr ""
545
+
546
+ #: views/global_options.php:98 views/global_options.php:100
547
  msgid ""
548
  "For buyers, play the purchased audio files instead of the truncated files "
549
  "for demo"
550
  msgstr ""
551
 
552
+ #: views/global_options.php:101
553
+ msgid "Reset the files"
554
+ msgstr ""
555
+
556
+ #: views/global_options.php:102
557
  msgid "Reset files interval"
558
  msgstr ""
559
 
560
+ #: views/global_options.php:103
561
+ msgid "daily"
562
+ msgstr ""
563
+
564
+ #: views/global_options.php:111 views/global_options.php:112
565
  msgid "Truncate the audio files for demo with ffmpeg"
566
  msgstr ""
567
 
568
+ #: views/global_options.php:115 views/global_options.php:116
569
  msgid "ffmpeg path"
570
  msgstr ""
571
 
572
+ #: views/global_options.php:119 views/global_options.php:121
573
  msgid "Watermark audio"
574
  msgstr ""
575
 
576
+ #: views/global_options.php:121
577
  msgid "Select"
578
  msgstr ""
579
 
580
+ #: views/global_options.php:122
581
+ msgid ""
582
+ "Select an audio file if you want to apply a watermark to the audio files for "
583
+ "demos. The watermark will be applied to the protected demos (Experimental "
584
+ "feature)."
585
+ msgstr ""
586
+
587
+ #: views/global_options.php:129 views/global_options.php:130
588
  msgid "Delete the demo files generated previously"
589
  msgstr ""
590
 
591
+ #: views/global_options.php:136 views/global_options.php:137
592
  msgid "Store demo files on Google Drive"
593
  msgstr ""
594
 
595
+ #: views/global_options.php:140
596
+ msgid "Import a JSON Key file"
597
+ msgstr ""
598
+
599
+ #: views/global_options.php:142
600
  msgid "JSON Key file"
601
  msgstr ""
602
 
603
+ #: views/global_options.php:186
604
+ msgid "Troubleshoot Area"
605
+ msgstr ""
606
+
607
+ #: views/global_options.php:190 views/global_options.php:193
608
  msgid "On iPads and iPhones, use native controls"
609
  msgstr ""
610
 
611
+ #: views/global_options.php:195
612
+ msgid ""
613
+ "tick the checkbox if the players do not work properly on iPads or iPhones"
614
+ msgstr ""
615
+
616
+ #: views/global_options.php:200
617
+ msgid "Loading players in the onload event"
618
+ msgstr ""
619
+
620
+ #: views/global_options.php:203
621
  msgid "Loading placeholder in the onload event"
622
  msgstr ""
623
 
624
+ #: views/global_options.php:205
625
+ msgid "tick the checkbox if the players are not being loaded properly"
626
+ msgstr ""
627
+
628
+ #: views/global_options.php:210
629
+ msgid "For files whose extensions cannot be determined"
630
+ msgstr ""
631
+
632
+ #: views/global_options.php:213
633
  msgid ""
634
  "For files whose extensions cannot be determined, handle them as mp3 files"
635
  msgstr ""
636
 
637
+ #: views/global_options.php:215
638
+ msgid "handle them as mp3 files"
639
+ msgstr ""
640
+
641
+ #: views/global_options.php:220 views/global_options.php:223
642
  msgid ""
643
  "For the WooCommerce Gutenberg Blocks, include the main player in the "
644
  "products titles"
645
  msgstr ""
646
 
647
+ #: views/global_options.php:225
648
+ msgid "Includes the main player in front of products titles"
649
+ msgstr ""
650
+
651
+ #: views/global_options.php:230 views/global_options.php:233
652
  msgid "WooCommerce hook used to display the players in the shop pages"
653
  msgstr ""
654
 
655
+ #: views/global_options.php:234
656
  msgid ""
657
  "The plugin uses by default the <b>woocommerce_shop_loop_item_title</b> hook. "
658
  "If the player is not being displayed, enter the hook used by the theme "
659
  "active on your website."
660
  msgstr ""
661
 
662
+ #: views/global_options.php:235
663
  msgid "Force the player in the title"
664
  msgstr ""
665
 
666
+ #: views/global_options.php:236
667
+ msgid "Forces the audio player to be displayed in the product title."
668
+ msgstr ""
669
+
670
+ #: views/global_options.php:241 views/global_options.php:244
671
  msgid "WooCommerce hook used to display the players in the products pages"
672
  msgstr ""
673
 
674
+ #: views/global_options.php:245
675
  msgid ""
676
  "The plugin uses by default the <b>woocommerce_single_product_summary</b> "
677
  "hook. If the player is not being displayed, enter the hook used by the theme "
678
  "active on your website."
679
  msgstr ""
680
 
681
+ #: views/global_options.php:250
682
  msgid ""
683
  "Click on the <a href=\"https://docs.woocommerce.com/wc-apidocs/hook-docs.html"
684
  "\" target=\"_blank\">THIS LINK</a> for the list of available <a href="
686
  "style=\"font-weight:bold;font-size:1.3em;\">WooCommerce Hooks</a>"
687
  msgstr ""
688
 
689
+ #: views/global_options.php:255
690
+ msgid "Include music player in all products"
691
+ msgstr ""
692
+
693
+ #: views/global_options.php:261
694
  msgid "Products pages only"
695
  msgstr ""
696
 
697
+ #: views/global_options.php:264
698
  msgid "Multiple-entry pages"
699
  msgstr ""
700
 
701
+ #: views/global_options.php:267
702
  msgid "Product and multiple-entry pages"
703
  msgstr ""
704
 
705
+ #: views/global_options.php:272 views/global_options.php:274
706
  msgid "Include players in cart"
707
  msgstr ""
708
 
709
+ #: views/global_options.php:291
710
  msgid "skin 2"
711
  msgstr ""
712
 
713
+ #: views/global_options.php:326 views/global_options.php:329
714
  msgid "Allow multiple players to play simultaneously"
715
  msgstr ""
716
 
717
+ #: views/global_options.php:332
718
+ msgid ""
719
+ "By default, only one player would be playing at once. By pressing the play "
720
+ "button of a player, the other players would stop. By ticking the checkbox, "
721
+ "multiple players could play simultaneously."
722
+ msgstr ""
723
+
724
+ #: views/global_options.php:337 views/player_options.php:234
725
+ msgid "Player volume (from 0 to 1)"
726
+ msgstr ""
727
+
728
+ #: views/global_options.php:339 views/player_options.php:236
729
  msgid "Player volume"
730
  msgstr ""
731
 
732
+ #: views/global_options.php:349 views/player_options.php:246
733
  msgid "On cover"
734
  msgstr ""
735
 
736
+ #: views/global_options.php:364 views/player_options.php:261
737
  msgid "Display the player title"
738
  msgstr ""
739
 
740
+ #: views/global_options.php:368 views/player_options.php:265
741
+ msgid "The security feature is only available in the PRO version of the plugin"
742
+ msgstr ""
743
+
744
+ #: views/global_options.php:371 views/global_options.php:372
745
+ #: views/player_options.php:268 views/player_options.php:269
746
  msgid "Protect the file"
747
  msgstr ""
748
 
749
+ #: views/global_options.php:375 views/global_options.php:377
750
+ #: views/player_options.php:272 views/player_options.php:274
751
  msgid "Percent of audio used for protected playbacks"
752
  msgstr ""
753
 
754
+ #: views/global_options.php:378 views/player_options.php:275
755
+ msgid ""
756
+ "To prevent unauthorized copying of audio files, the files will be partially "
757
+ "accessible"
758
+ msgstr ""
759
+
760
+ #: views/global_options.php:383
761
+ msgid ""
762
+ "Text to display beside the player explaining that demos are partial versions "
763
+ "of the original files"
764
+ msgstr ""
765
+
766
+ #: views/global_options.php:385
767
  msgid "Explaining that demos are partial versions of the original files"
768
  msgstr ""
769
 
770
+ #: views/global_options.php:399
771
+ msgid "Scope"
772
+ msgstr ""
773
+
774
+ #: views/global_options.php:400
775
+ msgid ""
776
+ "Ticking the checkbox the previous settings are applied to all products, even "
777
+ "if they have a player enabled."
778
+ msgstr ""
779
+
780
+ #: views/global_options.php:400
781
  msgid "Apply the previous settings to all products"
782
  msgstr ""
783
 
784
+ #: views/global_options.php:400
785
+ msgid "Apply the previous settings to all products pages in the website."
786
+ msgstr ""
787
+
788
+ #: views/global_options.php:412
789
+ msgid "Analytics"
790
+ msgstr ""
791
+
792
+ #: views/global_options.php:416
793
+ msgid ""
794
+ "Allows the integration with Google Analytics for registering new events when "
795
+ "the songs are played. The event information would include: the URL to the "
796
+ "audio file as the event label and the product's id as its value."
797
+ msgstr ""
798
+
799
+ #: views/global_options.php:417
800
+ msgid "Note"
801
+ msgstr ""
802
+
803
+ #: views/global_options.php:417
804
+ msgid ""
805
+ "If the preload option is configured as Metadata or Auto in the players "
806
+ "settings, the event would be registered when the audio file is loaded by the "
807
+ "player and not exactly when they are playing."
808
+ msgstr ""
809
+
810
+ #: views/global_options.php:422
811
+ msgid "Universal Analytics"
812
+ msgstr ""
813
+
814
+ #: views/global_options.php:423
815
+ msgid "Measurement Protocol (Google Analytics 4)"
816
+ msgstr ""
817
+
818
+ #: views/global_options.php:428 views/global_options.php:429
819
  msgid "Measurement Id"
820
  msgstr ""
821
 
822
+ #: views/global_options.php:434 views/global_options.php:435
823
  msgid "API Secret"
824
  msgstr ""
825
 
826
+ #: views/global_options.php:447
827
+ msgid "Add ons"
828
+ msgstr ""
829
+
830
+ #: views/global_options.php:454
831
  msgid "Save settings"
832
  msgstr ""
833
 
834
+ #: views/player_options.php:52
835
+ msgid ""
836
+ "The security feature and particular files for demo are only available in the "
837
+ "PRO version of the plugin"
838
+ msgstr ""
839
+
840
+ #: views/player_options.php:53
841
  msgid ""
842
  "For testing the premium version of the plugin, visit the online demo:<br/> "
843
  "<a href=\"https://demos.dwbooster.com/music-player-for-woocommerce/wp-login."
847
  "WooCommerce Store</a>"
848
  msgstr ""
849
 
850
+ #: views/player_options.php:73
851
+ msgid ""
852
+ "Go to Drive, press the right click on the file to use, and select the "
853
+ "option: "
854
+ msgstr ""
855
+
856
+ #: views/player_options.php:81
857
+ msgid "The previous action will generate an url with the structure: "
858
+ msgstr ""
859
+
860
+ #: views/player_options.php:117
861
+ msgid "Sign in to "
862
+ msgstr ""
863
+
864
+ #: views/player_options.php:134
865
+ msgid ""
866
+ "If a link hasn't been created, click Create a link. (If a link was already "
867
+ "created, click Copy link)"
868
+ msgstr ""
869
+
870
+ #: views/player_options.php:171
871
+ msgid ""
872
+ "The player is shown only if the product is \"downloadable\", and there is at "
873
+ "least an audio file between the \"Downloadable files\""
874
+ msgstr ""
875
+
876
+ #: views/player_options.php:176
877
  msgid "Include on products pages"
878
  msgstr ""
879
 
880
+ #: views/player_options.php:182
881
  msgid "Include on product and multiple-entry pages"
882
  msgstr ""
883
 
884
+ #: views/player_options.php:287
885
  msgid "Own demo files"
886
  msgstr ""
887
 
888
+ #: views/player_options.php:287
889
+ msgid "Select my own demo files"
890
+ msgstr ""
891
+
892
+ #: views/player_options.php:291
893
+ msgid "Demo files"
894
  msgstr ""
895
 
896
+ #: views/player_options.php:295
897
+ msgid "Name"
898
+ msgstr ""
899
+
900
+ #: views/player_options.php:296 views/player_options.php:306
901
  msgid "File URL"
902
  msgstr ""
903
 
904
+ #: views/player_options.php:303
905
+ msgid "File name"
906
+ msgstr ""
907
+
908
+ #: views/player_options.php:319
909
+ msgid "Add File"
910
+ msgstr ""
911
+
912
+ #: wcmp.php:241
913
  msgid "Help"
914
  msgstr ""
915
 
916
+ #: wcmp.php:1189
917
  msgid "There are no products that satisfy the block's settings"
918
  msgstr ""
919
 
920
+ #: widgets/playlist_widget.php:67
921
  msgid "Title"
922
  msgstr ""
923
 
924
+ #: widgets/playlist_widget.php:70
925
  msgid "Products IDs"
926
  msgstr ""
927
 
928
+ #: widgets/playlist_widget.php:70
929
  msgid "Products IDs separated by comma, or a * for all"
930
  msgstr ""
931
 
932
+ #: widgets/playlist_widget.php:74
933
  msgid ""
934
  "Enter the ID of products separated by comma, or a * symbol to includes all "
935
  "products in the playlist."
936
  msgstr ""
937
 
938
+ #: widgets/playlist_widget.php:78
939
  msgid "Volume (enter a number between 0 and 1)"
940
  msgstr ""
941
 
942
+ #: widgets/playlist_widget.php:81
943
  msgid "Playlist layout"
944
  msgstr ""
945
 
946
+ #: widgets/playlist_widget.php:84
947
  msgid "New layout"
948
  msgstr ""
949
 
950
+ #: widgets/playlist_widget.php:87
951
  msgid "Original layout"
952
  msgstr ""
953
 
954
+ #: widgets/playlist_widget.php:112
955
  msgid "Highlight the current product"
956
  msgstr ""
957
 
958
+ #: widgets/playlist_widget.php:115
959
  msgid "Continue playing after navigate"
960
  msgstr ""
961
 
962
+ #: widgets/playlist_widget.php:119
963
  msgid ""
964
  "Continue playing the same song at same position after navigate. You can "
965
  "experiment some delay because the music player should to load the audio file "
pagebuilders/beaverbuilder/wcmp.inc.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
- require_once dirname(__FILE__).'/wcmp/wcmp.pb.php';
3
-
4
- FLBuilder::register_module(
5
- 'WCMPBeaver',
6
- array(
7
- 'wcmp-tab' => array(
8
- 'title' => __('Enter the products ids and the rest of shortcode attributes', 'music-player-for-woocommerce'),
9
- 'sections' => array(
10
- 'wcmp-section' => array(
11
- 'title' => __('Playlist Shortcode', 'music-player-for-woocommerce'),
12
- 'fields' => array(
13
- 'products_ids' => array(
14
- 'type' => 'text',
15
- 'label' => __('Products ids separated by comma (* represents all products)', 'music-player-for-woocommerce')
16
- ),
17
- 'attributes' => array(
18
- 'type' => 'text',
19
- 'label' => __('Additional attributes', 'music-player-for-woocommerce')
20
- ),
21
- )
22
- )
23
- )
24
- )
25
- )
26
- );
1
+ <?php
2
+ require_once dirname( __FILE__ ) . '/wcmp/wcmp.pb.php';
3
+
4
+ FLBuilder::register_module(
5
+ 'WCMPBeaver',
6
+ array(
7
+ 'wcmp-tab' => array(
8
+ 'title' => __( 'Enter the products ids and the rest of shortcode attributes', 'music-player-for-woocommerce' ),
9
+ 'sections' => array(
10
+ 'wcmp-section' => array(
11
+ 'title' => __( 'Playlist Shortcode', 'music-player-for-woocommerce' ),
12
+ 'fields' => array(
13
+ 'products_ids' => array(
14
+ 'type' => 'text',
15
+ 'label' => __( 'Products ids separated by comma (* represents all products)', 'music-player-for-woocommerce' ),
16
+ ),
17
+ 'attributes' => array(
18
+ 'type' => 'text',
19
+ 'label' => __( 'Additional attributes', 'music-player-for-woocommerce' ),
20
+ ),
21
+ ),
22
+ ),
23
+ ),
24
+ ),
25
+ )
26
+ );
pagebuilders/beaverbuilder/wcmp/includes/frontend.php CHANGED
@@ -1,14 +1,17 @@
1
- <?php
2
- if(!empty($settings->products_ids))
3
- {
4
- $products_ids = preg_replace('/[^\d\,]/', '', $settings->products_ids);
5
- $products_ids = trim($products_ids, ',');
6
- }
7
- if(!empty($products_ids)) $products_ids = ' products_ids="'.sanitize_text_field($products_ids).'"';
8
-
9
- $output = '[wcmp-playlist'.$products_ids;
10
-
11
- if(!empty($settings->attributes)) $output .= ' '.sanitize_text_field($settings->attributes);
12
-
13
- $output .= ']';
14
- echo $output;
 
 
 
1
+ <?php
2
+ if ( ! empty( $settings->products_ids ) ) {
3
+ $products_ids = preg_replace( '/[^\d\,]/', '', $settings->products_ids );
4
+ $products_ids = trim( $products_ids, ',' );
5
+ }
6
+ if ( ! empty( $products_ids ) ) {
7
+ $products_ids = ' products_ids="' . sanitize_text_field( $products_ids ) . '"';
8
+ }
9
+
10
+ $output = '[wcmp-playlist' . $products_ids;
11
+
12
+ if ( ! empty( $settings->attributes ) ) {
13
+ $output .= ' ' . sanitize_text_field( $settings->attributes );
14
+ }
15
+
16
+ $output .= ']';
17
+ echo $output; // phpcs:ignore WordPress.Security.EscapeOutput
pagebuilders/beaverbuilder/wcmp/wcmp.pb.php CHANGED
@@ -1,18 +1,19 @@
1
- <?php
2
- class WCMPBeaver extends FLBuilderModule {
3
- public function __construct()
4
- {
5
- $modules_dir = dirname(__FILE__).'/';
6
- $modules_url = plugins_url( '/', __FILE__ ).'/';
7
-
8
- parent::__construct(array(
9
- 'name' => __( 'Music Player for WooCommerce', 'music-player-for-woocommerce' ),
10
- 'description' => __( 'Insert the playlist shortcode', 'music-player-for-woocommerce' ),
11
- 'group' => __( 'Music Player for WooCommerce', 'music-player-for-woocommerce' ),
12
- 'category' => __( 'Music Player for WooCommerce', 'music-player-for-woocommerce' ),
13
- 'dir' => $modules_dir,
14
- 'url' => $modules_url,
15
- 'partial_refresh' => true,
16
- ));
17
- }
18
- }
 
1
+ <?php
2
+ class WCMPBeaver extends FLBuilderModule {
3
+ public function __construct() {
4
+ $modules_dir = dirname( __FILE__ ) . '/';
5
+ $modules_url = plugins_url( '/', __FILE__ ) . '/';
6
+
7
+ parent::__construct(
8
+ array(
9
+ 'name' => __( 'Music Player for WooCommerce', 'music-player-for-woocommerce' ),
10
+ 'description' => __( 'Insert the playlist shortcode', 'music-player-for-woocommerce' ),
11
+ 'group' => __( 'Music Player for WooCommerce', 'music-player-for-woocommerce' ),
12
+ 'category' => __( 'Music Player for WooCommerce', 'music-player-for-woocommerce' ),
13
+ 'dir' => $modules_dir,
14
+ 'url' => $modules_url,
15
+ 'partial_refresh' => true,
16
+ )
17
+ );
18
+ }
19
+ }
pagebuilders/builders.php CHANGED
@@ -1,154 +1,137 @@
1
- <?php
2
- /**
3
- * Main class to interace with the different Content Editors: WCMP_BUILDERS class
4
- *
5
- */
6
- if(!class_exists('WCMP_BUILDERS'))
7
- {
8
- class WCMP_BUILDERS
9
- {
10
- private static $_instance;
11
-
12
- private function __construct(){}
13
- private static function instance()
14
- {
15
- if(!isset(self::$_instance)) self::$_instance = new self();
16
- return self::$_instance;
17
- } // End instance
18
-
19
- public static function run()
20
- {
21
- $instance = self::instance();
22
- add_action('init', array($instance, 'init'));
23
- add_action('after_setup_theme', array($instance, 'after_setup_theme'));
24
- }
25
-
26
- public function init()
27
- {
28
- $instance = self::instance();
29
-
30
- // Gutenberg
31
- add_action( 'enqueue_block_editor_assets', array($instance,'gutenberg_editor' ) );
32
- add_filter( 'pre_render_block', array($instance, 'gutenberg_pre_render_block'), 10, 2);
33
-
34
- // Elementor
35
- add_action( 'elementor/widgets/widgets_registered', array($instance, 'elementor_editor') );
36
- add_action( 'elementor/elements/categories_registered', array($instance, 'elementor_editor_category') );
37
-
38
- // Beaver builder
39
- if(class_exists('FLBuilder'))
40
- {
41
- include_once dirname(__FILE__).'/beaverbuilder/wcmp.inc.php';
42
- }
43
-
44
- // DIVI
45
- add_action( 'et_builder_ready', array($instance, 'divi_editor') );
46
-
47
- } // End init
48
-
49
- public function after_setup_theme()
50
- {
51
- $instance = $instance = self::instance();
52
-
53
- // SiteOrigin
54
- add_filter('siteorigin_widgets_widget_folders', array($instance, 'siteorigin_widgets_collection'));
55
- add_filter('siteorigin_panels_widget_dialog_tabs', array($instance, 'siteorigin_panels_widget_dialog_tabs'));
56
-
57
- // Visual Composer
58
- add_action('vcv:api', array($instance, 'visualcomposer_editor'));
59
- } // End after_setup_theme
60
-
61
- /**************************** DIVI ****************************/
62
-
63
- public function divi_editor()
64
- {
65
- if(class_exists('ET_Builder_Module'))
66
- {
67
- if(isset($_GET['et_fb']))
68
- {
69
- wp_enqueue_script('wcmp-admin-gutenberg-editor', plugin_dir_url(__FILE__).'divi/divi.js', array('react'), null, true);
70
- }
71
- require_once dirname(__FILE__).'/divi/divi.pb.php';
72
- }
73
- } // End divi_editor
74
-
75
- /**************************** GUTENBERG ****************************/
76
-
77
- /**
78
- * Loads the javascript resources to integrate the plugin with the Gutenberg editor
79
- */
80
- public function gutenberg_editor()
81
- {
82
- wp_enqueue_style('wcmp-gutenberg-editor-css', plugin_dir_url(__FILE__).'gutenberg/gutenberg.css');
83
-
84
- $url = WCMP_WEBSITE_URL;
85
- $url .= ((strpos($url, '?') === false) ? '?' : '&').'wcmp-preview=';
86
-
87
- wp_enqueue_script('wcmp-admin-gutenberg-editor', plugin_dir_url(__FILE__).'gutenberg/gutenberg.js', array( 'wp-blocks', 'wp-element' ), null, true);
88
-
89
- wp_localize_script('wcmp-admin-gutenberg-editor', 'wcmp_gutenberg_editor_config', array('url' => $url));
90
- } // End gutenberg_editor
91
-
92
- public function gutenberg_pre_render_block($content, $block)
93
- {
94
- if(
95
- stripos($block['blockName'], 'woocommerce/') !== false &&
96
- $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr( '_wcmp_force_main_player_in_title', 1 )
97
- )
98
- {
99
- add_filter( 'woocommerce_product_title', array($GLOBALS[ 'WooCommerceMusicPlayer' ], 'woocommerce_product_title'), 10, 2);
100
- $GLOBALS[ 'WooCommerceMusicPlayer' ]->enqueue_resources();
101
- wp_enqueue_script('wcmp-wcblocks-js', plugin_dir_url(__FILE__).'gutenberg/wcblocks.js', array('jquery'));
102
- wp_enqueue_style('wcmp-wcblocks-css', plugin_dir_url(__FILE__).'gutenberg/wcblocks.css');
103
- }
104
- return $content;
105
- } // End gutenberg_pre_render_block
106
-
107
- /**************************** ELEMENTOR ****************************/
108
-
109
- public function elementor_editor_category()
110
- {
111
- require_once dirname(__FILE__).'/elementor/elementor_category.pb.php';
112
- } // End elementor_editor
113
-
114
- public function elementor_editor()
115
- {
116
- require_once dirname(__FILE__).'/elementor/elementor.pb.php';
117
- } // End elementor_editor
118
-
119
- /**************************** SITEORIGIN ****************************/
120
-
121
- public function siteorigin_widgets_collection($folders)
122
- {
123
- $folders[] = dirname(__FILE__).'/siteorigin/';
124
- return $folders;
125
- } // End siteorigin_widgets_collection
126
-
127
- public function siteorigin_panels_widget_dialog_tabs($tabs)
128
- {
129
- $tabs[] = array(
130
- 'title' => __('Music Player for WooCommerce', 'music-player-for-woocommerce'),
131
- 'filter' => array(
132
- 'groups' => array('music-player-for-woocommerce')
133
- )
134
- );
135
-
136
- return $tabs;
137
- } // End siteorigin_panels_widget_dialog_tabs
138
-
139
- /**************************** VISUAL COMPOSER ****************************/
140
-
141
- public function visualcomposer_editor($api)
142
- {
143
- $elementsToRegister = ['WCMPplaylist'];
144
- $pluginBaseUrl = rtrim(plugins_url('visualcomposer/', __FILE__), '\\/');
145
- $elementsApi = $api->elements;
146
- foreach ($elementsToRegister as $tag)
147
- {
148
- $manifestPath = dirname(__FILE__) . '/visualcomposer/' . $tag . '/manifest.json';
149
- $elementBaseUrl = $pluginBaseUrl . '/' . $tag;
150
- $elementsApi->add($manifestPath, $elementBaseUrl);
151
- }
152
- } // End visualcomposer_editor
153
- } // End WCMP_BUILDERS
154
- }
1
+ <?php
2
+ /**
3
+ * Main class to interace with the different Content Editors: WCMP_BUILDERS class
4
+ */
5
+ if ( ! class_exists( 'WCMP_BUILDERS' ) ) {
6
+ class WCMP_BUILDERS {
7
+
8
+ private static $_instance;
9
+
10
+ private function __construct(){}
11
+ private static function instance() {
12
+ if ( ! isset( self::$_instance ) ) {
13
+ self::$_instance = new self();
14
+ }
15
+ return self::$_instance;
16
+ } // End instance
17
+
18
+ public static function run() {
19
+ $instance = self::instance();
20
+ add_action( 'init', array( $instance, 'init' ) );
21
+ add_action( 'after_setup_theme', array( $instance, 'after_setup_theme' ) );
22
+ }
23
+
24
+ public function init() {
25
+ $instance = self::instance();
26
+
27
+ // Gutenberg
28
+ add_action( 'enqueue_block_editor_assets', array( $instance, 'gutenberg_editor' ) );
29
+ add_filter( 'pre_render_block', array( $instance, 'gutenberg_pre_render_block' ), 10, 2 );
30
+
31
+ // Elementor
32
+ add_action( 'elementor/widgets/widgets_registered', array( $instance, 'elementor_editor' ) );
33
+ add_action( 'elementor/elements/categories_registered', array( $instance, 'elementor_editor_category' ) );
34
+
35
+ // Beaver builder
36
+ if ( class_exists( 'FLBuilder' ) ) {
37
+ include_once dirname( __FILE__ ) . '/beaverbuilder/wcmp.inc.php';
38
+ }
39
+
40
+ // DIVI
41
+ add_action( 'et_builder_ready', array( $instance, 'divi_editor' ) );
42
+
43
+ } // End init
44
+
45
+ public function after_setup_theme() {
46
+ $instance = $instance = self::instance();
47
+
48
+ // SiteOrigin
49
+ add_filter( 'siteorigin_widgets_widget_folders', array( $instance, 'siteorigin_widgets_collection' ) );
50
+ add_filter( 'siteorigin_panels_widget_dialog_tabs', array( $instance, 'siteorigin_panels_widget_dialog_tabs' ) );
51
+
52
+ // Visual Composer
53
+ add_action( 'vcv:api', array( $instance, 'visualcomposer_editor' ) );
54
+ } // End after_setup_theme
55
+
56
+ /**************************** DIVI ****************************/
57
+
58
+ public function divi_editor() {
59
+ if ( class_exists( 'ET_Builder_Module' ) ) {
60
+ if ( isset( $_GET['et_fb'] ) ) {
61
+ wp_enqueue_script( 'wcmp-admin-gutenberg-editor', plugin_dir_url( __FILE__ ) . 'divi/divi.js', array( 'react' ), WCMP_VERSION, true );
62
+ }
63
+ require_once dirname( __FILE__ ) . '/divi/divi.pb.php';
64
+ }
65
+ } // End divi_editor
66
+
67
+ /**************************** GUTENBERG ****************************/
68
+
69
+ /**
70
+ * Loads the javascript resources to integrate the plugin with the Gutenberg editor
71
+ */
72
+ public function gutenberg_editor() {
73
+ wp_enqueue_style( 'wcmp-gutenberg-editor-css', plugin_dir_url( __FILE__ ) . 'gutenberg/gutenberg.css', array(), WCMP_VERSION );
74
+
75
+ $url = WCMP_WEBSITE_URL;
76
+ $url .= ( ( strpos( $url, '?' ) === false ) ? '?' : '&' ) . 'wcmp-preview=';
77
+
78
+ wp_enqueue_script( 'wcmp-admin-gutenberg-editor', plugin_dir_url( __FILE__ ) . 'gutenberg/gutenberg.js', array( 'wp-blocks', 'wp-element' ), WCMP_VERSION, true );
79
+
80
+ wp_localize_script( 'wcmp-admin-gutenberg-editor', 'wcmp_gutenberg_editor_config', array( 'url' => $url ) );
81
+ } // End gutenberg_editor
82
+
83
+ public function gutenberg_pre_render_block( $content, $block ) {
84
+ if (
85
+ stripos( $block['blockName'], 'woocommerce/' ) !== false &&
86
+ $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_force_main_player_in_title', 1 )
87
+ ) {
88
+ add_filter( 'woocommerce_product_title', array( $GLOBALS['WooCommerceMusicPlayer'], 'woocommerce_product_title' ), 10, 2 );
89
+ $GLOBALS['WooCommerceMusicPlayer']->enqueue_resources();
90
+ wp_enqueue_script( 'wcmp-wcblocks-js', plugin_dir_url( __FILE__ ) . 'gutenberg/wcblocks.js', array( 'jquery' ), WCMP_VERSION );
91
+ wp_enqueue_style( 'wcmp-wcblocks-css', plugin_dir_url( __FILE__ ) . 'gutenberg/wcblocks.css', array(), WCMP_VERSION );
92
+ }
93
+ return $content;
94
+ } // End gutenberg_pre_render_block
95
+
96
+ /**************************** ELEMENTOR ****************************/
97
+
98
+ public function elementor_editor_category() {
99
+ require_once dirname( __FILE__ ) . '/elementor/elementor_category.pb.php';
100
+ } // End elementor_editor
101
+
102
+ public function elementor_editor() {
103
+ require_once dirname( __FILE__ ) . '/elementor/elementor.pb.php';
104
+ } // End elementor_editor
105
+
106
+ /**************************** SITEORIGIN ****************************/
107
+
108
+ public function siteorigin_widgets_collection( $folders ) {
109
+ $folders[] = dirname( __FILE__ ) . '/siteorigin/';
110
+ return $folders;
111
+ } // End siteorigin_widgets_collection
112
+
113
+ public function siteorigin_panels_widget_dialog_tabs( $tabs ) {
114
+ $tabs[] = array(
115
+ 'title' => __( 'Music Player for WooCommerce', 'music-player-for-woocommerce' ),
116
+ 'filter' => array(
117
+ 'groups' => array( 'music-player-for-woocommerce' ),
118
+ ),
119
+ );
120
+
121
+ return $tabs;
122
+ } // End siteorigin_panels_widget_dialog_tabs
123
+
124
+ /**************************** VISUAL COMPOSER ****************************/
125
+
126
+ public function visualcomposer_editor( $api ) {
127
+ $elementsToRegister = array( 'WCMPplaylist' );
128
+ $pluginBaseUrl = rtrim( plugins_url( 'visualcomposer/', __FILE__ ), '\\/' );
129
+ $elementsApi = $api->elements;
130
+ foreach ( $elementsToRegister as $tag ) {
131
+ $manifestPath = dirname( __FILE__ ) . '/visualcomposer/' . $tag . '/manifest.json';
132
+ $elementBaseUrl = $pluginBaseUrl . '/' . $tag;
133
+ $elementsApi->add( $manifestPath, $elementBaseUrl );
134
+ }
135
+ } // End visualcomposer_editor
136
+ } // End WCMP_BUILDERS
137
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pagebuilders/divi/divi.pb.php CHANGED
@@ -1,58 +1,59 @@
1
- <?php
2
- class WCMP_DIVI extends ET_Builder_Module
3
- {
4
-
5
- public $slug = 'et_pb_wcmp_divi_module';
6
- public $vb_support = 'on';
7
-
8
- public function init()
9
- {
10
- $this->name = esc_html__('Music Player for WooCommerce', 'music-player-for-woocommerce');
11
- $this->settings_modal_toggles = array(
12
- 'general' => array(
13
- 'toggles' => array(
14
- 'main_content' => esc_html__( 'Playlist', 'music-player-for-woocommerce' ),
15
- ),
16
- ),
17
- );
18
- }
19
-
20
- public function get_fields()
21
- {
22
- global $wpdb;
23
- return array(
24
- 'wcmp_products_ids' => array(
25
- 'label' => esc_html__( 'Products ids', 'music-player-for-woocommerce' ),
26
- 'type' => 'text',
27
- 'default' => '*',
28
- 'option_category' => 'basic_option',
29
- 'description' => esc_html__( 'Enter the products ids separated by comma, or the * sign to include all products.', 'music-player-for-woocommerce' ),
30
- 'toggle_slug' => 'main_content',
31
- ),
32
- 'wcmp_attributes' => array(
33
- 'label' => esc_html__( 'Additional attributes', 'music-player-for-woocommerce' ),
34
- 'type' => 'text',
35
- 'option_category' => 'basic_option',
36
- 'description' => 'controls="track" layout="new"',
37
- 'toggle_slug' => 'main_content',
38
- ),
39
- );
40
- }
41
-
42
- public function render($unprocessed_props, $content = null, $render_slug = null)
43
- {
44
- $output = '';
45
- $products = sanitize_text_field($this->props['wcmp_products_ids']);
46
- if(!empty($products)) $products = ' products_ids="'.esc_attr($products).'"';
47
-
48
- $output = '[wcmp-playlist'.$products;
49
-
50
- $attributes = sanitize_text_field($this->props['wcmp_attributes']);
51
- if(!empty($attributes)) $output .= ' '.$attributes;
52
-
53
- $output .= ']';
54
- return do_shortcode($output);
55
- }
56
- }
57
-
58
- new WCMP_DIVI;
 
1
+ <?php
2
+ class WCMP_DIVI extends ET_Builder_Module {
3
+
4
+
5
+ public $slug = 'et_pb_wcmp_divi_module';
6
+ public $vb_support = 'on';
7
+
8
+ public function init() {
9
+ $this->name = esc_html__( 'Music Player for WooCommerce', 'music-player-for-woocommerce' );
10
+ $this->settings_modal_toggles = array(
11
+ 'general' => array(
12
+ 'toggles' => array(
13
+ 'main_content' => esc_html__( 'Playlist', 'music-player-for-woocommerce' ),
14
+ ),
15
+ ),
16
+ );
17
+ }
18
+
19
+ public function get_fields() {
20
+ global $wpdb;
21
+ return array(
22
+ 'wcmp_products_ids' => array(
23
+ 'label' => esc_html__( 'Products ids', 'music-player-for-woocommerce' ),
24
+ 'type' => 'text',
25
+ 'default' => '*',
26
+ 'option_category' => 'basic_option',
27
+ 'description' => esc_html__( 'Enter the products ids separated by comma, or the * sign to include all products.', 'music-player-for-woocommerce' ),
28
+ 'toggle_slug' => 'main_content',
29
+ ),
30
+ 'wcmp_attributes' => array(
31
+ 'label' => esc_html__( 'Additional attributes', 'music-player-for-woocommerce' ),
32
+ 'type' => 'text',
33
+ 'option_category' => 'basic_option',
34
+ 'description' => 'controls="track" layout="new"',
35
+ 'toggle_slug' => 'main_content',
36
+ ),
37
+ );
38
+ }
39
+
40
+ public function render( $unprocessed_props, $content = null, $render_slug = null ) {
41
+ $output = '';
42
+ $products = sanitize_text_field( $this->props['wcmp_products_ids'] );
43
+ if ( ! empty( $products ) ) {
44
+ $products = ' products_ids="' . esc_attr( $products ) . '"';
45
+ }
46
+
47
+ $output = '[wcmp-playlist' . $products;
48
+
49
+ $attributes = sanitize_text_field( $this->props['wcmp_attributes'] );
50
+ if ( ! empty( $attributes ) ) {
51
+ $output .= ' ' . $attributes;
52
+ }
53
+
54
+ $output .= ']';
55
+ return do_shortcode( $output );
56
+ }
57
+ }
58
+
59
+ new WCMP_DIVI();
pagebuilders/elementor/elementor.pb.php CHANGED
@@ -1,111 +1,101 @@
1
- <?php
2
- namespace Elementor;
3
-
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit; // Exit if accessed directly.
6
- }
7
-
8
- class Elementor_WCMP_Widget extends Widget_Base
9
- {
10
- public function get_name()
11
- {
12
- return 'music-player-for-woocommerce';
13
- } // End get_name
14
-
15
- public function get_title()
16
- {
17
- return 'Playlist';
18
- } // End get_title
19
-
20
- public function get_icon()
21
- {
22
- return 'eicon-video-playlist';
23
- } // End get_icon
24
-
25
- public function get_categories()
26
- {
27
- return array( 'music-player-for-woocommerce-cat' );
28
- } // End get_categories
29
-
30
- public function is_reload_preview_required()
31
- {
32
- return true;
33
- } // End is_reload_preview_required
34
-
35
- protected function register_controls()
36
- {
37
- global $wpdb;
38
-
39
- $this->start_controls_section(
40
- 'wcmp_section',
41
- array(
42
- 'label' => __( 'Music Player For WooCommerce', 'music-player-for-woocommerce' )
43
- )
44
- );
45
-
46
- $this->add_control(
47
- 'shortcode',
48
- array(
49
- 'label' => __('Music Player For WooCommerce', 'music-player-for-woocommerce'),
50
- 'type' => Controls_Manager::TEXTAREA,
51
- 'default' => '[wcmp-playlist products_ids="*" controls="track"]',
52
- 'description' => '<p>'.__('To include specific products in the playlist enter their IDs in the products_ids attributes, separated by comma symbols (,)', 'music-player-for-woocommerce').'</p><p style="color:red;padding:10px 0;">'.__('If you are editing the products template, to load the player of the current product, delete the products_ids attribute from the shortcode', 'music-player-for-woocommerce').'</p><p>'.__('More information visiting the follwing link: ', 'music-player-for-woocommerce').'<br><a href="https://wcmp.dwbooster.com/documentation#playlist-shortcode" target="_blank">'.__('CLICK HERE', 'music-player-for-woocommerce').'</a></p>'
53
- )
54
- );
55
-
56
- $this->end_controls_section();
57
- } // End register_controls
58
-
59
- private function _get_shortcode()
60
- {
61
- $settings = $this->get_settings_for_display();
62
- $shortcode = $settings['shortcode'];
63
- $shortcode = preg_replace('/[\r\n]/', ' ', $shortcode);
64
- return trim($shortcode);
65
- } // End _get_shortcode
66
-
67
- protected function render()
68
- {
69
- $shortcode = sanitize_text_field($this->_get_shortcode());
70
- if(
71
- isset($_REQUEST['action']) &&
72
- (
73
- $_REQUEST['action'] == 'elementor' ||
74
- $_REQUEST['action'] == 'elementor_ajax'
75
- )
76
- )
77
- {
78
- try
79
- {
80
- if(stripos($shortcode, 'products_ids') === false)
81
- if(!empty($GLOBALS['post']) && is_object($GLOBALS['post']))
82
- $shortcode = preg_replace('/\]/', ' products_ids="'.$GLOBALS['post']->ID.'"]', $shortcode, 1);
83
- }
84
- catch(Exception $err){}
85
-
86
- $url = WCMP_WEBSITE_URL;
87
- $url .= ((strpos($url, '?') === false) ? '?' : '&').'wcmp-preview='.urlencode($shortcode);
88
- ?>
89
- <div class="wcmp-iframe-container" style="position:relative;">
90
- <div class="wcmp-iframe-overlay" style="position:absolute;top:0;right:0;bottom:0;left:0;"></div>
91
- <iframe height="0" width="100%" src="<?php print $url; ?>" scrolling="no">
92
- </div>
93
- <?php
94
- }
95
- else
96
- {
97
- print do_shortcode(shortcode_unautop($shortcode));
98
- }
99
-
100
- } // End render
101
-
102
- public function render_plain_content()
103
- {
104
- echo $this->_get_shortcode();
105
- } // End render_plain_content
106
-
107
- } // End Elementor_WCMP_Widget
108
-
109
-
110
- // Register the widgets
111
- Plugin::instance()->widgets_manager->register_widget_type( new Elementor_WCMP_Widget );
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ class Elementor_WCMP_Widget extends Widget_Base {
9
+
10
+ public function get_name() {
11
+ return 'music-player-for-woocommerce';
12
+ } // End get_name
13
+
14
+ public function get_title() {
15
+ return 'Playlist';
16
+ } // End get_title
17
+
18
+ public function get_icon() {
19
+ return 'eicon-video-playlist';
20
+ } // End get_icon
21
+
22
+ public function get_categories() {
23
+ return array( 'music-player-for-woocommerce-cat' );
24
+ } // End get_categories
25
+
26
+ public function is_reload_preview_required() {
27
+ return true;
28
+ } // End is_reload_preview_required
29
+
30
+ protected function register_controls() {
31
+ global $wpdb;
32
+
33
+ $this->start_controls_section(
34
+ 'wcmp_section',
35
+ array(
36
+ 'label' => __( 'Music Player For WooCommerce', 'music-player-for-woocommerce' ),
37
+ )
38
+ );
39
+
40
+ $this->add_control(
41
+ 'shortcode',
42
+ array(
43
+ 'label' => __( 'Music Player For WooCommerce', 'music-player-for-woocommerce' ),
44
+ 'type' => Controls_Manager::TEXTAREA,
45
+ 'default' => '[wcmp-playlist products_ids="*" controls="track"]',
46
+ 'description' => '<p>' . __( 'To include specific products in the playlist enter their IDs in the products_ids attributes, separated by comma symbols (,)', 'music-player-for-woocommerce' ) . '</p><p style="color:red;padding:10px 0;">' . __( 'If you are editing the products template, to load the player of the current product, delete the products_ids attribute from the shortcode', 'music-player-for-woocommerce' ) . '</p><p>' . __( 'More information visiting the follwing link: ', 'music-player-for-woocommerce' ) . '<br><a href="https://wcmp.dwbooster.com/documentation#playlist-shortcode" target="_blank">' . __( 'CLICK HERE', 'music-player-for-woocommerce' ) . '</a></p>',
47
+ )
48
+ );
49
+
50
+ $this->end_controls_section();
51
+ } // End register_controls
52
+
53
+ private function _get_shortcode() {
54
+ $settings = $this->get_settings_for_display();
55
+ $shortcode = $settings['shortcode'];
56
+ $shortcode = preg_replace( '/[\r\n]/', ' ', $shortcode );
57
+ return trim( $shortcode );
58
+ } // End _get_shortcode
59
+
60
+ protected function render() {
61
+ $shortcode = sanitize_text_field( $this->_get_shortcode() );
62
+ if (
63
+ isset( $_REQUEST['action'] ) &&
64
+ (
65
+ 'elementor' == $_REQUEST['action'] ||
66
+ 'elementor_ajax' == $_REQUEST['action']
67
+ )
68
+ ) {
69
+ try {
70
+ if ( stripos( $shortcode, 'products_ids' ) === false ) {
71
+ if ( ! empty( $GLOBALS['post'] ) && is_object( $GLOBALS['post'] ) ) {
72
+ $shortcode = preg_replace( '/\]/', ' products_ids="' . $GLOBALS['post']->ID . '"]', $shortcode, 1 );
73
+ }
74
+ }
75
+ } catch ( Exception $err ) {
76
+ error_log( $err->getMessage() );
77
+ }
78
+
79
+ $url = WCMP_WEBSITE_URL;
80
+ $url .= ( ( strpos( $url, '?' ) === false ) ? '?' : '&' ) . 'wcmp-preview=' . urlencode( $shortcode );
81
+ ?>
82
+ <div class="wcmp-iframe-container" style="position:relative;">
83
+ <div class="wcmp-iframe-overlay" style="position:absolute;top:0;right:0;bottom:0;left:0;"></div>
84
+ <iframe height="0" width="100%" src="<?php print esc_attr( $url ); ?>" scrolling="no">
85
+ </div>
86
+ <?php
87
+ } else {
88
+ print do_shortcode( shortcode_unautop( $shortcode ) );
89
+ }
90
+
91
+ } // End render
92
+
93
+ public function render_plain_content() {
94
+ echo $this->_get_shortcode(); // phpcs:ignore WordPress.Security.EscapeOutput
95
+ } // End render_plain_content
96
+
97
+ } // End Elementor_WCMP_Widget
98
+
99
+
100
+ // Register the widgets
101
+ Plugin::instance()->widgets_manager->register_widget_type( new Elementor_WCMP_Widget() );
 
 
 
 
 
 
 
 
 
 
pagebuilders/elementor/elementor_category.pb.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
- namespace Elementor;
3
-
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit; // Exit if accessed directly.
6
- }
7
-
8
- // Register the categories
9
- Plugin::$instance->elements_manager->add_category(
10
- 'music-player-for-woocommerce-cat',
11
- array(
12
- 'title'=>'Music Player For WooCommerce',
13
- 'icon' => 'fa fa-plug'
14
- ),
15
- 2 // position
16
- );
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit; // Exit if accessed directly.
6
+ }
7
+
8
+ // Register the categories
9
+ Plugin::$instance->elements_manager->add_category(
10
+ 'music-player-for-woocommerce-cat',
11
+ array(
12
+ 'title' => 'Music Player For WooCommerce',
13
+ 'icon' => 'fa fa-plug',
14
+ ),
15
+ 2 // position
16
+ );
pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php CHANGED
@@ -1,48 +1,45 @@
1
- <?php
2
- /*
3
- Widget Name: Music Player for WooCommerce
4
- Description: Insert a playlist with the products players.
5
- Documentation: https://wcmp.dwbooster.com/documentation#playlist-shortcode
6
- */
7
-
8
- class SiteOrigin_WCMP_Shortcode extends SiteOrigin_Widget
9
- {
10
- function __construct()
11
- {
12
- global $wpdb;
13
- $options = array();
14
- $default = '';
15
- parent::__construct(
16
- 'siteorigin-wcmp-shortcode',
17
- __('Music Player for WooCommerce', 'music-player-for-woocommerce'),
18
- array(
19
- 'description' => __('Insert a playlist with the products players', 'music-player-for-woocommerce'),
20
- 'panels_groups' => array('music-player-for-woocommerce'),
21
- 'help' => 'https://wcmp.dwbooster.com/documentation#playlist-shortcode',
22
- ),
23
- array(),
24
- array(
25
- 'shortcode' => array(
26
- 'type' => 'text',
27
- 'label' => __('To include specific products in the playlist enter their IDs in the products_ids attributes, separated by comma symbols (,)', 'music-player-for-woocommerce'),
28
- 'default' => '[wcmp-playlist products_ids="*" controls="track"]'
29
- ),
30
- ),
31
- plugin_dir_path(__FILE__)
32
- );
33
- } // End __construct
34
-
35
- function get_template_name($instance)
36
- {
37
- return 'siteorigin-wcmp-shortcode';
38
- } // End get_template_name
39
-
40
- function get_style_name($instance)
41
- {
42
- return '';
43
- } // End get_style_name
44
-
45
- } // End Class SiteOrigin_WCMP_Shortcode
46
-
47
- // Registering the widget
48
- siteorigin_widget_register('siteorigin-wcmp-shortcode', __FILE__, 'SiteOrigin_WCMP_Shortcode');
1
+ <?php
2
+ /*
3
+ Widget Name: Music Player for WooCommerce
4
+ Description: Insert a playlist with the products players.
5
+ Documentation: https://wcmp.dwbooster.com/documentation#playlist-shortcode
6
+ */
7
+
8
+ class SiteOrigin_WCMP_Shortcode extends SiteOrigin_Widget {
9
+
10
+ public function __construct() {
11
+ global $wpdb;
12
+ $options = array();
13
+ $default = '';
14
+ parent::__construct(
15
+ 'siteorigin-wcmp-shortcode',
16
+ __( 'Music Player for WooCommerce', 'music-player-for-woocommerce' ),
17
+ array(
18
+ 'description' => __( 'Insert a playlist with the products players', 'music-player-for-woocommerce' ),
19
+ 'panels_groups' => array( 'music-player-for-woocommerce' ),
20
+ 'help' => 'https://wcmp.dwbooster.com/documentation#playlist-shortcode',
21
+ ),
22
+ array(),
23
+ array(
24
+ 'shortcode' => array(
25
+ 'type' => 'text',
26
+ 'label' => __( 'To include specific products in the playlist enter their IDs in the products_ids attributes, separated by comma symbols (,)', 'music-player-for-woocommerce' ),
27
+ 'default' => '[wcmp-playlist products_ids="*" controls="track"]',
28
+ ),
29
+ ),
30
+ plugin_dir_path( __FILE__ )
31
+ );
32
+ } // End __construct
33
+
34
+ public function get_template_name( $instance ) {
35
+ return 'siteorigin-wcmp-shortcode';
36
+ } // End get_template_name
37
+
38
+ public function get_style_name( $instance ) {
39
+ return '';
40
+ } // End get_style_name
41
+
42
+ } // End Class SiteOrigin_WCMP_Shortcode
43
+
44
+ // Registering the widget
45
+ siteorigin_widget_register( 'siteorigin-wcmp-shortcode', __FILE__, 'SiteOrigin_WCMP_Shortcode' );
 
 
 
pagebuilders/siteorigin/siteorigin-wcmp/tpl/siteorigin-wcmp-shortcode.php CHANGED
@@ -1 +1 @@
1
- <?php print !empty($instance['shortcode']) ? sanitize_text_field($instance['shortcode']) : '';
1
+ <?php print ! empty( $instance['shortcode'] ) ? sanitize_text_field( $instance['shortcode'] ) : ''; // phpcs:ignore WordPress.Security.EscapeOutput
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: codepeople
3
  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: 1.0.178
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -226,6 +226,10 @@ Each time save the data of a product, the files for demo are deleted and generat
226
 
227
  == Changelog ==
228
 
 
 
 
 
229
  = 1.0.178 =
230
 
231
  * Modifies the preload behavior to avoid affecting server performance.
3
  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.1
7
+ Stable tag: 1.0.179
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.179 =
230
+
231
+ * Improves the plugin code.
232
+
233
  = 1.0.178 =
234
 
235
  * Modifies the preload behavior to avoid affecting server performance.
views/global_options.php CHANGED
@@ -47,12 +47,7 @@ $purchased_times_text = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_
47
  <h1><?php esc_html_e( 'Music Player for WooCommerce - Global Settings', 'music-player-for-woocommerce' ); ?></h1>
48
  <div style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;">
49
  <?php
50
- _e(
51
- 'For reporting any issue or to request a customization, <a href="https://wordpress.dwbooster.com/contact-us" target="_blank">CLICK HERE</a><br />
52
- For testing the premium version of the plugin, visit the online demo:<br/> <a href="https://demos.dwbooster.com/music-player-for-woocommerce/wp-login.php" target="_blank">Administration area: Click to access the administration area demo</a><br/>
53
- <a href="https://demos.dwbooster.com/music-player-for-woocommerce/" target="_blank">Public page: Click to visit the WooCommerce Store</a>',
54
- 'music-player-for-woocommerce'
55
- );
56
  ?>
57
  </div>
58
  <form method="post">
@@ -71,10 +66,7 @@ _e(
71
  <td>
72
  <div style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;">
73
  <?php
74
- _e(
75
- '<p>The player uses the audio files associated to the product. If you want protecting the audio files for selling, tick the checkbox: <b>"Protect the file"</b>, in whose case the plugin will create a truncated version of the audio files for selling to be used for demo. The size of audio files for demo is based on the number entered through the attribute: <b>"Percent of audio used for protected playbacks"</b>.</p><p><b>Protecting the files prevents that malicious users can access to the original audio files without pay for them.</b></p>',
76
- 'music-player-for-woocommerce'
77
- );
78
  ?>
79
  </div>
80
  </td>
@@ -239,7 +231,7 @@ _e(
239
  </td>
240
  <td>
241
  <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 />
242
- <?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>
243
  <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 ) {
244
  print 'checked';} ?>> <?php esc_html_e( 'Forces the audio player to be displayed in the product title.', 'music-player-for-woocommerce' ); ?>
245
  </td>
@@ -250,12 +242,12 @@ _e(
250
  </td>
251
  <td>
252
  <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 />
253
- <?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' ); ?>
254
  </td>
255
  </tr>
256
  <tr>
257
  <td></td>
258
- <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>
259
  </tr>
260
  </table>
261
  <table class="widefat wcmp-player-settings" style="border:1px solid #e1e1e1;">
@@ -267,13 +259,13 @@ _e(
267
  <td width="30%"><?php esc_html_e( 'Include in', 'music-player-for-woocommerce' ); ?></td>
268
  <td>
269
  <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' : '' ); ?> />
270
- <?php _e( 'single-entry pages <i>(Product\'s page only)</i>', 'music-player-for-woocommerce' ); ?><br />
271
 
272
  <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' : '' ); ?> />
273
- <?php _e( 'multiple entries pages <i>(Shop pages, archive pages, but not in the product\'s page)</i>', 'music-player-for-woocommerce' ); ?><br />
274
 
275
  <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' : '' ); ?> />
276
- <?php _e( 'all pages <i>(with single or multiple-entries)</i>', 'music-player-for-woocommerce' ); ?>
277
  </td>
278
  </tr>
279
  <tr>
47
  <h1><?php esc_html_e( 'Music Player for WooCommerce - Global Settings', 'music-player-for-woocommerce' ); ?></h1>
48
  <div style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;">
49
  <?php
50
+ _e( 'For reporting any issue or to request a customization, <a href="https://wordpress.dwbooster.com/contact-us" target="_blank">CLICK HERE</a><br />For testing the premium version of the plugin, visit the online demo:<br/> <a href="https://demos.dwbooster.com/music-player-for-woocommerce/wp-login.php" target="_blank">Administration area: Click to access the administration area demo</a><br/> <a href="https://demos.dwbooster.com/music-player-for-woocommerce/" target="_blank">Public page: Click to visit the WooCommerce Store</a>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput
 
 
 
 
 
51
  ?>
52
  </div>
53
  <form method="post">
66
  <td>
67
  <div style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;">
68
  <?php
69
+ _e( '<p>The player uses the audio files associated to the product. If you want protecting the audio files for selling, tick the checkbox: <b>"Protect the file"</b>, in whose case the plugin will create a truncated version of the audio files for selling to be used for demo. The size of audio files for demo is based on the number entered through the attribute: <b>"Percent of audio used for protected playbacks"</b>.</p><p><b>Protecting the files prevents that malicious users can access to the original audio files without pay for them.</b></p>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput
 
 
 
70
  ?>
71
  </div>
72
  </td>
231
  </td>
232
  <td>
233
  <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 />
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' ); // phpcs:ignore WordPress.Security.EscapeOutput ?><br>
235
  <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 ) {
236
  print 'checked';} ?>> <?php esc_html_e( 'Forces the audio player to be displayed in the product title.', 'music-player-for-woocommerce' ); ?>
237
  </td>
242
  </td>
243
  <td>
244
  <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 />
245
+ <?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' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
246
  </td>
247
  </tr>
248
  <tr>
249
  <td></td>
250
+ <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' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></td>
251
  </tr>
252
  </table>
253
  <table class="widefat wcmp-player-settings" style="border:1px solid #e1e1e1;">
259
  <td width="30%"><?php esc_html_e( 'Include in', 'music-player-for-woocommerce' ); ?></td>
260
  <td>
261
  <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' : '' ); ?> />
262
+ <?php _e( 'single-entry pages <i>(Product\'s page only)</i>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?><br />
263
 
264
  <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' : '' ); ?> />
265
+ <?php _e( 'multiple entries pages <i>(Shop pages, archive pages, but not in the product\'s page)</i>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?><br />
266
 
267
  <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' : '' ); ?> />
268
+ <?php _e( 'all pages <i>(with single or multiple-entries)</i>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
269
  </td>
270
  </tr>
271
  <tr>
views/player_options.php CHANGED
@@ -47,13 +47,10 @@ $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post-
47
  <?php if ( current_user_can( 'manage_options' ) ) : ?>
48
  <div class="wcmp-highlight-box">
49
  <?php
50
- _e(
51
- '<p>The player uses the audio files associated to the product. If you want protecting the audio files for selling, tick the checkbox: <b>"Protect the file"</b>, in whose case the plugin will create a truncated version of the audio files for selling to be used for demo. The size of audio files for demo is based on the number entered through the attribute: <b>"Percent of audio used for protected playbacks"</b>.</p><p><b>Protecting the files prevents that malicious users can access to the original audio files without pay for them.</b></p>',
52
- 'music-player-for-woocommerce'
53
- );
54
  ?>
55
  <p><?php esc_html_e( 'The security feature and particular files for demo are 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></p>
56
- <p><?php _e( 'For testing the premium version of the plugin, visit the online demo:<br/> <a href="https://demos.dwbooster.com/music-player-for-woocommerce/wp-login.php" target="_blank">Administration area: Click to access the administration area demo</a><br/><a href="https://demos.dwbooster.com/music-player-for-woocommerce/" target="_blank">Public page: Click to visit the WooCommerce Store</a>', 'music-player-for-woocommerce' ); ?></p>
57
  </div>
58
  <?php endif; ?>
59
  <div class="wcmp-highlight-box">
@@ -72,19 +69,19 @@ $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post-
72
  <li>
73
  <p> -
74
  <?php
75
- _e(
76
- 'Go to Drive, press the right click on the file to use, and select the option: <b>"Get Shareable Link"</b>',
77
  'music-player-for-woocommerce'
78
  );
79
- ?>
80
  </p>
81
  <p>
82
  <?php
83
- _e(
84
- 'The previous action will generate an url with the structure: <b>https://drive.google.com/open?id=FILE_ID</b>',
85
  'music-player-for-woocommerce'
86
  );
87
- ?>
88
  </p>
89
  </li>
90
  <li>
@@ -101,10 +98,7 @@ $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post-
101
  </p>
102
  <p>
103
  <?php
104
- _e(
105
- '<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as the last one in the URL',
106
- 'music-player-for-woocommerce'
107
- );
108
  ?>
109
  </p>
110
  </li>
@@ -119,21 +113,18 @@ $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post-
119
  <li>
120
  <p> -
121
  <?php
122
- _e(
123
- 'Sign in to <a href="https://www.dropbox.com/login" target="_blank">dropbox.com </a>',
124
  'music-player-for-woocommerce'
125
  );
126
- ?>
127
  </p>
128
  </li>
129
  <li>
130
  <p> -
131
  <?php
132
- _e(
133
- "Hover your cursor over the file or folder you'd like to share and click <b>Share</b> when it appears.",
134
- 'music-player-for-woocommerce'
135
- );
136
- ?>
137
  </p>
138
  </li>
139
  <li>
@@ -147,28 +138,22 @@ $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post-
147
  </p>
148
  <p>
149
  <?php
150
- _e(
151
- 'The link structure would be similar to:<br> https://www.dropbox.com/s/rycvgn8iokfedmo/file.mp3?dl=0',
152
  'music-player-for-woocommerce'
153
  );
154
- ?>
155
  </p>
156
  </li>
157
  <li>
158
  <p> -
159
  <?php
160
- _e(
161
- 'Enter the URL into the WooCommerce product with the following structure:<br> https://www.dropbox.com/s/rycvgn8iokfedmo/file.mp3?dl=1&.mp3',
162
- 'music-player-for-woocommerce'
163
- );
164
- ?>
165
  </p>
166
  <p>
167
  <?php
168
- _e(
169
- '<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as the last one in the URL. Furthermore, the parameter <b>dl=0</b>, has been modified as <b>dl=1</b>',
170
- 'music-player-for-woocommerce'
171
- );
172
  ?>
173
  </p>
174
  </li>
@@ -189,13 +174,13 @@ $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_product_attr( $post-
189
  <td><?php esc_html_e( 'Include in', 'music-player-for-woocommerce' ); ?></td>
190
  <td>
191
  <input aria-label="<?php esc_attr_e( 'Include on products pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="single" <?php echo ( ( 'single' == $show_in ) ? 'checked' : '' ); ?> />
192
- <?php _e( 'single-entry pages <i>(Product\'s page only)</i>', 'music-player-for-woocommerce' ); ?><br />
193
 
194
  <input aria-label="<?php esc_attr_e( 'Include on multiple-entry pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="multiple" <?php echo ( ( 'multiple' == $show_in ) ? 'checked' : '' ); ?> />
195
- <?php _e( 'multiple entries pages <i>(Shop pages, archive pages, but not in the product\'s page)</i>', 'music-player-for-woocommerce' ); ?><br />
196
 
197
  <input aria-label="<?php esc_attr_e( 'Include on product and multiple-entry pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="all" <?php echo ( ( 'all' == $show_in ) ? 'checked' : '' ); ?> />
198
- <?php _e( 'all pages <i>(with single or multiple-entries)</i>', 'music-player-for-woocommerce' ); ?>
199
  </td>
200
  </tr>
201
  <tr>
47
  <?php if ( current_user_can( 'manage_options' ) ) : ?>
48
  <div class="wcmp-highlight-box">
49
  <?php
50
+ _e( '<p>The player uses the audio files associated to the product. If you want protecting the audio files for selling, tick the checkbox: <b>"Protect the file"</b>, in whose case the plugin will create a truncated version of the audio files for selling to be used for demo. The size of audio files for demo is based on the number entered through the attribute: <b>"Percent of audio used for protected playbacks"</b>.</p><p><b>Protecting the files prevents that malicious users can access to the original audio files without pay for them.</b></p>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput
 
 
 
51
  ?>
52
  <p><?php esc_html_e( 'The security feature and particular files for demo are 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></p>
53
+ <p><?php _e( 'For testing the premium version of the plugin, visit the online demo:<br/> <a href="https://demos.dwbooster.com/music-player-for-woocommerce/wp-login.php" target="_blank">Administration area: Click to access the administration area demo</a><br/><a href="https://demos.dwbooster.com/music-player-for-woocommerce/" target="_blank">Public page: Click to visit the WooCommerce Store</a>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?></p>
54
  </div>
55
  <?php endif; ?>
56
  <div class="wcmp-highlight-box">
69
  <li>
70
  <p> -
71
  <?php
72
+ esc_html_e(
73
+ 'Go to Drive, press the right click on the file to use, and select the option: ',
74
  'music-player-for-woocommerce'
75
  );
76
+ ?><b>"Get Shareable Link"</b>
77
  </p>
78
  <p>
79
  <?php
80
+ esc_html_e(
81
+ 'The previous action will generate an url with the structure: ',
82
  'music-player-for-woocommerce'
83
  );
84
+ ?><b>https://drive.google.com/open?id=FILE_ID</b>
85
  </p>
86
  </li>
87
  <li>
98
  </p>
99
  <p>
100
  <?php
101
+ _e( '<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as the last one in the URL', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput
 
 
 
102
  ?>
103
  </p>
104
  </li>
113
  <li>
114
  <p> -
115
  <?php
116
+ esc_html_e(
117
+ 'Sign in to ',
118
  'music-player-for-woocommerce'
119
  );
120
+ ?><a href="https://www.dropbox.com/login" target="_blank">dropbox.com </a>
121
  </p>
122
  </li>
123
  <li>
124
  <p> -
125
  <?php
126
+ _e( "Hover your cursor over the file or folder you'd like to share and click <b>Share</b> when it appears.", 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput
127
+ ?>
 
 
 
128
  </p>
129
  </li>
130
  <li>
138
  </p>
139
  <p>
140
  <?php
141
+ esc_html_e(
142
+ 'The link structure would be similar to:',
143
  'music-player-for-woocommerce'
144
  );
145
+ ?><br> https://www.dropbox.com/s/rycvgn8iokfedmo/file.mp3?dl=0
146
  </p>
147
  </li>
148
  <li>
149
  <p> -
150
  <?php
151
+ esc_html_e( 'Enter the URL into the WooCommerce product with the following structure:', 'music-player-for-woocommerce' );
152
+ ?><br> https://www.dropbox.com/s/rycvgn8iokfedmo/file.mp3?dl=1&.mp3
 
 
 
153
  </p>
154
  <p>
155
  <?php
156
+ _e( '<b>Note:</b> Pay attention to the use of the fake parameter: <b>&.mp3</b> as the last one in the URL. Furthermore, the parameter <b>dl=0</b>, has been modified as <b>dl=1</b>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput
 
 
 
157
  ?>
158
  </p>
159
  </li>
174
  <td><?php esc_html_e( 'Include in', 'music-player-for-woocommerce' ); ?></td>
175
  <td>
176
  <input aria-label="<?php esc_attr_e( 'Include on products pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="single" <?php echo ( ( 'single' == $show_in ) ? 'checked' : '' ); ?> />
177
+ <?php _e( 'single-entry pages <i>(Product\'s page only)</i>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?><br />
178
 
179
  <input aria-label="<?php esc_attr_e( 'Include on multiple-entry pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="multiple" <?php echo ( ( 'multiple' == $show_in ) ? 'checked' : '' ); ?> />
180
+ <?php _e( 'multiple entries pages <i>(Shop pages, archive pages, but not in the product\'s page)</i>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?><br />
181
 
182
  <input aria-label="<?php esc_attr_e( 'Include on product and multiple-entry pages', 'music-player-for-woocommerce' ); ?>" type="radio" name="_wcmp_show_in" value="all" <?php echo ( ( 'all' == $show_in ) ? 'checked' : '' ); ?> />
183
+ <?php _e( 'all pages <i>(with single or multiple-entries)</i>', 'music-player-for-woocommerce' ); // phpcs:ignore WordPress.Security.EscapeOutput ?>
184
  </td>
185
  </tr>
186
  <tr>
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.178
6
  Text Domain: music-player-for-woocommerce
7
  Author: CodePeople
8
  Author URI: https://wcmp.dwbooster.com
@@ -26,6 +26,7 @@ define( 'WCMP_DEFAULT_PLAYER_VOLUME', 1 );
26
  define( 'WCMP_DEFAULT_PLAYER_CONTROLS', 'default' );
27
  define( 'WCMP_DEFAULT_PlAYER_TITLE', 1 );
28
  define( 'WCMP_REMOTE_TIMEOUT', 120 );
 
29
 
30
  // Load widgets
31
  require_once 'widgets/playlist_widget.php';
@@ -444,11 +445,11 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
444
 
445
  // Registering resources
446
  wp_enqueue_style( 'wp-mediaelement' );
447
- wp_enqueue_style( 'wp-mediaelement-skins', 'https://cdnjs.cloudflare.com/ajax/libs/mediaelement/2.23.5/mejs-skins.min.css', array(), '1.0.178' );
448
- wp_enqueue_style( 'wcmp-style', plugin_dir_url( __FILE__ ) . 'css/style.css', array(), '1.0.178' );
449
  wp_enqueue_script( 'jquery' );
450
  wp_enqueue_script( 'wp-mediaelement' );
451
- wp_enqueue_script( 'wcmp-script', plugin_dir_url( __FILE__ ) . 'js/public.js', array( 'jquery', 'wp-mediaelement' ), '1.0.178' );
452
 
453
  $play_all = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
454
  '_wcmp_play_all',
@@ -649,28 +650,21 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
649
  }
650
  }
651
 
652
- $products = $wpdb->get_results( $query );
653
 
654
  if ( ! empty( $products ) ) {
655
  $product_purchased_times = array();
656
  if ( $purchased_times ) {
657
  $products_ids_str = ( is_array( $products_ids ) ) ? implode( ',', $products_ids ) : $products_ids;
658
 
659
- $product_purchased_times = $wpdb->get_results(
660
- 'SELECT order_itemmeta.meta_value product_id, COUNT(order_itemmeta.meta_value) as times
661
- FROM
662
- ' . $wpdb->prefix . 'posts as orders INNER JOIN ' . $wpdb->prefix . 'woocommerce_order_items as order_items ON (orders.ID=order_items.order_id)
663
- INNER JOIN ' . $wpdb->prefix . 'woocommerce_order_itemmeta as order_itemmeta ON (order_items.order_item_id=order_itemmeta.order_item_id)
664
- WHERE orders.post_type="shop_order" AND orders.post_status="wc-completed" AND order_itemmeta.meta_key="_product_id" ' . ( strlen( $products_ids_str ) && false === strpos( '*', $products_ids_str ) ? ' AND order_itemmeta.meta_value IN (' . $products_ids_str . ')' : '' ) . '
665
- GROUP BY order_itemmeta.meta_value'
666
- );
667
  }
668
 
669
  // Enqueue resources
670
 
671
  $this->enqueue_resources();
672
- wp_enqueue_style( 'wcmp-playlist-widget-style', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/css/style.css', array(), '1.0.178' );
673
- wp_enqueue_script( 'wcmp-playlist-widget-script', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/js/public.js', array(), '1.0.178' );
674
  wp_localize_script(
675
  'wcmp-playlist-widget-script',
676
  'wcmp_widget_settings',
@@ -707,7 +701,8 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
707
  $purchased_times ?
708
  '<span class="wcmp-purchased-times">' .
709
  sprintf(
710
- __( $this->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' ), 'music-player-for-woocommerce' ),
 
711
  $get_times( $product->ID, $product_purchased_times )
712
  ) . '</span>' : ''
713
  ) .
@@ -800,7 +795,8 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
800
  $purchased_times ?
801
  '<span class="wcmp-purchased-times">' .
802
  sprintf(
803
- __( $this->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' ), 'music-player-for-woocommerce' ),
 
804
  $get_times( $product->ID, $product_purchased_times )
805
  ) . '</span>' : ''
806
  )
@@ -830,7 +826,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
830
  return $allowedposttags;
831
  } // End allowed_html_tags
832
 
833
- public function preload ( $preload, $audio_url ) {
834
  $result = $preload;
835
  if ( strpos( $audio_url, 'wcmp-action=play' ) !== false ) {
836
  if ( $this->_preload_times ) {
@@ -992,12 +988,12 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
992
 
993
  $output = '<div class="wcmp-player-container product-' . esc_attr( $file['product'] ) . '">' . $audio_tag . '</div>';
994
  if ( $_echo ) {
995
- print $output;
996
  }
997
 
998
  do_action( 'wcmp_after_player_shop_page', $id );
999
 
1000
- return $output;
1001
  }
1002
  } // End include_main_player
1003
 
@@ -1060,7 +1056,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1060
  $audio_url
1061
  );
1062
  $title = esc_html( ( $player_title ) ? apply_filters( 'wcmp_file_name', $file['name'], $id, $index ) : '' );
1063
- print '<div class="wcmp-player-container ' . esc_attr( $merge_grouped_clss ) . ' product-' . esc_attr( $file['product'] ) . '">' . $audio_tag . '</div><div class="wcmp-player-title">' . $title . '</div><div style="clear:both;"></div>';
1064
  } elseif ( $counter > 1 ) {
1065
  $before = '<table class="wcmp-player-list ' . $merge_grouped_clss . '">';
1066
  $after = '';
@@ -1088,16 +1084,16 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1088
  );
1089
  $title = esc_html( ( $player_title ) ? apply_filters( 'wcmp_file_name', $file['name'], $id, $index ) : '' );
1090
 
1091
- print $before;
1092
  $before = '';
1093
  $after = '</table>';
1094
  if ( 'all' != $player_controls ) {
1095
- print '<tr class="' . esc_attr( $evenOdd ) . ' product-' . esc_attr( $file['product'] ) . '"><td class="wcmp-player-container wcmp-column-player-' . esc_attr( $player_style ) . '">' . $audio_tag . '</td><td class="wcmp-player-title wcmp-column-player-title">' . $title . '</td></tr>';
1096
  } else {
1097
- print '<tr class="' . esc_attr( $evenOdd ) . ' product-' . esc_attr( $file['product'] ) . '"><td><div class="wcmp-player-container">' . $audio_tag . '</div><div class="wcmp-player-title wcmp-column-player-title">' . $title . '</div></td></tr>';
1098
  }
1099
  }
1100
- print $after;
1101
  }
1102
  do_action( 'wcmp_after_players_product_page', $id );
1103
  }
@@ -1210,7 +1206,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1210
  $wp_scripts->do_items();
1211
  }
1212
 
1213
- print '<div class="wcmp-preview-container">' . $output . '</div>';
1214
  print '<script type="text/javascript">jQuery(window).on("load", function(){ var frameEl = window.frameElement; if(frameEl) frameEl.height = jQuery(".wcmp-preview-container").outerHeight(true)+25; });</script>';
1215
  exit;
1216
  }
@@ -1448,7 +1444,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1448
 
1449
  $audio_files = array();
1450
  foreach ( $files as $index => $file ) {
1451
- if ( ! empty( $file['file'] ) && false !== ( $media_type = $this->_is_audio( $file['file'] ) ) ) {
1452
  $file['media_type'] = $media_type;
1453
 
1454
  if ( ! empty( $args['file_id'] ) ) {
@@ -1515,7 +1511,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1515
  } else {
1516
  try {
1517
  $c = false;
1518
- if ( ( $path = $this->_is_local( $url_fixed ) ) !== false ) {
1519
  $c = copy( $path, $file_path );
1520
  } else {
1521
  $response = wp_remote_get(
2
  /*
3
  Plugin Name: Music Player for WooCommerce
4
  Plugin URI: https://wcmp.dwbooster.com
5
+ Version: 1.0.179
6
  Text Domain: music-player-for-woocommerce
7
  Author: CodePeople
8
  Author URI: https://wcmp.dwbooster.com
26
  define( 'WCMP_DEFAULT_PLAYER_CONTROLS', 'default' );
27
  define( 'WCMP_DEFAULT_PlAYER_TITLE', 1 );
28
  define( 'WCMP_REMOTE_TIMEOUT', 120 );
29
+ define( 'WCMP_VERSION', '1.0.179' );
30
 
31
  // Load widgets
32
  require_once 'widgets/playlist_widget.php';
445
 
446
  // Registering resources
447
  wp_enqueue_style( 'wp-mediaelement' );
448
+ wp_enqueue_style( 'wp-mediaelement-skins', 'https://cdnjs.cloudflare.com/ajax/libs/mediaelement/2.23.5/mejs-skins.min.css', array(), WCMP_VERSION );
449
+ wp_enqueue_style( 'wcmp-style', plugin_dir_url( __FILE__ ) . 'css/style.css', array(), WCMP_VERSION );
450
  wp_enqueue_script( 'jquery' );
451
  wp_enqueue_script( 'wp-mediaelement' );
452
+ wp_enqueue_script( 'wcmp-script', plugin_dir_url( __FILE__ ) . 'js/public.js', array( 'jquery', 'wp-mediaelement' ), WCMP_VERSION );
453
 
454
  $play_all = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
455
  '_wcmp_play_all',
650
  }
651
  }
652
 
653
+ $products = $wpdb->get_results( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
654
 
655
  if ( ! empty( $products ) ) {
656
  $product_purchased_times = array();
657
  if ( $purchased_times ) {
658
  $products_ids_str = ( is_array( $products_ids ) ) ? implode( ',', $products_ids ) : $products_ids;
659
 
660
+ $product_purchased_times = $wpdb->get_results( 'SELECT order_itemmeta.meta_value product_id, COUNT(order_itemmeta.meta_value) as times FROM ' . $wpdb->prefix . 'posts as orders INNER JOIN ' . $wpdb->prefix . 'woocommerce_order_items as order_items ON (orders.ID=order_items.order_id) INNER JOIN ' . $wpdb->prefix . 'woocommerce_order_itemmeta as order_itemmeta ON (order_items.order_item_id=order_itemmeta.order_item_id) WHERE orders.post_type="shop_order" AND orders.post_status="wc-completed" AND order_itemmeta.meta_key="_product_id" ' . ( strlen( $products_ids_str ) && false === strpos( '*', $products_ids_str ) ? ' AND order_itemmeta.meta_value IN (' . $products_ids_str . ')' : '' ) . ' GROUP BY order_itemmeta.meta_value' ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
 
 
 
 
 
 
 
661
  }
662
 
663
  // Enqueue resources
664
 
665
  $this->enqueue_resources();
666
+ wp_enqueue_style( 'wcmp-playlist-widget-style', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/css/style.css', array(), WCMP_VERSION );
667
+ wp_enqueue_script( 'wcmp-playlist-widget-script', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/js/public.js', array(), WCMP_VERSION );
668
  wp_localize_script(
669
  'wcmp-playlist-widget-script',
670
  'wcmp_widget_settings',
701
  $purchased_times ?
702
  '<span class="wcmp-purchased-times">' .
703
  sprintf(
704
+ /* translators: %d: purchased times */
705
+ __( $this->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' ), 'music-player-for-woocommerce' ), // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
706
  $get_times( $product->ID, $product_purchased_times )
707
  ) . '</span>' : ''
708
  ) .
795
  $purchased_times ?
796
  '<span class="wcmp-purchased-times">' .
797
  sprintf(
798
+ /* translators: %d: purchased times */
799
+ __( $this->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' ), 'music-player-for-woocommerce' ), // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
800
  $get_times( $product->ID, $product_purchased_times )
801
  ) . '</span>' : ''
802
  )
826
  return $allowedposttags;
827
  } // End allowed_html_tags
828
 
829
+ public function preload( $preload, $audio_url ) {
830
  $result = $preload;
831
  if ( strpos( $audio_url, 'wcmp-action=play' ) !== false ) {
832
  if ( $this->_preload_times ) {
988
 
989
  $output = '<div class="wcmp-player-container product-' . esc_attr( $file['product'] ) . '">' . $audio_tag . '</div>';
990
  if ( $_echo ) {
991
+ print $output; // phpcs:ignore WordPress.Security.EscapeOutput
992
  }
993
 
994
  do_action( 'wcmp_after_player_shop_page', $id );
995
 
996
+ return $output; // phpcs:ignore WordPress.Security.EscapeOutput
997
  }
998
  } // End include_main_player
999
 
1056
  $audio_url
1057
  );
1058
  $title = esc_html( ( $player_title ) ? apply_filters( 'wcmp_file_name', $file['name'], $id, $index ) : '' );
1059
+ print '<div class="wcmp-player-container ' . esc_attr( $merge_grouped_clss ) . ' product-' . esc_attr( $file['product'] ) . '">' . $audio_tag . '</div><div class="wcmp-player-title">' . wp_kses_post( $title ) . '</div><div style="clear:both;"></div>'; // phpcs:ignore WordPress.Security.EscapeOutput
1060
  } elseif ( $counter > 1 ) {
1061
  $before = '<table class="wcmp-player-list ' . $merge_grouped_clss . '">';
1062
  $after = '';
1084
  );
1085
  $title = esc_html( ( $player_title ) ? apply_filters( 'wcmp_file_name', $file['name'], $id, $index ) : '' );
1086
 
1087
+ print $before; // phpcs:ignore WordPress.Security.EscapeOutput
1088
  $before = '';
1089
  $after = '</table>';
1090
  if ( 'all' != $player_controls ) {
1091
+ print '<tr class="' . esc_attr( $evenOdd ) . ' product-' . esc_attr( $file['product'] ) . '"><td class="wcmp-player-container wcmp-column-player-' . esc_attr( $player_style ) . '">' . $audio_tag . '</td><td class="wcmp-player-title wcmp-column-player-title">' . wp_kses_post( $title ) . '</td></tr>'; // phpcs:ignore WordPress.Security.EscapeOutput
1092
  } else {
1093
+ print '<tr class="' . esc_attr( $evenOdd ) . ' product-' . esc_attr( $file['product'] ) . '"><td><div class="wcmp-player-container">' . $audio_tag . '</div><div class="wcmp-player-title wcmp-column-player-title">' . wp_kses_post( $title ) . '</div></td></tr>'; // phpcs:ignore WordPress.Security.EscapeOutput
1094
  }
1095
  }
1096
+ print $after; // phpcs:ignore WordPress.Security.EscapeOutput
1097
  }
1098
  do_action( 'wcmp_after_players_product_page', $id );
1099
  }
1206
  $wp_scripts->do_items();
1207
  }
1208
 
1209
+ print '<div class="wcmp-preview-container">' . $output . '</div>'; // phpcs:ignore WordPress.Security.EscapeOutput
1210
  print '<script type="text/javascript">jQuery(window).on("load", function(){ var frameEl = window.frameElement; if(frameEl) frameEl.height = jQuery(".wcmp-preview-container").outerHeight(true)+25; });</script>';
1211
  exit;
1212
  }
1444
 
1445
  $audio_files = array();
1446
  foreach ( $files as $index => $file ) {
1447
+ if ( ! empty( $file['file'] ) && false !== ( $media_type = $this->_is_audio( $file['file'] ) ) ) { // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments
1448
  $file['media_type'] = $media_type;
1449
 
1450
  if ( ! empty( $args['file_id'] ) ) {
1511
  } else {
1512
  try {
1513
  $c = false;
1514
+ if ( ( $path = $this->_is_local( $url_fixed ) ) !== false ) { // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments
1515
  $c = copy( $path, $file_path );
1516
  } else {
1517
  $response = wp_remote_get(
widgets/playlist_widget.php CHANGED
@@ -1,161 +1,181 @@
1
- <?php
2
- if(!function_exists('wcmp_register_playlist_widget'))
3
- {
4
- function wcmp_register_playlist_widget()
5
- {
6
- if(!class_exists('woocommerce')) return;
7
- return register_widget("WCMP_PLAYLIST_WIDGET");
8
- }
9
- }
10
- add_action( 'widgets_init', 'wcmp_register_playlist_widget' );
11
-
12
- if( !class_exists( 'WCMP_PLAYLIST_WIDGET' ) )
13
- {
14
- class WCMP_PLAYLIST_WIDGET extends WP_Widget
15
- {
16
- function __construct()
17
- {
18
- $widget_ops = array('classname' => 'WCMP_PLAYLIST_WIDGET', 'description' => 'Includes a playlist with the audio files of products selected' );
19
-
20
- parent::__construct('WCMP_PLAYLIST_WIDGET', 'Music Player for WooCommerce - Playlist', $widget_ops);
21
- }
22
-
23
- function form($instance)
24
- {
25
- $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'products_ids' => '', 'volume' => '', 'highlight_current_product' => 0, 'continue_playing' => 0, 'player_style' => WCMP_DEFAULT_PLAYER_LAYOUT ) );
26
-
27
- $title = sanitize_text_field($instance['title']);
28
- $products_ids = sanitize_text_field($instance['products_ids']);
29
- $volume = sanitize_text_field($instance['volume']);
30
- $highlight_current_product = sanitize_text_field($instance['highlight_current_product']);
31
- $continue_playing = sanitize_text_field($instance['continue_playing']);
32
- $player_style = sanitize_text_field($instance['player_style']);
33
- $playlist_layout = sanitize_text_field((!empty($instance['playlist_layout'])) ? $instance['playlist_layout'] : 'new');
34
-
35
- $play_all = sanitize_text_field($GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
36
- '_wcmp_play_all',
37
- // This option is only for compatibility with versions previous to 1.0.28
38
- $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
39
- 'play_all',
40
- 0
41
- )
42
- ));
43
- $preload = sanitize_text_field($GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
44
- '_wcmp_preload',
45
- // This option is only for compatibility with versions previous to 1.0.28
46
- $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
47
- 'preload',
48
- 'metadata'
49
- )
50
- ));
51
- ?>
52
- <p>
53
- <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title', 'music-player-for-woocommerce' ); ?>: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label>
54
- </p>
55
- <p>
56
- <label for="<?php echo $this->get_field_id('products_ids'); ?>"><?php _e( 'Products IDs', 'music-player-for-woocommerce' ); ?>: <input class="widefat" id="<?php echo $this->get_field_id('products_ids'); ?>" name="<?php echo $this->get_field_name('products_ids'); ?>" type="text" value="<?php echo esc_attr($products_ids); ?>" placeholder="<?php _e( 'Products IDs separated by comma, or a * for all', 'music-player-for-woocommerce' ); ?>" /></label>
57
- </p>
58
- <p>
59
- <?php
60
- _e( 'Enter the ID of products separated by comma, or a * symbol to includes all products in the playlist.', 'music-player-for-woocommerce' );
61
- ?>
62
- </p>
63
- <p>
64
- <label><?php _e('Volume (enter a number between 0 and 1)', 'music-player-for-woocommerce'); ?>: <input class="widefat" name="<?php echo $this->get_field_name('volume'); ?>" type="number" min="0" max="1" step="0.01" value="<?php echo esc_attr($volume); ?>" /></label>
65
- </p>
66
- <p>
67
- <label for="<?php echo $this->get_field_id('playlist_layout'); ?>"><?php _e( 'Playlist layout', 'music-player-for-woocommerce' ); ?>: </label>
68
- </p>
69
- <p>
70
- <label><input name="<?php echo $this->get_field_name('playlist_layout'); ?>" type="radio" value="new" <?php echo (($playlist_layout == 'new') ? 'checked' : '') ;?> style="float:left; margin-top:8px;" /><?php _e('New layout', 'music-player-for-woocommerce'); ?></label>
71
- </p>
72
- <p>
73
- <label><input name="<?php echo $this->get_field_name('playlist_layout'); ?>" type="radio" value="old" <?php echo (($playlist_layout == 'old') ? 'checked' : '') ;?> style="float:left; margin-top:8px;" /><?php _e('Original layout', 'music-player-for-woocommerce'); ?></label>
74
- </p>
75
- <p>
76
- <label for="<?php echo $this->get_field_id('player_style'); ?>"><?php _e( 'Player layout', 'music-player-for-woocommerce' ); ?>: </label>
77
- </p>
78
- <p>
79
- <label><input name="<?php echo $this->get_field_name('player_style'); ?>" type="radio" value="mejs-classic" <?php echo (($player_style == 'mejs-classic') ? 'checked' : '') ;?> style="float:left; margin-top:8px;" /><img src="<?php print esc_url(WCMP_PLUGIN_URL); ?>/views/assets/skin1_btn.png" /></label>
80
- </p>
81
- <p>
82
- <label><input name="<?php echo $this->get_field_name('player_style'); ?>" type="radio" value="mejs-ted" <?php echo (($player_style == 'mejs-ted') ? 'checked' : '') ;?> style="float:left; margin-top:8px;" /><img src="<?php print esc_url(WCMP_PLUGIN_URL); ?>/views/assets/skin2_btn.png" /></label>
83
- </p>
84
- <p>
85
- <label><input name="<?php echo $this->get_field_name('player_style'); ?>" type="radio" value="mejs-wmp" <?php echo (($player_style == 'mejs-wmp') ? 'checked' : '') ;?> style="float:left; margin-top:16px;" /><img src="<?php print esc_url(WCMP_PLUGIN_URL); ?>/views/assets/skin3_btn.png" /></label>
86
- </p>
87
- <p>
88
- <label for="<?php echo $this->get_field_id('play_all'); ?>"><?php _e( 'Play all', 'music-player-for-woocommerce' ); ?>: <input id="<?php echo $this->get_field_id('play_all'); ?>" name="<?php echo $this->get_field_name('play_all'); ?>" type="checkbox" <?php echo ( ( $play_all ) ? 'CHECKED' : '' );
89
- ?> /></label>
90
- </p>
91
- <p>
92
- <label for="<?php echo $this->get_field_id('preload'); ?>"><?php _e( 'Preload', 'music-player-for-woocommerce' ); ?>:</label><br />
93
- <label><input name="<?php echo $this->get_field_name('preload'); ?>" type="radio" value="none" <?php echo ( ( $preload == 'none' ) ? 'CHECKED' : '' ); ?> /> None</label>
94
- <label><input name="<?php echo $this->get_field_name('preload'); ?>" type="radio" value="metadata" <?php echo ( ( $preload == 'metadata' ) ? 'CHECKED' : '' ); ?> /> Metadata</label>
95
- <label><input name="<?php echo $this->get_field_name('preload'); ?>" type="radio" value="auto" <?php echo ( ( $preload == 'auto' ) ? 'CHECKED' : '' ); ?> /> Auto</label>
96
- </p>
97
- <p>
98
- <label for="<?php echo $this->get_field_id('highlight_current_product'); ?>"><?php _e( 'Highlight the current product', 'music-player-for-woocommerce' ); ?>: <input id="<?php echo $this->get_field_id('highlight_current_product'); ?>" name="<?php echo $this->get_field_name('highlight_current_product'); ?>" type="checkbox" <?php echo ( ( $highlight_current_product ) ? 'CHECKED' : '' ); ?> /></label>
99
- </p>
100
- <p>
101
- <label for="<?php echo $this->get_field_id('continue_playing'); ?>"><?php _e( 'Continue playing after navigate', 'music-player-for-woocommerce' ); ?>: <input id="<?php echo $this->get_field_id('continue_playing'); ?>" name="<?php echo $this->get_field_name('continue_playing'); ?>" type="checkbox" <?php echo ( ( $continue_playing ) ? 'CHECKED' : '' ); ?> value="1" /></label>
102
- </p>
103
- <p>
104
- <?php
105
- _e( 'Continue playing the same song at same position after navigate. You can experiment some delay because the music player should to load the audio file again, and in some mobiles devices, where the action of the user is required, the player cannot starting playing automatically.', 'music-player-for-woocommerce' );
106
- ?>
107
- </p>
108
- <?php
109
- }
110
-
111
- function update($new_instance, $old_instance)
112
- {
113
- $instance = $old_instance;
114
- $instance['title'] = sanitize_text_field($new_instance['title']);
115
- $instance['products_ids'] = sanitize_text_field($new_instance['products_ids']);
116
- $instance['volume'] = sanitize_text_field($new_instance['volume']);
117
- $instance['highlight_current_product'] = (!empty($new_instance['highlight_current_product'])) ? true : false;
118
- $instance['continue_playing'] = (!empty($new_instance['continue_playing'])) ? true : false;
119
- $instance['player_style'] = sanitize_text_field($new_instance['player_style']);
120
- $instance['playlist_layout'] = sanitize_text_field((!empty($new_instance['playlist_layout'])) ? $new_instance['playlist_layout'] : 'new');
121
-
122
- $global_settings = get_option('wcmp_global_settings', array());
123
- $global_settings['_wcmp_play_all'] = (!empty($new_instance['play_all'])) ? 1 : 0;
124
- $global_settings['_wcmp_preload'] = (
125
- !empty($new_instance['preload']) &&
126
- in_array($new_instance['preload'], array('none','metadata','auto'))
127
- ) ? $new_instance['preload'] : 'metadata';
128
-
129
- update_option( 'wcmp_global_settings', $global_settings );
130
-
131
- return $instance;
132
- }
133
-
134
- function widget($args, $instance)
135
- {
136
- if(!is_array($args)) $args = array();
137
- extract($args, EXTR_SKIP);
138
-
139
- $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
140
-
141
- $attrs = array(
142
- 'products_ids' => $instance['products_ids'],
143
- 'highlight_current_product' => $instance['highlight_current_product'],
144
- 'continue_playing' => $instance['continue_playing'],
145
- 'player_style' => $instance['player_style'],
146
- 'layout' => (!empty($instance['playlist_layout'])) ? $instance['playlist_layout'] : 'new'
147
- );
148
-
149
- if(!empty($instance['volume']) && ($volume = @floatval($instance['volume'])) != 0) $attrs['volume'] = min(1,$volume);
150
-
151
- $output = $GLOBALS[ 'WooCommerceMusicPlayer' ]->replace_playlist_shortcode($attrs);
152
-
153
- if( strlen( $output ) == 0 ) return;
154
-
155
- print $before_widget;
156
- if (!empty($title)) print $before_title . $title . $after_title;
157
- print $output;
158
- print $after_widget;
159
- }
160
- } // End Class WCMP_PLAYLIST_WIDGET
161
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! function_exists( 'wcmp_register_playlist_widget' ) ) {
3
+ function wcmp_register_playlist_widget() {
4
+ if ( ! class_exists( 'woocommerce' ) ) {
5
+ return;
6
+ }
7
+ return register_widget( 'WCMP_PLAYLIST_WIDGET' );
8
+ }
9
+ }
10
+ add_action( 'widgets_init', 'wcmp_register_playlist_widget' );
11
+
12
+ if ( ! class_exists( 'WCMP_PLAYLIST_WIDGET' ) ) {
13
+ class WCMP_PLAYLIST_WIDGET extends WP_Widget {
14
+
15
+ public function __construct() {
16
+ $widget_ops = array(
17
+ 'classname' => 'WCMP_PLAYLIST_WIDGET',
18
+ 'description' => 'Includes a playlist with the audio files of products selected',
19
+ );
20
+
21
+ parent::__construct( 'WCMP_PLAYLIST_WIDGET', 'Music Player for WooCommerce - Playlist', $widget_ops );
22
+ }
23
+
24
+ public function form( $instance ) {
25
+ $instance = wp_parse_args(
26
+ (array) $instance,
27
+ array(
28
+ 'title' => '',
29
+ 'products_ids' => '',
30
+ 'volume' => '',
31
+ 'highlight_current_product' => 0,
32
+ 'continue_playing' => 0,
33
+ 'player_style' => WCMP_DEFAULT_PLAYER_LAYOUT,
34
+ )
35
+ );
36
+
37
+ $title = sanitize_text_field( $instance['title'] );
38
+ $products_ids = sanitize_text_field( $instance['products_ids'] );
39
+ $volume = sanitize_text_field( $instance['volume'] );
40
+ $highlight_current_product = sanitize_text_field( $instance['highlight_current_product'] );
41
+ $continue_playing = sanitize_text_field( $instance['continue_playing'] );
42
+ $player_style = sanitize_text_field( $instance['player_style'] );
43
+ $playlist_layout = sanitize_text_field( ( ! empty( $instance['playlist_layout'] ) ) ? $instance['playlist_layout'] : 'new' );
44
+
45
+ $play_all = sanitize_text_field(
46
+ $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
47
+ '_wcmp_play_all',
48
+ // This option is only for compatibility with versions previous to 1.0.28
49
+ $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
50
+ 'play_all',
51
+ 0
52
+ )
53
+ )
54
+ );
55
+ $preload = sanitize_text_field(
56
+ $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
57
+ '_wcmp_preload',
58
+ // This option is only for compatibility with versions previous to 1.0.28
59
+ $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
60
+ 'preload',
61
+ 'metadata'
62
+ )
63
+ )
64
+ );
65
+ ?>
66
+ <p>
67
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'music-player-for-woocommerce' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></label>
68
+ </p>
69
+ <p>
70
+ <label for="<?php echo esc_attr( $this->get_field_id( 'products_ids' ) ); ?>"><?php esc_html_e( 'Products IDs', 'music-player-for-woocommerce' ); ?>: <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'products_ids' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'products_ids' ) ); ?>" type="text" value="<?php echo esc_attr( $products_ids ); ?>" placeholder="<?php esc_attr_e( 'Products IDs separated by comma, or a * for all', 'music-player-for-woocommerce' ); ?>" /></label>
71
+ </p>
72
+ <p>
73
+ <?php
74
+ esc_html_e( 'Enter the ID of products separated by comma, or a * symbol to includes all products in the playlist.', 'music-player-for-woocommerce' );
75
+ ?>
76
+ </p>
77
+ <p>
78
+ <label><?php esc_html_e( 'Volume (enter a number between 0 and 1)', 'music-player-for-woocommerce' ); ?>: <input class="widefat" name="<?php echo esc_attr( $this->get_field_name( 'volume' ) ); ?>" type="number" min="0" max="1" step="0.01" value="<?php echo esc_attr( $volume ); ?>" /></label>
79
+ </p>
80
+ <p>
81
+ <label for="<?php echo esc_attr( $this->get_field_id( 'playlist_layout' ) ); ?>"><?php esc_html_e( 'Playlist layout', 'music-player-for-woocommerce' ); ?>: </label>
82
+ </p>
83
+ <p>
84
+ <label><input name="<?php echo esc_attr( $this->get_field_name( 'playlist_layout' ) ); ?>" type="radio" value="new" <?php echo ( ( 'new' == $playlist_layout ) ? 'checked' : '' ); ?> style="float:left; margin-top:8px;" /><?php esc_html_e( 'New layout', 'music-player-for-woocommerce' ); ?></label>
85
+ </p>
86
+ <p>
87
+ <label><input name="<?php echo esc_attr( $this->get_field_name( 'playlist_layout' ) ); ?>" type="radio" value="old" <?php echo ( ( 'old' == $playlist_layout ) ? 'checked' : '' ); ?> style="float:left; margin-top:8px;" /><?php esc_html_e( 'Original layout', 'music-player-for-woocommerce' ); ?></label>
88
+ </p>
89
+ <p>
90
+ <label for="<?php echo esc_attr( $this->get_field_id( 'player_style' ) ); ?>"><?php esc_html_e( 'Player layout', 'music-player-for-woocommerce' ); ?>: </label>
91
+ </p>
92
+ <p>
93
+ <label><input name="<?php echo esc_attr( $this->get_field_name( 'player_style' ) ); ?>" type="radio" value="mejs-classic" <?php echo ( ( 'mejs-classic' == $player_style ) ? 'checked' : '' ); ?> style="float:left; margin-top:8px;" /><img src="<?php print esc_url( WCMP_PLUGIN_URL ); ?>/views/assets/skin1_btn.png" /></label>
94
+ </p>
95
+ <p>
96
+ <label><input name="<?php echo esc_attr( $this->get_field_name( 'player_style' ) ); ?>" type="radio" value="mejs-ted" <?php echo ( ( 'mejs-ted' == $player_style ) ? 'checked' : '' ); ?> style="float:left; margin-top:8px;" /><img src="<?php print esc_url( WCMP_PLUGIN_URL ); ?>/views/assets/skin2_btn.png" /></label>
97
+ </p>
98
+ <p>
99
+ <label><input name="<?php echo esc_attr( $this->get_field_name( 'player_style' ) ); ?>" type="radio" value="mejs-wmp" <?php echo ( ( 'mejs-wmp' == $player_style ) ? 'checked' : '' ); ?> style="float:left; margin-top:16px;" /><img src="<?php print esc_url( WCMP_PLUGIN_URL ); ?>/views/assets/skin3_btn.png" /></label>
100
+ </p>
101
+ <p>
102
+ <label for="<?php echo esc_attr( $this->get_field_id( 'play_all' ) ); ?>"><?php esc_html_e( 'Play all', 'music-player-for-woocommerce' ); ?>: <input id="<?php echo esc_attr( $this->get_field_id( 'play_all' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'play_all' ) ); ?>" type="checkbox" <?php echo ( ( $play_all ) ? 'CHECKED' : '' );
103
+ ?> /></label>
104
+ </p>
105
+ <p>
106
+ <label for="<?php echo esc_attr( $this->get_field_id( 'preload' ) ); ?>"><?php esc_html_e( 'Preload', 'music-player-for-woocommerce' ); ?>:</label><br />
107
+ <label><input name="<?php echo esc_attr( $this->get_field_name( 'preload' ) ); ?>" type="radio" value="none" <?php echo ( ( 'none' == $preload ) ? 'CHECKED' : '' ); ?> /> None</label>
108
+ <label><input name="<?php echo esc_attr( $this->get_field_name( 'preload' ) ); ?>" type="radio" value="metadata" <?php echo ( ( 'metadata' == $preload ) ? 'CHECKED' : '' ); ?> /> Metadata</label>
109
+ <label><input name="<?php echo esc_attr( $this->get_field_name( 'preload' ) ); ?>" type="radio" value="auto" <?php echo ( ( 'auto' == $preload ) ? 'CHECKED' : '' ); ?> /> Auto</label>
110
+ </p>
111
+ <p>
112
+ <label for="<?php echo esc_attr( $this->get_field_id( 'highlight_current_product' ) ); ?>"><?php esc_html_e( 'Highlight the current product', 'music-player-for-woocommerce' ); ?>: <input id="<?php echo esc_attr( $this->get_field_id( 'highlight_current_product' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'highlight_current_product' ) ); ?>" type="checkbox" <?php echo ( ( $highlight_current_product ) ? 'CHECKED' : '' ); ?> /></label>
113
+ </p>
114
+ <p>
115
+ <label for="<?php echo esc_attr( $this->get_field_id( 'continue_playing' ) ); ?>"><?php esc_html_e( 'Continue playing after navigate', 'music-player-for-woocommerce' ); ?>: <input id="<?php echo esc_attr( $this->get_field_id( 'continue_playing' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'continue_playing' ) ); ?>" type="checkbox" <?php echo ( ( $continue_playing ) ? 'CHECKED' : '' ); ?> value="1" /></label>
116
+ </p>
117
+ <p>
118
+ <?php
119
+ esc_html_e( 'Continue playing the same song at same position after navigate. You can experiment some delay because the music player should to load the audio file again, and in some mobiles devices, where the action of the user is required, the player cannot starting playing automatically.', 'music-player-for-woocommerce' );
120
+ ?>
121
+ </p>
122
+ <?php
123
+ }
124
+
125
+ public function update( $new_instance, $old_instance ) {
126
+ $instance = $old_instance;
127
+ $instance['title'] = sanitize_text_field( $new_instance['title'] );
128
+ $instance['products_ids'] = sanitize_text_field( $new_instance['products_ids'] );
129
+ $instance['volume'] = sanitize_text_field( $new_instance['volume'] );
130
+ $instance['highlight_current_product'] = ( ! empty( $new_instance['highlight_current_product'] ) ) ? true : false;
131
+ $instance['continue_playing'] = ( ! empty( $new_instance['continue_playing'] ) ) ? true : false;
132
+ $instance['player_style'] = sanitize_text_field( $new_instance['player_style'] );
133
+ $instance['playlist_layout'] = sanitize_text_field( ( ! empty( $new_instance['playlist_layout'] ) ) ? $new_instance['playlist_layout'] : 'new' );
134
+
135
+ $global_settings = get_option( 'wcmp_global_settings', array() );
136
+ $global_settings['_wcmp_play_all'] = ( ! empty( $new_instance['play_all'] ) ) ? 1 : 0;
137
+ $global_settings['_wcmp_preload'] = (
138
+ ! empty( $new_instance['preload'] ) &&
139
+ in_array( $new_instance['preload'], array( 'none', 'metadata', 'auto' ) )
140
+ ) ? $new_instance['preload'] : 'metadata';
141
+
142
+ update_option( 'wcmp_global_settings', $global_settings );
143
+
144
+ return $instance;
145
+ }
146
+
147
+ public function widget( $args, $instance ) {
148
+ if ( ! is_array( $args ) ) {
149
+ $args = array();
150
+ }
151
+ extract( $args, EXTR_SKIP ); // phpcs:ignore WordPress.PHP.DontExtract
152
+
153
+ $title = empty( $instance['title'] ) ? ' ' : apply_filters( 'widget_title', $instance['title'] );
154
+
155
+ $attrs = array(
156
+ 'products_ids' => $instance['products_ids'],
157
+ 'highlight_current_product' => $instance['highlight_current_product'],
158
+ 'continue_playing' => $instance['continue_playing'],
159
+ 'player_style' => $instance['player_style'],
160
+ 'layout' => ( ! empty( $instance['playlist_layout'] ) ) ? $instance['playlist_layout'] : 'new',
161
+ );
162
+
163
+ if ( ! empty( $instance['volume'] ) && ( $volume = @floatval( $instance['volume'] ) ) != 0 ) { // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments
164
+ $attrs['volume'] = min( 1, $volume );
165
+ }
166
+
167
+ $output = $GLOBALS['WooCommerceMusicPlayer']->replace_playlist_shortcode( $attrs );
168
+
169
+ if ( strlen( $output ) == 0 ) {
170
+ return;
171
+ }
172
+
173
+ print $before_widget; // phpcs:ignore WordPress.Security.EscapeOutput
174
+ if ( ! empty( $title ) ) {
175
+ print $before_title . $title . $after_title; // phpcs:ignore WordPress.Security.EscapeOutput
176
+ }
177
+ print $output; // phpcs:ignore WordPress.Security.EscapeOutput
178
+ print $after_widget; // phpcs:ignore WordPress.Security.EscapeOutput
179
+ }
180
+ } // End Class WCMP_PLAYLIST_WIDGET
181
+ }