Plugin Directory

Changeset 942263


Ignore:
Timestamp:
07/02/2014 04:15:02 PM (12 years ago)
Author:
dxw
Message:
  • Bump version to 0.2.6
  • The api now groups counts of plugin requests by the version of the dxw Sec plugin that requested it
  • Minor bugfixes
Location:
dxw-security/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • dxw-security/trunk/dxw-security.php

    r942260 r942263  
    99  * Author URI: http://dxw.com/
    1010*/
     11define('DXW_SECURITY_PLUGIN_VERSION', "0.2.6");
    1112
    1213// Prevent Full Path Disclosure
  • dxw-security/trunk/lib/api.class.php

    r942262 r942263  
    5252    $api_root = DXW_SECURITY_API_ROOT;
    5353    $api_path = $this->api_path();
     54    $query    = "?dxwsec_version=" . DXW_SECURITY_PLUGIN_VERSION;
    5455
    5556    // this should exist in core, but doesn't seem to:
     
    6162    //   )
    6263    // );
    63     $url = $api_root . $api_path;
     64    $url = $api_root . $api_path . $query;
    6465
    6566    $response = wp_remote_get(esc_url($url));
  • dxw-security/trunk/lib/dashboard_widget.class.php

    r934571 r942263  
    8080      // Stop making requests after a certain number of failures:
    8181      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);
    8383      } else {
    8484        $api = new dxw_security_Plugin_Review_API($plugin_file_object->plugin_slug);
     
    8787          $this->handle_api_response($reviews, $installed_version, $plugin_file_object->plugin_slug);
    8888        } catch (Exception $e) {
    89           $this->handle_api_error($e);
     89          $this->handle_api_error($e, $plugin_file_object->plugin_slug);
    9090        }
    9191      }
     
    128128  }
    129129
    130   private function handle_api_error($error) {
     130  private function handle_api_error($error, $plugin_slug) {
    131131    // TODO: Handle errors actually raised by us in the api class separately from other errors?
    132132    // TODO: in future we should provide some way for users to give us back some useful information when they get an error
    133133    $this->failed_requests++;
    134     if (is_null($this->first_failed_requests_slug)) { $this->first_failed_requests_slug = $plugin_slug; }
     134    if (is_null($this->first_failed_request_slug)) { $this->first_failed_request_slug = $plugin_slug; }
    135135  }
    136136
    137   private function handle_api_fatal_error() {
     137  private function handle_api_fatal_error($plugin_slug) {
    138138    // Assume it would have failed
    139139    //   Keep counting because currently we're just displaying "x failed"
    140140    $this->failed_requests++;
    141     if (is_null($this->first_failed_requests_slug)) { $this->first_failed_requests_slug = $plugin_slug; }
     141    if (is_null($this->first_failed_request_slug)) { $this->first_failed_request_slug = $plugin_slug; }
    142142    // TODO: instead throw an error here to be captured higher up.
    143143  }
  • dxw-security/trunk/readme.txt

    r942260 r942263  
    5757= 0.2.6 =
    5858* 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
    5961
    6062= 0.2.5 =
Note: See TracChangeset for help on using the changeset viewer.