Skip to content

Commit

Permalink
Merge branch 'master' into wp55-auto-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
YahnisElsts committed Aug 21, 2020
2 parents 9ff0a29 + 8c4a998 commit 9788564
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Puc/v4p10/DebugBar/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ protected function preAjaxRequest() {
@ini_set('display_errors', 'On');
}

/**
* Remove hooks that were added by this extension.
*/
public function removeHooks() {
remove_filter('debug_bar_panels', array($this, 'addDebugBarPanel'));
remove_action('debug_bar_enqueue_scripts', array($this, 'enqueuePanelDependencies'));
remove_action('wp_ajax_puc_v4_debug_check_now', array($this, 'ajaxCheckNow'));
}

/**
* @param string $filePath
* @return string
Expand Down
11 changes: 10 additions & 1 deletion Puc/v4p10/UpdateChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ abstract class Puc_v4p10_UpdateChecker {
*/
protected $cachedMetadataHost = 0;

/**
* @var Puc_v4p9_DebugBar_Extension|null
*/
protected $debugBarExtension = null;

public function __construct($metadataUrl, $directoryName, $slug = null, $checkPeriod = 12, $optionName = '') {
$this->debugMode = (bool)(constant('WP_DEBUG'));
$this->metadataUrl = $metadataUrl;
Expand Down Expand Up @@ -168,6 +173,10 @@ public function removeHooks() {
if ( $this->scheduler ) {
$this->scheduler->removeHooks();
}

if ( $this->debugBarExtension ) {
$this->debugBarExtension->removeHooks();
}
}

/**
Expand Down Expand Up @@ -963,7 +972,7 @@ protected function isBadDirectoryStructure($remoteSource) {
*/
public function maybeInitDebugBar() {
if ( class_exists('Debug_Bar', false) && file_exists(dirname(__FILE__) . '/DebugBar') ) {
$this->createDebugBarExtension();
$this->debugBarExtension = $this->createDebugBarExtension();
}
}

Expand Down
Binary file added languages/plugin-update-checker-zh_CN.mo
Binary file not shown.
48 changes: 48 additions & 0 deletions languages/plugin-update-checker-zh_CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
msgid ""
msgstr ""
"Project-Id-Version: plugin-update-checker\n"
"POT-Creation-Date: 2017-11-24 17:02+0200\n"
"PO-Revision-Date: 2020-08-04 08:10+0800\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n"
"Last-Translator: Seaton Jiang <[email protected]>\n"
"Language: zh_CN\n"
"X-Poedit-SearchPath-0: .\n"

#: Puc/v4p3/Plugin/UpdateChecker.php:395
msgid "Check for updates"
msgstr "检查更新"

#: Puc/v4p3/Plugin/UpdateChecker.php:548
#, php-format
msgctxt "the plugin title"
msgid "The %s plugin is up to date."
msgstr "%s 目前是最新版本。"

#: Puc/v4p3/Plugin/UpdateChecker.php:550
#, php-format
msgctxt "the plugin title"
msgid "A new version of the %s plugin is available."
msgstr "%s 当前有可用的更新。"

#: Puc/v4p3/Plugin/UpdateChecker.php:552
#, php-format
msgctxt "the plugin title"
msgid "Could not determine if updates are available for %s."
msgstr "%s 无法确定是否有可用的更新。"

#: Puc/v4p3/Plugin/UpdateChecker.php:558
#, php-format
msgid "Unknown update checker status \"%s\""
msgstr "未知的更新检查状态:%s"

#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95
msgid "There is no changelog available."
msgstr "没有可用的更新日志。"

0 comments on commit 9788564

Please sign in to comment.