-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
57 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
class Plugin { | ||
|
||
/** | ||
* 创建一个插件实例 | ||
* 创建插件实例 | ||
*/ | ||
public function __construct() { | ||
new Base(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,9 @@ public function __construct() { | |
* 初始化 | ||
*/ | ||
public function init() { | ||
if ( $this->settings['monitor'] != 'on' ) { | ||
return; | ||
} | ||
// 检查应用市场可用性 | ||
if ( ! wp_next_scheduled( 'wp_china_yes_maybe_check_store' ) && $this->settings['store'] != 'off' ) { | ||
wp_schedule_event( time(), 'hourly', 'wp_china_yes_maybe_check_store' ); | ||
|
@@ -141,6 +144,14 @@ public function maybe_check_admincdn() { | |
$this->update_settings(); | ||
} | ||
} | ||
// jsDelivr 公共库 | ||
if ( ! empty( $this->settings['admincdn']['jsdelivr'] ) ) { | ||
$response = wp_remote_get( 'https://jsd.admincdn.com/npm/[email protected]/dist/jquery.slim.min.js' ); | ||
if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) != 200 ) { | ||
unset( $this->settings['admincdn']['jsdelivr'] ); | ||
$this->update_settings(); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters