PluginProbe ʕ •ᴥ•ʔ
Presto Player / trunk
Presto Player vtrunk
4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.4 4.2.3 4.2.2 4.2.0 4.2.1 trunk 1.10.0 1.10.1 1.10.2 1.11.0 1.12.0 1.13.0 1.14.0 1.14.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.10 1.6.11 1.6.12 1.6.13 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.3-beta1 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.0-beta1 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.1.0 3.1.1 3.1.2 3.1.3 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4
presto-player / inc / Services / Compatibility.php
presto-player / inc / Services Last commit date
API 1 week ago Abilities 1 week ago Blocks 3 weeks ago License 1 month ago OAuth 1 week ago AdminNotice.php 2 months ago AdminNotices.php 2 months ago AjaxActions.php 2 months ago Blocks.php 2 years ago Compatibility.php 11 months ago FeatureAnnounce.php 1 week ago Learn.php 1 week ago Menu.php 1 week ago Migrations.php 2 years ago NpsSurvey.php 6 months ago Onboarding.php 2 months ago Player.php 3 weeks ago PluginInstaller.php 1 week ago PreloadService.php 2 years ago ProCompatibility.php 3 weeks ago ReusableVideos.php 2 months ago RewriteRulesManager.php 2 years ago Scripts.php 2 months ago Settings.php 3 months ago Shortcodes.php 1 week ago Streamer.php 2 months ago Translation.php 3 weeks ago Usage.php 1 week ago VideoPostType.php 3 weeks ago
Compatibility.php
119 lines
1 <?php
2
3 namespace PrestoPlayer\Services;
4
5 class Compatibility {
6
7 public function register() {
8 // wp rocket compat
9 add_action( 'rocket_exclude_js', array( $this, 'excludeComponentsFile' ) );
10
11 // siteground optimize
12 add_action( 'sgo_js_minify_exclude', array( $this, 'excludeHandle' ) );
13
14 // godaddy's shitty feedback modal
15 add_action( 'admin_enqueue_scripts', array( $this, 'goDaddyModal' ), 99 );
16
17 // allow our player html
18 add_filter( 'wp_kses_allowed_html', array( $this, 'allowHtml' ), 11 );
19
20 // allow our css variables in safe css.
21 add_filter( 'safe_style_css', array( $this, 'safeCSS' ) );
22 }
23
24 /**
25 * Allows our css variables to be outputted wp_kses_allowed_html
26 *
27 * @param array $styles Array of allowed styles.
28 * @return array
29 */
30 public function safeCSS( $styles ) {
31 $player_styles = array(
32 '--plyr-color-main',
33 '--plyr-captions-background',
34 '--presto-player-border-radius',
35 '--presto-player-logo-width',
36 '--presto-player-email-border-radius',
37 '--presto-player-button-border-radius',
38 '--presto-player-button-color',
39 '--presto-player-button-text',
40 '--presto-player-cta-background-opacity',
41 '--plyr-audio-controls-background',
42 '--plyr-audio-control-color',
43 '--plyr-range-thumb-background',
44 '--plyr-range-fill-background',
45 '--presto-popup-media-width',
46 '--presto-popup-media-width-mobile',
47 '--presto-popup-background-color',
48 );
49 return array_merge( $player_styles, $styles );
50 }
51
52 /**
53 * Lets us use our player tag in content.
54 *
55 * @param array $tags Allowed tags.
56 * @return array
57 */
58 public function allowHtml( $tags ) {
59 $tags['presto-player'] = array(
60 'direction' => true,
61 'css' => true,
62 'skin' => true,
63 'icon-url' => true,
64 'id' => true,
65 'src' => true,
66 'class' => true,
67 'preload' => true,
68 'poster' => true,
69 'playsinline' => true,
70 'autoplay' => true,
71 'preset' => true,
72 'branding' => true,
73 'chapters' => true,
74 'overlays' => true,
75 'tracks' => true,
76 'block-attributes' => true,
77 'analytics' => true,
78 'automations' => true,
79 'provider' => true,
80 'media-title' => true,
81 'youtube' => true,
82 'provider-video-id' => true,
83 'video-id' => true,
84 'lazy-load-youtube' => true,
85 );
86 return $tags;
87 }
88
89 public function goDaddyModal() {
90 global $post_type;
91 if ( 'pp_video_block' == $post_type ) {
92 wp_dequeue_script( 'nextgen-feedback-modal' );
93 }
94 }
95
96 /**
97 * Exclude module by file
98 *
99 * @param array $excluded_js
100 * @return array
101 */
102 public function excludeComponentsFile( $excluded_js ) {
103 $excluded_js[] = str_replace( home_url(), '', PRESTO_PLAYER_PLUGIN_URL . 'dist/components/web-components/web-components.esm.js' );
104
105 return $excluded_js;
106 }
107
108 /**
109 * Exclude module by handle
110 *
111 * @param array $handles
112 * @return array
113 */
114 public function excludeHandle( $handles ) {
115 $handles[] = 'presto-components';
116 return $handles;
117 }
118 }
119