| @@ -41,16 +41,9 @@ | ||
| 41 | 41 | defined('WPB_VC_VERSION') |
| 42 | 42 | && isset($_GET['vc_editable']) |
| 43 | 43 | && $_GET['vc_editable'] === 'true' |
| 44 | 44 | ) |
| 45 | - // Oxygen | |
| 46 | - || ( | |
| 47 | - defined('CT_VERSION') | |
| 48 | - && isset($_GET['ct_builder']) | |
| 49 | - && $_GET['ct_builder'] === 'true' | |
| 50 | - ) | |
| 51 | 45 | ) { |
| 52 | - Compat\Log::add(null, 'Disabling PhastPress during visual editing'); | |
| 53 | 46 | return; |
| 54 | 47 | } |
| 55 | 48 | |
| 56 | 49 | // Support phast_no_defer script attribute. |
| @@ -78,10 +71,8 @@ | ||
| 78 | 71 | Compat\Slimstat::class, |
| 79 | 72 | Compat\GoogleSiteKit::class, |
| 80 | 73 | Compat\GAGoogleAnalytics::class, |
| 81 | 74 | Compat\AdThrive::class, |
| 82 | - Compat\TwentyTwentyOneDarkMode::class, | |
| 83 | - Compat\BurstStatistics::class, | |
| 84 | 75 | ] as $class) { |
| 85 | 76 | (new $class())->setup(); |
| 86 | 77 | } |
| 87 | 78 | |
| @@ -88,15 +79,13 @@ | ||
| 88 | 79 | $sdk = phastpress_get_plugin_sdk(); |
| 89 | 80 | $handler = $sdk->getPhastAPI()->deployOutputBufferForDocument(); |
| 90 | 81 | |
| 91 | 82 | // Allow disabling PhastPress with hook. |
| 92 | - if ($handler) { | |
| 93 | - add_action('template_redirect', function () use ($handler) { | |
| 94 | - if (apply_filters('phastpress_disable', false)) { | |
| 95 | - $handler->cancel(); | |
| 96 | - } | |
| 97 | - }, 100); | |
| 98 | - } | |
| 83 | + add_action('template_redirect', function () use ($handler) { | |
| 84 | + if (apply_filters('phastpress_disable', false)) { | |
| 85 | + $handler->cancel(); | |
| 86 | + } | |
| 87 | + }, 100); | |
| 99 | 88 | |
| 100 | 89 | $plugin_config = $sdk->getPluginConfiguration(); |
| 101 | 90 | $display_footer = $plugin_config->shouldDisplayFooter(); |
| 102 | 91 | if ($display_footer) { |
| @@ -128,15 +117,5 @@ | ||
| 128 | 117 | function phastpress_render_footer() { |
| 129 | 118 | echo '<div class="phast-footer">' |
| 130 | 119 | . '<a href="https://wordpress.org/plugins/phastpress/" target="_blank">' |
| 131 | 120 | . __('Optimized by PhastPress', 'phastpress') . '</a></div>'; |
| 132 | -} | |
| 133 | - | |
| 134 | -function phastpress_script(string $script, array $attrs = []): string { | |
| 135 | - if (!isset($attrs['nonce'])) { | |
| 136 | - $nonce = apply_filters('phastpress_csp_nonce', null); | |
| 137 | - if ($nonce !== null) { | |
| 138 | - $attrs['nonce'] = (string) $nonce; | |
| 139 | - } | |
| 140 | - } | |
| 141 | - return (string) wp_get_inline_script_tag($script, $attrs); | |
| 142 | 121 | } |