Plugin Directory

Changeset 3389775


Ignore:
Timestamp:
11/04/2025 03:35:14 PM (5 months ago)
Author:
wpstream
Message:

Update to version 4.8.4 from GitHub

Location:
wpstream
Files:
8 edited
1 copied

Legend:

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

    r3388690 r3389775  
    26222622                if ( $post->post_type !== 'product' ) return;
    26232623                $term_list      =   wp_get_post_terms($post->ID, 'product_type');
    2624                 if( $term_list[0]->name=='video_on_demand' || 
    2625                     $term_list[0]->name=='live_stream' || 
    2626                     $term_list[0]->name=='wpstream_bundle'){
    2627                         update_post_meta( $post->ID, '_virtual', 'yes' );
     2624                if( !empty($term_list) &&
     2625                    isset($term_list[0]->name) &&
     2626                    in_array($term_list[0]->name, ['live_stream', 'video_on_demand', 'wpstream_bundle'])
     2627                ){
     2628                    update_post_meta( $post->ID, '_virtual', 'yes' );
    26282629                }
    26292630            }
  • wpstream/tags/4.8.4/includes/class-wpstream-quota-manager.php

    r3388690 r3389775  
    1414
    1515     /*
    16       * Cron hook name
    17       */
    18      const CRON_HOOK = 'wpstream_quota_check_cron';
    19 
    20      /*
    21       * Cron interval name
    22       */
    23      const CRON_INTERVAL = 'wpstream_every_minute';
    24 
    25      /*
    2616      * Transient key for quota data
    2717      */
     
    3626
    3727     private function init_hooks() {
    38          add_action(self::CRON_HOOK, array( $this, 'update_quota_transient' ) );
    39          add_filter('cron_schedules', array( $this, 'add_cron_intervals' ) );
    40 
    41          // Schedule the first run if not already scheduled
    42          add_action( 'init', array( $this, 'schedule_quota_check_cron' ) );
    43 
    44          /* Cron job cleanup on deactivation */
    45          register_deactivation_hook( WP_PLUGIN_DIR . '/' . WPSTREAM_PLUGIN_BASE, array( $this, 'unschedule_quota_check_cron' ) );
     28         // Add admin-only hook
     29        add_action( 'admin_init', array( $this, 'maybe_update_quota' ) );
    4630     }
    4731
    48      /*
    49       * Schedule quota check cron job
    50       */
    51      public function schedule_quota_check_cron() {
    52          if ( ! wp_next_scheduled( self::CRON_HOOK ) ) {
    53              wp_schedule_event( time(), self::CRON_INTERVAL, self::CRON_HOOK );
     32     public function maybe_update_quota() {
     33         if ( !current_user_can( 'manage_options' ) ) {
     34             return;
    5435         }
    55      }
    5636
    57      /*
    58       * Unschedule quota check cron job
    59       */
    60      public function unschedule_quota_check_cron() {
    61          wp_clear_scheduled_hook( self::CRON_HOOK );
     37         $cached_data = get_transient( self::TRANSIENT_KEY );
     38         if ( $cached_data === false ) {
     39             $this->update_quota_transient();
     40         }
    6241     }
    6342
     
    6948
    7049         if ( $this->is_valid_quota_data( $quota_data ) ) {
    71              set_transient( self::TRANSIENT_KEY, $quota_data, 120 );
     50             set_transient( self::TRANSIENT_KEY, $quota_data, 60 );
    7251
    7352             $this->log_quota_update( 'success', 'User quota updated via cron' );
     
    9675     }
    9776
    98      public function add_cron_intervals( $schedules ) {
    99          $schedules[self::CRON_INTERVAL] = array(
    100              'interval' => 60,
    101              'display'  => __( 'Every Minute', 'wpstream' )
    102          );
    103          return $schedules;
    104      }
    105 
    10677     /*
    10778      * Force immediate quota update and return fresh data
  • wpstream/tags/4.8.4/readme.txt

    r3388690 r3389775  
    55Tested up to: 6.8
    66Requires PHP: 7.1
    7 Stable tag: 4.8.3
     7Stable tag: 4.8.4
    88License: GPL
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    136136== Changelog ==
    137137
     138= 4.8.4 =
     139* Fix - Optimizing the quota calls
     140
    138141= 4.8.3 =
    139142* Fix - Saving individual/global channel settings
  • wpstream/tags/4.8.4/wpstream.php

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

    r3388690 r3389775  
    26222622                if ( $post->post_type !== 'product' ) return;
    26232623                $term_list      =   wp_get_post_terms($post->ID, 'product_type');
    2624                 if( $term_list[0]->name=='video_on_demand' || 
    2625                     $term_list[0]->name=='live_stream' || 
    2626                     $term_list[0]->name=='wpstream_bundle'){
    2627                         update_post_meta( $post->ID, '_virtual', 'yes' );
     2624                if( !empty($term_list) &&
     2625                    isset($term_list[0]->name) &&
     2626                    in_array($term_list[0]->name, ['live_stream', 'video_on_demand', 'wpstream_bundle'])
     2627                ){
     2628                    update_post_meta( $post->ID, '_virtual', 'yes' );
    26282629                }
    26292630            }
  • wpstream/trunk/includes/class-wpstream-quota-manager.php

    r3388690 r3389775  
    1414
    1515     /*
    16       * Cron hook name
    17       */
    18      const CRON_HOOK = 'wpstream_quota_check_cron';
    19 
    20      /*
    21       * Cron interval name
    22       */
    23      const CRON_INTERVAL = 'wpstream_every_minute';
    24 
    25      /*
    2616      * Transient key for quota data
    2717      */
     
    3626
    3727     private function init_hooks() {
    38          add_action(self::CRON_HOOK, array( $this, 'update_quota_transient' ) );
    39          add_filter('cron_schedules', array( $this, 'add_cron_intervals' ) );
    40 
    41          // Schedule the first run if not already scheduled
    42          add_action( 'init', array( $this, 'schedule_quota_check_cron' ) );
    43 
    44          /* Cron job cleanup on deactivation */
    45          register_deactivation_hook( WP_PLUGIN_DIR . '/' . WPSTREAM_PLUGIN_BASE, array( $this, 'unschedule_quota_check_cron' ) );
     28         // Add admin-only hook
     29        add_action( 'admin_init', array( $this, 'maybe_update_quota' ) );
    4630     }
    4731
    48      /*
    49       * Schedule quota check cron job
    50       */
    51      public function schedule_quota_check_cron() {
    52          if ( ! wp_next_scheduled( self::CRON_HOOK ) ) {
    53              wp_schedule_event( time(), self::CRON_INTERVAL, self::CRON_HOOK );
     32     public function maybe_update_quota() {
     33         if ( !current_user_can( 'manage_options' ) ) {
     34             return;
    5435         }
    55      }
    5636
    57      /*
    58       * Unschedule quota check cron job
    59       */
    60      public function unschedule_quota_check_cron() {
    61          wp_clear_scheduled_hook( self::CRON_HOOK );
     37         $cached_data = get_transient( self::TRANSIENT_KEY );
     38         if ( $cached_data === false ) {
     39             $this->update_quota_transient();
     40         }
    6241     }
    6342
     
    6948
    7049         if ( $this->is_valid_quota_data( $quota_data ) ) {
    71              set_transient( self::TRANSIENT_KEY, $quota_data, 120 );
     50             set_transient( self::TRANSIENT_KEY, $quota_data, 60 );
    7251
    7352             $this->log_quota_update( 'success', 'User quota updated via cron' );
     
    9675     }
    9776
    98      public function add_cron_intervals( $schedules ) {
    99          $schedules[self::CRON_INTERVAL] = array(
    100              'interval' => 60,
    101              'display'  => __( 'Every Minute', 'wpstream' )
    102          );
    103          return $schedules;
    104      }
    105 
    10677     /*
    10778      * Force immediate quota update and return fresh data
  • wpstream/trunk/readme.txt

    r3388690 r3389775  
    55Tested up to: 6.8
    66Requires PHP: 7.1
    7 Stable tag: 4.8.3
     7Stable tag: 4.8.4
    88License: GPL
    99License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     
    136136== Changelog ==
    137137
     138= 4.8.4 =
     139* Fix - Optimizing the quota calls
     140
    138141= 4.8.3 =
    139142* Fix - Saving individual/global channel settings
  • wpstream/trunk/wpstream.php

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