Changeset 3352404
- Timestamp:
- 08/29/2025 03:03:56 AM (4 months ago)
- Location:
- naiba-coming-soon/trunk
- Files:
-
- 6 added
- 2 edited
-
languages (added)
-
languages/naiba-coming-soon-en_US.mo (added)
-
languages/naiba-coming-soon-en_US.po (added)
-
languages/naiba-coming-soon-zh_CN.mo (added)
-
languages/naiba-coming-soon-zh_CN.po (added)
-
languages/naiba-coming-soon.pot (added)
-
naiba-coming-soon.php (modified) (8 diffs)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
naiba-coming-soon/trunk/naiba-coming-soon.php
r2902178 r3352404 4 4 Plugin URI: https://blog.naibabiji.com/files/wordpress-plugins/naiba-coming-soon.html 5 5 Description: A simple and effective coming soon plugin for WordPress. 6 Version: 1. 06 Version: 1.1 7 7 Author: 奶爸建站笔记 8 8 Author URI: https://blog.naibabiji.com 9 9 Requires at least: 5.9 10 Tested up to: 6. 211 Stable tag: 1. 010 Tested up to: 6.8.2 11 Stable tag: 1.1 12 12 Requires PHP: 5.6 13 13 License: GPLv2 14 14 License URI: http://www.gnu.org/licenses/gpl-2.0.html 15 Text Domain: naiba-coming-soon 16 Domain Path: /languages 15 17 */ 18 19 // 注意:WordPress插件头部信息不支持翻译函数,插件名称和描述的翻译需要在.po文件中添加 16 20 17 21 // Block direct access to the plugin PHP files … … 20 24 } 21 25 26 // WordPress 4.6+ automatically loads translations from the languages directory 27 // No need to manually call load_plugin_textdomain() anymore 28 29 // Register and enqueue plugin styles 30 function naiba_coming_soon_enqueue_styles() { 31 wp_register_style('naiba-coming-soon-style', plugin_dir_url(__FILE__) . 'css/style.css', array(), '1.1'); 32 wp_enqueue_style('naiba-coming-soon-style'); 33 } 34 35 // Enqueue styles for admin pages 36 function naiba_coming_soon_admin_enqueue_styles($hook) { 37 // Only load on dashboard and plugin settings page 38 if ($hook === 'index.php' || $hook === 'settings_page_naiba_coming_soon_settings') { 39 wp_enqueue_style('naiba-coming-soon-style', plugin_dir_url(__FILE__) . 'css/style.css', array(), '1.1'); 40 } 41 } 42 add_action('admin_enqueue_scripts', 'naiba_coming_soon_admin_enqueue_styles'); 43 22 44 // Add Coming Soon page functionality 23 45 function naiba_coming_soon_page() { … … 25 47 26 48 // Set page title meta 27 $page_title = get_option('naiba_coming_soon_page_title', 'Coming Soon');49 $page_title = get_option('naiba_coming_soon_page_title', __('Coming Soon', 'naiba-coming-soon')); 28 50 29 51 // Set default page content 30 $default_page_content = 'We are working on something awesome. Stay tuned!';52 $default_page_content = __('We are working on something awesome. Stay tuned!', 'naiba-coming-soon'); 31 53 32 54 // Get user-defined page content … … 43 65 <head> 44 66 <title><?php echo esc_html($page_title); ?></title> 45 <link rel="stylesheet" type="text/css" href="<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'css/style.css' ); ?>">46 67 <meta name="robots" content="noindex, nofollow"> 47 68 <meta name="viewport" content="width=device-width, initial-scale=1"> 69 <?php 70 // Properly enqueue styles 71 naiba_coming_soon_enqueue_styles(); 72 wp_print_styles(); 73 ?> 48 74 </head> 49 75 <body> … … 69 95 if ( $screen->id === 'dashboard' ) { 70 96 $links = array( 71 'link1' => array('name' => '1、WordPress的基本概念和术语', 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-concept.html'),72 'link2' => array('name' => '2、WordPress的后台管理界面', 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-dashboard.html'),73 'link3' => array('name' => '3、选择主题', 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-theme.html'),74 'link4' => array('name' => '4、安装插件', 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-plugin.html'),75 'link5' => array('name' => '5、创建页面', 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-pages.html'),76 'link6' => array('name' => '6、创建产品', 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-products.html'),77 'link7' => array('name' => '7、创建文章', 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-posts.html'),78 'link8' => array('name' => '8、自定义菜单', 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-menu.html'),79 'link9' => array('name' => '9、SEO优化', 'url' => 'https://blog.naibabiji.com/google-seo'),80 'link10' => array('name' => '10、速度优化', 'url' => 'https://blog.naibabiji.com/skill/speed-up-wordpress.html'),81 'link11' => array('name' => '👉建站资源导航', 'url' => 'https://blog.naibabiji.com/nav'),97 'link1' => array('name' => __('1、WordPress的基本概念和术语', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-concept.html'), 98 'link2' => array('name' => __('2、WordPress的后台管理界面', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-dashboard.html'), 99 'link3' => array('name' => __('3、选择主题', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-theme.html'), 100 'link4' => array('name' => __('4、安装插件', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-plugin.html'), 101 'link5' => array('name' => __('5、创建页面', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-pages.html'), 102 'link6' => array('name' => __('6、创建产品', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-products.html'), 103 'link7' => array('name' => __('7、创建文章', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-posts.html'), 104 'link8' => array('name' => __('8、自定义菜单', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/tutorial/wordpress-menu.html'), 105 'link9' => array('name' => __('9、SEO优化', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/google-seo'), 106 'link10' => array('name' => __('10、速度优化', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/skill/speed-up-wordpress.html'), 107 'link11' => array('name' => __('👉建站资源导航', 'naiba-coming-soon'), 'url' => 'https://blog.naibabiji.com/nav'), 82 108 ); 83 109 ?> 84 <link rel="stylesheet" type="text/css" href="<?php echo esc_url( plugin_dir_url( __FILE__ ) . 'css/style.css' ); ?>">85 110 <div class="notice notice-info is-dismissible naiba-notice"> 86 111 <h2><?php esc_html_e('新手WordPress建站指引', 'naiba-coming-soon'); ?></h2> … … 101 126 // Add plugin settings page 102 127 function naiba_coming_soon_settings_page() { 103 add_options_page( 'Naiba Coming Soon Settings', 'Naiba Coming Soon', 'manage_options', 'naiba_coming_soon_settings', 'naiba_coming_soon_settings_page_html');128 add_options_page(__('Naiba Coming Soon Settings', 'naiba-coming-soon'), __('Naiba Coming Soon', 'naiba-coming-soon'), 'manage_options', 'naiba_coming_soon_settings', 'naiba_coming_soon_settings_page_html'); 104 129 } 105 130 add_action('admin_menu', 'naiba_coming_soon_settings_page'); 106 131 107 132 function naiba_coming_soon_settings_link( $links ) { 108 $settings_link = '<a href="admin.php?page=naiba_coming_soon_settings"> 插件设置</a>';133 $settings_link = '<a href="admin.php?page=naiba_coming_soon_settings">' . __('Settings', 'naiba-coming-soon') . '</a>'; 109 134 array_push( $links, $settings_link ); 110 135 return $links; … … 116 141 // Display plugin settings page 117 142 function naiba_coming_soon_settings_page_html() { 118 // Check if user has appropriate permissions 119 if (!current_user_can('manage_options')) { 120 return; 121 } 122 // Get options 123 $page_title = get_option('naiba_coming_soon_page_title', 'Coming Soon'); 124 $page_content = get_option('naiba_coming_soon_page_content', ''); 125 126 // Save options on form submit 127 if (isset($_POST['naiba_coming_soon_submit'])) { 128 $page_title = sanitize_text_field($_POST['naiba_coming_soon_page_title']); 129 $page_content = wp_kses_post($_POST['naiba_coming_soon_page_content']); 130 131 update_option('naiba_coming_soon_page_title', $page_title); 132 update_option('naiba_coming_soon_page_content', $page_content); 133 134 ?> 135 <div id="message" class="updated notice is-dismissible"><p><?php esc_html_e('Settings saved.', 'naiba-coming-soon'); ?></p></div> 136 <?php 137 } 143 // Check if user has appropriate permissions 144 if (!current_user_can('manage_options')) { 145 return; 146 } 147 148 // Get options 149 $page_title = get_option('naiba_coming_soon_page_title', __('Coming Soon', 'naiba-coming-soon')); 150 $page_content = get_option('naiba_coming_soon_page_content', ''); 151 152 // Save options on form submit 153 if (isset($_POST['naiba_coming_soon_submit'])) { 154 // Verify nonce for security 155 if (!isset($_POST['naiba_coming_soon_nonce']) || !wp_verify_nonce(sanitize_key(wp_unslash($_POST['naiba_coming_soon_nonce'])), 'naiba_coming_soon_save_settings')) { 156 ?> 157 <div id="message" class="error notice is-dismissible"><p><?php esc_html_e('Security check failed. Please try again.', 'naiba-coming-soon'); ?></p></div> 158 <?php 159 } else { 160 // Validate and sanitize inputs 161 $page_title = isset($_POST['naiba_coming_soon_page_title']) ? sanitize_text_field(wp_unslash($_POST['naiba_coming_soon_page_title'])) : ''; 162 $page_content = isset($_POST['naiba_coming_soon_page_content']) ? wp_kses_post(wp_unslash($_POST['naiba_coming_soon_page_content'])) : ''; 163 164 // Save options 165 update_option('naiba_coming_soon_page_title', $page_title); 166 update_option('naiba_coming_soon_page_content', $page_content); 167 168 ?> 169 <div id="message" class="updated notice is-dismissible"><p><?php esc_html_e('Settings saved.', 'naiba-coming-soon'); ?></p></div> 170 <?php 171 } 172 } 138 173 ?> 139 174 … … 141 176 <h1><?php esc_html_e('Naiba Coming Soon Settings', 'naiba-coming-soon'); ?></h1> 142 177 <form method="post" action=""> 178 <?php wp_nonce_field('naiba_coming_soon_save_settings', 'naiba_coming_soon_nonce'); ?> 143 179 <table class="form-table"> 144 180 <tr> -
naiba-coming-soon/trunk/readme.txt
r2902178 r3352404 1 1 === Naiba Coming Soon === 2 Contributors: 奶爸建站笔记2 Contributors: naibabiji 3 3 Tags: coming soon, maintenance, under construction 4 4 Requires at least: 5.9 5 Tested up to: 6. 26 Stable tag: 1. 05 Tested up to: 6.8 6 Stable tag: 1.1 7 7 Requires PHP: 5.6 8 8 License: GPLv2 or later … … 21 21 * Designed to work with any theme 22 22 * Secure and follows WordPress coding standards 23 * Multilingual support (English and Chinese) 24 * Automatically adds search engine blocking instructions to prevent indexing of unfinished websites, protecting your future SEO performance 23 25 24 26 == Installation == … … 41 43 == Changelog == 42 44 45 = 1.1 = 46 * Added documentation about search engine blocking feature. 47 * Updated translations and improved multilingual support. 48 43 49 = 1.0 = 44 50 * Initial release. … … 46 52 == Upgrade Notice == 47 53 54 = 1.1 = 55 * Documentation improvements and translation updates. 56 48 57 = 1.0 = 49 58 * Initial release. No upgrade notice.
Note: See TracChangeset
for help on using the changeset viewer.