PluginProbe
WpStream – Live Streaming, Video on Demand, Pay Per View / 4.6.7.5
WpStream – Live Streaming, Video on Demand, Pay Per View v4.6.7.5
4.14.0 4.13.2 4.13.1 4.13 4.12.5 4.12.4 4.12.3 4.12.2 4.12.1 4.12 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5 4.5.1 4.5.11 4.5.11.1 4.5.11.2 4.5.11.4 4.5.11.5 4.5.11.6 4.5.12 All 180 releases
wpstream / wpstream.php

wpstream.php in WpStream – Live Streaming, Video on Demand, Pay Per View 4.6.7.5, at wpstream.php

188 lines 6.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: WpStream - Live Streaming, Video on Demand, Pay Per View
4 * Plugin URI: http://wpstream.net
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.6.7.5
7 * Author: wpstream
8 * Author URI: http://wpstream.net
9 * Text Domain: wpstream
10 * Domain Path: /languages
11 */
12
13 // If this file is called directly, abort.
14 if ( ! defined( 'WPINC' ) ) {
15 die;
16 }
17 define('WPSTREAM_PLUGIN_VERSION', '4.6.7.5');
18 define('WPSTREAM_CLUBLINK', 'wpstream.net');
19 define('WPSTREAM_CLUBLINKSSL', 'https');
20 define('WPSTREAM_PLUGIN_URL', plugins_url() );
21 define('WPSTREAM_PLUGIN_DIR_URL', plugin_dir_url(__FILE__) );
22 define('WPSTREAM_PLUGIN_PATH', plugin_dir_path(__FILE__) );
23 define('WPSTREAM_PLUGIN_BASE', plugin_basename(__FILE__) );
24 define('WPSTREAM_API', 'https://baker.wpstream.net');
25
26 function wpstream_cleanup_logs_handler() {
27 $logger = new WpStream_Logger();
28 $logger->clear_old_logs();
29 }
30 add_action('wpstream_log_cleanup', 'wpstream_cleanup_logs_handler');
31
32 /**
33 * The code that runs during plugin activation.
34 * This action is documented in includes/class-wpstream-activator.php
35 */
36 function activate_wpstream() {
37 require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpstream-activator.php';
38 Wpstream_Activator::activate();
39
40 if( !wp_next_scheduled( 'wpstream_log_cleanup' ) ) {
41 wp_schedule_event( time(), 'daily', 'wpstream_log_cleanup' );
42 }
43 }
44
45 /**
46 * The code that runs during plugin deactivation.
47 * This action is documented in includes/class-wpstream-deactivator.php
48 */
49 function deactivate_wpstream() {
50 require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpstream-deactivator.php';
51 Wpstream_Deactivator::deactivate();
52
53 wp_clear_scheduled_hook( 'wpstream_log_cleanup' );
54 }
55
56 register_activation_hook( __FILE__, 'activate_wpstream' );
57 register_deactivation_hook( __FILE__, 'deactivate_wpstream' );
58
59 /**
60 * The core plugin class that is used to define internationalization,
61 * admin-specific hooks, and public-facing site hooks.
62 */
63 require plugin_dir_path( __FILE__ ) . 'includes/class-wpstream.php';
64 require plugin_dir_path( __FILE__ ) . 'wpstream-elementor.php';
65 require plugin_dir_path( __FILE__ ) . 'streamify/streamify.php';
66
67 require plugin_dir_path( __FILE__ ) . 'integrations/integrations.php';
68
69 /**
70 * Begins execution of the plugin.
71 *
72 * Since everything within the plugin is registered via hooks,
73 * then kicking off the plugin from this point in the file does
74 * not affect the page life cycle.
75 *
76 * @since 3.0.1
77 */
78
79 global $wpstream_plugin;
80 $wpstream_plugin = new Wpstream();
81 $wpstream_plugin->run();
82
83 add_action( 'upgrader_process_complete', 'wpstream_my_upgrate_function',10, 2);
84
85 function wpstream_my_upgrate_function( $upgrader_object, $options ) {
86
87
88 $current_plugin_path_name = plugin_basename( __FILE__ );
89
90 if ($options['action'] == 'update' && $options['type'] == 'plugin' ) {
91 if(is_array($options)):
92 foreach($options['plugins'] as $each_plugin) {
93 if ($each_plugin==$current_plugin_path_name) {
94 delete_transient('wpstream_token_api');
95 update_option('wp_estate_token_expire',0);
96 update_option('wp_estate_curent_token',' ');
97
98 }
99 }
100 endif;
101 }
102
103
104 }
105
106
107
108 add_action('wp_head', 'wpstream_add_custom_meta_to_header');
109
110 function wpstream_add_custom_meta_to_header(){
111 global $post;
112
113
114 if ( is_singular('product') || is_singular('wpstream_product') || is_singular('wpstream_product_vod') ){
115 $image_id = get_post_thumbnail_id();
116 $share_img = wp_get_attachment_image_src( $image_id, 'full');
117 $the_post = get_post($post->ID); ?>
118
119 <meta property='og:title' content="<?php print esc_html(get_the_title($post->ID)); ?>"/>
120 <?php if(isset($share_img[0])){ ?>
121 <meta property="og:image" content="<?php print esc_url($share_img[0]); ?>"/>
122 <meta property="og:image:secure_url" content="<?php print esc_url($share_img[0]); ?>" />
123 <?php }?>
124
125 <meta property="og:description" content=" <?php print wp_strip_all_tags( $the_post->post_content);?>" />
126 <?php }
127
128
129 }
130
131
132 /*
133 *
134 * Check integrations
135 *
136 */
137 require_once plugin_dir_path(__FILE__) . 'integrations/hello-wpstream/theme-import.php';
138 add_filter('pt-ocdi/import_files', 'ocdi_import_files');
139 add_action('pt-ocdi/after_import', 'ocdi_after_import_setup');
140 add_filter('pt-ocdi/plugin_intro_text', 'ocdi_plugin_intro_text');
141
142
143 add_action( 'plugins_loaded', 'wpstream_check_integrations' );
144
145
146 /*
147 *
148 * Redirect on plugin activation
149 *
150 */
151
152 function wpstream_activation_redirect( $plugin ) {
153 if( $plugin == plugin_basename( __FILE__ ) ) {
154 exit( wp_redirect( admin_url( 'admin.php?page=wpstream_onboard' ) ) );
155 }
156 }
157 add_action( 'activated_plugin', 'wpstream_activation_redirect' );
158
159
160
161 /*
162 *
163 * remove the style selectWoo for the theme
164 *
165 */
166 if ( function_exists( 'wpstream_get_author_id' ) ) {
167 // only if wpstream-theme is activated
168
169 remove_filter( 'pre_user_description', 'wp_filter_kses' ); // Removes the filter that applies KSES filtering for user descriptions
170 remove_filter( 'term_description', 'wp_kses_data' ); // Removes the filter that applies KSES data filtering for term descriptions
171
172 if ( ! function_exists( 'wsis_dequeue_stylesandscripts_select2' ) ) {
173 add_action( 'wp_enqueue_scripts', 'wsis_dequeue_stylesandscripts_select2', 100 );
174 /**
175 * Remove CSS and/or JS for Select2 used by WooCommerce
176 */
177 function wsis_dequeue_stylesandscripts_select2() {
178 if ( class_exists( 'woocommerce' ) ) {
179 wp_dequeue_style( 'selectWoo' );
180 wp_deregister_style( 'selectWoo' );
181
182 wp_dequeue_script( 'selectWoo' );
183 wp_deregister_script( 'selectWoo' );
184 }
185 }
186 }
187 }
188