Music Player for WooCommerce - Version 1.0.177

Version Description

  • Implements the integration with Google Analytics 4.
Download this release

Release Info

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

Code changes from version 1.0.176 to 1.0.177

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-03-03 00:43+0100\n"
5
- "PO-Revision-Date: 2022-03-03 00:43+0100\n"
6
  "Last-Translator: CodePeople\n"
7
  "Language-Team: CodePeople\n"
8
  "Language: en_US\n"
@@ -10,7 +10,7 @@ msgstr ""
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
- "X-Generator: Poedit 3.0.1\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-KeywordsList: __;_e;esc_attr__;esc_attr_e\n"
16
  "X-Poedit-SearchPath-0: .\n"
@@ -95,15 +95,15 @@ msgstr ""
95
  msgid "Hides the players settings from vendors interface."
96
  msgstr ""
97
 
98
- #: addons/dokan/player_options.php:9 views/player_options.php:309
99
  msgid "File Name"
100
  msgstr ""
101
 
102
- #: addons/dokan/player_options.php:10 views/player_options.php:315
103
  msgid "Choose file"
104
  msgstr ""
105
 
106
- #: addons/dokan/player_options.php:11 views/player_options.php:318
107
  msgid "Delete"
108
  msgstr ""
109
 
@@ -123,97 +123,96 @@ msgstr ""
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 views/player_options.php:57
127
  msgid "[+|-] Tips"
128
  msgstr ""
129
 
130
- #: addons/dokan/player_options.php:67 views/player_options.php:63
131
  msgid "[+|-] Using the audio files stored on Google Drive"
132
  msgstr ""
133
 
134
- #: addons/dokan/player_options.php:75 views/player_options.php:71
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:79
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 views/player_options.php:89
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:100
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 views/player_options.php:110
159
  msgid "[+|-] Using the audio files stored on DropBox"
160
  msgstr ""
161
 
162
- #: addons/dokan/player_options.php:122 views/player_options.php:118
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:128
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 views/player_options.php:138
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:146
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:156
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:164
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:253
200
- #: views/player_options.php:181
201
  msgid "Enable player"
202
  msgstr ""
203
 
204
- #: addons/dokan/player_options.php:181 views/global_options.php:253
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 views/player_options.php:180
212
  msgid "Include music player"
213
  msgstr ""
214
 
215
- #: addons/dokan/player_options.php:185 views/global_options.php:256
216
- #: views/player_options.php:184
217
  msgid "Include in"
218
  msgstr ""
219
 
@@ -221,17 +220,17 @@ msgstr ""
221
  msgid "Include on products pages only"
222
  msgstr ""
223
 
224
- #: addons/dokan/player_options.php:188 views/global_options.php:259
225
- #: views/player_options.php:187
226
  msgid "single-entry pages <i>(Product's page only)</i>"
227
  msgstr ""
228
 
229
- #: addons/dokan/player_options.php:190 views/player_options.php:189
230
  msgid "Include on multiple-entry pages"
231
  msgstr ""
232
 
233
- #: addons/dokan/player_options.php:191 views/global_options.php:262
234
- #: views/player_options.php:190
235
  msgid ""
236
  "multiple entries pages <i>(Shop pages, archive pages, but not in the "
237
  "product's page)</i>"
@@ -241,104 +240,95 @@ msgstr ""
241
  msgid "Include on products and multiple-entry pages"
242
  msgstr ""
243
 
244
- #: addons/dokan/player_options.php:194 views/global_options.php:265
245
- #: views/player_options.php:193
246
  msgid "all pages <i>(with single or multiple-entries)</i>"
247
  msgstr ""
248
 
249
  #: addons/dokan/player_options.php:198 addons/dokan/player_options.php:199
250
- #: views/global_options.php:275 views/global_options.php:276
251
- #: views/player_options.php:197 views/player_options.php:198
252
  msgid "Merge in grouped products"
253
  msgstr ""
254
 
255
- #: addons/dokan/player_options.php:200 views/global_options.php:276
256
- #: views/player_options.php:198
257
  msgid ""
258
  "In grouped products, display the \"Add to cart\" buttons and quantity fields "
259
  "in the players rows"
260
  msgstr ""
261
 
262
- #: addons/dokan/player_options.php:203 views/global_options.php:279
263
- #: views/player_options.php:201 widgets/playlist_widget.php:76
264
  msgid "Player layout"
265
  msgstr ""
266
 
267
- #: addons/dokan/player_options.php:206 views/global_options.php:283
268
- #: views/global_options.php:284 views/player_options.php:205
269
- #: views/player_options.php:206
270
  msgid "Skin 1"
271
  msgstr ""
272
 
273
- #: addons/dokan/player_options.php:211 views/global_options.php:289
274
- #: views/player_options.php:210 views/player_options.php:211
275
  msgid "Skin 2"
276
  msgstr ""
277
 
278
- #: addons/dokan/player_options.php:216 views/global_options.php:293
279
- #: views/global_options.php:294 views/player_options.php:215
280
- #: views/player_options.php:216
281
  msgid "Skin 3"
282
  msgstr ""
283
 
284
- #: addons/dokan/player_options.php:222 views/global_options.php:301
285
- #: views/player_options.php:223 widgets/playlist_widget.php:92
286
  msgid "Preload"
287
  msgstr ""
288
 
289
- #: addons/dokan/player_options.php:224 views/global_options.php:304
290
- #: views/player_options.php:226
291
  msgid "Preload - none"
292
  msgstr ""
293
 
294
- #: addons/dokan/player_options.php:225 views/global_options.php:305
295
- #: views/player_options.php:227
296
  msgid "Preload - metadata"
297
  msgstr ""
298
 
299
- #: addons/dokan/player_options.php:226 views/global_options.php:306
300
- #: views/player_options.php:228
301
  msgid "Preload - auto"
302
  msgstr ""
303
 
304
- #: addons/dokan/player_options.php:230 views/global_options.php:311
305
- #: views/global_options.php:314 views/player_options.php:233
306
- #: views/player_options.php:236 widgets/playlist_widget.php:88
307
  msgid "Play all"
308
  msgstr ""
309
 
310
- #: addons/dokan/player_options.php:233 views/global_options.php:335
311
- #: views/player_options.php:246
312
  msgid "Player controls"
313
  msgstr ""
314
 
315
- #: addons/dokan/player_options.php:235 views/global_options.php:337
316
- #: views/player_options.php:248
317
  msgid "Play/pause button"
318
  msgstr ""
319
 
320
- #: addons/dokan/player_options.php:235 views/global_options.php:337
321
- #: views/player_options.php:248
322
  msgid "the play/pause button only"
323
  msgstr ""
324
 
325
- #: addons/dokan/player_options.php:236 views/global_options.php:338
326
- #: views/player_options.php:249
327
  msgid "All controls"
328
  msgstr ""
329
 
330
- #: addons/dokan/player_options.php:236 views/global_options.php:338
331
- #: views/player_options.php:249
332
  msgid "all controls"
333
  msgstr ""
334
 
335
- #: addons/dokan/player_options.php:237 views/global_options.php:339
336
- #: views/player_options.php:250
337
  msgid "Depending on context"
338
  msgstr ""
339
 
340
- #: addons/dokan/player_options.php:237 views/global_options.php:339
341
- #: views/player_options.php:250
342
  msgid "the play/pause button only, or all controls depending on context"
343
  msgstr ""
344
 
@@ -346,20 +336,17 @@ msgstr ""
346
  msgid "Player on cover"
347
  msgstr ""
348
 
349
- #: addons/dokan/player_options.php:241 views/global_options.php:344
350
- #: views/player_options.php:255
351
  msgid "for play/pause button players display them on cover images."
352
  msgstr ""
353
 
354
- #: addons/dokan/player_options.php:242 views/global_options.php:347
355
- #: views/player_options.php:258
356
  msgid ""
357
  "(This feature is experimental, and will depend on the theme active on the "
358
  "website.)"
359
  msgstr ""
360
 
361
- #: addons/dokan/player_options.php:247 views/global_options.php:354
362
- #: views/player_options.php:265
363
  msgid "Display the player's title"
364
  msgstr ""
365
 
@@ -414,7 +401,7 @@ msgstr ""
414
  #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:9
415
  #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:11
416
  #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:12 pagebuilders/builders.php:130
417
- #: pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:17 wcmp.php:225
418
  msgid "Music Player for WooCommerce"
419
  msgstr ""
420
 
@@ -452,11 +439,7 @@ msgstr ""
452
  msgid "Insert a playlist with the products players"
453
  msgstr ""
454
 
455
- #: views/global_options.php:41
456
- msgid "Music Player for WooCommerce - Global Settings"
457
- msgstr ""
458
-
459
- #: views/global_options.php:45
460
  msgid ""
461
  "For reporting any issue or to request a customization, <a href=\"https://"
462
  "wordpress.dwbooster.com/contact-us\" target=\"_blank\">CLICK HERE</a><br />\n"
@@ -468,23 +451,15 @@ msgid ""
468
  "target=\"_blank\">Public page: Click to visit the WooCommerce Store</a>"
469
  msgstr ""
470
 
471
- #: views/global_options.php:54
472
- msgid "Registering of Plugin"
473
- msgstr ""
474
-
475
- #: views/global_options.php:56
476
- msgid "Enter the email address of buyer"
477
- msgstr ""
478
-
479
- #: views/global_options.php:57
480
  msgid "Buyer email"
481
  msgstr ""
482
 
483
- #: views/global_options.php:57
484
  msgid "Register"
485
  msgstr ""
486
 
487
- #: views/global_options.php:69 views/player_options.php:46
488
  msgid ""
489
  "<p>The player uses the audio files associated to the product. If you want "
490
  "protecting the audio files for selling, tick the checkbox: <b>\"Protect the "
@@ -496,177 +471,102 @@ msgid ""
496
  "pay for them.</b></p>"
497
  msgstr ""
498
 
499
- #: views/global_options.php:80
500
- msgid "General Settings"
501
- msgstr ""
502
-
503
- #: views/global_options.php:83 views/global_options.php:84
504
  msgid "Include the players only for registered users"
505
  msgstr ""
506
 
507
- #: views/global_options.php:87 views/global_options.php:88
508
  msgid "Apply fade out to playing audio when possible"
509
  msgstr ""
510
 
511
- #: views/global_options.php:91
512
- msgid "Text for product purchased times in playlists"
513
- msgstr ""
514
-
515
- #: views/global_options.php:92
516
  msgid "Purchased times text"
517
  msgstr ""
518
 
519
- #: views/global_options.php:93
520
- msgid ""
521
- "Texts to display when the playlist shortcode includes the purchased_times "
522
- "attribute.<br>Ex."
523
- msgstr ""
524
-
525
- #: views/global_options.php:97
526
- msgid "The general settings affect only the PRO version of the plugin"
527
- msgstr ""
528
-
529
- #: views/global_options.php:97 views/global_options.php:360
530
- #: views/player_options.php:50 views/player_options.php:271
531
- msgid "CLICK HERE TO GET THE PRO VERSION OF THE PLUGIN"
532
- msgstr ""
533
-
534
- #: views/global_options.php:100 views/global_options.php:102
535
  msgid ""
536
  "For buyers, play the purchased audio files instead of the truncated files "
537
  "for demo"
538
  msgstr ""
539
 
540
- #: views/global_options.php:103
541
- msgid "Reset the files"
542
- msgstr ""
543
-
544
- #: views/global_options.php:104
545
  msgid "Reset files interval"
546
  msgstr ""
547
 
548
- #: views/global_options.php:105
549
- msgid "daily"
550
- msgstr ""
551
-
552
- #: views/global_options.php:113 views/global_options.php:114
553
  msgid "Truncate the audio files for demo with ffmpeg"
554
  msgstr ""
555
 
556
- #: views/global_options.php:117 views/global_options.php:118
557
  msgid "ffmpeg path"
558
  msgstr ""
559
 
560
- #: views/global_options.php:121 views/global_options.php:123
561
  msgid "Watermark audio"
562
  msgstr ""
563
 
564
- #: views/global_options.php:123
565
  msgid "Select"
566
  msgstr ""
567
 
568
- #: views/global_options.php:124
569
- msgid ""
570
- "Select an audio file if you want to apply a watermark to the audio files for "
571
- "demos. The watermark will be applied to the protected demos (Experimental "
572
- "feature)."
573
- msgstr ""
574
-
575
- #: views/global_options.php:131 views/global_options.php:132
576
  msgid "Delete the demo files generated previously"
577
  msgstr ""
578
 
579
- #: views/global_options.php:138 views/global_options.php:139
580
  msgid "Store demo files on Google Drive"
581
  msgstr ""
582
 
583
- #: views/global_options.php:142
584
- msgid "Import a JSON Key file"
585
- msgstr ""
586
-
587
- #: views/global_options.php:144
588
  msgid "JSON Key file"
589
  msgstr ""
590
 
591
- #: views/global_options.php:188
592
- msgid "Troubleshoot Area"
593
- msgstr ""
594
-
595
- #: views/global_options.php:192 views/global_options.php:195
596
- msgid "On iPads and iPhones, use native controls"
597
- msgstr ""
598
-
599
- #: views/global_options.php:196
600
- msgid ""
601
- "tick the checkbox if the players do not work properly on iPads or iPhones"
602
- msgstr ""
603
-
604
  #: views/global_options.php:201
605
- msgid "Loading players in the onload event"
606
  msgstr ""
607
 
608
- #: views/global_options.php:204
609
  msgid "Loading placeholder in the onload event"
610
  msgstr ""
611
 
612
- #: views/global_options.php:205
613
- msgid "tick the checkbox if the players are not being loaded properly"
614
- msgstr ""
615
-
616
- #: views/global_options.php:210
617
- msgid "For files whose extensions cannot be determined"
618
- msgstr ""
619
-
620
- #: views/global_options.php:213
621
  msgid ""
622
  "For files whose extensions cannot be determined, handle them as mp3 files"
623
  msgstr ""
624
 
625
- #: views/global_options.php:214
626
- msgid "handle them as mp3 files"
627
- msgstr ""
628
-
629
- #: views/global_options.php:219 views/global_options.php:222
630
  msgid ""
631
  "For the WooCommerce Gutenberg Blocks, include the main player in the "
632
  "products titles"
633
  msgstr ""
634
 
635
- #: views/global_options.php:223
636
- msgid "Includes the main player in front of products titles"
637
- msgstr ""
638
-
639
- #: views/global_options.php:228 views/global_options.php:231
640
  msgid "WooCommerce hook used to display the players in the shop pages"
641
  msgstr ""
642
 
643
- #: views/global_options.php:232
644
  msgid ""
645
  "The plugin uses by default the <b>woocommerce_shop_loop_item_title</b> hook. "
646
  "If the player is not being displayed, enter the hook used by the theme "
647
  "active on your website."
648
  msgstr ""
649
 
650
- #: views/global_options.php:233
651
  msgid "Force the player in the title"
652
  msgstr ""
653
 
654
- #: views/global_options.php:233
655
- msgid "Forces the audio player to be displayed in the product title."
656
- msgstr ""
657
-
658
- #: views/global_options.php:238 views/global_options.php:241
659
  msgid "WooCommerce hook used to display the players in the products pages"
660
  msgstr ""
661
 
662
- #: views/global_options.php:242
663
  msgid ""
664
  "The plugin uses by default the <b>woocommerce_single_product_summary</b> "
665
  "hook. If the player is not being displayed, enter the hook used by the theme "
666
  "active on your website."
667
  msgstr ""
668
 
669
- #: views/global_options.php:247
670
  msgid ""
671
  "Click on the <a href=\"https://docs.woocommerce.com/wc-apidocs/hook-docs.html"
672
  "\" target=\"_blank\">THIS LINK</a> for the list of available <a href="
@@ -674,146 +574,71 @@ msgid ""
674
  "style=\"font-weight:bold;font-size:1.3em;\">WooCommerce Hooks</a>"
675
  msgstr ""
676
 
677
- #: views/global_options.php:252
678
- msgid "Include music player in all products"
679
- msgstr ""
680
-
681
- #: views/global_options.php:258
682
  msgid "Products pages only"
683
  msgstr ""
684
 
685
- #: views/global_options.php:261
686
  msgid "Multiple-entry pages"
687
  msgstr ""
688
 
689
- #: views/global_options.php:264
690
  msgid "Product and multiple-entry pages"
691
  msgstr ""
692
 
693
- #: views/global_options.php:269 views/global_options.php:271
694
  msgid "Include players in cart"
695
  msgstr ""
696
 
697
- #: views/global_options.php:288
698
  msgid "skin 2"
699
  msgstr ""
700
 
701
- #: views/global_options.php:319 views/global_options.php:322
702
  msgid "Allow multiple players to play simultaneously"
703
  msgstr ""
704
 
705
- #: views/global_options.php:324
706
- msgid ""
707
- "By default, only one player would be playing at once. By pressing the play "
708
- "button of a player, the other players would stop. By ticking the checkbox, "
709
- "multiple players could play simultaneously."
710
- msgstr ""
711
-
712
- #: views/global_options.php:329 views/player_options.php:240
713
- msgid "Player volume (from 0 to 1)"
714
- msgstr ""
715
-
716
- #: views/global_options.php:331 views/player_options.php:242
717
  msgid "Player volume"
718
  msgstr ""
719
 
720
- #: views/global_options.php:341 views/player_options.php:252
721
  msgid "On cover"
722
  msgstr ""
723
 
724
- #: views/global_options.php:356 views/player_options.php:267
725
  msgid "Display the player title"
726
  msgstr ""
727
 
728
- #: views/global_options.php:360 views/player_options.php:271
729
- msgid "The security feature is only available in the PRO version of the plugin"
730
- msgstr ""
731
-
732
- #: views/global_options.php:363 views/global_options.php:364
733
- #: views/player_options.php:274 views/player_options.php:275
734
  msgid "Protect the file"
735
  msgstr ""
736
 
737
- #: views/global_options.php:367 views/global_options.php:369
738
- #: views/player_options.php:278 views/player_options.php:280
739
  msgid "Percent of audio used for protected playbacks"
740
  msgstr ""
741
 
742
- #: views/global_options.php:370 views/player_options.php:281
743
- msgid ""
744
- "To prevent unauthorized copying of audio files, the files will be partially "
745
- "accessible"
746
- msgstr ""
747
-
748
- #: views/global_options.php:375
749
- msgid ""
750
- "Text to display beside the player explaining that demos are partial versions "
751
- "of the original files"
752
- msgstr ""
753
-
754
- #: views/global_options.php:377
755
  msgid "Explaining that demos are partial versions of the original files"
756
  msgstr ""
757
 
758
- #: views/global_options.php:391
759
- msgid "Scope"
760
- msgstr ""
761
-
762
- #: views/global_options.php:392
763
- msgid ""
764
- "Ticking the checkbox the previous settings are applied to all products, even "
765
- "if they have a player enabled."
766
- msgstr ""
767
-
768
- #: views/global_options.php:392
769
- msgid "Apply the previous settings to all products"
770
- msgstr ""
771
-
772
- #: views/global_options.php:392
773
- msgid "Apply the previous settings to all products pages in the website."
774
- msgstr ""
775
-
776
- #: views/global_options.php:404
777
- msgid "Analytics"
778
- msgstr ""
779
-
780
  #: views/global_options.php:408
781
- msgid ""
782
- "Allows the integration with Google Analytics for registering new events when "
783
- "the songs are played. The event information would include: the URL to the "
784
- "audio file as the event label and the product's id as its value."
785
- msgstr ""
786
-
787
- #: views/global_options.php:409
788
- msgid "Note"
789
- msgstr ""
790
-
791
- #: views/global_options.php:409
792
- msgid ""
793
- "If the preload option is configured as Metadata or Auto in the players "
794
- "settings, the event would be registered when the audio file is loaded by the "
795
- "player and not exactly when they are playing."
796
  msgstr ""
797
 
798
- #: views/global_options.php:414 views/global_options.php:415
799
- msgid "Tracking Id"
800
  msgstr ""
801
 
802
- #: views/global_options.php:427
803
- msgid "Add ons"
804
  msgstr ""
805
 
806
- #: views/global_options.php:434
807
  msgid "Save settings"
808
  msgstr ""
809
 
810
- #: views/player_options.php:50
811
- msgid ""
812
- "The security feature and particular files for demo are only available in the "
813
- "PRO version of the plugin"
814
- msgstr ""
815
-
816
- #: views/player_options.php:51
817
  msgid ""
818
  "For testing the premium version of the plugin, visit the online demo:<br/> "
819
  "<a href=\"https://demos.dwbooster.com/music-player-for-woocommerce/wp-login."
@@ -823,53 +648,31 @@ msgid ""
823
  "WooCommerce Store</a>"
824
  msgstr ""
825
 
826
- #: views/player_options.php:181
827
- msgid ""
828
- "The player is shown only if the product is \"downloadable\", and there is at "
829
- "least an audio file between the \"Downloadable files\""
830
- msgstr ""
831
-
832
- #: views/player_options.php:186
833
  msgid "Include on products pages"
834
  msgstr ""
835
 
836
- #: views/player_options.php:192
837
  msgid "Include on product and multiple-entry pages"
838
  msgstr ""
839
 
840
- #: views/player_options.php:293
841
  msgid "Own demo files"
842
  msgstr ""
843
 
844
- #: views/player_options.php:293
845
- msgid "Select my own demo files"
846
- msgstr ""
847
-
848
- #: views/player_options.php:297
849
- msgid "Demo files"
850
- msgstr ""
851
-
852
- #: views/player_options.php:301
853
- msgid "Name"
854
- msgstr ""
855
-
856
- #: views/player_options.php:302 views/player_options.php:312
857
- msgid "File URL"
858
- msgstr ""
859
-
860
- #: views/player_options.php:309
861
  msgid "File name"
862
  msgstr ""
863
 
864
- #: views/player_options.php:325
865
- msgid "Add File"
866
  msgstr ""
867
 
868
- #: wcmp.php:235
869
  msgid "Help"
870
  msgstr ""
871
 
872
- #: wcmp.php:1144
873
  msgid "There are no products that satisfy the block's settings"
874
  msgstr ""
875
 
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"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\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\n"
16
  "X-Poedit-SearchPath-0: .\n"
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
 
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
 
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>"
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
 
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
 
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
 
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"
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
  "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
  "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
  "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
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wcmp.dwbooster.com
4
  Tags:WooCommerce,music player,audio,music,song,player,audio player,media player,mp3,m3u,m3u8,wav,oga,ogg,dokan,wcfm
5
  Requires at least: 3.5.0
6
  Tested up to: 6.0
7
- Stable tag: 1.0.176
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.176 =
230
 
231
  * Fixes an issue with the products titles.
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.177
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.177 =
230
+
231
+ * Implements the integration with Google Analytics 4.
232
+
233
  = 1.0.176 =
234
 
235
  * Fixes an issue with the products titles.
views/global_options.php CHANGED
@@ -36,11 +36,13 @@ $play_all = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
36
  // This option is only for compatibility with versions previous to 1.0.28
37
  $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( 'play_all', 0 )
38
  );
39
- $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_on_cover', 0 ) );
40
- $analytics_property = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_analytics_property', '' );
41
- $registered_only = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_registered_only', 0 );
42
- $fade_out = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_fade_out', 1 );
43
- $purchased_times_text = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' );
 
 
44
  ?>
45
  <h1><?php esc_html_e( 'Music Player for WooCommerce - Global Settings', 'music-player-for-woocommerce' ); ?></h1>
46
  <div style="border:1px solid #E6DB55;margin-bottom:10px;padding:5px;background-color: #FFFFE0;">
@@ -425,8 +427,20 @@ _e(
425
  </tr>
426
  <tr>
427
  <td>
428
- <div><?php esc_html_e( 'Tracking Id', 'music-player-for-woocommerce' ); ?></div>
429
- <div><input aria-label="<?php esc_attr_e( 'Tracking Id', 'music-player-for-woocommerce' ); ?>" type="text" name="_wcmp_analytics_property" value="<?php print esc_attr( $analytics_property ); ?>" style="width:100%;" placeholder="UA-XXXXX-Y"></div>
 
 
 
 
 
 
 
 
 
 
 
 
430
  </td>
431
  </tr>
432
  </table>
@@ -459,6 +473,12 @@ _e(
459
  $(document).on('change', '[name="_wcmp_player_controls"]', function(){
460
  coverSection();
461
  });
 
 
 
 
 
 
462
  coverSection();
463
  });</script>
464
  <style>.wcmp-player-settings tr td:first-child{width:225px;}</style>
36
  // This option is only for compatibility with versions previous to 1.0.28
37
  $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( 'play_all', 0 )
38
  );
39
+ $on_cover = intval( $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_on_cover', 0 ) );
40
+ $analytics_integration = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_analytics_integration', 'ua' );
41
+ $analytics_property = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_analytics_property', '' );
42
+ $analytics_api_secret = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_analytics_api_secret', '' );
43
+ $registered_only = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_registered_only', 0 );
44
+ $fade_out = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_fade_out', 1 );
45
+ $purchased_times_text = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' );
46
  ?>
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;">
427
  </tr>
428
  <tr>
429
  <td>
430
+ <label><input type="radio" name="_wcmp_analytics_integration" value="ua" <?php print 'ua' == $analytics_integration ? 'CHECKED' : ''; ?>> <?php esc_html_e( 'Universal Analytics', 'music-player-for-woocommerce' ); ?></label>
431
+ <label style="margin-left:30px;"><input type="radio" name="_wcmp_analytics_integration" value="g" <?php print 'g' == $analytics_integration ? 'CHECKED' : ''; ?>> <?php esc_html_e( 'Measurement Protocol (Google Analytics 4)', 'music-player-for-woocommerce' ); ?></label>
432
+ </td>
433
+ </tr>
434
+ <tr>
435
+ <td>
436
+ <div><?php esc_html_e( 'Measurement Id', 'music-player-for-woocommerce' ); ?></div>
437
+ <div><input aria-label="<?php esc_attr_e( 'Measurement Id', 'music-player-for-woocommerce' ); ?>" type="text" name="_wcmp_analytics_property" value="<?php print esc_attr( $analytics_property ); ?>" style="width:100%;" placeholder=""></div>
438
+ </td>
439
+ </tr>
440
+ <tr class="wcmp-analytics-g4" style="display:<?php print esc_attr( 'ua' == $analytics_integration ? 'none' : 'table-row' ); ?>;">
441
+ <td style="width:100%;">
442
+ <div><?php esc_html_e( 'API Secret', 'music-player-for-woocommerce' ); ?></div>
443
+ <div><input aria-label="<?php esc_attr_e( 'API Secret', 'music-player-for-woocommerce' ); ?>" type="text" name="_wcmp_analytics_api_secret" value="<?php print esc_attr( $analytics_api_secret ); ?>" style="width:100%;"></div>
444
  </td>
445
  </tr>
446
  </table>
473
  $(document).on('change', '[name="_wcmp_player_controls"]', function(){
474
  coverSection();
475
  });
476
+ $(document).on('change', '[name="_wcmp_analytics_integration"]', function(){
477
+ var v = $('[name="_wcmp_analytics_integration"]:checked').val();
478
+ $('.wcmp-analytics-g4').css('display', v == 'g' ? 'table-row' : 'none');
479
+ $('[name="_wcmp_analytics_property"]').attr('placeholder', v == 'g' ? 'G-XXXXXXXX' : 'UA-XXXXX-Y');
480
+ });
481
+ $('[name="_wcmp_analytics_integration"]:eq(0)').change();
482
  coverSection();
483
  });</script>
484
  <style>.wcmp-player-settings tr td:first-child{width:225px;}</style>
wcmp.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Music Player for WooCommerce
4
  Plugin URI: https://wcmp.dwbooster.com
5
- Version: 1.0.176
6
  Text Domain: music-player-for-woocommerce
7
  Author: CodePeople
8
  Author URI: https://wcmp.dwbooster.com
@@ -128,7 +128,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
128
  $_current_user_id = get_current_user_id();
129
  if (
130
  $this->get_global_attr( '_wcmp_registered_only', 0 ) &&
131
- $_current_user_id == 0
132
  ) {
133
  $this->_insert_player = false;
134
  }
@@ -137,12 +137,12 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
137
  // Define the shortcode for the playlist_widget
138
  add_shortcode( 'wcmp-playlist', array( &$this, 'replace_playlist_shortcode' ) );
139
  $this->_preview();
140
- if ( isset( $_REQUEST['wcmp-action'] ) && $_REQUEST['wcmp-action'] == 'play' ) {
141
  if ( isset( $_REQUEST['wcmp-product'] ) ) {
142
  $product_id = @intval( $_REQUEST['wcmp-product'] );
143
  if ( ! empty( $product_id ) ) {
144
  $product = wc_get_product( $product_id );
145
- if ( $product !== false && isset( $_REQUEST['wcmp-file'] ) ) {
146
  $files = $this->_get_product_files(
147
  array(
148
  'product' => $product,
@@ -171,7 +171,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
171
  $include_all_players_hook = 'woocommerce_single_product_summary';
172
  }
173
 
174
- if ( $this->_force_hook_title == 0 ) {
175
  add_action( $include_main_player_hook, array( &$this, 'include_main_player' ), 11 );
176
  }
177
 
@@ -200,7 +200,8 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
200
  if (
201
  $this->get_global_attr( '_wcmp_force_main_player_in_title', 1 ) &&
202
  ! empty( $_SERVER['REQUEST_URI'] )
203
- /* ! empty( $_SERVER['REQUEST_URI'] ) &&
 
204
  stripos( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'wc/store' ) !== false */
205
  ) {
206
  add_filter( 'woocommerce_product_title', array( &$this, 'woocommerce_product_title' ), 10, 2 );
@@ -271,7 +272,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
271
  in_array( $_REQUEST['_wcmp_player_controls'], $this->_player_controls )
272
  ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_player_controls'] ) ) : WCMP_DEFAULT_PLAYER_CONTROLS;
273
 
274
- $on_cover = ( ( $player_controls == 'button' || $player_controls == 'default' ) && isset( $_REQUEST['_wcmp_player_on_cover'] ) ) ? 1 : 0;
275
 
276
  $player_title = ( isset( $_REQUEST['_wcmp_player_title'] ) ) ? 1 : 0;
277
  $merge_grouped = ( isset( $_REQUEST['_wcmp_merge_in_grouped'] ) ) ? 1 : 0;
@@ -306,7 +307,9 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
306
  '_wcmp_main_player_hook' => $include_main_player_hook,
307
  '_wcmp_main_player_hook_title' => $main_player_hook_title,
308
  '_wcmp_all_players_hook' => $include_all_players_hook,
 
309
  '_wcmp_analytics_property' => ( isset( $_REQUEST['_wcmp_analytics_property'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_property'] ) ) : '',
 
310
  );
311
 
312
  $apply_to_all_players = ( isset( $_REQUEST['_wcmp_apply_to_all_players'] ) ) ? 1 : 0;
@@ -366,7 +369,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
366
  $player_style = (
367
  isset( $_REQUEST['_wcmp_player_layout'] ) &&
368
  in_array( $_REQUEST['_wcmp_player_layout'], $this->_player_layouts )
369
- ) ? $_REQUEST['_wcmp_player_layout'] : WCMP_DEFAULT_PLAYER_LAYOUT;
370
 
371
  $player_controls = (
372
  isset( $_REQUEST['_wcmp_player_controls'] ) &&
@@ -382,7 +385,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
382
  in_array( $_REQUEST['_wcmp_preload'], array( 'none', 'metadata', 'auto' ) )
383
  ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_preload'] ) ) : 'none';
384
 
385
- $on_cover = ( ( $player_controls == 'button' || $player_controls == 'default' ) && isset( $_REQUEST['_wcmp_player_on_cover'] ) ) ? 1 : 0;
386
 
387
  add_post_meta( $post_id, '_wcmp_enable_player', $enable_player, true );
388
  add_post_meta( $post_id, '_wcmp_show_in', $show_in, true );
@@ -437,11 +440,11 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
437
 
438
  // Registering resources
439
  wp_enqueue_style( 'wp-mediaelement' );
440
- wp_enqueue_style( 'wp-mediaelement-skins', 'https://cdnjs.cloudflare.com/ajax/libs/mediaelement/2.23.5/mejs-skins.min.css' );
441
- wp_enqueue_style( 'wcmp-style', plugin_dir_url( __FILE__ ) . 'css/style.css' );
442
  wp_enqueue_script( 'jquery' );
443
  wp_enqueue_script( 'wp-mediaelement' );
444
- wp_enqueue_script( 'wcmp-script', plugin_dir_url( __FILE__ ) . 'js/public.js', array( 'jquery', 'wp-mediaelement' ), '1.0.176' );
445
 
446
  $play_all = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
447
  '_wcmp_play_all',
@@ -552,19 +555,19 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
552
  $atts
553
  );
554
 
555
- $products_ids = $atts['products_ids'];
556
- $purchased_products = $atts['purchased_products'];
557
  $highlight_current_product = $atts['highlight_current_product'];
558
- $continue_playing = $atts['continue_playing'];
559
- $player_style = $atts['player_style'];
560
- $controls = $atts['controls'];
561
- $layout = $atts['layout'];
562
- $cover = $atts['cover'];
563
- $volume = $atts['volume'];
564
- $hide_purchase_buttons = $atts['hide_purchase_buttons'];
565
- $class = $atts['class'];
566
- $loop = $atts['loop'];
567
- $purchased_times = $atts['purchased_times'];
568
 
569
  // Typecasting variables.
570
  $cover = is_numeric( $cover ) ? intval( $cover ) : 0;
@@ -598,7 +601,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
598
 
599
  // Getting the list of purchased products
600
  $_current_user_id = get_current_user_id();
601
- if ( $_current_user_id == 0 ) {
602
  return $output;
603
  }
604
 
@@ -654,7 +657,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
654
  FROM
655
  ' . $wpdb->prefix . 'posts as orders INNER JOIN ' . $wpdb->prefix . 'woocommerce_order_items as order_items ON (orders.ID=order_items.order_id)
656
  INNER JOIN ' . $wpdb->prefix . 'woocommerce_order_itemmeta as order_itemmeta ON (order_items.order_item_id=order_itemmeta.order_item_id)
657
- WHERE orders.post_type="shop_order" AND orders.post_status="wc-completed" AND order_itemmeta.meta_key="_product_id" ' . ( strlen( $products_ids_str ) && strpos( '*', $products_ids_str ) === false ? ' AND order_itemmeta.meta_value IN (' . $products_ids_str . ')' : '' ) . '
658
  GROUP BY order_itemmeta.meta_value'
659
  );
660
  }
@@ -662,8 +665,8 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
662
  // Enqueue resources
663
 
664
  $this->enqueue_resources();
665
- wp_enqueue_style( 'wcmp-playlist-widget-style', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/css/style.css', array(), '1.0.176' );
666
- wp_enqueue_script( 'wcmp-playlist-widget-script', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/js/public.js', array(), '1.0.176' );
667
  wp_localize_script(
668
  'wcmp-playlist-widget-script',
669
  'wcmp_widget_settings',
@@ -676,7 +679,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
676
  $counter++;
677
  $preload = $this->get_product_attr( $product->ID, '_wcmp_preload', '' );
678
  $row_class = 'wcmp-even-product';
679
- if ( $counter % 2 == 1 ) {
680
  $row_class = 'wcmp-odd-product';
681
  }
682
 
@@ -689,7 +692,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
689
  $featured_image = get_the_post_thumbnail_url( $product->ID );
690
  }
691
 
692
- if ( $layout == 'new' ) {
693
  $price = $product_obj->get_price();
694
  $output .= '
695
  <div class="wcmp-widget-product controls-' . esc_attr( $controls ) . ' ' . esc_attr( $class ) . ' ' . esc_attr( $row_class ) . ' ' . esc_attr( ( $product->ID == $current_post_id && $highlight_current_product ) ? 'wcmp-current-product' : '' ) . '">
@@ -700,13 +703,13 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
700
  $purchased_times ?
701
  '<span class="wcmp-purchased-times">' .
702
  sprintf(
703
- __( $this->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' ) ),
704
  $get_times( $product->ID, $product_purchased_times )
705
  ) . '</span>' : ''
706
  ) .
707
  '</div><!-- product title -->
708
  ';
709
- if ( @floatval( $price ) != 0 && $hide_purchase_buttons == 0 ) {
710
  $output .= '<div class="wcmp-widget-product-purchase">
711
  ' . wc_price( $product_obj->get_price(), '' ) . ' <a href="?add-to-cart=' . $product->ID . '"></a>
712
  </div><!-- product purchase -->
@@ -793,7 +796,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
793
  $purchased_times ?
794
  '<span class="wcmp-purchased-times">' .
795
  sprintf(
796
- __( $this->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' ) ),
797
  $get_times( $product->ID, $product_purchased_times )
798
  ) . '</span>' : ''
799
  )
@@ -907,13 +910,13 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
907
  }
908
  }
909
  } catch ( Exception $err ) {
910
- error_log( $err->getMessage() );
911
  }
912
  }
913
  return $value;
914
  }
915
 
916
- public function include_main_player( $product = '', $echo = true ) {
917
  $output = '';
918
  if ( ! $this->_insert_player ) {
919
  return $output;
@@ -935,8 +938,8 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
935
 
936
  $show_in = $this->get_product_attr( $id, '_wcmp_show_in', 'all' );
937
  if (
938
- ( $show_in == 'single' && ( ! function_exists( 'is_product' ) || ! is_product() ) ) ||
939
- ( $show_in == 'multiple' && ( function_exists( 'is_product' ) && is_product() ) && get_queried_object_id() == $id )
940
  ) {
941
  return $output;
942
  }
@@ -972,7 +975,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
972
  do_action( 'wcmp_before_player_shop_page', $id );
973
 
974
  $output = '<div class="wcmp-player-container product-' . esc_attr( $file['product'] ) . '">' . $audio_tag . '</div>';
975
- if ( $echo ) {
976
  print $output;
977
  }
978
 
@@ -1000,8 +1003,8 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1000
 
1001
  $show_in = $this->get_product_attr( $id, '_wcmp_show_in', 'all' );
1002
  if (
1003
- ( $show_in == 'single' && ! is_singular() ) ||
1004
- ( $show_in == 'multiple' && is_singular() )
1005
  ) {
1006
  return;
1007
  }
@@ -1017,8 +1020,8 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1017
  $counter = count( $files );
1018
 
1019
  do_action( 'wcmp_before_players_product_page', $id );
1020
- if ( $counter == 1 ) {
1021
- $player_controls = ( $player_controls == 'button' ) ? 'track' : '';
1022
  $file = reset( $files );
1023
  $index = key( $files );
1024
  $audio_url = $this->_generate_audio_url( $id, $index, $file );
@@ -1041,12 +1044,12 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1041
  $audio_url
1042
  );
1043
  $title = esc_html( ( $player_title ) ? apply_filters( 'wcmp_file_name', $file['name'], $id, $index ) : '' );
1044
- print '<div class="wcmp-player-container ' . $merge_grouped_clss . ' product-' . esc_attr( $file['product'] ) . '">' . $audio_tag . '</div><div class="wcmp-player-title">' . $title . '</div><div style="clear:both;"></div>';
1045
  } elseif ( $counter > 1 ) {
1046
  $before = '<table class="wcmp-player-list ' . $merge_grouped_clss . '">';
1047
  $after = '';
1048
  foreach ( $files as $index => $file ) {
1049
- $evenOdd = ( $counter % 2 == 1 ) ? 'wcmp-odd-row' : 'wcmp-even-row';
1050
  $counter--;
1051
  $audio_url = $this->_generate_audio_url( $id, $index, $file );
1052
  $duration = $this->_get_duration_by_url( $file['file'] );
@@ -1056,7 +1059,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1056
  $audio_url,
1057
  array(
1058
  'player_style' => $player_style,
1059
- 'player_controls' => ( $player_controls != 'all' ) ? 'track' : '',
1060
  'media_type' => $file['media_type'],
1061
  'duration' => $duration,
1062
  'preload' => $preload,
@@ -1072,7 +1075,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1072
  print $before;
1073
  $before = '';
1074
  $after = '</table>';
1075
- if ( $player_controls != 'all' ) {
1076
  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>';
1077
  } else {
1078
  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>';
@@ -1125,7 +1128,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1125
  $this->_force_hook_title = $this->get_global_attr( '_wcmp_main_player_hook_title', 1 );
1126
 
1127
  // Integration with "WOOF – Products Filter for WooCommerce" by realmag777
1128
- if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'woof_draw_products' ) {
1129
  $this->_force_hook_title = 1;
1130
  }
1131
 
@@ -1250,12 +1253,12 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1250
  }
1251
  if ( ! empty( $attachment ) ) {
1252
  $metadata = wp_get_attachment_metadata( $attachment[0] );
1253
- if ( $metadata !== false && ! empty( $metadata['length_formatted'] ) ) {
1254
  return $metadata['length_formatted'];
1255
  }
1256
  }
1257
  } catch ( Exception $err ) {
1258
- error_log( $err->getMessage() );
1259
  }
1260
  return false;
1261
  } // End _get_duration_by_url
@@ -1269,7 +1272,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1269
 
1270
  // If the playback of music are tracked with Google Analytics, should not be loaded directly the audio files.
1271
  $_wcmp_analytics_property = trim( $this->get_global_attr( '_wcmp_analytics_property', '' ) );
1272
- if ( $_wcmp_analytics_property == '' ) {
1273
  $file_name = $this->_demo_file_name( $file_url );
1274
 
1275
  $file_path = $this->_files_directory_path . $file_name;
@@ -1379,7 +1382,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1379
  $product_type = $product->get_type();
1380
  $id = $product->get_id();
1381
 
1382
- if ( $product_type == 'variation' ) {
1383
  // $_files = $product->get_files();
1384
  $_files = $product->get_downloads();
1385
  $_files = $this->_edit_files_array( $id, $_files );
@@ -1429,7 +1432,7 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1429
 
1430
  $audio_files = array();
1431
  foreach ( $files as $index => $file ) {
1432
- if ( ! empty( $file['file'] ) && ( $media_type = $this->_is_audio( $file['file'] ) ) !== false ) {
1433
  $file['media_type'] = $media_type;
1434
 
1435
  if ( ! empty( $args['file_id'] ) ) {
@@ -1507,12 +1510,12 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1507
  'filename' => $file_path,
1508
  )
1509
  );
1510
- if ( ! is_wp_error( $response ) && $response['response']['code'] == 200 ) {
1511
  $c = true;
1512
  }
1513
  }
1514
 
1515
- if ( $c === true ) {
1516
  header( 'location: http' . ( ( is_ssl() ) ? 's:' : ':' ) . $this->_files_directory_url . $file_name );
1517
  exit;
1518
  }
@@ -1579,33 +1582,62 @@ if ( ! class_exists( 'WooCommerceMusicPlayer' ) ) {
1579
  } // End _is_local
1580
 
1581
  private function _tracking_play_event( $product_id, $file_url ) {
1582
- $_wcmp_analytics_property = trim( $this->get_global_attr( '_wcmp_analytics_property', '' ) );
1583
- if ( $_wcmp_analytics_property != '' ) {
1584
- $cid = 555;
 
 
1585
  try {
1586
  if ( isset( $_COOKIE['_ga'] ) ) {
1587
  $cid_parts = explode( '.', sanitize_text_field( wp_unslash( $_COOKIE['_ga'] ) ), 3 );
1588
  $cid = $cid_parts[2];
1589
  }
1590
  } catch ( Exception $err ) {
1591
- error_log( $err->getMessage() );
1592
  }
1593
 
1594
- $_response = wp_remote_post(
1595
- 'http://www.google-analytics.com/collect',
1596
- array(
1597
- 'body' => array(
1598
- 'v' => 1,
1599
- 'tid' => $_wcmp_analytics_property,
1600
- 'cid' => $cid,
1601
- 't' => 'event',
1602
- 'ec' => 'Music Player for WooCommerce',
1603
- 'ea' => 'play',
1604
- 'el' => $file_url,
1605
- 'ev' => $product_id,
1606
- ),
1607
- )
1608
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1609
 
1610
  if ( is_wp_error( $_response ) ) {
1611
  error_log( $_response->get_error_message() );
2
  /*
3
  Plugin Name: Music Player for WooCommerce
4
  Plugin URI: https://wcmp.dwbooster.com
5
+ Version: 1.0.177
6
  Text Domain: music-player-for-woocommerce
7
  Author: CodePeople
8
  Author URI: https://wcmp.dwbooster.com
128
  $_current_user_id = get_current_user_id();
129
  if (
130
  $this->get_global_attr( '_wcmp_registered_only', 0 ) &&
131
+ 0 == $_current_user_id
132
  ) {
133
  $this->_insert_player = false;
134
  }
137
  // Define the shortcode for the playlist_widget
138
  add_shortcode( 'wcmp-playlist', array( &$this, 'replace_playlist_shortcode' ) );
139
  $this->_preview();
140
+ if ( isset( $_REQUEST['wcmp-action'] ) && 'play' == $_REQUEST['wcmp-action'] ) {
141
  if ( isset( $_REQUEST['wcmp-product'] ) ) {
142
  $product_id = @intval( $_REQUEST['wcmp-product'] );
143
  if ( ! empty( $product_id ) ) {
144
  $product = wc_get_product( $product_id );
145
+ if ( false !== $product && isset( $_REQUEST['wcmp-file'] ) ) {
146
  $files = $this->_get_product_files(
147
  array(
148
  'product' => $product,
171
  $include_all_players_hook = 'woocommerce_single_product_summary';
172
  }
173
 
174
+ if ( 0 == $this->_force_hook_title ) {
175
  add_action( $include_main_player_hook, array( &$this, 'include_main_player' ), 11 );
176
  }
177
 
200
  if (
201
  $this->get_global_attr( '_wcmp_force_main_player_in_title', 1 ) &&
202
  ! empty( $_SERVER['REQUEST_URI'] )
203
+ /*
204
+ ! empty( $_SERVER['REQUEST_URI'] ) &&
205
  stripos( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'wc/store' ) !== false */
206
  ) {
207
  add_filter( 'woocommerce_product_title', array( &$this, 'woocommerce_product_title' ), 10, 2 );
272
  in_array( $_REQUEST['_wcmp_player_controls'], $this->_player_controls )
273
  ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_player_controls'] ) ) : WCMP_DEFAULT_PLAYER_CONTROLS;
274
 
275
+ $on_cover = ( ( 'button' == $player_controls || 'default' == $player_controls ) && isset( $_REQUEST['_wcmp_player_on_cover'] ) ) ? 1 : 0;
276
 
277
  $player_title = ( isset( $_REQUEST['_wcmp_player_title'] ) ) ? 1 : 0;
278
  $merge_grouped = ( isset( $_REQUEST['_wcmp_merge_in_grouped'] ) ) ? 1 : 0;
307
  '_wcmp_main_player_hook' => $include_main_player_hook,
308
  '_wcmp_main_player_hook_title' => $main_player_hook_title,
309
  '_wcmp_all_players_hook' => $include_all_players_hook,
310
+ '_wcmp_analytics_integration' => ( isset( $_REQUEST['_wcmp_analytics_integration'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_integration'] ) ) : 'ua',
311
  '_wcmp_analytics_property' => ( isset( $_REQUEST['_wcmp_analytics_property'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_property'] ) ) : '',
312
+ '_wcmp_analytics_api_secret' => ( isset( $_REQUEST['_wcmp_analytics_api_secret'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_api_secret'] ) ) : '',
313
  );
314
 
315
  $apply_to_all_players = ( isset( $_REQUEST['_wcmp_apply_to_all_players'] ) ) ? 1 : 0;
369
  $player_style = (
370
  isset( $_REQUEST['_wcmp_player_layout'] ) &&
371
  in_array( $_REQUEST['_wcmp_player_layout'], $this->_player_layouts )
372
+ ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_player_layout'] ) ) : WCMP_DEFAULT_PLAYER_LAYOUT;
373
 
374
  $player_controls = (
375
  isset( $_REQUEST['_wcmp_player_controls'] ) &&
385
  in_array( $_REQUEST['_wcmp_preload'], array( 'none', 'metadata', 'auto' ) )
386
  ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_preload'] ) ) : 'none';
387
 
388
+ $on_cover = ( ( 'button' == $player_controls || 'default' == $player_controls ) && isset( $_REQUEST['_wcmp_player_on_cover'] ) ) ? 1 : 0;
389
 
390
  add_post_meta( $post_id, '_wcmp_enable_player', $enable_player, true );
391
  add_post_meta( $post_id, '_wcmp_show_in', $show_in, true );
440
 
441
  // Registering resources
442
  wp_enqueue_style( 'wp-mediaelement' );
443
+ wp_enqueue_style( 'wp-mediaelement-skins', 'https://cdnjs.cloudflare.com/ajax/libs/mediaelement/2.23.5/mejs-skins.min.css', array(), '1.0.177' );
444
+ wp_enqueue_style( 'wcmp-style', plugin_dir_url( __FILE__ ) . 'css/style.css', array(), '1.0.177' );
445
  wp_enqueue_script( 'jquery' );
446
  wp_enqueue_script( 'wp-mediaelement' );
447
+ wp_enqueue_script( 'wcmp-script', plugin_dir_url( __FILE__ ) . 'js/public.js', array( 'jquery', 'wp-mediaelement' ), '1.0.177' );
448
 
449
  $play_all = $GLOBALS['WooCommerceMusicPlayer']->get_global_attr(
450
  '_wcmp_play_all',
555
  $atts
556
  );
557
 
558
+ $products_ids = $atts['products_ids'];
559
+ $purchased_products = $atts['purchased_products'];
560
  $highlight_current_product = $atts['highlight_current_product'];
561
+ $continue_playing = $atts['continue_playing'];
562
+ $player_style = $atts['player_style'];
563
+ $controls = $atts['controls'];
564
+ $layout = $atts['layout'];
565
+ $cover = $atts['cover'];
566
+ $volume = $atts['volume'];
567
+ $hide_purchase_buttons = $atts['hide_purchase_buttons'];
568
+ $class = $atts['class'];
569
+ $loop = $atts['loop'];
570
+ $purchased_times = $atts['purchased_times'];
571
 
572
  // Typecasting variables.
573
  $cover = is_numeric( $cover ) ? intval( $cover ) : 0;
601
 
602
  // Getting the list of purchased products
603
  $_current_user_id = get_current_user_id();
604
+ if ( 0 == $_current_user_id ) {
605
  return $output;
606
  }
607
 
657
  FROM
658
  ' . $wpdb->prefix . 'posts as orders INNER JOIN ' . $wpdb->prefix . 'woocommerce_order_items as order_items ON (orders.ID=order_items.order_id)
659
  INNER JOIN ' . $wpdb->prefix . 'woocommerce_order_itemmeta as order_itemmeta ON (order_items.order_item_id=order_itemmeta.order_item_id)
660
+ 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 . ')' : '' ) . '
661
  GROUP BY order_itemmeta.meta_value'
662
  );
663
  }
665
  // Enqueue resources
666
 
667
  $this->enqueue_resources();
668
+ wp_enqueue_style( 'wcmp-playlist-widget-style', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/css/style.css', array(), '1.0.177' );
669
+ wp_enqueue_script( 'wcmp-playlist-widget-script', plugin_dir_url( __FILE__ ) . 'widgets/playlist_widget/js/public.js', array(), '1.0.177' );
670
  wp_localize_script(
671
  'wcmp-playlist-widget-script',
672
  'wcmp_widget_settings',
679
  $counter++;
680
  $preload = $this->get_product_attr( $product->ID, '_wcmp_preload', '' );
681
  $row_class = 'wcmp-even-product';
682
+ if ( 1 == $counter % 2 ) {
683
  $row_class = 'wcmp-odd-product';
684
  }
685
 
692
  $featured_image = get_the_post_thumbnail_url( $product->ID );
693
  }
694
 
695
+ if ( 'new' == $layout ) {
696
  $price = $product_obj->get_price();
697
  $output .= '
698
  <div class="wcmp-widget-product controls-' . esc_attr( $controls ) . ' ' . esc_attr( $class ) . ' ' . esc_attr( $row_class ) . ' ' . esc_attr( ( $product->ID == $current_post_id && $highlight_current_product ) ? 'wcmp-current-product' : '' ) . '">
703
  $purchased_times ?
704
  '<span class="wcmp-purchased-times">' .
705
  sprintf(
706
+ __( $this->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' ), 'music-player-for-woocommerce' ),
707
  $get_times( $product->ID, $product_purchased_times )
708
  ) . '</span>' : ''
709
  ) .
710
  '</div><!-- product title -->
711
  ';
712
+ if ( 0 != @floatval( $price ) && 0 == $hide_purchase_buttons ) {
713
  $output .= '<div class="wcmp-widget-product-purchase">
714
  ' . wc_price( $product_obj->get_price(), '' ) . ' <a href="?add-to-cart=' . $product->ID . '"></a>
715
  </div><!-- product purchase -->
796
  $purchased_times ?
797
  '<span class="wcmp-purchased-times">' .
798
  sprintf(
799
+ __( $this->get_global_attr( '_wcmp_purchased_times_text', '- purchased %d time(s)' ), 'music-player-for-woocommerce' ),
800
  $get_times( $product->ID, $product_purchased_times )
801
  ) . '</span>' : ''
802
  )
910
  }
911
  }
912
  } catch ( Exception $err ) {
913
+ error_log( $err->getMessage() );
914
  }
915
  }
916
  return $value;
917
  }
918
 
919
+ public function include_main_player( $product = '', $_echo = true ) {
920
  $output = '';
921
  if ( ! $this->_insert_player ) {
922
  return $output;
938
 
939
  $show_in = $this->get_product_attr( $id, '_wcmp_show_in', 'all' );
940
  if (
941
+ ( 'single' == $show_in && ( ! function_exists( 'is_product' ) || ! is_product() ) ) ||
942
+ ( 'multiple' == $show_in && ( function_exists( 'is_product' ) && is_product() ) && get_queried_object_id() == $id )
943
  ) {
944
  return $output;
945
  }
975
  do_action( 'wcmp_before_player_shop_page', $id );
976
 
977
  $output = '<div class="wcmp-player-container product-' . esc_attr( $file['product'] ) . '">' . $audio_tag . '</div>';
978
+ if ( $_echo ) {
979
  print $output;
980
  }
981
 
1003
 
1004
  $show_in = $this->get_product_attr( $id, '_wcmp_show_in', 'all' );
1005
  if (
1006
+ ( 'single' == $show_in && ! is_singular() ) ||
1007
+ ( 'multiple' == $show_in && is_singular() )
1008
  ) {
1009
  return;
1010
  }
1020
  $counter = count( $files );
1021
 
1022
  do_action( 'wcmp_before_players_product_page', $id );
1023
+ if ( 1 == $counter ) {
1024
+ $player_controls = ( 'button' == $player_controls ) ? 'track' : '';
1025
  $file = reset( $files );
1026
  $index = key( $files );
1027
  $audio_url = $this->_generate_audio_url( $id, $index, $file );
1044
  $audio_url
1045
  );
1046
  $title = esc_html( ( $player_title ) ? apply_filters( 'wcmp_file_name', $file['name'], $id, $index ) : '' );
1047
+ 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>';
1048
  } elseif ( $counter > 1 ) {
1049
  $before = '<table class="wcmp-player-list ' . $merge_grouped_clss . '">';
1050
  $after = '';
1051
  foreach ( $files as $index => $file ) {
1052
+ $evenOdd = ( 1 == $counter % 2 ) ? 'wcmp-odd-row' : 'wcmp-even-row';
1053
  $counter--;
1054
  $audio_url = $this->_generate_audio_url( $id, $index, $file );
1055
  $duration = $this->_get_duration_by_url( $file['file'] );
1059
  $audio_url,
1060
  array(
1061
  'player_style' => $player_style,
1062
+ 'player_controls' => ( 'all' != $player_controls ) ? 'track' : '',
1063
  'media_type' => $file['media_type'],
1064
  'duration' => $duration,
1065
  'preload' => $preload,
1075
  print $before;
1076
  $before = '';
1077
  $after = '</table>';
1078
+ if ( 'all' != $player_controls ) {
1079
  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>';
1080
  } else {
1081
  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>';
1128
  $this->_force_hook_title = $this->get_global_attr( '_wcmp_main_player_hook_title', 1 );
1129
 
1130
  // Integration with "WOOF – Products Filter for WooCommerce" by realmag777
1131
+ if ( isset( $_REQUEST['action'] ) && 'woof_draw_products' == $_REQUEST['action'] ) {
1132
  $this->_force_hook_title = 1;
1133
  }
1134
 
1253
  }
1254
  if ( ! empty( $attachment ) ) {
1255
  $metadata = wp_get_attachment_metadata( $attachment[0] );
1256
+ if ( false !== $metadata && ! empty( $metadata['length_formatted'] ) ) {
1257
  return $metadata['length_formatted'];
1258
  }
1259
  }
1260
  } catch ( Exception $err ) {
1261
+ error_log( $err->getMessage() );
1262
  }
1263
  return false;
1264
  } // End _get_duration_by_url
1272
 
1273
  // If the playback of music are tracked with Google Analytics, should not be loaded directly the audio files.
1274
  $_wcmp_analytics_property = trim( $this->get_global_attr( '_wcmp_analytics_property', '' ) );
1275
+ if ( '' == $_wcmp_analytics_property ) {
1276
  $file_name = $this->_demo_file_name( $file_url );
1277
 
1278
  $file_path = $this->_files_directory_path . $file_name;
1382
  $product_type = $product->get_type();
1383
  $id = $product->get_id();
1384
 
1385
+ if ( 'variation' == $product_type ) {
1386
  // $_files = $product->get_files();
1387
  $_files = $product->get_downloads();
1388
  $_files = $this->_edit_files_array( $id, $_files );
1432
 
1433
  $audio_files = array();
1434
  foreach ( $files as $index => $file ) {
1435
+ if ( ! empty( $file['file'] ) && false !== ( $media_type = $this->_is_audio( $file['file'] ) ) ) {
1436
  $file['media_type'] = $media_type;
1437
 
1438
  if ( ! empty( $args['file_id'] ) ) {
1510
  'filename' => $file_path,
1511
  )
1512
  );
1513
+ if ( ! is_wp_error( $response ) && 200 == $response['response']['code'] ) {
1514
  $c = true;
1515
  }
1516
  }
1517
 
1518
+ if ( true === $c ) {
1519
  header( 'location: http' . ( ( is_ssl() ) ? 's:' : ':' ) . $this->_files_directory_url . $file_name );
1520
  exit;
1521
  }
1582
  } // End _is_local
1583
 
1584
  private function _tracking_play_event( $product_id, $file_url ) {
1585
+ $_wcmp_analytics_integration = $this->get_global_attr( '_wcmp_analytics_integration', 'ua' );
1586
+ $_wcmp_analytics_property = trim( $this->get_global_attr( '_wcmp_analytics_property', '' ) );
1587
+ $_wcmp_analytics_api_secret = trim( $this->get_global_attr( '_wcmp_analytics_api_secret', '' ) );
1588
+ if ( ! empty( $_wcmp_analytics_property ) ) {
1589
+ $cid = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : 555;
1590
  try {
1591
  if ( isset( $_COOKIE['_ga'] ) ) {
1592
  $cid_parts = explode( '.', sanitize_text_field( wp_unslash( $_COOKIE['_ga'] ) ), 3 );
1593
  $cid = $cid_parts[2];
1594
  }
1595
  } catch ( Exception $err ) {
1596
+ error_log( $err->getMessage() );
1597
  }
1598
 
1599
+ if ( 'ua' == $_wcmp_analytics_integration ) {
1600
+ $_response = wp_remote_post(
1601
+ 'http://www.google-analytics.com/collect',
1602
+ array(
1603
+ 'body' => array(
1604
+ 'v' => 1,
1605
+ 'tid' => $_wcmp_analytics_property,
1606
+ 'cid' => $cid,
1607
+ 't' => 'event',
1608
+ 'ec' => 'Music Player for WooCommerce',
1609
+ 'ea' => 'play',
1610
+ 'el' => $file_url,
1611
+ 'ev' => $product_id,
1612
+ ),
1613
+ )
1614
+ );
1615
+ } else {
1616
+ $_response = wp_remote_post(
1617
+ 'https://www.google-analytics.com/mp/collect?api_secret=' . $_wcmp_analytics_api_secret . '&measurement_id=' . $_wcmp_analytics_property,
1618
+ array(
1619
+ 'sslverify' => true,
1620
+ 'headers' => array(
1621
+ 'Content-Type' => 'application/json',
1622
+ ),
1623
+ 'body' => json_encode(
1624
+ array(
1625
+ 'client_id' => $cid,
1626
+ 'events' => array(
1627
+ array(
1628
+ 'name' => 'play',
1629
+ 'params' => array(
1630
+ 'event_category' => 'Music Player for WooCommerce',
1631
+ 'event_label' => $file_url,
1632
+ 'event_value' => $product_id,
1633
+ ),
1634
+ ),
1635
+ ),
1636
+ )
1637
+ ),
1638
+ )
1639
+ );
1640
+ }
1641
 
1642
  if ( is_wp_error( $_response ) ) {
1643
  error_log( $_response->get_error_message() );