Plugin Directory

Changeset 3483477


Ignore:
Timestamp:
03/16/2026 07:07:35 AM (12 days ago)
Author:
wpstream
Message:

Update to version 4.11.2 from GitHub

Location:
wpstream
Files:
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wpstream/tags/4.11.2/hello-wpstream/elementor/wpstream-elementor-functions.php

    r3335660 r3483477  
    233233            print wpstream_compose_ajax_holder_data( $attributes ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    234234            $unit_card_type = wpstream_video_item_card_selector( intval($attributes['video_card']) );
    235            
     235            $theme_template_path = locate_template( $unit_card_type );
     236            $plugin_template_path = WPSTREAM_PLUGIN_PATH . 'hello-wpstream/' . $unit_card_type;
     237
    236238            if ( $query->have_posts() ) :
    237239                while ( $query->have_posts() ) :
    238240                    $query->the_post();
    239                     include locate_template( $unit_card_type );
    240                     endwhile;
    241                 endif;
     241                    if ( ! empty( $theme_template_path ) && file_exists( $theme_template_path ) ) {
     242                        include $theme_template_path;
     243                    } elseif ( file_exists( $plugin_template_path ) ) {
     244                        include $plugin_template_path;
     245                    }
     246                endwhile;
     247            endif;
    242248
    243249            print '</div>';
  • wpstream/tags/4.11.2/hello-wpstream/framework/ajax-upload.php

    r3335660 r3483477  
    1111 */
    1212function wpstream_me_upload() {
    13     if ( ! is_user_logged_in() ) {
    14         exit( 'ko' );
     13    check_ajax_referer( 'aaiu_allow', 'nonce' );
     14
     15    if ( ! is_user_logged_in() || ! current_user_can( 'upload_files' ) ) {
     16        wp_send_json_error( array( 'message' => 'You are not allowed to upload files.' ), 403 );
    1517    }
    1618
     
    2527    );
    2628
    27     wpstream_fileupload_process( $file, $button_id);
     29    wpstream_fileupload_process( $file, $button_id );
    2830}
    2931
  • wpstream/tags/4.11.2/hello-wpstream/framework/classes/class-wpstream-login-register.php

    r3335660 r3483477  
    756756
    757757
    758             <input type="checkbox" name="terms" class="wpstream-theme_user_terms_register"/>
     758            <input type="checkbox" name="terms" id="wpstream-theme_user_terms_register" class="wpstream-theme_user_terms_register"/>
    759759            <label id="user_terms_register_label" for="wpstream-theme_user_terms_register">
    760760                <?php esc_html_e( 'I agree with ', 'hello-wpstream' ); ?>
  • wpstream/tags/4.11.2/hello-wpstream/framework/wpstream-help-functions.php

    r3335660 r3483477  
    489489            'dashboard' => wpstream_theme_get_svg_icon('dashboard.svg'),
    490490            'orders' => wpstream_theme_get_svg_icon('orders-icon.svg'),
     491            'downloads' => wpstream_theme_get_svg_icon('downloads.svg'),
    491492            'subscriptions' => wpstream_theme_get_svg_icon('orders-subscription.svg'),
    492493            'edit-address' => wpstream_theme_get_svg_icon('location-icon.svg'),
  • wpstream/tags/4.11.2/hello-wpstream/js/ajax-upload.js

    r3335660 r3483477  
    173173        uploader.bind('Error', function (up, err) {
    174174            console.log ('Error .....');
    175             jQuery('#'+aaiu_upload_imagelist).append("<div>Error: " + err.code +
    176                 ", Message: " + err.message +
    177                 (err.file ? ", File: " + err.file.name : "") +
    178                 "</div>"
    179             );
     175            let errorMessage = "An error occurred during upload.";
     176            if ( typeof err.response === 'string' && err.response.trim() !== '' ) {
     177                try {
     178                    const parsedResponse = JSON.parse(err.response);
     179                    if ( parsedResponse && parsedResponse.data && parsedResponse.data.message ) {
     180                        errorMessage = parsedResponse.data.message;
     181                    }
     182                } catch ( e ) {
     183                    // If response is not a valid JSON, keep the default error message
     184                }
     185            }
     186            jQuery('#'+aaiu_upload_imagelist).append(
     187                `<div>Error: ${err.code}, Message: ${errorMessage} ${err.file ? `, File: ${err.file.name}` : ''}</div>`
     188            );
    180189            up.refresh(); // Reposition Flash/Silverlight
    181190        });
  • wpstream/tags/4.11.2/includes/class-wpstream-ajax.php

    r3389966 r3483477  
    133133        if ( ! is_user_logged_in() ) {
    134134            wp_send_json_error( array( 'error' => 'User is not logged in.' ) );
     135            die();
     136        }
     137
     138        /* Making sure that the channel that's currently selected by the user is the one being updated */
     139        $current_user = wp_get_current_user();
     140        if ( isset( $_POST['postID'] ) && intval( $_POST['postID'] ) !== 0 ) {
     141            $current_editing_channel = get_user_meta( $current_user->ID, 'wpstream_start_streaming_channel', true );
     142            if ( intval( $current_editing_channel ) !== intval( $_POST['postID'] ) ) {
     143                wp_send_json_error( array( 'error' => 'Can\'t edit this channel.' ) );
     144                die();
     145            }
     146        } else {
     147            wp_send_json_error( array( 'error' => 'Invalid channel ID.' ) );
    135148            die();
    136149        }
  • wpstream/tags/4.11.2/integrations/hello-wpstream/theme-import.php

    r3463205 r3483477  
    22
    33if (!defined('ABSPATH')) exit;
     4
     5
     6    function wpstream_track_onboarding_step_php( $action, $step, $element_type = 'system', $element_name = '' ) {
     7        if ( ! defined( 'WPSTREAM_CLICK' ) || empty( WPSTREAM_CLICK ) ) {
     8            return false;
     9        }
     10
     11        $endpoint = trailingslashit( WPSTREAM_CLICK ) . 'onboarding/index.php';
     12        $transaction_id = '';
     13        if ( isset( $_COOKIE['transactionId'] ) ) {
     14            $transaction_id = sanitize_text_field( wp_unslash( $_COOKIE['transactionId'] ) );
     15        }
     16
     17        $payload = array(
     18            'website'        => home_url(),
     19            'action'         => $action,
     20            'wps_user'       => get_option('wpstream_api_username_from_token'),
     21            'parameters'     => array(
     22                'step'         => $step,
     23                'element_type' => $element_type,
     24                'element_name' => $element_name,
     25            ),
     26            'plugin_version' => defined( 'WPSTREAM_PLUGIN_VERSION' ) ? WPSTREAM_PLUGIN_VERSION : '',
     27            'session_id'     => '',
     28            'transaction_id' => $transaction_id,
     29        );
     30
     31        $response = wp_remote_post(
     32            $endpoint,
     33            array(
     34                'timeout' => 5,
     35                'headers' => array(
     36                    'Content-Type' => 'application/json',
     37                ),
     38                'body'    => wp_json_encode( $payload ),
     39            )
     40        );
     41
     42        return ! is_wp_error( $response );
     43    }
     44
     45
     46    function wpstream_track_ocdi_import_attempt( $selected_import ) {
     47        $import_name = 'unknown_import';
     48
     49        if ( is_array( $selected_import ) && ! empty( $selected_import['import_file_name'] ) ) {
     50            $import_name = sanitize_text_field( $selected_import['import_file_name'] );
     51        }
     52
     53        wpstream_track_onboarding_step_php( 'import_attempted', 'ocdi_before_content_import', 'system', $import_name );
     54    }
    455
    556
     
    100151        // so users can see the paid channels/VODs after demo import
    101152        update_option('woocommerce_coming_soon', 'no');
     153
     154        // Track successful demo import for onboarding analytics.
     155        wpstream_track_onboarding_step_php( 'import_succeeded', 'ocdi_after_import_setup', 'system', 'demo_import' );
    102156    }
    103  
    104 
    105 
    106157
    107158?>
  • wpstream/tags/4.11.2/public/class-wpstream-public.php

    r3448460 r3483477  
    341341                    'dashboard'         => __( 'Dashboard', 'wpstream' ),
    342342                    'orders'            => __( 'Orders', 'wpstream' ),
     343                    'downloads'         => __( 'Downloads', 'wpstream' ),
    343344                    'edit-address'      => __( 'Addresses', 'wpstream' ),
    344345                    'edit-account'      => __( 'Edit Account', 'wpstream' ),
     
    353354                    'dashboard'         => __( 'Dashboard2', 'wpstream' ),
    354355                    'orders'            => __( 'Orders', 'wpstream' ),
     356                    'downloads'         => __( 'Downloads', 'wpstream' ),
    355357                    'edit-address'      => __( 'Addresses', 'wpstream' ),
    356358                    'edit-account'      => __( 'Edit Account', 'wpstream' ),
  • wpstream/tags/4.11.2/public/js/broadcaster.js

    r3469940 r3483477  
    7474    console.log('Popup session ID:', popupSessionId);
    7575
     76    function trackOnboardingStepSafe(action, step, elementType = '', elementName = '', trackingSessionId = '') {
     77        if (typeof wpstream_track_onboarding_step === 'function') {
     78            wpstream_track_onboarding_step(action, step, elementType, elementName, trackingSessionId);
     79        }
     80    }
     81
    7682    // Get WHIP URL from config
    7783    if (wpstream_broadcaster_vars && wpstream_broadcaster_vars.whip_url) {
     
    383389                    } else {
    384390                        console.log('connection closed, not reconnecting');
    385                         wpstream_track_onboarding_step('broadcaster_streaming_stopped', 'wpstream_broadcaster', 'button', 'streaming_stopped', popupSessionId);
     391                        trackOnboardingStepSafe('broadcaster_streaming_stopped', 'wpstream_broadcaster', 'button', 'streaming_stopped', popupSessionId);
    386392                        // updateInputState(false);
    387393                    }
     
    395401                        // showMessage("Broadcast started successfully");
    396402                        updateStatus('connected');
    397                         wpstream_track_onboarding_step('broadcaster_streaming_started', 'wpstream_broadcaster', 'button', 'streaming_started', popupSessionId);
     403                        trackOnboardingStepSafe('broadcaster_streaming_started', 'wpstream_broadcaster', 'button', 'streaming_started', popupSessionId);
    398404                    }
    399405
  • wpstream/tags/4.11.2/readme.txt

    r3469940 r3483477  
    55Tested up to: 6.9
    66Requires PHP: 7.1
    7 Stable tag: 4.11.1
     7Stable tag: 4.11.2
    88License: GPL
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    136136== Changelog ==
    137137
     138= 4.11.2 =
     139* Enhancement - Security improvements on frontend dashboard
     140* Fix - Downloads section missing from the My Account dashboard
     141* Fix - Terms and Conditions link on the signup form
     142
    138143= 4.11.1 =
    139144* Tested up to WordPress 6.9.1
  • wpstream/tags/4.11.2/wpstream.php

    r3469940 r3483477  
    44 * Plugin URI:        http://wpstream.net
    55 * Description:       WpStream is a platform that allows you to live stream, create Video-on-Demand, and offer Pay-Per-View videos. We provide an affordable and user-friendly way for businesses, non-profits, and public institutions to broadcast their content and monetize their work.
    6  * Version:           4.11.1
     6 * Version:           4.11.2
    77 * Author:            wpstream
    88 * Author URI:        http://wpstream.net
     
    1515    die;
    1616}
    17 define('WPSTREAM_PLUGIN_VERSION', '4.11.1');
     17define('WPSTREAM_PLUGIN_VERSION', '4.11.2');
    1818define('WPSTREAM_CLUBLINK', 'wpstream.net');
    1919define('WPSTREAM_CLUBLINKSSL', 'https');
     
    229229add_action('pt-ocdi/after_import', 'ocdi_after_import_setup');
    230230add_filter('pt-ocdi/plugin_intro_text', 'ocdi_plugin_intro_text');
     231add_action('ocdi/before_content_import', 'wpstream_track_ocdi_import_attempt', 10, 1);
    231232
    232233
  • wpstream/trunk/hello-wpstream/elementor/wpstream-elementor-functions.php

    r3335660 r3483477  
    233233            print wpstream_compose_ajax_holder_data( $attributes ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    234234            $unit_card_type = wpstream_video_item_card_selector( intval($attributes['video_card']) );
    235            
     235            $theme_template_path = locate_template( $unit_card_type );
     236            $plugin_template_path = WPSTREAM_PLUGIN_PATH . 'hello-wpstream/' . $unit_card_type;
     237
    236238            if ( $query->have_posts() ) :
    237239                while ( $query->have_posts() ) :
    238240                    $query->the_post();
    239                     include locate_template( $unit_card_type );
    240                     endwhile;
    241                 endif;
     241                    if ( ! empty( $theme_template_path ) && file_exists( $theme_template_path ) ) {
     242                        include $theme_template_path;
     243                    } elseif ( file_exists( $plugin_template_path ) ) {
     244                        include $plugin_template_path;
     245                    }
     246                endwhile;
     247            endif;
    242248
    243249            print '</div>';
  • wpstream/trunk/hello-wpstream/framework/ajax-upload.php

    r3335660 r3483477  
    1111 */
    1212function wpstream_me_upload() {
    13     if ( ! is_user_logged_in() ) {
    14         exit( 'ko' );
     13    check_ajax_referer( 'aaiu_allow', 'nonce' );
     14
     15    if ( ! is_user_logged_in() || ! current_user_can( 'upload_files' ) ) {
     16        wp_send_json_error( array( 'message' => 'You are not allowed to upload files.' ), 403 );
    1517    }
    1618
     
    2527    );
    2628
    27     wpstream_fileupload_process( $file, $button_id);
     29    wpstream_fileupload_process( $file, $button_id );
    2830}
    2931
  • wpstream/trunk/hello-wpstream/framework/classes/class-wpstream-login-register.php

    r3335660 r3483477  
    756756
    757757
    758             <input type="checkbox" name="terms" class="wpstream-theme_user_terms_register"/>
     758            <input type="checkbox" name="terms" id="wpstream-theme_user_terms_register" class="wpstream-theme_user_terms_register"/>
    759759            <label id="user_terms_register_label" for="wpstream-theme_user_terms_register">
    760760                <?php esc_html_e( 'I agree with ', 'hello-wpstream' ); ?>
  • wpstream/trunk/hello-wpstream/framework/wpstream-help-functions.php

    r3335660 r3483477  
    489489            'dashboard' => wpstream_theme_get_svg_icon('dashboard.svg'),
    490490            'orders' => wpstream_theme_get_svg_icon('orders-icon.svg'),
     491            'downloads' => wpstream_theme_get_svg_icon('downloads.svg'),
    491492            'subscriptions' => wpstream_theme_get_svg_icon('orders-subscription.svg'),
    492493            'edit-address' => wpstream_theme_get_svg_icon('location-icon.svg'),
  • wpstream/trunk/hello-wpstream/js/ajax-upload.js

    r3335660 r3483477  
    173173        uploader.bind('Error', function (up, err) {
    174174            console.log ('Error .....');
    175             jQuery('#'+aaiu_upload_imagelist).append("<div>Error: " + err.code +
    176                 ", Message: " + err.message +
    177                 (err.file ? ", File: " + err.file.name : "") +
    178                 "</div>"
    179             );
     175            let errorMessage = "An error occurred during upload.";
     176            if ( typeof err.response === 'string' && err.response.trim() !== '' ) {
     177                try {
     178                    const parsedResponse = JSON.parse(err.response);
     179                    if ( parsedResponse && parsedResponse.data && parsedResponse.data.message ) {
     180                        errorMessage = parsedResponse.data.message;
     181                    }
     182                } catch ( e ) {
     183                    // If response is not a valid JSON, keep the default error message
     184                }
     185            }
     186            jQuery('#'+aaiu_upload_imagelist).append(
     187                `<div>Error: ${err.code}, Message: ${errorMessage} ${err.file ? `, File: ${err.file.name}` : ''}</div>`
     188            );
    180189            up.refresh(); // Reposition Flash/Silverlight
    181190        });
  • wpstream/trunk/includes/class-wpstream-ajax.php

    r3389966 r3483477  
    133133        if ( ! is_user_logged_in() ) {
    134134            wp_send_json_error( array( 'error' => 'User is not logged in.' ) );
     135            die();
     136        }
     137
     138        /* Making sure that the channel that's currently selected by the user is the one being updated */
     139        $current_user = wp_get_current_user();
     140        if ( isset( $_POST['postID'] ) && intval( $_POST['postID'] ) !== 0 ) {
     141            $current_editing_channel = get_user_meta( $current_user->ID, 'wpstream_start_streaming_channel', true );
     142            if ( intval( $current_editing_channel ) !== intval( $_POST['postID'] ) ) {
     143                wp_send_json_error( array( 'error' => 'Can\'t edit this channel.' ) );
     144                die();
     145            }
     146        } else {
     147            wp_send_json_error( array( 'error' => 'Invalid channel ID.' ) );
    135148            die();
    136149        }
  • wpstream/trunk/integrations/hello-wpstream/theme-import.php

    r3463205 r3483477  
    22
    33if (!defined('ABSPATH')) exit;
     4
     5
     6    function wpstream_track_onboarding_step_php( $action, $step, $element_type = 'system', $element_name = '' ) {
     7        if ( ! defined( 'WPSTREAM_CLICK' ) || empty( WPSTREAM_CLICK ) ) {
     8            return false;
     9        }
     10
     11        $endpoint = trailingslashit( WPSTREAM_CLICK ) . 'onboarding/index.php';
     12        $transaction_id = '';
     13        if ( isset( $_COOKIE['transactionId'] ) ) {
     14            $transaction_id = sanitize_text_field( wp_unslash( $_COOKIE['transactionId'] ) );
     15        }
     16
     17        $payload = array(
     18            'website'        => home_url(),
     19            'action'         => $action,
     20            'wps_user'       => get_option('wpstream_api_username_from_token'),
     21            'parameters'     => array(
     22                'step'         => $step,
     23                'element_type' => $element_type,
     24                'element_name' => $element_name,
     25            ),
     26            'plugin_version' => defined( 'WPSTREAM_PLUGIN_VERSION' ) ? WPSTREAM_PLUGIN_VERSION : '',
     27            'session_id'     => '',
     28            'transaction_id' => $transaction_id,
     29        );
     30
     31        $response = wp_remote_post(
     32            $endpoint,
     33            array(
     34                'timeout' => 5,
     35                'headers' => array(
     36                    'Content-Type' => 'application/json',
     37                ),
     38                'body'    => wp_json_encode( $payload ),
     39            )
     40        );
     41
     42        return ! is_wp_error( $response );
     43    }
     44
     45
     46    function wpstream_track_ocdi_import_attempt( $selected_import ) {
     47        $import_name = 'unknown_import';
     48
     49        if ( is_array( $selected_import ) && ! empty( $selected_import['import_file_name'] ) ) {
     50            $import_name = sanitize_text_field( $selected_import['import_file_name'] );
     51        }
     52
     53        wpstream_track_onboarding_step_php( 'import_attempted', 'ocdi_before_content_import', 'system', $import_name );
     54    }
    455
    556
     
    100151        // so users can see the paid channels/VODs after demo import
    101152        update_option('woocommerce_coming_soon', 'no');
     153
     154        // Track successful demo import for onboarding analytics.
     155        wpstream_track_onboarding_step_php( 'import_succeeded', 'ocdi_after_import_setup', 'system', 'demo_import' );
    102156    }
    103  
    104 
    105 
    106157
    107158?>
  • wpstream/trunk/public/class-wpstream-public.php

    r3448460 r3483477  
    341341                    'dashboard'         => __( 'Dashboard', 'wpstream' ),
    342342                    'orders'            => __( 'Orders', 'wpstream' ),
     343                    'downloads'         => __( 'Downloads', 'wpstream' ),
    343344                    'edit-address'      => __( 'Addresses', 'wpstream' ),
    344345                    'edit-account'      => __( 'Edit Account', 'wpstream' ),
     
    353354                    'dashboard'         => __( 'Dashboard2', 'wpstream' ),
    354355                    'orders'            => __( 'Orders', 'wpstream' ),
     356                    'downloads'         => __( 'Downloads', 'wpstream' ),
    355357                    'edit-address'      => __( 'Addresses', 'wpstream' ),
    356358                    'edit-account'      => __( 'Edit Account', 'wpstream' ),
  • wpstream/trunk/public/js/broadcaster.js

    r3469940 r3483477  
    7474    console.log('Popup session ID:', popupSessionId);
    7575
     76    function trackOnboardingStepSafe(action, step, elementType = '', elementName = '', trackingSessionId = '') {
     77        if (typeof wpstream_track_onboarding_step === 'function') {
     78            wpstream_track_onboarding_step(action, step, elementType, elementName, trackingSessionId);
     79        }
     80    }
     81
    7682    // Get WHIP URL from config
    7783    if (wpstream_broadcaster_vars && wpstream_broadcaster_vars.whip_url) {
     
    383389                    } else {
    384390                        console.log('connection closed, not reconnecting');
    385                         wpstream_track_onboarding_step('broadcaster_streaming_stopped', 'wpstream_broadcaster', 'button', 'streaming_stopped', popupSessionId);
     391                        trackOnboardingStepSafe('broadcaster_streaming_stopped', 'wpstream_broadcaster', 'button', 'streaming_stopped', popupSessionId);
    386392                        // updateInputState(false);
    387393                    }
     
    395401                        // showMessage("Broadcast started successfully");
    396402                        updateStatus('connected');
    397                         wpstream_track_onboarding_step('broadcaster_streaming_started', 'wpstream_broadcaster', 'button', 'streaming_started', popupSessionId);
     403                        trackOnboardingStepSafe('broadcaster_streaming_started', 'wpstream_broadcaster', 'button', 'streaming_started', popupSessionId);
    398404                    }
    399405
  • wpstream/trunk/readme.txt

    r3469940 r3483477  
    55Tested up to: 6.9
    66Requires PHP: 7.1
    7 Stable tag: 4.11.1
     7Stable tag: 4.11.2
    88License: GPL
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    136136== Changelog ==
    137137
     138= 4.11.2 =
     139* Enhancement - Security improvements on frontend dashboard
     140* Fix - Downloads section missing from the My Account dashboard
     141* Fix - Terms and Conditions link on the signup form
     142
    138143= 4.11.1 =
    139144* Tested up to WordPress 6.9.1
  • wpstream/trunk/wpstream.php

    r3469940 r3483477  
    44 * Plugin URI:        http://wpstream.net
    55 * Description:       WpStream is a platform that allows you to live stream, create Video-on-Demand, and offer Pay-Per-View videos. We provide an affordable and user-friendly way for businesses, non-profits, and public institutions to broadcast their content and monetize their work.
    6  * Version:           4.11.1
     6 * Version:           4.11.2
    77 * Author:            wpstream
    88 * Author URI:        http://wpstream.net
     
    1515    die;
    1616}
    17 define('WPSTREAM_PLUGIN_VERSION', '4.11.1');
     17define('WPSTREAM_PLUGIN_VERSION', '4.11.2');
    1818define('WPSTREAM_CLUBLINK', 'wpstream.net');
    1919define('WPSTREAM_CLUBLINKSSL', 'https');
     
    229229add_action('pt-ocdi/after_import', 'ocdi_after_import_setup');
    230230add_filter('pt-ocdi/plugin_intro_text', 'ocdi_plugin_intro_text');
     231add_action('ocdi/before_content_import', 'wpstream_track_ocdi_import_attempt', 10, 1);
    231232
    232233
Note: See TracChangeset for help on using the changeset viewer.