| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /** |
| 3 | 3 | * Plugin Name: FlyWP |
| 4 | 4 | * Plugin URI: https://flywp.com |
| 5 | 5 | * Description: Helper plugin for FlyWP |
| 6 | - * Version: 1.7.1 | |
| 6 | + * Version: 0.3 | |
| 7 | 7 | * Author: FlyWP |
| 8 | 8 | * Author URI: https://flywp.com/?utm_source=wporg&utm_medium=banner&utm_campaign=author-uri |
| 9 | 9 | * License: GPL2 |
| 10 | 10 | */ |
| @@ -40,9 +40,9 @@ | ||
| 40 | 40 | * Plugin version. |
| 41 | 41 | * |
| 42 | 42 | * @var string |
| 43 | 43 | */ |
| 44 | - public $version = '1.7.1'; | |
| 44 | + public $version = '0.3'; | |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Plugin Constructor. |
| 48 | 48 | * |
| @@ -52,9 +52,8 @@ | ||
| 52 | 52 | $this->define_constants(); |
| 53 | 53 | |
| 54 | 54 | $this->add_action( 'plugins_loaded', 'init_plugin' ); |
| 55 | 55 | register_activation_hook( __FILE__, [ $this, 'activate' ] ); |
| 56 | - register_deactivation_hook( __FILE__, [ $this, 'deactivate' ] ); | |
| 57 | 56 | } |
| 58 | 57 | |
| 59 | 58 | /** |
| 60 | 59 | * Define plugin constants. |
| @@ -70,12 +69,8 @@ | ||
| 70 | 69 | |
| 71 | 70 | if ( ! defined( 'FLYWP_API_KEY' ) ) { |
| 72 | 71 | define( 'FLYWP_API_KEY', '' ); |
| 73 | 72 | } |
| 74 | - | |
| 75 | - if ( ! defined( 'FLYWP_LOGIN_PUBLIC_KEY' ) ) { | |
| 76 | - define( 'FLYWP_LOGIN_PUBLIC_KEY', '' ); | |
| 77 | - } | |
| 78 | 73 | } |
| 79 | 74 | |
| 80 | 75 | /** |
| 81 | 76 | * Plugin activation hook. |
| @@ -89,29 +84,13 @@ | ||
| 89 | 84 | flush_rewrite_rules( false ); |
| 90 | 85 | } |
| 91 | 86 | |
| 92 | 87 | /** |
| 93 | - * Plugin deactivation hook. | |
| 94 | - * | |
| 95 | - * @return void | |
| 96 | - */ | |
| 97 | - public function deactivate() { | |
| 98 | - $timestamp = wp_next_scheduled( FlyWP\Api\UpdatesData::CRON_HOOK ); | |
| 99 | - if ( $timestamp ) { | |
| 100 | - wp_unschedule_event( $timestamp, FlyWP\Api\UpdatesData::CRON_HOOK ); | |
| 101 | - } | |
| 102 | - } | |
| 103 | - | |
| 104 | - /** | |
| 105 | 88 | * Initialize plugin. |
| 106 | 89 | * |
| 107 | 90 | * @return void |
| 108 | 91 | */ |
| 109 | 92 | public function init_plugin() { |
| 110 | - // Loaded ahead of the API-key gate below, as it does not use the API key. It answers | |
| 111 | - // one POST path and does nothing on any other request. | |
| 112 | - new FlyWP\Frontend\MagicLogin(); | |
| 113 | - | |
| 114 | 93 | if ( ! $this->has_key() ) { |
| 115 | 94 | $this->add_action( 'admin_notices', 'admin_notice' ); |
| 116 | 95 | |
| 117 | 96 | return; |
| @@ -122,17 +101,13 @@ | ||
| 122 | 101 | } else { |
| 123 | 102 | $this->frontend = new FlyWP\Frontend(); |
| 124 | 103 | } |
| 125 | 104 | |
| 126 | - $this->router = new FlyWP\Router(); | |
| 127 | - $this->rest = new FlyWP\Api(); | |
| 128 | - $this->fastcgi = new FlyWP\Fastcgi_Cache(); | |
| 129 | - $this->opcache = new FlyWP\Opcache(); | |
| 130 | - $this->flyapi = new FlyWP\FlyApi(); | |
| 131 | - $this->email = new FlyWP\Email(); | |
| 132 | - $this->optimize = new FlyWP\Optimizations(); | |
| 133 | - $this->litespeed = new FlyWP\Litespeed(); | |
| 134 | - $this->updates_data = new FlyWP\Api\UpdatesData(); | |
| 105 | + $this->router = new FlyWP\Router(); | |
| 106 | + $this->rest = new FlyWP\Api(); | |
| 107 | + $this->fastcgi = new FlyWP\Fastcgi_Cache(); | |
| 108 | + $this->opcache = new FlyWP\Opcache(); | |
| 109 | + $this->flyapi = new FlyWP\FlyApi(); | |
| 135 | 110 | } |
| 136 | 111 | |
| 137 | 112 | /** |
| 138 | 113 | * Show admin notice if API key is not set. |
| @@ -160,26 +135,8 @@ | ||
| 160 | 135 | * @return string |
| 161 | 136 | */ |
| 162 | 137 | public function get_key() { |
| 163 | 138 | return FLYWP_API_KEY; |
| 164 | - } | |
| 165 | - | |
| 166 | - /** | |
| 167 | - * Public key used to verify magic-login tokens. | |
| 168 | - * | |
| 169 | - * Set as a constant on classic WordPress. On Bedrock it may only be present in the | |
| 170 | - * environment, so fall back to `getenv()`. | |
| 171 | - * | |
| 172 | - * @return string | |
| 173 | - */ | |
| 174 | - public function get_login_public_key() { | |
| 175 | - if ( FLYWP_LOGIN_PUBLIC_KEY !== '' ) { | |
| 176 | - return FLYWP_LOGIN_PUBLIC_KEY; | |
| 177 | - } | |
| 178 | - | |
| 179 | - $from_env = getenv( 'FLYWP_LOGIN_PUBLIC_KEY' ); | |
| 180 | - | |
| 181 | - return $from_env === false ? '' : $from_env; | |
| 182 | 139 | } |
| 183 | 140 | } |
| 184 | 141 | |
| 185 | 142 | /** |