diff --git a/index.php b/index.php index 735f6a1..1ff89ce 100644 --- a/index.php +++ b/index.php @@ -142,16 +142,158 @@ class WP_CHINA_YES { } public function settings() { - $setting_page_url = plugins_url('settings.html', __FILE__) . '?v=2.2.0'; echo << - +
+

WP-China-Yes

+ + +

这是一个开源项目,她需要每个人的支持和贡献才能健康长久的发展。
项目地址:GitHub

+
+ EOT; } public function set_cookie() { - if ( ! isset($_COOKIE['wp-china-yes']) && current_user_can('manage_options')) { + if (current_user_can('manage_options')) { setcookie('wp-china-yes', json_encode([ 'get_config' => wp_create_nonce('wpcy_get_config'), 'set_config' => wp_create_nonce('wpcy_set_config') @@ -160,10 +302,12 @@ EOT; } public function get_config() { + check_ajax_referer('wpcy_get_config'); self::success('', $this->wp_china_yes_options); } public function set_config() { + check_ajax_referer('wpcy_set_config'); if ( ! array_key_exists('community', $_POST) || ( ! array_key_exists('custom_api_server', $_POST) && ! array_key_exists('custom_download_server', $_POST))) { self::error('参数错误', - 1);