PluginProbe
FlyWP Helper – Page Cache, Page Optimization, Emails for FlyWP Server Control Panel / 1.0
FlyWP Helper – Page Cache, Page Optimization, Emails for FlyWP Server Control Panel v1.0
1.7.1 1.7.0 1.6.0 1.5.2 trunk 0.1 0.2.0 0.2.1 0.3 0.3.1 0.3.2 0.3.3 0.3.4 0.4 0.4.1 0.4.2 0.4.3 1.0 1.1 1.2 1.3.1 1.4.0 1.4.1 1.5.0 1.5.1 All 26 releases
← All changes | flywp.php +19 -43 trunk1.0 View file →
@@ -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: 1.0
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 = '1.0';
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,14 @@
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();
110 + $this->email = new FlyWP\Email();
135 111 }
136 112
137 113 /**
138 114 * Show admin notice if API key is not set.
@@ -163,23 +139,23 @@
163 139 return FLYWP_API_KEY;
164 140 }
165 141
166 142 /**
167 - * Public key used to verify magic-login tokens.
143 + * Debugging helper.
168 144 *
169 - * Set as a constant on classic WordPress. On Bedrock it may only be present in the
170 - * environment, so fall back to `getenv()`.
145 + * @param mixed $value
146 + * @param bool $die
171 147 *
172 - * @return string
148 + * @return void
173 149 */
174 - public function get_login_public_key() {
175 - if ( FLYWP_LOGIN_PUBLIC_KEY !== '' ) {
176 - return FLYWP_LOGIN_PUBLIC_KEY;
150 + public function debug( $value, $die = false ) {
151 + echo '<pre>';
152 + print_r( $value );
153 + echo '</pre>';
154 +
155 + if ( $die ) {
156 + die();
177 157 }
178 -
179 - $from_env = getenv( 'FLYWP_LOGIN_PUBLIC_KEY' );
180 -
181 - return $from_env === false ? '' : $from_env;
182 158 }
183 159 }
184 160
185 161 /**