Changeset 3389775
- Timestamp:
- 11/04/2025 03:35:14 PM (5 months ago)
- Location:
- wpstream
- Files:
-
- 8 edited
- 1 copied
-
tags/4.8.4 (copied) (copied from wpstream/trunk)
-
tags/4.8.4/admin/class-wpstream-admin.php (modified) (1 diff)
-
tags/4.8.4/includes/class-wpstream-quota-manager.php (modified) (4 diffs)
-
tags/4.8.4/readme.txt (modified) (2 diffs)
-
tags/4.8.4/wpstream.php (modified) (2 diffs)
-
trunk/admin/class-wpstream-admin.php (modified) (1 diff)
-
trunk/includes/class-wpstream-quota-manager.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wpstream.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpstream/tags/4.8.4/admin/class-wpstream-admin.php
r3388690 r3389775 2622 2622 if ( $post->post_type !== 'product' ) return; 2623 2623 $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' ); 2628 2629 } 2629 2630 } -
wpstream/tags/4.8.4/includes/class-wpstream-quota-manager.php
r3388690 r3389775 14 14 15 15 /* 16 * Cron hook name17 */18 const CRON_HOOK = 'wpstream_quota_check_cron';19 20 /*21 * Cron interval name22 */23 const CRON_INTERVAL = 'wpstream_every_minute';24 25 /*26 16 * Transient key for quota data 27 17 */ … … 36 26 37 27 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' ) ); 46 30 } 47 31 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; 54 35 } 55 }56 36 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 } 62 41 } 63 42 … … 69 48 70 49 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 ); 72 51 73 52 $this->log_quota_update( 'success', 'User quota updated via cron' ); … … 96 75 } 97 76 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 106 77 /* 107 78 * Force immediate quota update and return fresh data -
wpstream/tags/4.8.4/readme.txt
r3388690 r3389775 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.1 7 Stable tag: 4.8. 37 Stable tag: 4.8.4 8 8 License: GPL 9 9 License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 136 136 == Changelog == 137 137 138 = 4.8.4 = 139 * Fix - Optimizing the quota calls 140 138 141 = 4.8.3 = 139 142 * Fix - Saving individual/global channel settings -
wpstream/tags/4.8.4/wpstream.php
r3388690 r3389775 4 4 * Plugin URI: http://wpstream.net 5 5 * 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. 36 * Version: 4.8.4 7 7 * Author: wpstream 8 8 * Author URI: http://wpstream.net … … 15 15 die; 16 16 } 17 define('WPSTREAM_PLUGIN_VERSION', '4.8. 3');17 define('WPSTREAM_PLUGIN_VERSION', '4.8.4'); 18 18 define('WPSTREAM_CLUBLINK', 'wpstream.net'); 19 19 define('WPSTREAM_CLUBLINKSSL', 'https'); -
wpstream/trunk/admin/class-wpstream-admin.php
r3388690 r3389775 2622 2622 if ( $post->post_type !== 'product' ) return; 2623 2623 $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' ); 2628 2629 } 2629 2630 } -
wpstream/trunk/includes/class-wpstream-quota-manager.php
r3388690 r3389775 14 14 15 15 /* 16 * Cron hook name17 */18 const CRON_HOOK = 'wpstream_quota_check_cron';19 20 /*21 * Cron interval name22 */23 const CRON_INTERVAL = 'wpstream_every_minute';24 25 /*26 16 * Transient key for quota data 27 17 */ … … 36 26 37 27 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' ) ); 46 30 } 47 31 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; 54 35 } 55 }56 36 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 } 62 41 } 63 42 … … 69 48 70 49 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 ); 72 51 73 52 $this->log_quota_update( 'success', 'User quota updated via cron' ); … … 96 75 } 97 76 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 106 77 /* 107 78 * Force immediate quota update and return fresh data -
wpstream/trunk/readme.txt
r3388690 r3389775 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.1 7 Stable tag: 4.8. 37 Stable tag: 4.8.4 8 8 License: GPL 9 9 License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html … … 136 136 == Changelog == 137 137 138 = 4.8.4 = 139 * Fix - Optimizing the quota calls 140 138 141 = 4.8.3 = 139 142 * Fix - Saving individual/global channel settings -
wpstream/trunk/wpstream.php
r3388690 r3389775 4 4 * Plugin URI: http://wpstream.net 5 5 * 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. 36 * Version: 4.8.4 7 7 * Author: wpstream 8 8 * Author URI: http://wpstream.net … … 15 15 die; 16 16 } 17 define('WPSTREAM_PLUGIN_VERSION', '4.8. 3');17 define('WPSTREAM_PLUGIN_VERSION', '4.8.4'); 18 18 define('WPSTREAM_CLUBLINK', 'wpstream.net'); 19 19 define('WPSTREAM_CLUBLINKSSL', 'https');
Note: See TracChangeset
for help on using the changeset viewer.