PluginProbe
WpStream – Live Streaming, Video on Demand, Pay Per View / 4.6.6.4
WpStream – Live Streaming, Video on Demand, Pay Per View v4.6.6.4
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.6.4, at wpstream.php

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