Changeset 2978053
- Timestamp:
- 10/12/2023 10:37:44 AM (2 years ago)
- Location:
- wgpwpp/trunk
- Files:
-
- 5 edited
-
README.txt (modified) (2 diffs)
-
admin/class-wgpwpp-verification.php (modified) (3 diffs)
-
admin/css/wgpwpp-admin.css (modified) (1 diff)
-
includes/class-wgpwpp-log.php (modified) (6 diffs)
-
wgpwpp.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wgpwpp/trunk/README.txt
r2971788 r2978053 5 5 Requires at least: 5.6 6 6 Tested up to: 6.3 7 Stable tag: 1.0. 17 Stable tag: 1.0.2 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 120 120 121 121 == Changelog == 122 = v1.0.2 = 123 124 * Web server compatibility improvements 125 * Logging improvements 126 * Minor adjustments to the verification process 127 122 128 = v1.0.1 = 123 129 -
wgpwpp/trunk/admin/class-wgpwpp-verification.php
r2971707 r2978053 140 140 public function generate_verification_header($user, string $random): string 141 141 { 142 $state_data = sprintf( 143 '%s-%s-%s-%d-%d', 144 $this->plugin->get_plugin_name(), 145 $random, 146 $user->get('user_login'), 147 $user->get('id'), 148 time() + self::VERIFICATION_REQUEST_EXPIRATION 149 ); 142 $state_data = sprintf( 143 '%s-%s-%s-%d-%d-%s', 144 $this->plugin->get_plugin_name(), 145 $random, 146 $user->get('user_login'), 147 $user->get('id'), 148 time() + self::VERIFICATION_REQUEST_EXPIRATION, 149 get_rest_url() 150 ); 150 151 151 152 $state = base64_encode($state_data); … … 248 249 249 250 $data = explode('-', $code); 250 if (count($data) !==5)251 if (count($data) < 5) 251 252 { 252 253 $this->log('Invalid verification request - invalid verification code', $code, Wgpwpp_Log::TYPE_ERROR); … … 379 380 'code' => 2004, 380 381 'msg' => 'Failed to send verification email!', 382 'data' => [ 383 'challenge' => $code['challenge'], 384 ], 381 385 ]; 382 386 } -
wgpwpp/trunk/admin/css/wgpwpp-admin.css
r2971707 r2978053 10 10 .wgpwpp-service-info-table { 11 11 margin-top: 20px; 12 border: 1px solid black;13 12 border-collapse: collapse; 14 13 } -
wgpwpp/trunk/includes/class-wgpwpp-log.php
r2971707 r2978053 62 62 * @return string 63 63 */ 64 private function get_log_header() 65 { 66 $header = 'PHP Version: '.$this->plugin->get_php_version().PHP_EOL; 64 private function get_log_header(): string 65 { 66 $header = "Server info:".PHP_EOL; 67 $header .= "============".PHP_EOL; 68 $header .= print_r($_SERVER, true).PHP_EOL.PHP_EOL; 69 70 $header .= "WordPress info:".PHP_EOL; 71 $header .= "===============".PHP_EOL; 72 $header .= 'PHP Version: '.$this->plugin->get_php_version().PHP_EOL; 67 73 $header .= 'WordPress Version: '.$this->plugin->get_wp_version().PHP_EOL; 68 74 $header .= 'WordPress Admin E-mail: '.$this->plugin->get_admin_email().PHP_EOL; … … 70 76 $header .= 'WordPress Domain: '.$this->plugin->get_host().PHP_EOL; 71 77 $header .= 'WGPWPP Version: '.$this->plugin->get_version().PHP_EOL; 72 $header .= 'WGPWPP URL: '.$this->plugin->get_admin_page_url().PHP_EOL; 78 $header .= 'WGPWPP URL: '.$this->plugin->get_admin_page_url().PHP_EOL.PHP_EOL; 79 80 $service = $this->plugin->get_service(); 81 $header .= "Service info:".PHP_EOL; 82 $header .= "=============".PHP_EOL; 83 $header .= "Service name: ".$service->get_service_name().PHP_EOL; 84 $header .= "Service TLD: ".$service->get_service_tld().PHP_EOL; 85 $header .= "Service state: ".$service->get_service_state().PHP_EOL; 86 $header .= "Service state data: ".print_r($service->get_service_state_data(), true).PHP_EOL; 87 73 88 return $header; 74 89 } … … 166 181 public function download(): bool 167 182 { 183 $header = $this->get_log_header().PHP_EOL; 184 $header .= "Log:".PHP_EOL; 185 $header .= "====".PHP_EOL.PHP_EOL; 186 168 187 $log = $this->plugin->option->get(Wgpwpp_Option::OPTION_LOG); 169 188 if (!is_array($log)) … … 175 194 if (is_wp_error($hostname)) 176 195 return false; 196 197 $log = $header.$log; 177 198 178 199 $filename = 'wgpwpp-'.str_replace('.', '-', $hostname).'.log'; … … 201 222 public function send_log() 202 223 { 224 $header = $this->get_log_header().PHP_EOL; 225 $header .= "Log:".PHP_EOL; 226 $header .= "====".PHP_EOL.PHP_EOL; 227 203 228 $log = $this->plugin->option->get(Wgpwpp_Option::OPTION_LOG); 204 229 if (!is_array($log)) … … 214 239 215 240 $msg = "WGP WordPress Plugin - DEBUG report".PHP_EOL.PHP_EOL; 216 $msg .= "WordPress info:".PHP_EOL; 217 $msg .= $this->get_log_header().PHP_EOL; 218 219 $service = $this->plugin->get_service(); 220 $msg .= "Service info:".PHP_EOL; 221 $msg .= "Service name: ".$service->get_service_name().PHP_EOL; 222 $msg .= "Service TLD: ".$service->get_service_tld().PHP_EOL; 223 $msg .= "Service state: ".$service->get_service_state().PHP_EOL; 224 $msg .= "Service state data: ".print_r($service->get_service_state_data(), true).PHP_EOL; 225 226 $msg .= PHP_EOL.$log; 241 $msg .= $header.$log; 227 242 228 243 $headers = [ -
wgpwpp/trunk/wgpwpp.php
r2971757 r2978053 17 17 * Plugin URI: https://www.wedos.global/protection/wp-plugin 18 18 * Description: Activate and use the WEDOS Global Protection service. WEDOS Global Protection brings global security for your WordPress website, ensures low latency and minimal loading time. 19 * Version: 1.0. 119 * Version: 1.0.2 20 20 * Requires at least: 5.6 21 21 * Requires PHP: 7.4 … … 38 38 * Rename this for your plugin and update it as you release new versions. 39 39 */ 40 const WGPWPP_VERSION = '1.0. 1';40 const WGPWPP_VERSION = '1.0.2'; 41 41 const WGPWPP_PLUGIN_NAME = 'wgpwpp'; 42 42 const WGPWPP_PLUGIN_FILE = __FILE__;
Note: See TracChangeset
for help on using the changeset viewer.