Plugin Directory

Changeset 3453905


Ignore:
Timestamp:
02/04/2026 03:34:37 PM (5 weeks ago)
Author:
codepeople2
Message:

New version 1.7.9
Modifications in the changelogs.

Location:
music-player-for-woocommerce
Files:
123 added
4 edited

Legend:

Unmodified
Added
Removed
  • music-player-for-woocommerce/trunk/pagebuilders/builders.php

    r3336669 r3453905  
    99
    1010        private function __construct(){}
     11
    1112        private static function instance() {
    1213            if ( ! isset( self::$_instance ) ) {
     
    1516            return self::$_instance;
    1617        } // End instance
     18
     19        public static function get_preview_url() {
     20            $url  = WCMP_WEBSITE_URL;
     21            $url  = wp_nonce_url( $url, 'wcmp_generate_preview',  'wcmp-preview-nonce' );
     22            $url .= '&wcmp-preview=';
     23
     24            return $url;
     25        } // End get_preview_url
    1726
    1827        public static function run() {
     
    3847            }
    3948
    40             // DIVI
    41             add_action( 'et_builder_ready', array( $instance, 'divi_editor' ) );
    42 
    4349        } // End init
    4450
     
    5258            // Visual Composer
    5359            add_action( 'vcv:api', array( $instance, 'visualcomposer_editor' ) );
     60
     61            // DIVI
     62            if ( function_exists( 'et_get_theme_version' ) ) {
     63                if ( version_compare( et_get_theme_version(), '5.0', '>=' ) ) { // DIVI 5
     64                    add_action( 'et_builder_ready', array($instance, 'divi_editor') );
     65                    add_action( 'divi_visual_builder_assets_before_enqueue_scripts',
     66                        function() {
     67                            if ( et_core_is_fb_enabled() && et_builder_d5_enabled() ) {
     68
     69                                wp_register_script( 'wcmp-divi5-editor-config', '', array(), null, true );
     70                                wp_enqueue_script( 'wcmp-divi5-editor-config' );
     71                                $script = 'var wcmp_divi5_player_preview_url = "' . self::get_preview_url() . '";';
     72                                wp_add_inline_script( 'wcmp-divi5-editor-config', $script );
     73
     74                                \ET\Builder\VisualBuilder\Assets\PackageBuildManager::register_package_build(
     75                                    [
     76                                        'name'    => 'wcmp-divi-5-module-visual-builder',
     77                                        'version' => '1.0.0',
     78                                        'script'  => [
     79                                            'src' => plugins_url('/pagebuilders/divi5/divi.js', WCMP_PLUGIN_PATH),
     80                                            'deps'=> [
     81                                                'react',
     82                                                'jquery',
     83                                                'divi-module-library',
     84                                                'wp-hooks',
     85                                                'divi-rest',
     86                                            ],
     87                                            'enqueue_top_window' => false,
     88                                            'enqueue_app_window' => true,
     89                                        ],
     90                                    ]
     91                                );
     92                            }
     93                        }
     94                    );
     95
     96                    // Register module.
     97                    add_action(
     98                        'divi_module_library_modules_dependency_tree',
     99                        function( $dependency_tree ) {
     100                            // Load Divi 5 modules.
     101                            require_once dirname(WCMP_PLUGIN_PATH) . '/pagebuilders/divi5/index.php';
     102                            $dependency_tree->add_dependency( new WCMP_DIVI5() );
     103                        }
     104                    );
     105
     106                    add_filter(
     107                        'divi.moduleLibrary.conversion.moduleConversionOutlineFile',
     108                        function( $conversion_outline_file, $module_name ) {
     109                            if ( 'wcmp/wcmp_divi' === $module_name ) {
     110                                return dirname(WCMP_PLUGIN_PATH) . '/pagebuilders/divi5/conversion-outline.json';
     111                            }
     112                            return $conversion_outline_file;
     113                        }, 10, 2
     114                    );
     115                } else { // DIVI 4
     116                    add_action( 'et_builder_ready', array($instance, 'divi_editor') );
     117                }
     118            }
    54119        } // End after_setup_theme
    55120
     
    73138            wp_enqueue_style( 'wcmp-gutenberg-editor-css', plugin_dir_url( __FILE__ ) . 'gutenberg/gutenberg.css', array(), WCMP_VERSION );
    74139
    75             $url  = WCMP_WEBSITE_URL;
    76             $url .= ( ( strpos( $url, '?' ) === false ) ? '?' : '&' ) . 'wcmp-preview=';
     140            $url = self::get_preview_url();
    77141
    78142            wp_enqueue_script( 'wcmp-admin-gutenberg-editor', plugin_dir_url( __FILE__ ) . 'gutenberg/gutenberg.js', array( 'wp-blocks', 'wp-element' ), WCMP_VERSION, true );
  • music-player-for-woocommerce/trunk/pagebuilders/elementor/elementor.pb.php

    r2849699 r3453905  
    7777            }
    7878
    79             $url  = WCMP_WEBSITE_URL;
    80             $url .= ( ( strpos( $url, '?' ) === false ) ? '?' : '&' ) . 'wcmp-preview=' . urlencode( $shortcode );
     79            $url  = \WCMP_BUILDERS::get_preview_url();
     80            $url .= '&wcmp-preview=' . urlencode( $shortcode );
    8181            ?>
    8282            <div class="wcmp-iframe-container" style="position:relative;">
  • music-player-for-woocommerce/trunk/readme.txt

    r3450974 r3453905  
    55Requires at least: 3.5.0
    66Tested up to: 6.9
    7 Stable tag: 1.7.8
     7Stable tag: 1.7.9
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    266266== Changelog ==
    267267
     268= 1.7.9 =
     269
     270* Implements the Divi 5 Playlist module.
     271* Improves the security of the playlist preview generation module.
     272
    268273= 1.7.8 =
    269274
  • music-player-for-woocommerce/trunk/wcmp.php

    r3450974 r3453905  
    33Plugin Name: Music Player for WooCommerce
    44Plugin URI: https://wcmp.dwbooster.com
    5 Version: 1.7.8
     5Version: 1.7.9
    66Text Domain: music-player-for-woocommerce
    77Author: CodePeople
     
    3333
    3434// CONSTANTS
    35 
     35define( 'WCMP_PLUGIN_PATH', __FILE__ );
    3636define( 'WCMP_WEBSITE_URL', get_home_url( get_current_blog_id(), '', is_ssl() ? 'https' : 'http' ) );
    3737define( 'WCMP_PLUGIN_URL', plugins_url( '', __FILE__ ) );
     
    4242define( 'WCMP_DEFAULT_PlAYER_TITLE', 1 );
    4343define( 'WCMP_REMOTE_TIMEOUT', 120 );
    44 define( 'WCMP_VERSION', '1.7.8' );
     44define( 'WCMP_VERSION', '1.7.9' );
    4545
    4646// Load Tools
     
    17561756
    17571757            if ( array_intersect( $allowed_roles, $user->roles ) ) {
    1758                 if ( ! empty( $_REQUEST['wcmp-preview'] ) ) {
     1758                if ( ! empty( $_REQUEST['wcmp-preview'] ) && ! empty( $_REQUEST['wcmp-preview-nonce'] ) ) {
    17591759                    // Sanitizing variable
    17601760                    $preview = sanitize_text_field( wp_unslash( $_REQUEST['wcmp-preview'] ) );
     1761                    $nonce   = sanitize_text_field( wp_unslash( $_REQUEST['wcmp-preview-nonce'] ) );
     1762
     1763                    if ( ! wp_verify_nonce( $nonce, 'wcmp_generate_preview' ) ) exit;
    17611764
    17621765                    // Remove every shortcode that is not in the plugin
Note: See TracChangeset for help on using the changeset viewer.