Changeset 3448586
- Timestamp:
- 01/28/2026 10:31:16 AM (6 weeks ago)
- Location:
- music-player-for-woocommerce
- Files:
-
- 114 added
- 4 edited
-
tags/1.7.7 (added)
-
tags/1.7.7/addons (added)
-
tags/1.7.7/addons/ap-compact-audio-player.addon.php (added)
-
tags/1.7.7/addons/ap-cp-media-player (added)
-
tags/1.7.7/addons/ap-cp-media-player.addon.php (added)
-
tags/1.7.7/addons/ap-cp-media-player/style.css (added)
-
tags/1.7.7/addons/ap-html5-audio-player (added)
-
tags/1.7.7/addons/ap-html5-audio-player.addon.php (added)
-
tags/1.7.7/addons/ap-html5-audio-player/style.css (added)
-
tags/1.7.7/addons/ap-mp3-jplayer (added)
-
tags/1.7.7/addons/ap-mp3-jplayer.addon.php (added)
-
tags/1.7.7/addons/ap-mp3-jplayer/style.css (added)
-
tags/1.7.7/addons/dokan (added)
-
tags/1.7.7/addons/dokan.addon.php (added)
-
tags/1.7.7/addons/dokan/player_options.php (added)
-
tags/1.7.7/addons/dokan/style.css (added)
-
tags/1.7.7/addons/mvx.addon.php (added)
-
tags/1.7.7/addons/wcfm (added)
-
tags/1.7.7/addons/wcfm.addon.php (added)
-
tags/1.7.7/addons/wcfm/script.js (added)
-
tags/1.7.7/addons/wcfm/style.css (added)
-
tags/1.7.7/addons/wcv (added)
-
tags/1.7.7/addons/wcv.addon.php (added)
-
tags/1.7.7/addons/wcv/style.css (added)
-
tags/1.7.7/banner.php (added)
-
tags/1.7.7/css (added)
-
tags/1.7.7/css/style.admin.css (added)
-
tags/1.7.7/css/style.css (added)
-
tags/1.7.7/feedback (added)
-
tags/1.7.7/feedback/cp-feedback.php (added)
-
tags/1.7.7/feedback/feedback.html (added)
-
tags/1.7.7/feedback/screenshots (added)
-
tags/1.7.7/feedback/screenshots/screen1.png (added)
-
tags/1.7.7/feedback/screenshots/screen2.png (added)
-
tags/1.7.7/feedback/screenshots/screen3.png (added)
-
tags/1.7.7/feedback/screenshots/screen4.png (added)
-
tags/1.7.7/inc (added)
-
tags/1.7.7/inc/cache.inc.php (added)
-
tags/1.7.7/inc/landing.inc.php (added)
-
tags/1.7.7/inc/skingenerator.inc.php (added)
-
tags/1.7.7/inc/tools.inc.php (added)
-
tags/1.7.7/js (added)
-
tags/1.7.7/js/admin.js (added)
-
tags/1.7.7/js/public.js (added)
-
tags/1.7.7/js/public_src.js (added)
-
tags/1.7.7/languages (added)
-
tags/1.7.7/languages/music-player-for-woocommerce-en_US.mo (added)
-
tags/1.7.7/languages/music-player-for-woocommerce-en_US.po (added)
-
tags/1.7.7/pagebuilders (added)
-
tags/1.7.7/pagebuilders/beaverbuilder (added)
-
tags/1.7.7/pagebuilders/beaverbuilder/wcmp (added)
-
tags/1.7.7/pagebuilders/beaverbuilder/wcmp.inc.php (added)
-
tags/1.7.7/pagebuilders/beaverbuilder/wcmp/includes (added)
-
tags/1.7.7/pagebuilders/beaverbuilder/wcmp/includes/frontend.php (added)
-
tags/1.7.7/pagebuilders/beaverbuilder/wcmp/wcmp.pb.php (added)
-
tags/1.7.7/pagebuilders/builders.php (added)
-
tags/1.7.7/pagebuilders/divi (added)
-
tags/1.7.7/pagebuilders/divi/divi.js (added)
-
tags/1.7.7/pagebuilders/divi/divi.pb.php (added)
-
tags/1.7.7/pagebuilders/elementor (added)
-
tags/1.7.7/pagebuilders/elementor/elementor.pb.php (added)
-
tags/1.7.7/pagebuilders/elementor/elementor_category.pb.php (added)
-
tags/1.7.7/pagebuilders/gutenberg (added)
-
tags/1.7.7/pagebuilders/gutenberg/gutenberg.css (added)
-
tags/1.7.7/pagebuilders/gutenberg/gutenberg.js (added)
-
tags/1.7.7/pagebuilders/gutenberg/wcblocks.css (added)
-
tags/1.7.7/pagebuilders/gutenberg/wcblocks.js (added)
-
tags/1.7.7/pagebuilders/siteorigin (added)
-
tags/1.7.7/pagebuilders/siteorigin/siteorigin-wcmp (added)
-
tags/1.7.7/pagebuilders/siteorigin/siteorigin-wcmp/assets (added)
-
tags/1.7.7/pagebuilders/siteorigin/siteorigin-wcmp/assets/banner.svg (added)
-
tags/1.7.7/pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php (added)
-
tags/1.7.7/pagebuilders/siteorigin/siteorigin-wcmp/tpl (added)
-
tags/1.7.7/pagebuilders/siteorigin/siteorigin-wcmp/tpl/siteorigin-wcmp-shortcode.php (added)
-
tags/1.7.7/pagebuilders/visualcomposer (added)
-
tags/1.7.7/pagebuilders/visualcomposer/WCMPplaylist (added)
-
tags/1.7.7/pagebuilders/visualcomposer/WCMPplaylist/WCMPplaylist (added)
-
tags/1.7.7/pagebuilders/visualcomposer/WCMPplaylist/WCMPplaylist/public (added)
-
tags/1.7.7/pagebuilders/visualcomposer/WCMPplaylist/WCMPplaylist/public/wcmp-preview.png (added)
-
tags/1.7.7/pagebuilders/visualcomposer/WCMPplaylist/WCMPplaylist/public/wcmp-thumbnail.png (added)
-
tags/1.7.7/pagebuilders/visualcomposer/WCMPplaylist/manifest.json (added)
-
tags/1.7.7/pagebuilders/visualcomposer/WCMPplaylist/public (added)
-
tags/1.7.7/pagebuilders/visualcomposer/WCMPplaylist/public/dist (added)
-
tags/1.7.7/pagebuilders/visualcomposer/WCMPplaylist/public/dist/element.bundle.js (added)
-
tags/1.7.7/readme.txt (added)
-
tags/1.7.7/vendors (added)
-
tags/1.7.7/vendors/demo (added)
-
tags/1.7.7/vendors/demo/demo.mp3 (added)
-
tags/1.7.7/vendors/mejs-skins (added)
-
tags/1.7.7/vendors/mejs-skins/Guifx_v2_Transports.woff (added)
-
tags/1.7.7/vendors/mejs-skins/controls-ted.png (added)
-
tags/1.7.7/vendors/mejs-skins/controls-wmp-bg.png (added)
-
tags/1.7.7/vendors/mejs-skins/controls-wmp.png (added)
-
tags/1.7.7/vendors/mejs-skins/mejs-skins.css (added)
-
tags/1.7.7/vendors/mejs-skins/mejs-skins.min.css (added)
-
tags/1.7.7/views (added)
-
tags/1.7.7/views/assets (added)
-
tags/1.7.7/views/assets/skin1.png (added)
-
tags/1.7.7/views/assets/skin1_btn.png (added)
-
tags/1.7.7/views/assets/skin2.png (added)
-
tags/1.7.7/views/assets/skin2_btn.png (added)
-
tags/1.7.7/views/assets/skin3.png (added)
-
tags/1.7.7/views/assets/skin3_btn.png (added)
-
tags/1.7.7/views/global_options.php (added)
-
tags/1.7.7/views/player_options.php (added)
-
tags/1.7.7/wcmp.php (added)
-
tags/1.7.7/widgets (added)
-
tags/1.7.7/widgets/playlist_widget (added)
-
tags/1.7.7/widgets/playlist_widget.php (added)
-
tags/1.7.7/widgets/playlist_widget/css (added)
-
tags/1.7.7/widgets/playlist_widget/css/style.css (added)
-
tags/1.7.7/widgets/playlist_widget/js (added)
-
tags/1.7.7/widgets/playlist_widget/js/public.js (added)
-
trunk/inc/landing.inc.php (added)
-
trunk/languages/music-player-for-woocommerce-en_US.mo (modified) (previous)
-
trunk/languages/music-player-for-woocommerce-en_US.po (modified) (9 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wcmp.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
music-player-for-woocommerce/trunk/languages/music-player-for-woocommerce-en_US.po
r3384254 r3448586 2 2 msgstr "" 3 3 "Project-Id-Version: music-player-for-woocommerce\n" 4 "POT-Creation-Date: 202 5-10-24 23:58+0200\n"5 "PO-Revision-Date: 202 5-10-24 23:58+0200\n"4 "POT-Creation-Date: 2026-01-28 10:56+0100\n" 5 "PO-Revision-Date: 2026-01-28 10:56+0100\n" 6 6 "Last-Translator: CodePeople\n" 7 7 "Language-Team: CodePeople\n" … … 264 264 msgstr "" 265 265 266 #: addons/dokan/player_options.php:161 views/global_options.php:318 266 #: addons/dokan/player_options.php:161 inc/landing.inc.php:224 267 #: inc/landing.inc.php:225 views/global_options.php:318 267 268 #: views/global_options.php:319 views/player_options.php:214 268 269 #: views/player_options.php:215 … … 270 271 msgstr "" 271 272 272 #: addons/dokan/player_options.php:166 views/global_options.php:323 273 #: addons/dokan/player_options.php:166 inc/landing.inc.php:229 274 #: inc/landing.inc.php:230 views/global_options.php:323 273 275 #: views/global_options.php:324 views/player_options.php:219 274 276 #: views/player_options.php:220 … … 276 278 msgstr "" 277 279 278 #: addons/dokan/player_options.php:171 views/global_options.php:328 280 #: addons/dokan/player_options.php:171 inc/landing.inc.php:234 281 #: inc/landing.inc.php:235 views/global_options.php:328 279 282 #: views/global_options.php:329 views/player_options.php:224 280 283 #: views/player_options.php:225 … … 359 362 msgstr "" 360 363 361 #: addons/dokan/player_options.php:206 views/global_options.php:550362 #: views/ player_options.php:305364 #: addons/dokan/player_options.php:206 inc/landing.inc.php:251 365 #: views/global_options.php:550 views/player_options.php:305 363 366 msgid "Display the player's title" 364 367 msgstr "" … … 408 411 "If the \"WC Vendors\" plugin is installed on the website, check the checkbox " 409 412 "to allow vendors to configure their music players." 413 msgstr "" 414 415 #: inc/landing.inc.php:159 416 msgid "close the landing page" 417 msgstr "" 418 419 #: inc/landing.inc.php:162 420 msgid "Welcome to the Music Player for WooCommerce" 421 msgstr "" 422 423 #: inc/landing.inc.php:199 424 msgid "" 425 "You are currently using the free version of Music Player for WooCommerce, " 426 "which allows audio players only on downloadable products that include at " 427 "least one audio file." 428 msgstr "" 429 430 #: inc/landing.inc.php:200 inc/landing.inc.php:201 431 msgid "" 432 "Upgrade to the commercial version to unlock full flexibility: enable audio " 433 "players on any WooCommerce product, whether downloadable or physical, and " 434 "present your audio content exactly where it drives the most value." 435 msgstr "" 436 437 #: inc/landing.inc.php:205 438 msgid "Downloadable Products" 439 msgstr "" 440 441 #: inc/landing.inc.php:207 442 msgid "Compatible with the Music Player for WooCommerce Free" 443 msgstr "" 444 445 #: inc/landing.inc.php:210 446 msgid "Other Products" 447 msgstr "" 448 449 #: inc/landing.inc.php:212 450 msgid "Compatible with the Music Player for WooCommerce Pro" 451 msgstr "" 452 453 #: inc/landing.inc.php:215 454 msgid "" 455 "Using this dialog, you can automatically enable the audio player for all " 456 "downloadable products that contain one or more associated audio files." 457 msgstr "" 458 459 #: inc/landing.inc.php:220 460 msgid "Select a player skin:" 461 msgstr "" 462 463 #: inc/landing.inc.php:241 464 msgid "Other options:" 465 msgstr "" 466 467 #: inc/landing.inc.php:243 views/global_options.php:542 468 #: views/player_options.php:297 469 msgid "Visualizer control" 470 msgstr "" 471 472 #: inc/landing.inc.php:244 473 msgid "Display the visualizer component over the player." 474 msgstr "" 475 476 #: inc/landing.inc.php:251 views/global_options.php:552 477 #: views/player_options.php:307 478 msgid "Display the player title" 479 msgstr "" 480 481 #: inc/landing.inc.php:258 482 msgid "Enabling the audio player" 483 msgstr "" 484 485 #: inc/landing.inc.php:261 486 msgid "Go to your products list" 487 msgstr "" 488 489 #: inc/landing.inc.php:274 490 msgid "Thanks!!!" 491 msgstr "" 492 493 #: inc/landing.inc.php:278 494 msgid "Visit your store" 495 msgstr "" 496 497 #: inc/landing.inc.php:295 498 msgid "Why Upgrade?" 499 msgstr "" 500 501 #: inc/landing.inc.php:299 502 msgid "(One-time purchase, lifetime access plugin updates)" 503 msgstr "" 504 505 #: inc/landing.inc.php:305 506 msgid "Display players on non-downloadable products" 507 msgstr "" 508 509 #: inc/landing.inc.php:305 510 msgid "Allow audio players to be enabled on non-downloadable products." 511 msgstr "" 512 513 #: inc/landing.inc.php:306 514 msgid "Protect the audio files" 515 msgstr "" 516 517 #: inc/landing.inc.php:306 518 msgid "" 519 "Generate new demo audio files to ensure that unauthorized access only " 520 "exposes demo versions, not the full sales audio." 521 msgstr "" 522 523 #: inc/landing.inc.php:307 524 msgid "Audio watermark" 525 msgstr "" 526 527 #: inc/landing.inc.php:307 528 msgid "Allows you to apply audio watermarks to demo files." 529 msgstr "" 530 531 #: inc/landing.inc.php:310 532 msgid "Demo specific audio files" 533 msgstr "" 534 535 #: inc/landing.inc.php:310 536 msgid "" 537 "Assign specific audio files as demo versions, keeping them separate from the " 538 "original audio files." 539 msgstr "" 540 541 #: inc/landing.inc.php:311 542 msgid "Allow accessing purchased files" 543 msgstr "" 544 545 #: inc/landing.inc.php:311 546 msgid "" 547 "Allows verified buyers to listen to the original audio files rather than " 548 "demo versions." 549 msgstr "" 550 551 #: inc/landing.inc.php:316 552 msgid "LIFETIME" 553 msgstr "" 554 555 #: inc/landing.inc.php:317 556 msgid "UPGRADE!" 410 557 msgstr "" 411 558 … … 438 585 #: pagebuilders/beaverbuilder/wcmp/wcmp.pb.php:12 pagebuilders/builders.php:126 439 586 #: pagebuilders/divi/divi.pb.php:9 440 #: pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:16 wcmp.php:3 69587 #: pagebuilders/siteorigin/siteorigin-wcmp/siteorigin-wcmp.php:16 wcmp.php:387 441 588 msgid "Music Player for WooCommerce" 442 589 msgstr "" … … 891 1038 msgstr "" 892 1039 893 #: views/global_options.php:542 views/player_options.php:297894 msgid "Visualizer control"895 msgstr ""896 897 1040 #: views/global_options.php:543 views/player_options.php:298 898 1041 msgid "" 899 1042 "For \"all controls\" mode, display the visualizer component over the player." 900 msgstr ""901 902 #: views/global_options.php:552 views/player_options.php:307903 msgid "Display the player title"904 1043 msgstr "" 905 1044 … … 1144 1283 msgstr "" 1145 1284 1146 #: wcmp.php:3 791285 #: wcmp.php:397 1147 1286 msgid "Playback Counter" 1148 1287 msgstr "" 1149 1288 1150 #: wcmp.php:4 001289 #: wcmp.php:418 1151 1290 msgid "Help" 1152 1291 msgstr "" 1153 1292 1154 #: wcmp.php:1 1701293 #: wcmp.php:1269 1155 1294 msgid "download" 1156 1295 msgstr "" 1157 1296 1158 #: wcmp.php:1 6591297 #: wcmp.php:1768 1159 1298 msgid "There are no products that satisfy the block's settings" 1160 1299 msgstr "" -
music-player-for-woocommerce/trunk/readme.txt
r3432879 r3448586 5 5 Requires at least: 3.5.0 6 6 Tested up to: 6.9 7 Stable tag: 1.7. 67 Stable tag: 1.7.7 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 266 266 == Changelog == 267 267 268 = 1.7.7 = 269 270 * Enables players quickly with a simple, intuitive setup. 271 268 272 = 1.7.6 = 269 273 … … 339 343 340 344 * Implements two new attributes in the Playlist shortcode for filtering the products by the product categories and tags. 341 342 = 1.3.11 =343 344 * Enhances the user experience when editing the global player settings.345 346 = 1.3.10 =347 348 * Resolves a compatibility issue with WordPress version previous to 5.5.349 350 = 1.3.9 =351 352 * Resolves a notice by ensuring the language files are properly loaded.353 354 = 1.3.8 =355 356 * Fixes a conflict with Elementor's cache which is currently in Beta.357 358 = 1.3.7 =359 360 * Accepts a new attribute in the playlist shortcode to display/hide the audio durations from the playlist.361 362 = 1.3.6 =363 364 * Modifies the playlists, including additional information like the original file duration (do not confuse it with the duration of the demos files)365 366 = 1.3.5 =367 368 * Modifies the player settings to enhance its accessibility and user experience.369 370 = 1.3.4 =371 372 * Changes the method by which the plugin identifies the product currently being edited.373 374 = 1.3.3 =375 376 * Prevents the LiteSpeed Cache plugin to affect the players.377 378 = 1.3.2 =379 380 * Modifies the module to load the language files to ensure compatibility with WP 6.7.381 382 = 1.3.1 =383 384 * Improves the plugin settings page.385 * Modifies the FFmpeg integration (Professional version).386 387 = 1.3.0 =388 389 * Updates the plugin settings page to make it more user-friendly.390 * Enhance the troubleshooting area to make it easier to resolve conflicts with third-party plugins and themes. -
music-player-for-woocommerce/trunk/wcmp.php
r3432879 r3448586 3 3 Plugin Name: Music Player for WooCommerce 4 4 Plugin URI: https://wcmp.dwbooster.com 5 Version: 1.7. 65 Version: 1.7.7 6 6 Text Domain: music-player-for-woocommerce 7 7 Author: CodePeople … … 42 42 define( 'WCMP_DEFAULT_PlAYER_TITLE', 1 ); 43 43 define( 'WCMP_REMOTE_TIMEOUT', 120 ); 44 define( 'WCMP_VERSION', '1.7. 6' );44 define( 'WCMP_VERSION', '1.7.7' ); 45 45 46 46 // Load Tools … … 185 185 $this->_clearDir( $this->_files_directory_path ); 186 186 $this->_createDir(); 187 188 // Check if the ladning page was opened previously, and redirect to the settings page if not. 189 if ( ! get_option( 'wcmp-landing-page' ) ) { 190 // Check if there is any player configured previously (this means that the user has used the plugin before). 191 global $wpdb; 192 if ( 0 == $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->postmeta} WHERE meta_key LIKE '%_wcmp_%'" ) ) { 193 set_transient( 'wcmp-landing-page', true, 24 * 60 * 60 ); 194 set_transient( 'wcmp-landing-page-redirect', true, 24 * 60 * 60 ); 195 update_option( 'wcmp-landing-page', 1 ); 196 } 197 } 187 198 } 188 199 … … 365 376 } 366 377 378 // Redirect to the landing page if activated. 379 if ( get_transient( 'wcmp-landing-page-redirect' ) ) { 380 delete_transient( 'wcmp-landing-page-redirect' ); 381 wp_safe_redirect(admin_url('options-general.php?page=music-player-for-woocommerce-settings')); 382 } 383 384 // Clear transients 367 385 $this->clear_expired_transients(); 368 386 … … 408 426 409 427 public function settings_page() { 428 $delete_landing_page_transient = false; 429 if ( isset( $_GET['close-landing-page'] ) ) delete_transient('wcmp-landing-page'); 410 430 if ( 411 isset( $_POST['wcmp_nonce'] ) && 412 wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['wcmp_nonce'] ) ), 'wcmp_updating_plugin_settings' ) 431 isset( $_POST['wcmp_nonce'] ) 413 432 ) { 433 $updated_settings = false; 434 $wcmp_nonce = sanitize_text_field( wp_unslash( $_POST['wcmp_nonce'] ) ); 414 435 $_REQUEST = stripslashes_deep( $_REQUEST ); 415 // Save the player settings 416 $registered_only = ( isset( $_REQUEST['_wcmp_registered_only'] ) ) ? 1 : 0; 417 $fade_out = ( isset( $_REQUEST['_wcmp_fade_out'] ) ) ? 1 : 0; 418 $purchased_times_text = sanitize_text_field( isset( $_REQUEST['_wcmp_purchased_times_text'] ) ? wp_unslash( $_REQUEST['_wcmp_purchased_times_text'] ) : '' ); 419 $troubleshoot_default_extension = ( isset( $_REQUEST['_wcmp_default_extension'] ) ) ? true : false; 420 $ios_controls = ( isset( $_REQUEST['_wcmp_ios_controls'] ) ) ? true : false; 421 $troubleshoot_onload = ( isset( $_REQUEST['_wcmp_onload'] ) ) ? true : false; 422 $include_main_player_hook = ( isset( $_REQUEST['_wcmp_main_player_hook'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_main_player_hook'] ) ) : ''; 423 $main_player_hook_title = ( isset( $_REQUEST['_wcmp_main_player_hook_title'] ) ) ? 1 : 0; 424 $disable_302 = ( isset( $_REQUEST['_wcmp_disable_302'] ) ) ? 1 : 0; 425 $include_all_players_hook = ( isset( $_REQUEST['_wcmp_all_players_hook'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_all_players_hook'] ) ) : ''; 426 427 $enable_player = ( isset( $_REQUEST['_wcmp_enable_player'] ) ) ? 1 : 0; 428 $show_in = ( isset( $_REQUEST['_wcmp_show_in'] ) && in_array( $_REQUEST['_wcmp_show_in'], array( 'single', 'multiple' ) ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_show_in'] ) ) : 'all'; 429 $players_in_cart = ( isset( $_REQUEST['_wcmp_players_in_cart'] ) ) ? true : false; 430 $player_style = ( 431 isset( $_REQUEST['_wcmp_player_layout'] ) && 432 in_array( $_REQUEST['_wcmp_player_layout'], $this->_player_layouts ) 433 ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_player_layout'] ) ) : WCMP_DEFAULT_PLAYER_LAYOUT; 434 $custom_skin_desc = ( isset( $_REQUEST['_wcmp_skin_generator_description'] ) ? sanitize_textarea_field( wp_unslash( $_REQUEST['_wcmp_skin_generator_description'] ) ) : '' ); 435 $custom_skin = ( isset( $_REQUEST['_wcmp_custom_skin'] ) ? sanitize_textarea_field( wp_unslash( $_REQUEST['_wcmp_custom_skin'] ) ) : '' ); 436 $single_player = ( isset( $_REQUEST['_wcmp_single_player'] ) ) ? 1 : 0; 437 $player_controls = ( 438 isset( $_REQUEST['_wcmp_player_controls'] ) && 439 in_array( $_REQUEST['_wcmp_player_controls'], $this->_player_controls ) 440 ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_player_controls'] ) ) : WCMP_DEFAULT_PLAYER_CONTROLS; 441 442 $on_cover = ( ( 'button' == $player_controls || 'default' == $player_controls ) && isset( $_REQUEST['_wcmp_player_on_cover'] ) ) ? 1 : 0; 443 $visualizer = isset( $_REQUEST['_wcmp_visualizer'] ) ? 1 : 0; 444 445 $player_title = ( isset( $_REQUEST['_wcmp_player_title'] ) ) ? 1 : 0; 446 $merge_grouped = ( isset( $_REQUEST['_wcmp_merge_in_grouped'] ) ) ? 1 : 0; 447 $play_all = ( isset( $_REQUEST['_wcmp_play_all'] ) ) ? 1 : 0; 448 $loop = ( isset( $_REQUEST['_wcmp_loop'] ) ) ? 1 : 0; 449 $play_simultaneously = ( isset( $_REQUEST['_wcmp_play_simultaneously'] ) ) ? 1 : 0; 450 $volume = ( isset( $_REQUEST['_wcmp_player_volume'] ) && is_numeric( $_REQUEST['_wcmp_player_volume'] ) ) ? floatval( $_REQUEST['_wcmp_player_volume'] ) : 1; 451 $preload = ( 452 isset( $_REQUEST['_wcmp_preload'] ) && 453 in_array( $_REQUEST['_wcmp_preload'], array( 'none', 'metadata', 'auto' ) ) 454 ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_preload'] ) ) : 'none'; 455 456 $apply_to_all_players = ( isset( $_REQUEST['_wcmp_apply_to_all_players'] ) ) ? 1 : 0; 457 458 $global_settings = array( 459 '_wcmp_registered_only' => $registered_only, 460 '_wcmp_fade_out' => $fade_out, 461 '_wcmp_purchased_times_text' => $purchased_times_text, 462 '_wcmp_enable_player' => $enable_player, 463 '_wcmp_show_in' => $show_in, 464 '_wcmp_players_in_cart' => $players_in_cart, 465 '_wcmp_player_layout' => $player_style, 466 '_wcmp_skin_generator_description' => $custom_skin_desc, 467 '_wcmp_custom_skin' => $custom_skin, 468 '_wcmp_player_volume' => $volume, 469 '_wcmp_single_player' => $single_player, 470 '_wcmp_player_controls' => $player_controls, 471 '_wcmp_player_title' => $player_title, 472 '_wcmp_merge_in_grouped' => $merge_grouped, 473 '_wcmp_play_all' => $play_all, 474 '_wcmp_loop' => $loop, 475 '_wcmp_play_simultaneously' => $play_simultaneously, 476 '_wcmp_preload' => $preload, 477 '_wcmp_on_cover' => $on_cover, 478 '_wcmp_visualizer' => $visualizer, 479 '_wcmp_default_extension' => $troubleshoot_default_extension, 480 '_wcmp_ios_controls' => $ios_controls, 481 '_wcmp_onload' => $troubleshoot_onload, 482 '_wcmp_main_player_hook' => $include_main_player_hook, 483 '_wcmp_main_player_hook_title' => $main_player_hook_title, 484 '_wcmp_disable_302' => $disable_302, 485 '_wcmp_all_players_hook' => $include_all_players_hook, 486 '_wcmp_playback_counter_column' => ( isset( $_REQUEST['_wcmp_playback_counter_column'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_playback_counter_column'] ) ) : 0, 487 '_wcmp_analytics_integration' => ( isset( $_REQUEST['_wcmp_analytics_integration'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_integration'] ) ) : 'ua', 488 '_wcmp_analytics_property' => ( isset( $_REQUEST['_wcmp_analytics_property'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_property'] ) ) : '', 489 '_wcmp_analytics_api_secret' => ( isset( $_REQUEST['_wcmp_analytics_api_secret'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_api_secret'] ) ) : '', 490 '_wcmp_apply_to_all_players' => $apply_to_all_players, 491 ); 492 493 if ( $apply_to_all_players ) { 494 $this->_clearDir( $this->_files_directory_path ); 495 496 $products_ids = array( 497 'post_type' => $this->_get_post_types(), 498 'numberposts' => -1, 499 'post_status' => array( 'publish', 'pending', 'draft', 'future' ), 500 'fields' => 'ids', 501 'cache_results' => false, 502 ); 503 504 $products = get_posts( $products_ids ); 505 foreach ( $products as $product_id ) { 506 update_post_meta( $product_id, '_wcmp_enable_player', $enable_player ); 507 update_post_meta( $product_id, '_wcmp_show_in', $show_in ); 508 update_post_meta( $product_id, '_wcmp_player_layout', $player_style ); 509 update_post_meta( $product_id, '_wcmp_single_player', $single_player ); 510 update_post_meta( $product_id, '_wcmp_player_controls', $player_controls ); 511 update_post_meta( $product_id, '_wcmp_player_volume', $volume ); 512 update_post_meta( $product_id, '_wcmp_player_title', $player_title ); 513 update_post_meta( $product_id, '_wcmp_merge_in_grouped', $merge_grouped ); 514 update_post_meta( $product_id, '_wcmp_play_all', $play_all ); 515 update_post_meta( $product_id, '_wcmp_loop', $loop ); 516 update_post_meta( $product_id, '_wcmp_preload', $preload ); 517 update_post_meta( $product_id, '_wcmp_on_cover', $on_cover ); 518 update_post_meta( $product_id, '_wcmp_visualizer', $visualizer ); 519 } 520 } 521 522 update_option( 'wcmp_global_settings', $global_settings ); 523 $this->_global_attrs = $global_settings; 524 do_action( 'wcmp_save_setting' ); 525 526 /** Purge Cache **/ 527 include_once __DIR__ . '/inc/cache.inc.php'; 436 437 if ( wp_verify_nonce( $wcmp_nonce, 'wcmp_updating_plugin_settings_landing_page' ) ) { // phpcs:ignore() 438 $delete_landing_page_transient = true; 439 $enable_player = 1; 440 $main_player_hook_title = 1; 441 $fade_out = 1; 442 $visualizer = isset($_REQUEST['_wcmp_visualizer']) ? 1 : 0; 443 $player_title = (isset($_REQUEST['_wcmp_player_title'])) ? 1 : 0; 444 $play_all = 1; 445 $show_in = 'all'; 446 $player_style = ( 447 isset($_REQUEST['_wcmp_player_layout']) && 448 in_array($_REQUEST['_wcmp_player_layout'], $this->_player_layouts) 449 ) ? sanitize_text_field(wp_unslash($_REQUEST['_wcmp_player_layout'])) : WCMP_DEFAULT_PLAYER_LAYOUT; 450 $player_controls = ( 451 isset($_REQUEST['_wcmp_player_controls']) && 452 in_array($_REQUEST['_wcmp_player_controls'], $this->_player_controls) 453 ) ? sanitize_text_field(wp_unslash($_REQUEST['_wcmp_player_controls'])) : WCMP_DEFAULT_PLAYER_CONTROLS; 454 $volume = 1; 455 $preload = 'none'; 456 $apply_to_all_players = 1; 457 458 $global_settings = get_option('wcmp_global_settings', []); 459 $global_settings = array_merge( 460 $global_settings, 461 array( 462 '_wcmp_fade_out' => $fade_out, 463 '_wcmp_enable_player' => $enable_player, 464 '_wcmp_show_in' => $show_in, 465 '_wcmp_player_layout' => $player_style, 466 '_wcmp_player_volume' => $volume, 467 '_wcmp_player_controls' => $player_controls, 468 '_wcmp_player_title' => $player_title, 469 '_wcmp_play_all' => $play_all, 470 '_wcmp_preload' => $preload, 471 '_wcmp_visualizer' => $visualizer, 472 '_wcmp_main_player_hook_title' => $main_player_hook_title, 473 '_wcmp_apply_to_all_players' => $apply_to_all_players, 474 ) 475 ); 476 477 if ($apply_to_all_players) { 478 $this->_clearDir($this->_files_directory_path); 479 480 $products_ids = array( 481 'post_type' => $this->_get_post_types(), 482 'numberposts' => -1, 483 'post_status' => array('publish', 'pending', 'draft', 'future'), 484 'fields' => 'ids', 485 'cache_results' => false, 486 ); 487 488 $products = get_posts($products_ids); 489 foreach ($products as $product_id) { 490 update_post_meta($product_id, '_wcmp_enable_player', $enable_player); 491 update_post_meta($product_id, '_wcmp_show_in', $show_in); 492 update_post_meta($product_id, '_wcmp_player_layout', $player_style); 493 update_post_meta($product_id, '_wcmp_player_controls', $player_controls); 494 update_post_meta($product_id, '_wcmp_player_volume', $volume); 495 update_post_meta($product_id, '_wcmp_player_title', $player_title); 496 update_post_meta($product_id, '_wcmp_play_all', $play_all); 497 update_post_meta($product_id, '_wcmp_preload', $preload); 498 update_post_meta($product_id, '_wcmp_visualizer', $visualizer); 499 } 500 } 501 502 $updated_settings = true; 503 } elseif ( wp_verify_nonce( $wcmp_nonce, 'wcmp_updating_plugin_settings' ) ) { // phpcs:ignore() 504 // Save the player settings 505 $registered_only = ( isset( $_REQUEST['_wcmp_registered_only'] ) ) ? 1 : 0; 506 $fade_out = ( isset( $_REQUEST['_wcmp_fade_out'] ) ) ? 1 : 0; 507 $purchased_times_text = sanitize_text_field( isset( $_REQUEST['_wcmp_purchased_times_text'] ) ? wp_unslash( $_REQUEST['_wcmp_purchased_times_text'] ) : '' ); 508 $troubleshoot_default_extension = ( isset( $_REQUEST['_wcmp_default_extension'] ) ) ? true : false; 509 $ios_controls = ( isset( $_REQUEST['_wcmp_ios_controls'] ) ) ? true : false; 510 $troubleshoot_onload = ( isset( $_REQUEST['_wcmp_onload'] ) ) ? true : false; 511 $include_main_player_hook = ( isset( $_REQUEST['_wcmp_main_player_hook'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_main_player_hook'] ) ) : ''; 512 $main_player_hook_title = ( isset( $_REQUEST['_wcmp_main_player_hook_title'] ) ) ? 1 : 0; 513 $disable_302 = ( isset( $_REQUEST['_wcmp_disable_302'] ) ) ? 1 : 0; 514 $include_all_players_hook = ( isset( $_REQUEST['_wcmp_all_players_hook'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_all_players_hook'] ) ) : ''; 515 516 $enable_player = ( isset( $_REQUEST['_wcmp_enable_player'] ) ) ? 1 : 0; 517 $show_in = ( isset( $_REQUEST['_wcmp_show_in'] ) && in_array( $_REQUEST['_wcmp_show_in'], array( 'single', 'multiple' ) ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_show_in'] ) ) : 'all'; 518 $players_in_cart = ( isset( $_REQUEST['_wcmp_players_in_cart'] ) ) ? true : false; 519 $player_style = ( 520 isset( $_REQUEST['_wcmp_player_layout'] ) && 521 in_array( $_REQUEST['_wcmp_player_layout'], $this->_player_layouts ) 522 ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_player_layout'] ) ) : WCMP_DEFAULT_PLAYER_LAYOUT; 523 $custom_skin_desc = ( isset( $_REQUEST['_wcmp_skin_generator_description'] ) ? sanitize_textarea_field( wp_unslash( $_REQUEST['_wcmp_skin_generator_description'] ) ) : '' ); 524 $custom_skin = ( isset( $_REQUEST['_wcmp_custom_skin'] ) ? sanitize_textarea_field( wp_unslash( $_REQUEST['_wcmp_custom_skin'] ) ) : '' ); 525 $single_player = ( isset( $_REQUEST['_wcmp_single_player'] ) ) ? 1 : 0; 526 $player_controls = ( 527 isset( $_REQUEST['_wcmp_player_controls'] ) && 528 in_array( $_REQUEST['_wcmp_player_controls'], $this->_player_controls ) 529 ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_player_controls'] ) ) : WCMP_DEFAULT_PLAYER_CONTROLS; 530 531 $on_cover = ( ( 'button' == $player_controls || 'default' == $player_controls ) && isset( $_REQUEST['_wcmp_player_on_cover'] ) ) ? 1 : 0; 532 $visualizer = isset( $_REQUEST['_wcmp_visualizer'] ) ? 1 : 0; 533 534 $player_title = ( isset( $_REQUEST['_wcmp_player_title'] ) ) ? 1 : 0; 535 $merge_grouped = ( isset( $_REQUEST['_wcmp_merge_in_grouped'] ) ) ? 1 : 0; 536 $play_all = ( isset( $_REQUEST['_wcmp_play_all'] ) ) ? 1 : 0; 537 $loop = ( isset( $_REQUEST['_wcmp_loop'] ) ) ? 1 : 0; 538 $play_simultaneously = ( isset( $_REQUEST['_wcmp_play_simultaneously'] ) ) ? 1 : 0; 539 $volume = ( isset( $_REQUEST['_wcmp_player_volume'] ) && is_numeric( $_REQUEST['_wcmp_player_volume'] ) ) ? floatval( $_REQUEST['_wcmp_player_volume'] ) : 1; 540 $preload = ( 541 isset( $_REQUEST['_wcmp_preload'] ) && 542 in_array( $_REQUEST['_wcmp_preload'], array( 'none', 'metadata', 'auto' ) ) 543 ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_preload'] ) ) : 'none'; 544 545 $apply_to_all_players = ( isset( $_REQUEST['_wcmp_apply_to_all_players'] ) ) ? 1 : 0; 546 547 $global_settings = array( 548 '_wcmp_registered_only' => $registered_only, 549 '_wcmp_fade_out' => $fade_out, 550 '_wcmp_purchased_times_text' => $purchased_times_text, 551 '_wcmp_enable_player' => $enable_player, 552 '_wcmp_show_in' => $show_in, 553 '_wcmp_players_in_cart' => $players_in_cart, 554 '_wcmp_player_layout' => $player_style, 555 '_wcmp_skin_generator_description' => $custom_skin_desc, 556 '_wcmp_custom_skin' => $custom_skin, 557 '_wcmp_player_volume' => $volume, 558 '_wcmp_single_player' => $single_player, 559 '_wcmp_player_controls' => $player_controls, 560 '_wcmp_player_title' => $player_title, 561 '_wcmp_merge_in_grouped' => $merge_grouped, 562 '_wcmp_play_all' => $play_all, 563 '_wcmp_loop' => $loop, 564 '_wcmp_play_simultaneously' => $play_simultaneously, 565 '_wcmp_preload' => $preload, 566 '_wcmp_on_cover' => $on_cover, 567 '_wcmp_visualizer' => $visualizer, 568 '_wcmp_default_extension' => $troubleshoot_default_extension, 569 '_wcmp_ios_controls' => $ios_controls, 570 '_wcmp_onload' => $troubleshoot_onload, 571 '_wcmp_main_player_hook' => $include_main_player_hook, 572 '_wcmp_main_player_hook_title' => $main_player_hook_title, 573 '_wcmp_disable_302' => $disable_302, 574 '_wcmp_all_players_hook' => $include_all_players_hook, 575 '_wcmp_playback_counter_column' => ( isset( $_REQUEST['_wcmp_playback_counter_column'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_playback_counter_column'] ) ) : 0, 576 '_wcmp_analytics_integration' => ( isset( $_REQUEST['_wcmp_analytics_integration'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_integration'] ) ) : 'ua', 577 '_wcmp_analytics_property' => ( isset( $_REQUEST['_wcmp_analytics_property'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_property'] ) ) : '', 578 '_wcmp_analytics_api_secret' => ( isset( $_REQUEST['_wcmp_analytics_api_secret'] ) ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wcmp_analytics_api_secret'] ) ) : '', 579 '_wcmp_apply_to_all_players' => $apply_to_all_players, 580 ); 581 582 if ( $apply_to_all_players ) { 583 $this->_clearDir( $this->_files_directory_path ); 584 585 $products_ids = array( 586 'post_type' => $this->_get_post_types(), 587 'numberposts' => -1, 588 'post_status' => array( 'publish', 'pending', 'draft', 'future' ), 589 'fields' => 'ids', 590 'cache_results' => false, 591 ); 592 593 $products = get_posts( $products_ids ); 594 foreach ( $products as $product_id ) { 595 update_post_meta( $product_id, '_wcmp_enable_player', $enable_player ); 596 update_post_meta( $product_id, '_wcmp_show_in', $show_in ); 597 update_post_meta( $product_id, '_wcmp_player_layout', $player_style ); 598 update_post_meta( $product_id, '_wcmp_single_player', $single_player ); 599 update_post_meta( $product_id, '_wcmp_player_controls', $player_controls ); 600 update_post_meta( $product_id, '_wcmp_player_volume', $volume ); 601 update_post_meta( $product_id, '_wcmp_player_title', $player_title ); 602 update_post_meta( $product_id, '_wcmp_merge_in_grouped', $merge_grouped ); 603 update_post_meta( $product_id, '_wcmp_play_all', $play_all ); 604 update_post_meta( $product_id, '_wcmp_loop', $loop ); 605 update_post_meta( $product_id, '_wcmp_preload', $preload ); 606 update_post_meta( $product_id, '_wcmp_on_cover', $on_cover ); 607 update_post_meta( $product_id, '_wcmp_visualizer', $visualizer ); 608 } 609 } 610 $updated_settings = true; 611 } 612 613 if ( $updated_settings ) { 614 update_option( 'wcmp_global_settings', $global_settings ); 615 $this->_global_attrs = $global_settings; 616 do_action( 'wcmp_save_setting' ); 617 /** Purge Cache **/ 618 include_once __DIR__ . '/inc/cache.inc.php'; 619 } 528 620 } // Save settings 529 621 530 622 print '<div class="wrap">'; // Open Wrap 531 include_once dirname( __FILE__ ) . '/views/global_options.php'; 623 if ( get_transient( 'wcmp-landing-page' ) ) { 624 include_once dirname( __FILE__ ) . '/inc/landing.inc.php'; 625 if( $delete_landing_page_transient ) { delete_transient( 'wcmp-landing-page' ); } 626 } else { 627 include_once dirname( __FILE__ ) . '/views/global_options.php'; 628 } 532 629 print '</div>'; // Close Wrap 533 630 } // End settings_page
Note: See TracChangeset
for help on using the changeset viewer.