Changeset 942263
- Timestamp:
- 07/02/2014 04:15:02 PM (12 years ago)
- Location:
- dxw-security/trunk
- Files:
-
- 4 edited
-
dxw-security.php (modified) (1 diff)
-
lib/api.class.php (modified) (2 diffs)
-
lib/dashboard_widget.class.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dxw-security/trunk/dxw-security.php
r942260 r942263 9 9 * Author URI: http://dxw.com/ 10 10 */ 11 define('DXW_SECURITY_PLUGIN_VERSION', "0.2.6"); 11 12 12 13 // Prevent Full Path Disclosure -
dxw-security/trunk/lib/api.class.php
r942262 r942263 52 52 $api_root = DXW_SECURITY_API_ROOT; 53 53 $api_path = $this->api_path(); 54 $query = "?dxwsec_version=" . DXW_SECURITY_PLUGIN_VERSION; 54 55 55 56 // this should exist in core, but doesn't seem to: … … 61 62 // ) 62 63 // ); 63 $url = $api_root . $api_path ;64 $url = $api_root . $api_path . $query; 64 65 65 66 $response = wp_remote_get(esc_url($url)); -
dxw-security/trunk/lib/dashboard_widget.class.php
r934571 r942263 80 80 // Stop making requests after a certain number of failures: 81 81 if ($this->failed_requests > DXW_SECURITY_FAILURE_lIMIT) { 82 $this->handle_api_fatal_error( );82 $this->handle_api_fatal_error($plugin_file_object->plugin_slug); 83 83 } else { 84 84 $api = new dxw_security_Plugin_Review_API($plugin_file_object->plugin_slug); … … 87 87 $this->handle_api_response($reviews, $installed_version, $plugin_file_object->plugin_slug); 88 88 } catch (Exception $e) { 89 $this->handle_api_error($e );89 $this->handle_api_error($e, $plugin_file_object->plugin_slug); 90 90 } 91 91 } … … 128 128 } 129 129 130 private function handle_api_error($error ) {130 private function handle_api_error($error, $plugin_slug) { 131 131 // TODO: Handle errors actually raised by us in the api class separately from other errors? 132 132 // TODO: in future we should provide some way for users to give us back some useful information when they get an error 133 133 $this->failed_requests++; 134 if (is_null($this->first_failed_request s_slug)) { $this->first_failed_requests_slug = $plugin_slug; }134 if (is_null($this->first_failed_request_slug)) { $this->first_failed_request_slug = $plugin_slug; } 135 135 } 136 136 137 private function handle_api_fatal_error( ) {137 private function handle_api_fatal_error($plugin_slug) { 138 138 // Assume it would have failed 139 139 // Keep counting because currently we're just displaying "x failed" 140 140 $this->failed_requests++; 141 if (is_null($this->first_failed_request s_slug)) { $this->first_failed_requests_slug = $plugin_slug; }141 if (is_null($this->first_failed_request_slug)) { $this->first_failed_request_slug = $plugin_slug; } 142 142 // TODO: instead throw an error here to be captured higher up. 143 143 } -
dxw-security/trunk/readme.txt
r942260 r942263 57 57 = 0.2.6 = 58 58 * Cache keys are now namespaced to minimise the chance of name clashes and accidental overwrites 59 * The api now groups counts of plugin requests by the version of the dxw Sec plugin that requested it 60 * Minor bugfixes 59 61 60 62 = 0.2.5 =
Note: See TracChangeset
for help on using the changeset viewer.