| @@ -6,32 +6,8 @@ | ||
| 6 | 6 | if (!defined('PHASTPRESS_VERSION')) { |
| 7 | 7 | exit; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | -try { | |
| 11 | - new PDO('sqlite::memory:'); | |
| 12 | -} catch (\Throwable $e) { | |
| 13 | - add_action('admin_notices', function () use ($e) { | |
| 14 | - ?> | |
| 15 | - <div class="error notice"> | |
| 16 | - <p><b>Sorry, PhastPress requires a PHP extension that is not installed.</b></p> | |
| 17 | - <p> | |
| 18 | - The PDO extension needs to be installed with the SQLite3 database driver available.<br> | |
| 19 | - Currently we're getting this error: <em><?= esc_html($e->getMessage()); ?></em> | |
| 20 | - </p> | |
| 21 | - <p> | |
| 22 | - Ask your hosting provider to install the <a href="https://www.php.net/manual/en/ref.pdo-sqlite.php" target="_blank" rel="noopener">PDO_SQLITE extension</a>, or downgrade to <a href="https://downloads.wordpress.org/plugin/phastpress.2.1.zip" target="_blank" rel="noopener">PhastPress 2.1</a>. | |
| 23 | - </p> | |
| 24 | - </div> | |
| 25 | - <?php | |
| 26 | - }); | |
| 27 | - return; | |
| 28 | -} | |
| 29 | - | |
| 30 | -if (!defined('REQUESTS_SILENCE_PSR0_DEPRECATIONS')) { | |
| 31 | - define('REQUESTS_SILENCE_PSR0_DEPRECATIONS', true); | |
| 32 | -} | |
| 33 | - | |
| 34 | 10 | require_once __DIR__ . '/autoload.php'; |
| 35 | 11 | |
| 36 | 12 | add_action('plugins_loaded', function () { |
| 37 | 13 | if (!get_option('phastpress_1.43')) { |
| @@ -54,9 +30,9 @@ | ||
| 54 | 30 | phastpress_get_plugin_sdk()->getAJAXRequestsDispatcher()->dispatch($_POST) |
| 55 | 31 | ); |
| 56 | 32 | }); |
| 57 | 33 | |
| 58 | -add_action('admin_footer', function () { | |
| 34 | +add_action('admin_notices', function () { | |
| 59 | 35 | echo phastpress_get_plugin_sdk()->getInstallNotice()->render(); |
| 60 | 36 | }); |
| 61 | 37 | |
| 62 | 38 | add_filter('plugin_action_links_' . plugin_basename(PHASTPRESS_PLUGIN_FILE), function ($links) { |
| @@ -69,12 +45,8 @@ | ||
| 69 | 45 | add_action('plugins_loaded', function () { |
| 70 | 46 | CDN::installHook(); |
| 71 | 47 | Compat\Log::setup(); |
| 72 | 48 | |
| 73 | - if ((new Compat\Ajax())->setup()) { | |
| 74 | - return; | |
| 75 | - } | |
| 76 | - | |
| 77 | 49 | if (($priority = has_filter('init', 'wp_cache_late_loader')) !== false) { |
| 78 | 50 | add_action('init', 'phastpress_deploy', $priority + 1); |
| 79 | 51 | Compat\Log::add( |
| 80 | 52 | 'wp-super-cache', |
| @@ -80,16 +52,8 @@ | ||
| 80 | 52 | 'wp-super-cache', |
| 81 | 53 | 'deploying PhastPress via init hook to support WP Super Cache late init' |
| 82 | 54 | ); |
| 83 | 55 | (new Compat\NextGenGallery())->setup($priority + 1); |
| 84 | - } elseif (class_exists(\LiteSpeed\Core::class) | |
| 85 | - && ($priority = (new Compat\LiteSpeedCache())->getHookPriority()) !== null | |
| 86 | - ) { | |
| 87 | - add_action('after_setup_theme', 'phastpress_deploy', $priority + 1); | |
| 88 | - Compat\Log::add( | |
| 89 | - 'litespeed-cache', | |
| 90 | - 'deploying PhastPress via after_setup_theme hook to support LiteSpeed Cache' | |
| 91 | - ); | |
| 92 | 56 | } else { |
| 93 | 57 | phastpress_deploy(); |
| 94 | 58 | } |
| 95 | 59 | }); |
| @@ -119,12 +83,11 @@ | ||
| 119 | 83 | ); |
| 120 | 84 | }); |
| 121 | 85 | |
| 122 | 86 | function phastpress_console_log(...$args) { |
| 123 | - echo phastpress_script( | |
| 124 | - sprintf('console.log(%s)', implode(',', array_map('json_encode', $args))), | |
| 125 | - ['data-phast-no-defer' => ''] | |
| 126 | - ); | |
| 87 | + echo '<script data-phast-no-defer>console.log(' . | |
| 88 | + implode(',', array_map('json_encode', $args)) . | |
| 89 | + ')</script>'; | |
| 127 | 90 | } |
| 128 | 91 | |
| 129 | 92 | function phastpress_render_settings() { |
| 130 | 93 | echo sprintf( |