An updated theme (based on Atticus Finch) for ClassicPress
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
959 B

3 years ago
  1. <?php
  2. if ( !class_exists('Puc_v4p1_DebugBar_PluginExtension', false) ):
  3. class Puc_v4p1_DebugBar_PluginExtension extends Puc_v4p1_DebugBar_Extension {
  4. /** @var Puc_v4p1_Plugin_UpdateChecker */
  5. protected $updateChecker;
  6. public function __construct($updateChecker) {
  7. parent::__construct($updateChecker, 'Puc_v4p1_DebugBar_PluginPanel');
  8. add_action('wp_ajax_puc_v4_debug_request_info', array($this, 'ajaxRequestInfo'));
  9. }
  10. /**
  11. * Request plugin info and output it.
  12. */
  13. public function ajaxRequestInfo() {
  14. if ( $_POST['uid'] !== $this->updateChecker->getUniqueName('uid') ) {
  15. return;
  16. }
  17. $this->preAjaxReqest();
  18. $info = $this->updateChecker->requestInfo();
  19. if ( $info !== null ) {
  20. echo 'Successfully retrieved plugin info from the metadata URL:';
  21. echo '<pre>', htmlentities(print_r($info, true)), '</pre>';
  22. } else {
  23. echo 'Failed to retrieve plugin info from the metadata URL.';
  24. }
  25. exit;
  26. }
  27. }
  28. endif;