Plugin Directory

Changeset 3296345


Ignore:
Timestamp:
05/19/2025 10:00:12 AM (10 months ago)
Author:
wpstream
Message:

Update to version 4.6.7.3 from GitHub

Location:
wpstream
Files:
2 added
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wpstream/tags/4.6.7.3/admin/class-wpstream-admin.php

    r3288783 r3296345  
    263263                    ));
    264264
     265                wp_enqueue_script('wpstream-settings',   plugin_dir_url( __DIR__  ) .'/admin/js/wpstream_settings.js?v='.time(),array(),  WPSTREAM_PLUGIN_VERSION, true);
     266                wp_localize_script('wpstream-settings', 'wpstream_settings_vars', array(
     267                        'error_message' => esc_html__( 'Failed to save settings. Please try again.', 'wpstream'),
     268                ));
     269
    265270
    266271                    wp_enqueue_script('wpstream-on-boarding-js',   plugin_dir_url( __DIR__  ) .'/admin/js/wpstream-onboarding2.js?v='.time(),array(),  WPSTREAM_PLUGIN_VERSION, true);
     
    12621267                     update_option( sanitize_key('wpstream_stream_role'), '' );
    12631268                }
    1264                
    1265                 foreach($_POST as $variable=>$value){   
     1269
     1270                foreach($_POST as $variable=>$value){
    12661271                    if ($variable!='submit'){
    12671272                        if (!in_array($variable, $exclude_array) ){
     
    12961301               
    12971302                // reset permalinkgs
    1298                 global $wp_rewrite; 
    1299            
    1300                 update_option( "rewrite_rules", FALSE ); 
     1303                global $wp_rewrite;
     1304
     1305                update_option( "rewrite_rules", FALSE );
    13011306                $wp_rewrite->flush_rules( true );
    13021307               
     
    15121517                                       continue;
    15131518                                   }
    1514                                    
     1519
     1520                                   if ( $option['type']=='user_streaming_global_channel_options' ) {
     1521                                       print '<div class="default-channel-settings-info">';
     1522                                       print esc_html__( 'These settings will apply to newly created channels; existing channels will not change settings if you change them here', 'wpstream');
     1523                                       print '</div>';
     1524
     1525                                   }
    15151526                                   print '<div class="wpstream_option">';
    15161527                                            $options_value =   get_option('wpstream_'.$option['name']) ;
     
    15391550                                               
    15401551                                                print '<label for="'.$option['name'].'">'.$option['label'].'</label>';
    1541                                                 print '<input id="'.$option['name'].'" type="'.$option['type'].'" size="36"  name="'.$option['name'].'" value="'.esc_attr($options_value).'" />';
     1552                                                print '<input class="wpstream-text-input-setting" id="'.$option['name'].'" type="'.$option['type'].'" size="36"  name="'.$option['name'].'" value="'.esc_attr($options_value).'" />';
    15421553                                                print '<div class="settings_details">'.$option['details'].'</div>';
    15431554                                               
     
    15621573                                                      <input type="hidden" class="wpstream_event_option_itemc" value="0" name="'.$option['name'].'" >
    15631574                                                      <input type="checkbox" class="wpstream_event_option_itemc" value="1" name="'.$option['name'].'" ';
    1564                                                      
    1565                                                             if( intval($options_value) !==0 ){
    1566                                                                 print ' checked ';
    1567                                                             }
    1568                                                      
    1569 
    1570 
    1571                                                     print '> <span class="wpstream_slider round"></span>';
    1572                                                     print '</label>';
    1573                                                     print '<div class="settings_details">'.$option['details'].'</div>';
     1575                                                if( intval($options_value) !==0 ){
     1576                                                    print ' checked ';
     1577                                                }
     1578                                                print '> <span class="wpstream_slider round"></span>';
     1579                                                print '</label>';
     1580                                                print '<div class="settings_details">'.$option['details'].'</div>';
    15741581                                            }
    15751582                                   print '</div>';
     
    15781585
    15791586
     1587                        print '<div class="wpstream-save-settings">';
    15801588                       print '<input type="submit" name="submit"  class="wpstream_button wpstream_button_action" value="'.__('Save Changes','wpstream').'" />';
    1581 
    1582                     print  '<input name="wpstream-settings-nonce" type="hidden" value="'.wp_create_nonce('wpstream-settings-nonce').'" /> ';     
     1589                       print '<div class="spinner"></div>';
     1590                       print '</div>';
     1591
     1592                    print  '<input id="wpstream-settings-nonce" name="wpstream-settings-nonce" type="hidden" value="'.wp_create_nonce('wpstream-settings-nonce').'" /> ';
    15831593            print   '</form>';
    15841594        print '</div>';
     
    16781688                $allowed_html   =   array();
    16791689
    1680                 foreach($_POST as $variable=>$value){   
     1690                foreach($_POST as $variable=>$value){
    16811691                    if ($variable!='submit'){
    16821692                        if (!in_array($variable, $exclude_array) ){
    1683                             update_option( sanitize_key('wpstream_'.$variable), wp_kses ($value,$allowed_html) );
    1684                         }   
     1693                            switch ( $variable ) {
     1694                                case 'api_username':
     1695                                    update_option( sanitize_key('wpstream_api_username'), sanitize_text_field($value) );
     1696                                    break;
     1697                                case 'api_password':
     1698                                    update_option( sanitize_key('wpstream_api_password'), $value );
     1699                                    break;
     1700                            }
     1701                        }
    16851702                    }   
    16861703                }
     
    19441961
    19451962                // show pending items
    1946                 if ( is_array( $video_list_raw['pending'] ) ) {
     1963                if ( key_exists( 'pending', $video_list_raw ) && is_array( $video_list_raw['pending'] ) ) {
    19471964                    foreach ( $video_list_raw['pending'] as $key => $video ) {
    19481965                        $video_size = intval($video['size']/1048576);
     
    19942011
    19952012                // no items to show
    1996                 if ( !is_array( $video_list_raw['items'] ) || !is_array( $video_list_raw['pending'] ) ) {
     2013                if ( !is_array( $video_list_raw['items'] ) || ( key_exists( 'pending', $video_list_raw ) && !is_array( $video_list_raw['pending'] ) ) ) {
    19972014                    $to_return.= '<div class="wpstream_video_wrapper">'.esc_html__('You don\'t have any videos.','wpstream').'</div>';
    19982015               }
     
    34183435            if(current_user_can('administrator')){
    34193436                $username       = sanitize_text_field($_POST['api_username']);
    3420                 $password       = sanitize_text_field($_POST['api_password']);
     3437                $password       = $_POST['api_password'];
    34213438                update_option('wpstream_api_username',$username);
    34223439                update_option('wpstream_api_password',$password);
  • wpstream/tags/4.6.7.3/admin/css/wpstream-admin.css

    r3278949 r3296345  
    470470.wpstream_button_action{
    471471    padding: 12px 25px;
     472}
     473
     474.default-channel-settings-info {
     475    width: 40%;
     476    padding-bottom: 20px;
     477    font-size: 14px;
     478    line-height: 1.4rem;;
     479}
     480
     481.wpstream-save-settings {
     482    display: flex;
     483    align-items: center;
     484}
     485
     486.wpstream-save-settings-error {
     487    color: #f00;
    472488}
    473489
  • wpstream/tags/4.6.7.3/includes/class-wpstream-live-api-connection.php

    r3283102 r3296345  
    1010        add_action( 'wp_ajax_wpstream_turn_of_channel',  array($this,'wpstream_turn_of_channel') ); 
    1111        add_action( 'wp_ajax_wpstream_update_local_event_settings',array($this,'wpstream_update_local_event_settings'));
    12        
     12        add_action( 'wp_ajax_wpstream_update_default_channel_settings', array( $this, 'wpstream_update_default_channel_settings' ) );
     13        add_action( 'wp_ajax_wpstream_update_settings', array( $this, 'wpstream_update_settings' ) );
     14
    1315        add_action( 'wp_ajax_wpstream_check_dns_sync', array($this,'wpstream_check_dns_sync') );
    1416        add_action( 'wp_ajax_wpstream_check_event_status', array($this,'wpstream_check_event_status') );
     
    414416     
    415417    }
    416    
    417  
     418
     419    public function wpstream_update_default_channel_settings() {
     420        check_ajax_referer( 'wpstream-settings-nonce', 'security' );
     421
     422        $options_array= $_POST['option'];
     423        $sanitized_options = array();
     424        foreach( $options_array as $key => $value ) {
     425            $sanitized_options[ sanitize_key( $key ) ] = sanitize_text_field( $value );
     426        }
     427
     428        if ( $sanitized_options['low_latency'] == 1 || $sanitized_options['adaptive_bitrate'] == 1 ) {
     429            $sanitized_options['encrypt'] = 0;
     430        }
     431
     432        if ( $sanitized_options['encrypt'] == 1 ) {
     433            $sanitized_options['low_latency'] = 0;
     434            $sanitized_options['adaptive_bitrate'] = 0;
     435        }
     436
     437        $successful_update = update_option( 'wpstream_user_streaming_global_channel_options', $sanitized_options );
     438
     439        if ( $successful_update ) {
     440            wp_send_json(
     441                array(
     442                    'success' => true,
     443                )
     444            );
     445        } else {
     446            wp_send_json_error(
     447                array(
     448                    'success' => false,
     449                )
     450            );
     451        }
     452
     453        wp_die();
     454    }
     455
     456    public function wpstream_update_settings() {
     457        check_ajax_referer( 'wpstream-settings-nonce', 'security' );
     458
     459        $option_name    = sanitize_key( $_POST['option_name'] );
     460        $option_type    = sanitize_key( $_POST['option_type'] );
     461
     462        switch( $option_type ) {
     463            case 'checkbox':
     464                $option_value = filter_var( $_POST['option_value'], FILTER_VALIDATE_INT );
     465                break;
     466            case 'text':
     467            case 'select':
     468                $option_value = sanitize_text_field( $_POST['option_value'] );
     469                break;
     470            case 'multiple-select':
     471                $option_value = array_map( 'sanitize_text_field', $_POST['option_value'] );
     472                break;
     473            default:
     474                $option_value = sanitize_text_field( $_POST['option_value'] );
     475        }
     476
     477        $successful_update = update_option( 'wpstream_' . $option_name, $option_value );
     478
     479        if( $successful_update ) {
     480            wp_send_json(
     481                array(
     482                    'success' => true,
     483                )
     484            );
     485        } else {
     486            wp_send_json_error(
     487                array(
     488                    'success' => false,
     489                )
     490            );
     491        }
     492
     493        wp_die();
     494    }
    418495
    419496 /**
     
    864941     */
    865942    protected function wpstream_club_get_token(){
    866         $username       = esc_html ( get_option('wpstream_api_username','') );
    867         $password       = esc_html ( get_option('wpstream_api_password','') );
     943        $username       = get_option('wpstream_api_username','');
     944        $password       = get_option('wpstream_api_password','');
    868945
    869946        if ( $username=='' || $password==''){
     
    875952            'grant_type'    =>  'password',
    876953            'username'      =>  $username,
    877             'password'      =>  $password         
     954            'password'      =>  $password
    878955        );
    879956       
  • wpstream/tags/4.6.7.3/includes/class-wpstream.php

    r3288783 r3296345  
    264264                // add and save category extra fields
    265265                $this->loader->add_action( 'category_edit_form_fields',  $plugin_post_types,   'wpstream_category_callback_function', 10, 2);
    266                 $this->loader->add_action( 'category_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function', 10, 2 ); 
     266                $this->loader->add_action( 'category_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function' );
    267267                $this->loader->add_action( 'created_category',           $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    268268                $this->loader->add_action( 'edited_category',            $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    269269
    270270                $this->loader->add_action( 'product_cat_edit_form_fields',  $plugin_post_types,  'wpstream_category_callback_function', 10, 2);
    271                 $this->loader->add_action( 'product_cat_add_form_fields',   $plugin_post_types,  'wpstream_category_callback_add_function', 10, 2 ); 
     271                $this->loader->add_action( 'product_cat_add_form_fields',   $plugin_post_types,  'wpstream_category_callback_add_function' );
    272272                $this->loader->add_action( 'created_product_cat',           $plugin_post_types,  'wpstream_category_save_extra_fields_callback', 10, 2);
    273273                $this->loader->add_action( 'edited_product_cat',            $plugin_post_types,  'wpstream_category_save_extra_fields_callback', 10, 2);
     
    275275
    276276                $this->loader->add_action( 'wpstream_category_edit_form_fields', $plugin_post_types,   'wpstream_category_callback_function', 10, 2);
    277                 $this->loader->add_action( 'wpstream_category_add_form_fields',  $plugin_post_types,   'wpstream_category_callback_add_function', 10, 2 ); 
     277                $this->loader->add_action( 'wpstream_category_add_form_fields',  $plugin_post_types,   'wpstream_category_callback_add_function' );
    278278                $this->loader->add_action( 'created_wpstream_category',          $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    279279                $this->loader->add_action( 'edited_wpstream_category',           $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
     
    281281
    282282                $this->loader->add_action( 'wpstream_actors_edit_form_fields',  $plugin_post_types,   'wpstream_category_callback_function', 10, 2);
    283                 $this->loader->add_action( 'wpstream_actors_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function', 10, 2 ); 
     283                $this->loader->add_action( 'wpstream_actors_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function' );
    284284                $this->loader->add_action( 'created_wpstream_actors',           $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    285285                $this->loader->add_action( 'edited_wpstream_actors',            $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    286286
    287287                $this->loader->add_action( 'wpstream_movie_rating_edit_form_fields',  $plugin_post_types,   'wpstream_category_callback_function', 10, 2);
    288                 $this->loader->add_action( 'wpstream_movie_rating_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function', 10, 2 ); 
     288                $this->loader->add_action( 'wpstream_movie_rating_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function' );
    289289                $this->loader->add_action( 'created_wpstream_movie_rating',           $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    290290                $this->loader->add_action( 'edited_wpstream_movie_rating',            $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
  • wpstream/tags/4.6.7.3/includes/class-wpstream_product.php

    r3149939 r3296345  
    403403
    404404
    405     public   function wpstream_category_callback_function($tag){
     405    public   function wpstream_category_callback_function($tag, $taxonomy){
    406406            if(is_object ($tag)){
    407407                $t_id                       =   $tag->term_id;
     
    447447
    448448
    449                     <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$tag->taxonomy.'" />
     449                    <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$taxonomy.'" />
    450450
    451451
     
    499499            <input id="category_tagline" type="text" size="36" name="term_meta[category_tagline]" value="'.$category_tagline.'" />
    500500        </div>
    501         <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$tag->taxonomy.'" />
     501        <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$tag.'" />
    502502        ';
    503503    }
  • wpstream/tags/4.6.7.3/public/js/start_streaming.js

    r3278949 r3296345  
    747747        wpstream_adjust_settings(jQuery(this));
    748748
    749        
    750749        var holder  =   jQuery(this).parents('.wpstream_event_streaming_local');
    751750        var show_id =   jQuery(this).parents('.event_list_unit').find('.start_event').attr('data-show-id');
     
    782781}
    783782
    784 
    785783/*
    786784*
  • wpstream/tags/4.6.7.3/readme.txt

    r3288783 r3296345  
    55Tested up to: 6.8
    66Requires PHP: 7.1
    7 Stable tag: 4.6.7.2
     7Stable tag: 4.6.7.3
    88License: GPL
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    138138== Changelog ==
    139139
     140= 4.6.7.3 =
     141* Fix - Broken WpStream login functionality
     142* Enhancement - Automatically save changes on the plugin settings
     143
    140144= 4.6.7.2 =
    141145* Fix - Styling of the play button over the player
  • wpstream/tags/4.6.7.3/wpstream.php

    r3288783 r3296345  
    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.6.7.2
     6 * Version:           4.6.7.3
    77 * Author:            wpstream
    88 * Author URI:        http://wpstream.net
     
    1515    die;
    1616}
    17 define('WPSTREAM_PLUGIN_VERSION', '4.6.7.2');
     17define('WPSTREAM_PLUGIN_VERSION', '4.6.7.3');
    1818define('WPSTREAM_CLUBLINK', 'wpstream.net');
    1919define('WPSTREAM_CLUBLINKSSL', 'https');
  • wpstream/trunk/admin/class-wpstream-admin.php

    r3288783 r3296345  
    263263                    ));
    264264
     265                wp_enqueue_script('wpstream-settings',   plugin_dir_url( __DIR__  ) .'/admin/js/wpstream_settings.js?v='.time(),array(),  WPSTREAM_PLUGIN_VERSION, true);
     266                wp_localize_script('wpstream-settings', 'wpstream_settings_vars', array(
     267                        'error_message' => esc_html__( 'Failed to save settings. Please try again.', 'wpstream'),
     268                ));
     269
    265270
    266271                    wp_enqueue_script('wpstream-on-boarding-js',   plugin_dir_url( __DIR__  ) .'/admin/js/wpstream-onboarding2.js?v='.time(),array(),  WPSTREAM_PLUGIN_VERSION, true);
     
    12621267                     update_option( sanitize_key('wpstream_stream_role'), '' );
    12631268                }
    1264                
    1265                 foreach($_POST as $variable=>$value){   
     1269
     1270                foreach($_POST as $variable=>$value){
    12661271                    if ($variable!='submit'){
    12671272                        if (!in_array($variable, $exclude_array) ){
     
    12961301               
    12971302                // reset permalinkgs
    1298                 global $wp_rewrite; 
    1299            
    1300                 update_option( "rewrite_rules", FALSE ); 
     1303                global $wp_rewrite;
     1304
     1305                update_option( "rewrite_rules", FALSE );
    13011306                $wp_rewrite->flush_rules( true );
    13021307               
     
    15121517                                       continue;
    15131518                                   }
    1514                                    
     1519
     1520                                   if ( $option['type']=='user_streaming_global_channel_options' ) {
     1521                                       print '<div class="default-channel-settings-info">';
     1522                                       print esc_html__( 'These settings will apply to newly created channels; existing channels will not change settings if you change them here', 'wpstream');
     1523                                       print '</div>';
     1524
     1525                                   }
    15151526                                   print '<div class="wpstream_option">';
    15161527                                            $options_value =   get_option('wpstream_'.$option['name']) ;
     
    15391550                                               
    15401551                                                print '<label for="'.$option['name'].'">'.$option['label'].'</label>';
    1541                                                 print '<input id="'.$option['name'].'" type="'.$option['type'].'" size="36"  name="'.$option['name'].'" value="'.esc_attr($options_value).'" />';
     1552                                                print '<input class="wpstream-text-input-setting" id="'.$option['name'].'" type="'.$option['type'].'" size="36"  name="'.$option['name'].'" value="'.esc_attr($options_value).'" />';
    15421553                                                print '<div class="settings_details">'.$option['details'].'</div>';
    15431554                                               
     
    15621573                                                      <input type="hidden" class="wpstream_event_option_itemc" value="0" name="'.$option['name'].'" >
    15631574                                                      <input type="checkbox" class="wpstream_event_option_itemc" value="1" name="'.$option['name'].'" ';
    1564                                                      
    1565                                                             if( intval($options_value) !==0 ){
    1566                                                                 print ' checked ';
    1567                                                             }
    1568                                                      
    1569 
    1570 
    1571                                                     print '> <span class="wpstream_slider round"></span>';
    1572                                                     print '</label>';
    1573                                                     print '<div class="settings_details">'.$option['details'].'</div>';
     1575                                                if( intval($options_value) !==0 ){
     1576                                                    print ' checked ';
     1577                                                }
     1578                                                print '> <span class="wpstream_slider round"></span>';
     1579                                                print '</label>';
     1580                                                print '<div class="settings_details">'.$option['details'].'</div>';
    15741581                                            }
    15751582                                   print '</div>';
     
    15781585
    15791586
     1587                        print '<div class="wpstream-save-settings">';
    15801588                       print '<input type="submit" name="submit"  class="wpstream_button wpstream_button_action" value="'.__('Save Changes','wpstream').'" />';
    1581 
    1582                     print  '<input name="wpstream-settings-nonce" type="hidden" value="'.wp_create_nonce('wpstream-settings-nonce').'" /> ';     
     1589                       print '<div class="spinner"></div>';
     1590                       print '</div>';
     1591
     1592                    print  '<input id="wpstream-settings-nonce" name="wpstream-settings-nonce" type="hidden" value="'.wp_create_nonce('wpstream-settings-nonce').'" /> ';
    15831593            print   '</form>';
    15841594        print '</div>';
     
    16781688                $allowed_html   =   array();
    16791689
    1680                 foreach($_POST as $variable=>$value){   
     1690                foreach($_POST as $variable=>$value){
    16811691                    if ($variable!='submit'){
    16821692                        if (!in_array($variable, $exclude_array) ){
    1683                             update_option( sanitize_key('wpstream_'.$variable), wp_kses ($value,$allowed_html) );
    1684                         }   
     1693                            switch ( $variable ) {
     1694                                case 'api_username':
     1695                                    update_option( sanitize_key('wpstream_api_username'), sanitize_text_field($value) );
     1696                                    break;
     1697                                case 'api_password':
     1698                                    update_option( sanitize_key('wpstream_api_password'), $value );
     1699                                    break;
     1700                            }
     1701                        }
    16851702                    }   
    16861703                }
     
    19441961
    19451962                // show pending items
    1946                 if ( is_array( $video_list_raw['pending'] ) ) {
     1963                if ( key_exists( 'pending', $video_list_raw ) && is_array( $video_list_raw['pending'] ) ) {
    19471964                    foreach ( $video_list_raw['pending'] as $key => $video ) {
    19481965                        $video_size = intval($video['size']/1048576);
     
    19942011
    19952012                // no items to show
    1996                 if ( !is_array( $video_list_raw['items'] ) || !is_array( $video_list_raw['pending'] ) ) {
     2013                if ( !is_array( $video_list_raw['items'] ) || ( key_exists( 'pending', $video_list_raw ) && !is_array( $video_list_raw['pending'] ) ) ) {
    19972014                    $to_return.= '<div class="wpstream_video_wrapper">'.esc_html__('You don\'t have any videos.','wpstream').'</div>';
    19982015               }
     
    34183435            if(current_user_can('administrator')){
    34193436                $username       = sanitize_text_field($_POST['api_username']);
    3420                 $password       = sanitize_text_field($_POST['api_password']);
     3437                $password       = $_POST['api_password'];
    34213438                update_option('wpstream_api_username',$username);
    34223439                update_option('wpstream_api_password',$password);
  • wpstream/trunk/admin/css/wpstream-admin.css

    r3278949 r3296345  
    470470.wpstream_button_action{
    471471    padding: 12px 25px;
     472}
     473
     474.default-channel-settings-info {
     475    width: 40%;
     476    padding-bottom: 20px;
     477    font-size: 14px;
     478    line-height: 1.4rem;;
     479}
     480
     481.wpstream-save-settings {
     482    display: flex;
     483    align-items: center;
     484}
     485
     486.wpstream-save-settings-error {
     487    color: #f00;
    472488}
    473489
  • wpstream/trunk/includes/class-wpstream-live-api-connection.php

    r3283102 r3296345  
    1010        add_action( 'wp_ajax_wpstream_turn_of_channel',  array($this,'wpstream_turn_of_channel') ); 
    1111        add_action( 'wp_ajax_wpstream_update_local_event_settings',array($this,'wpstream_update_local_event_settings'));
    12        
     12        add_action( 'wp_ajax_wpstream_update_default_channel_settings', array( $this, 'wpstream_update_default_channel_settings' ) );
     13        add_action( 'wp_ajax_wpstream_update_settings', array( $this, 'wpstream_update_settings' ) );
     14
    1315        add_action( 'wp_ajax_wpstream_check_dns_sync', array($this,'wpstream_check_dns_sync') );
    1416        add_action( 'wp_ajax_wpstream_check_event_status', array($this,'wpstream_check_event_status') );
     
    414416     
    415417    }
    416    
    417  
     418
     419    public function wpstream_update_default_channel_settings() {
     420        check_ajax_referer( 'wpstream-settings-nonce', 'security' );
     421
     422        $options_array= $_POST['option'];
     423        $sanitized_options = array();
     424        foreach( $options_array as $key => $value ) {
     425            $sanitized_options[ sanitize_key( $key ) ] = sanitize_text_field( $value );
     426        }
     427
     428        if ( $sanitized_options['low_latency'] == 1 || $sanitized_options['adaptive_bitrate'] == 1 ) {
     429            $sanitized_options['encrypt'] = 0;
     430        }
     431
     432        if ( $sanitized_options['encrypt'] == 1 ) {
     433            $sanitized_options['low_latency'] = 0;
     434            $sanitized_options['adaptive_bitrate'] = 0;
     435        }
     436
     437        $successful_update = update_option( 'wpstream_user_streaming_global_channel_options', $sanitized_options );
     438
     439        if ( $successful_update ) {
     440            wp_send_json(
     441                array(
     442                    'success' => true,
     443                )
     444            );
     445        } else {
     446            wp_send_json_error(
     447                array(
     448                    'success' => false,
     449                )
     450            );
     451        }
     452
     453        wp_die();
     454    }
     455
     456    public function wpstream_update_settings() {
     457        check_ajax_referer( 'wpstream-settings-nonce', 'security' );
     458
     459        $option_name    = sanitize_key( $_POST['option_name'] );
     460        $option_type    = sanitize_key( $_POST['option_type'] );
     461
     462        switch( $option_type ) {
     463            case 'checkbox':
     464                $option_value = filter_var( $_POST['option_value'], FILTER_VALIDATE_INT );
     465                break;
     466            case 'text':
     467            case 'select':
     468                $option_value = sanitize_text_field( $_POST['option_value'] );
     469                break;
     470            case 'multiple-select':
     471                $option_value = array_map( 'sanitize_text_field', $_POST['option_value'] );
     472                break;
     473            default:
     474                $option_value = sanitize_text_field( $_POST['option_value'] );
     475        }
     476
     477        $successful_update = update_option( 'wpstream_' . $option_name, $option_value );
     478
     479        if( $successful_update ) {
     480            wp_send_json(
     481                array(
     482                    'success' => true,
     483                )
     484            );
     485        } else {
     486            wp_send_json_error(
     487                array(
     488                    'success' => false,
     489                )
     490            );
     491        }
     492
     493        wp_die();
     494    }
    418495
    419496 /**
     
    864941     */
    865942    protected function wpstream_club_get_token(){
    866         $username       = esc_html ( get_option('wpstream_api_username','') );
    867         $password       = esc_html ( get_option('wpstream_api_password','') );
     943        $username       = get_option('wpstream_api_username','');
     944        $password       = get_option('wpstream_api_password','');
    868945
    869946        if ( $username=='' || $password==''){
     
    875952            'grant_type'    =>  'password',
    876953            'username'      =>  $username,
    877             'password'      =>  $password         
     954            'password'      =>  $password
    878955        );
    879956       
  • wpstream/trunk/includes/class-wpstream.php

    r3288783 r3296345  
    264264                // add and save category extra fields
    265265                $this->loader->add_action( 'category_edit_form_fields',  $plugin_post_types,   'wpstream_category_callback_function', 10, 2);
    266                 $this->loader->add_action( 'category_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function', 10, 2 ); 
     266                $this->loader->add_action( 'category_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function' );
    267267                $this->loader->add_action( 'created_category',           $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    268268                $this->loader->add_action( 'edited_category',            $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    269269
    270270                $this->loader->add_action( 'product_cat_edit_form_fields',  $plugin_post_types,  'wpstream_category_callback_function', 10, 2);
    271                 $this->loader->add_action( 'product_cat_add_form_fields',   $plugin_post_types,  'wpstream_category_callback_add_function', 10, 2 ); 
     271                $this->loader->add_action( 'product_cat_add_form_fields',   $plugin_post_types,  'wpstream_category_callback_add_function' );
    272272                $this->loader->add_action( 'created_product_cat',           $plugin_post_types,  'wpstream_category_save_extra_fields_callback', 10, 2);
    273273                $this->loader->add_action( 'edited_product_cat',            $plugin_post_types,  'wpstream_category_save_extra_fields_callback', 10, 2);
     
    275275
    276276                $this->loader->add_action( 'wpstream_category_edit_form_fields', $plugin_post_types,   'wpstream_category_callback_function', 10, 2);
    277                 $this->loader->add_action( 'wpstream_category_add_form_fields',  $plugin_post_types,   'wpstream_category_callback_add_function', 10, 2 ); 
     277                $this->loader->add_action( 'wpstream_category_add_form_fields',  $plugin_post_types,   'wpstream_category_callback_add_function' );
    278278                $this->loader->add_action( 'created_wpstream_category',          $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    279279                $this->loader->add_action( 'edited_wpstream_category',           $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
     
    281281
    282282                $this->loader->add_action( 'wpstream_actors_edit_form_fields',  $plugin_post_types,   'wpstream_category_callback_function', 10, 2);
    283                 $this->loader->add_action( 'wpstream_actors_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function', 10, 2 ); 
     283                $this->loader->add_action( 'wpstream_actors_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function' );
    284284                $this->loader->add_action( 'created_wpstream_actors',           $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    285285                $this->loader->add_action( 'edited_wpstream_actors',            $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    286286
    287287                $this->loader->add_action( 'wpstream_movie_rating_edit_form_fields',  $plugin_post_types,   'wpstream_category_callback_function', 10, 2);
    288                 $this->loader->add_action( 'wpstream_movie_rating_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function', 10, 2 ); 
     288                $this->loader->add_action( 'wpstream_movie_rating_add_form_fields',   $plugin_post_types,   'wpstream_category_callback_add_function' );
    289289                $this->loader->add_action( 'created_wpstream_movie_rating',           $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
    290290                $this->loader->add_action( 'edited_wpstream_movie_rating',            $plugin_post_types,   'wpstream_category_save_extra_fields_callback', 10, 2);
  • wpstream/trunk/includes/class-wpstream_product.php

    r3149939 r3296345  
    403403
    404404
    405     public   function wpstream_category_callback_function($tag){
     405    public   function wpstream_category_callback_function($tag, $taxonomy){
    406406            if(is_object ($tag)){
    407407                $t_id                       =   $tag->term_id;
     
    447447
    448448
    449                     <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$tag->taxonomy.'" />
     449                    <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$taxonomy.'" />
    450450
    451451
     
    499499            <input id="category_tagline" type="text" size="36" name="term_meta[category_tagline]" value="'.$category_tagline.'" />
    500500        </div>
    501         <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$tag->taxonomy.'" />
     501        <input id="category_tax" type="hidden" size="36" name="term_meta[category_tax]" value="'.$tag.'" />
    502502        ';
    503503    }
  • wpstream/trunk/public/js/start_streaming.js

    r3278949 r3296345  
    747747        wpstream_adjust_settings(jQuery(this));
    748748
    749        
    750749        var holder  =   jQuery(this).parents('.wpstream_event_streaming_local');
    751750        var show_id =   jQuery(this).parents('.event_list_unit').find('.start_event').attr('data-show-id');
     
    782781}
    783782
    784 
    785783/*
    786784*
  • wpstream/trunk/readme.txt

    r3288783 r3296345  
    55Tested up to: 6.8
    66Requires PHP: 7.1
    7 Stable tag: 4.6.7.2
     7Stable tag: 4.6.7.3
    88License: GPL
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    138138== Changelog ==
    139139
     140= 4.6.7.3 =
     141* Fix - Broken WpStream login functionality
     142* Enhancement - Automatically save changes on the plugin settings
     143
    140144= 4.6.7.2 =
    141145* Fix - Styling of the play button over the player
  • wpstream/trunk/wpstream.php

    r3288783 r3296345  
    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.6.7.2
     6 * Version:           4.6.7.3
    77 * Author:            wpstream
    88 * Author URI:        http://wpstream.net
     
    1515    die;
    1616}
    17 define('WPSTREAM_PLUGIN_VERSION', '4.6.7.2');
     17define('WPSTREAM_PLUGIN_VERSION', '4.6.7.3');
    1818define('WPSTREAM_CLUBLINK', 'wpstream.net');
    1919define('WPSTREAM_CLUBLINKSSL', 'https');
Note: See TracChangeset for help on using the changeset viewer.