PluginProbe ʕ •ᴥ•ʔ
Presto Player / 2.2.3-beta1
Presto Player v2.2.3-beta1
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 2 years ago Blocks 5 years ago License 5 years ago AdminNotice.php 5 years ago AdminNotices.php 4 years ago AjaxActions.php 2 years ago Blocks.php 5 years ago Compatibility.php 4 years ago Menu.php 3 years ago Migrations.php 5 years ago Player.php 2 years ago ProCompatibility.php 2 years ago ReusableVideos.php 4 years ago Scripts.php 2 years ago Settings.php 4 years ago Shortcodes.php 2 years ago Streamer.php 4 years ago Translation.php 2 years ago VideoPostType.php 4 years ago
Compatibility.php
109 lines
1 <?php
2
3 namespace PrestoPlayer\Services;
4
5 class Compatibility
6 {
7 public function register()
8 {
9 // wp rocket compat
10 add_action('rocket_exclude_js', [$this, 'excludeComponentsFile']);
11
12 // siteground optimize
13 add_action('sgo_js_minify_exclude', [$this, 'excludeHandle']);
14
15 // godaddy's shitty feedback modal
16 add_action('admin_enqueue_scripts', [$this, 'goDaddyModal'], 99);
17
18 // allow our player html
19 add_filter('wp_kses_allowed_html', [$this, 'allowHtml'], 11);
20
21 // allow our css variables in safe css.
22 add_filter('safe_style_css', [$this, 'safeCSS']);
23 }
24
25 /**
26 * Allows our css variables to be outputted wp_kses_allowed_html
27 *
28 * @param array $styles Array of allowed styles.
29 * @return array
30 */
31 public function safeCSS($styles)
32 {
33 $player_styles = [
34 '--plyr-color-main',
35 '--plyr-captions-background',
36 '--presto-player-border-radius',
37 '--presto-player-logo-width',
38 '--presto-player-email-border-radius',
39 '--presto-player-button-border-radius',
40 '--presto-player-button-color',
41 '--presto-player-button-text',
42 '--presto-player-cta-background-opacity',
43 '--plyr-audio-controls-background',
44 '--plyr-audio-control-color',
45 '--plyr-range-thumb-background',
46 '--plyr-range-fill-background'
47 ];
48 return array_merge($player_styles, $styles);
49 }
50
51 /**
52 * Lets us use our player tag in content.
53 *
54 * @param array $tags Allowed tags.
55 * @return array
56 */
57 public function allowHtml($tags)
58 {
59 $tags['presto-player'] = [
60 'direction' => true,
61 'css' => true,
62 'skin' => true,
63 'icon-url' => true,
64 'id' => true,
65 'src' => true,
66 'css' => true,
67 'class' => true,
68 'preload' => true,
69 'poster' => true,
70 'playsinline' => true,
71 'autoplay' => true,
72 ];
73 return $tags;
74 }
75
76 public function goDaddyModal()
77 {
78 global $post_type;
79 if ('pp_video_block' == $post_type) {
80 wp_dequeue_script('nextgen-feedback-modal');
81 }
82 }
83
84 /**
85 * Exclude module by file
86 *
87 * @param array $excluded_js
88 * @return array
89 */
90 public function excludeComponentsFile($excluded_js)
91 {
92 $excluded_js[] = str_replace(home_url(), '', PRESTO_PLAYER_PLUGIN_URL . "dist/components/web-components/web-components.esm.js");
93
94 return $excluded_js;
95 }
96
97 /**
98 * Exclude module by handle
99 *
100 * @param array $handles
101 * @return array
102 */
103 public function excludeHandle($handles)
104 {
105 $handles[] = 'presto-components';
106 return $handles;
107 }
108 }
109