Changeset 3439751
- Timestamp:
- 01/14/2026 05:48:59 PM (3 months ago)
- Location:
- site-under-construction
- Files:
-
- 38 added
- 4 edited
- 1 copied
-
assets/banner-1544x500.png (added)
-
assets/banner-772x250.png (added)
-
assets/icon-128x128.png (added)
-
assets/icon-256x256.png (added)
-
tags/1.0.1 (copied) (copied from site-under-construction/trunk)
-
tags/1.0.1/assets (added)
-
tags/1.0.1/assets/images (added)
-
tags/1.0.1/assets/images/exclusive-hotel.webp (added)
-
tags/1.0.1/assets/images/modern-productivity-women.webp (added)
-
tags/1.0.1/assets/images/modern-productivity.webp (added)
-
tags/1.0.1/assets/images/simple-elegant.webp (added)
-
tags/1.0.1/includes (added)
-
tags/1.0.1/includes/class-autoloader.php (added)
-
tags/1.0.1/includes/class-constant.php (added)
-
tags/1.0.1/includes/class-plugin.php (added)
-
tags/1.0.1/includes/helpers.php (added)
-
tags/1.0.1/readme.txt (modified) (3 diffs)
-
tags/1.0.1/site-under-construction.php (modified) (2 diffs)
-
tags/1.0.1/templates (added)
-
tags/1.0.1/templates/themes (added)
-
tags/1.0.1/templates/themes/exclusive-hotel.php (added)
-
tags/1.0.1/templates/themes/modern-productivity-women.php (added)
-
tags/1.0.1/templates/themes/modern-productivity.php (added)
-
tags/1.0.1/templates/themes/simple-elegant.php (added)
-
trunk/assets (added)
-
trunk/assets/images (added)
-
trunk/assets/images/exclusive-hotel.webp (added)
-
trunk/assets/images/modern-productivity-women.webp (added)
-
trunk/assets/images/modern-productivity.webp (added)
-
trunk/assets/images/simple-elegant.webp (added)
-
trunk/includes (added)
-
trunk/includes/class-autoloader.php (added)
-
trunk/includes/class-constant.php (added)
-
trunk/includes/class-plugin.php (added)
-
trunk/includes/helpers.php (added)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/site-under-construction.php (modified) (2 diffs)
-
trunk/templates (added)
-
trunk/templates/themes (added)
-
trunk/templates/themes/exclusive-hotel.php (added)
-
trunk/templates/themes/modern-productivity-women.php (added)
-
trunk/templates/themes/modern-productivity.php (added)
-
trunk/templates/themes/simple-elegant.php (added)
Legend:
- Unmodified
- Added
- Removed
-
site-under-construction/tags/1.0.1/readme.txt
r3220380 r3439751 1 1 === Site Under Construction === 2 2 Contributors: bdplugins 3 Tags: coming soon , maintenance mode, under construction4 Requires at least: 5.05 Tested up to: 6. 76 Requires PHP: 7.47 Stable tag: 1.0. 03 Tags: coming soon page, under construction mode, under construction, under construction page, coming soon mode 4 Requires at least: 6.2 5 Tested up to: 6.9 6 Requires PHP: 8.0 7 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 18 18 - Enable or disable the "Site Under Construction" mode with a checkbox. 19 19 - Customize the message displayed to visitors. 20 - Seamlessly integrates with the WordPress General Settings page. 20 - Seamlessly integrates with the WordPress tools page. 21 - Change 4 modern coming soon template. 21 22 22 23 == Installation == … … 38 39 39 40 == Changelog == 41 = 1.0.1= 42 * Added: Four new Coming Soon templates. 43 * Added: Options to customize the Coming Soon description text. 44 * Improved: Code optimization for better performance and maintainability. 40 45 41 = 1.0.0 ( 11/01/2025 )=46 = 1.0.0 = 42 47 * Initial release with the ability to enable/disable the mode and customize the message. 43 48 44 == Upgrade Notice ==45 46 = 1.0.0 =47 Initial release. Upgrade smoothly to activate maintenance mode for your site.48 -
site-under-construction/tags/1.0.1/site-under-construction.php
r3220380 r3439751 1 1 <?php 2 3 namespace BDPlugins\SUC; 4 2 5 /* 3 6 * Plugin Name: Site Under Construction 4 7 * Description: A simple plugin to display a "Site Under Construction" page to visitors while administrators can view the site. 5 * Version: 1.0.0 8 * Version: 1.0.1 9 * Requires PHP: 8.0 10 * Requires at least: 6.2 6 11 * Author: bdplugins 7 12 * License: GPL v2 or later … … 11 16 12 17 // Exit if accessed directly 13 if (!defined('ABSPATH')) { 14 exit; 15 } 18 defined('ABSPATH') || exit; 16 19 17 // Hook to display the Coming Soon message 18 add_action('template_redirect', 'bdpsuc_coming_soon_mode'); 20 define('BDPSUC_FILE', __FILE__); 21 define('BDPSUC_PATH', plugin_dir_path(__FILE__)); 22 define('BDPSUC_URL', plugin_dir_url(__FILE__)); 19 23 20 function bdpsuc_coming_soon_mode() 21 { 22 // Check if the coming soon mode is enabled 23 if (!get_option('bdpsuc_coming_soon_enabled', false)) { 24 return; // Coming soon mode is off 25 } 24 require_once BDPSUC_PATH . 'includes/class-constant.php'; 25 require_once Constant::get_plugin_dir('includes/helpers.php'); 26 require_once Constant::get_plugin_dir('includes/class-autoloader.php'); 26 27 27 // Check if the user is logged in and has the administrator role 28 if (current_user_can('manage_options')) { 29 return; // Allow administrators to see the site 30 } 28 Autoloader::register(); 31 29 32 // Get the custom message from the settings 33 $coming_soon_message = get_option('bdpsuc_coming_soon_message', __('Our website is under construction. Please check back soon!','site-under-construction')); 34 35 // Display the Coming Soon message 36 wp_die( 37 '<h1>' . esc_html__('Site Under Construction', 'site-under-construction') . '</h1><p>' . esc_html($coming_soon_message) . '</p>', 38 esc_html__('Site Under Construction', 'site-under-construction'), 39 ['response' => 503] 40 ); 41 } 42 43 // Add settings to the General Settings page 44 add_action('admin_init', 'bdpsuc_coming_soon_register_settings'); 45 46 function bdpsuc_coming_soon_register_settings() 47 { 48 register_setting('general', 'bdpsuc_coming_soon_message', [ 49 'type' => 'string', 50 'sanitize_callback' => 'sanitize_text_field', 51 'default' => __('Our website is under construction. Please check back soon!', 'site-under-construction'), 52 ]); 53 54 register_setting('general', 'bdpsuc_coming_soon_enabled', [ 55 'type' => 'boolean', 56 'sanitize_callback' => 'rest_sanitize_boolean', 57 'default' => false, 58 ]); 59 60 add_settings_field( 61 'bdpsuc_coming_soon_enabled', 62 'Enable Coming Soon Mode', 63 'bdpsuc_coming_soon_enabled_field_callback', 64 'general' 65 ); 66 67 add_settings_field( 68 'bdpsuc_coming_soon_message', 69 'Coming Soon Message', 70 'bdpsuc_coming_soon_message_field_callback', 71 'general' 72 ); 73 } 74 75 function bdpsuc_coming_soon_message_field_callback() 76 { 77 $value = get_option('bdpsuc_coming_soon_message', 'Our website is under construction. Please check back soon!'); 78 echo '<input type="text" id="bdpsuc_coming_soon_message" name="bdpsuc_coming_soon_message" value="' . esc_attr($value) . '" class="regular-text" />'; 79 echo '<p class="description">Enter the message to display on the Coming Soon page.</p>'; 80 } 81 82 function bdpsuc_coming_soon_enabled_field_callback() 83 { 84 $checked = get_option('bdpsuc_coming_soon_enabled', false) ? 'checked' : ''; 85 echo '<input type="checkbox" id="bdpsuc_coming_soon_enabled" name="bdpsuc_coming_soon_enabled" value="1" ' . esc_attr($checked ) . ' />'; 86 echo '<p class="description">Check to enable the Coming Soon mode.</p>'; 87 } 88 30 new Plugin(); -
site-under-construction/trunk/readme.txt
r3220380 r3439751 1 1 === Site Under Construction === 2 2 Contributors: bdplugins 3 Tags: coming soon , maintenance mode, under construction4 Requires at least: 5.05 Tested up to: 6. 76 Requires PHP: 7.47 Stable tag: 1.0. 03 Tags: coming soon page, under construction mode, under construction, under construction page, coming soon mode 4 Requires at least: 6.2 5 Tested up to: 6.9 6 Requires PHP: 8.0 7 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 18 18 - Enable or disable the "Site Under Construction" mode with a checkbox. 19 19 - Customize the message displayed to visitors. 20 - Seamlessly integrates with the WordPress General Settings page. 20 - Seamlessly integrates with the WordPress tools page. 21 - Change 4 modern coming soon template. 21 22 22 23 == Installation == … … 38 39 39 40 == Changelog == 41 = 1.0.1= 42 * Added: Four new Coming Soon templates. 43 * Added: Options to customize the Coming Soon description text. 44 * Improved: Code optimization for better performance and maintainability. 40 45 41 = 1.0.0 ( 11/01/2025 )=46 = 1.0.0 = 42 47 * Initial release with the ability to enable/disable the mode and customize the message. 43 48 44 == Upgrade Notice ==45 46 = 1.0.0 =47 Initial release. Upgrade smoothly to activate maintenance mode for your site.48 -
site-under-construction/trunk/site-under-construction.php
r3220380 r3439751 1 1 <?php 2 3 namespace BDPlugins\SUC; 4 2 5 /* 3 6 * Plugin Name: Site Under Construction 4 7 * Description: A simple plugin to display a "Site Under Construction" page to visitors while administrators can view the site. 5 * Version: 1.0.0 8 * Version: 1.0.1 9 * Requires PHP: 8.0 10 * Requires at least: 6.2 6 11 * Author: bdplugins 7 12 * License: GPL v2 or later … … 11 16 12 17 // Exit if accessed directly 13 if (!defined('ABSPATH')) { 14 exit; 15 } 18 defined('ABSPATH') || exit; 16 19 17 // Hook to display the Coming Soon message 18 add_action('template_redirect', 'bdpsuc_coming_soon_mode'); 20 define('BDPSUC_FILE', __FILE__); 21 define('BDPSUC_PATH', plugin_dir_path(__FILE__)); 22 define('BDPSUC_URL', plugin_dir_url(__FILE__)); 19 23 20 function bdpsuc_coming_soon_mode() 21 { 22 // Check if the coming soon mode is enabled 23 if (!get_option('bdpsuc_coming_soon_enabled', false)) { 24 return; // Coming soon mode is off 25 } 24 require_once BDPSUC_PATH . 'includes/class-constant.php'; 25 require_once Constant::get_plugin_dir('includes/helpers.php'); 26 require_once Constant::get_plugin_dir('includes/class-autoloader.php'); 26 27 27 // Check if the user is logged in and has the administrator role 28 if (current_user_can('manage_options')) { 29 return; // Allow administrators to see the site 30 } 28 Autoloader::register(); 31 29 32 // Get the custom message from the settings 33 $coming_soon_message = get_option('bdpsuc_coming_soon_message', __('Our website is under construction. Please check back soon!','site-under-construction')); 34 35 // Display the Coming Soon message 36 wp_die( 37 '<h1>' . esc_html__('Site Under Construction', 'site-under-construction') . '</h1><p>' . esc_html($coming_soon_message) . '</p>', 38 esc_html__('Site Under Construction', 'site-under-construction'), 39 ['response' => 503] 40 ); 41 } 42 43 // Add settings to the General Settings page 44 add_action('admin_init', 'bdpsuc_coming_soon_register_settings'); 45 46 function bdpsuc_coming_soon_register_settings() 47 { 48 register_setting('general', 'bdpsuc_coming_soon_message', [ 49 'type' => 'string', 50 'sanitize_callback' => 'sanitize_text_field', 51 'default' => __('Our website is under construction. Please check back soon!', 'site-under-construction'), 52 ]); 53 54 register_setting('general', 'bdpsuc_coming_soon_enabled', [ 55 'type' => 'boolean', 56 'sanitize_callback' => 'rest_sanitize_boolean', 57 'default' => false, 58 ]); 59 60 add_settings_field( 61 'bdpsuc_coming_soon_enabled', 62 'Enable Coming Soon Mode', 63 'bdpsuc_coming_soon_enabled_field_callback', 64 'general' 65 ); 66 67 add_settings_field( 68 'bdpsuc_coming_soon_message', 69 'Coming Soon Message', 70 'bdpsuc_coming_soon_message_field_callback', 71 'general' 72 ); 73 } 74 75 function bdpsuc_coming_soon_message_field_callback() 76 { 77 $value = get_option('bdpsuc_coming_soon_message', 'Our website is under construction. Please check back soon!'); 78 echo '<input type="text" id="bdpsuc_coming_soon_message" name="bdpsuc_coming_soon_message" value="' . esc_attr($value) . '" class="regular-text" />'; 79 echo '<p class="description">Enter the message to display on the Coming Soon page.</p>'; 80 } 81 82 function bdpsuc_coming_soon_enabled_field_callback() 83 { 84 $checked = get_option('bdpsuc_coming_soon_enabled', false) ? 'checked' : ''; 85 echo '<input type="checkbox" id="bdpsuc_coming_soon_enabled" name="bdpsuc_coming_soon_enabled" value="1" ' . esc_attr($checked ) . ' />'; 86 echo '<p class="description">Check to enable the Coming Soon mode.</p>'; 87 } 88 30 new Plugin();
Note: See TracChangeset
for help on using the changeset viewer.