mirror of
https://github.com/WenPai-org/lelms-copyright.git
synced 2025-08-04 21:05:15 +08:00
源码提交
This commit is contained in:
parent
2955d0dde5
commit
3fd3701567
131 changed files with 13972 additions and 0 deletions
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace YahnisElsts\PluginUpdateChecker\v5p3\DebugBar;
|
||||
|
||||
use YahnisElsts\PluginUpdateChecker\v5p3\Plugin\UpdateChecker;
|
||||
|
||||
if ( !class_exists(PluginExtension::class, false) ):
|
||||
|
||||
class PluginExtension extends Extension {
|
||||
/** @var UpdateChecker */
|
||||
protected $updateChecker;
|
||||
|
||||
public function __construct($updateChecker) {
|
||||
parent::__construct($updateChecker, PluginPanel::class);
|
||||
|
||||
add_action('wp_ajax_puc_v5_debug_request_info', array($this, 'ajaxRequestInfo'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Request plugin info and output it.
|
||||
*/
|
||||
public function ajaxRequestInfo() {
|
||||
//phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce is checked in preAjaxRequest().
|
||||
if ( !isset($_POST['uid']) || ($_POST['uid'] !== $this->updateChecker->getUniqueName('uid')) ) {
|
||||
return;
|
||||
}
|
||||
$this->preAjaxRequest();
|
||||
$info = $this->updateChecker->requestInfo();
|
||||
if ( $info !== null ) {
|
||||
echo 'Successfully retrieved plugin info from the metadata URL:';
|
||||
//phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_print_r -- For debugging output.
|
||||
echo '<pre>', esc_html(print_r($info, true)), '</pre>';
|
||||
} else {
|
||||
echo 'Failed to retrieve plugin info from the metadata URL.';
|
||||
}
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
endif;
|
Loading…
Add table
Add a link
Reference in a new issue