Plugin Directory

Changeset 3439751


Ignore:
Timestamp:
01/14/2026 05:48:59 PM (3 months ago)
Author:
bdplugins
Message:

Release v1.0.1

Location:
site-under-construction
Files:
38 added
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • site-under-construction/tags/1.0.1/readme.txt

    r3220380 r3439751  
    11=== Site Under Construction ===
    22Contributors: bdplugins
    3 Tags: coming soon, maintenance mode, under construction
    4 Requires at least: 5.0
    5 Tested up to: 6.7
    6 Requires PHP: 7.4
    7 Stable tag: 1.0.0
     3Tags: coming soon page, under construction mode, under construction, under construction page, coming soon mode
     4Requires at least: 6.2
     5Tested up to: 6.9
     6Requires PHP: 8.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1818- Enable or disable the "Site Under Construction" mode with a checkbox.
    1919- 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.
    2122
    2223== Installation ==
     
    3839
    3940== 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.
    4045
    41 = 1.0.0 ( 11/01/2025 ) =
     46= 1.0.0 =
    4247* Initial release with the ability to enable/disable the mode and customize the message.
    4348
    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  
    11<?php
     2
     3namespace BDPlugins\SUC;
     4
    25/*
    36 * Plugin Name: Site Under Construction
    47 * 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
    611 * Author: bdplugins
    712 * License:           GPL v2 or later
     
    1116
    1217// Exit if accessed directly
    13 if (!defined('ABSPATH')) {
    14     exit;
    15 }
     18defined('ABSPATH') || exit;
    1619
    17 // Hook to display the Coming Soon message
    18 add_action('template_redirect', 'bdpsuc_coming_soon_mode');
     20define('BDPSUC_FILE', __FILE__);
     21define('BDPSUC_PATH', plugin_dir_path(__FILE__));
     22define('BDPSUC_URL', plugin_dir_url(__FILE__));
    1923
    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     }
     24require_once BDPSUC_PATH . 'includes/class-constant.php';
     25require_once Constant::get_plugin_dir('includes/helpers.php');
     26require_once Constant::get_plugin_dir('includes/class-autoloader.php');
    2627
    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     }
     28Autoloader::register();
    3129
    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 
     30new Plugin();
  • site-under-construction/trunk/readme.txt

    r3220380 r3439751  
    11=== Site Under Construction ===
    22Contributors: bdplugins
    3 Tags: coming soon, maintenance mode, under construction
    4 Requires at least: 5.0
    5 Tested up to: 6.7
    6 Requires PHP: 7.4
    7 Stable tag: 1.0.0
     3Tags: coming soon page, under construction mode, under construction, under construction page, coming soon mode
     4Requires at least: 6.2
     5Tested up to: 6.9
     6Requires PHP: 8.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1818- Enable or disable the "Site Under Construction" mode with a checkbox.
    1919- 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.
    2122
    2223== Installation ==
     
    3839
    3940== 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.
    4045
    41 = 1.0.0 ( 11/01/2025 ) =
     46= 1.0.0 =
    4247* Initial release with the ability to enable/disable the mode and customize the message.
    4348
    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  
    11<?php
     2
     3namespace BDPlugins\SUC;
     4
    25/*
    36 * Plugin Name: Site Under Construction
    47 * 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
    611 * Author: bdplugins
    712 * License:           GPL v2 or later
     
    1116
    1217// Exit if accessed directly
    13 if (!defined('ABSPATH')) {
    14     exit;
    15 }
     18defined('ABSPATH') || exit;
    1619
    17 // Hook to display the Coming Soon message
    18 add_action('template_redirect', 'bdpsuc_coming_soon_mode');
     20define('BDPSUC_FILE', __FILE__);
     21define('BDPSUC_PATH', plugin_dir_path(__FILE__));
     22define('BDPSUC_URL', plugin_dir_url(__FILE__));
    1923
    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     }
     24require_once BDPSUC_PATH . 'includes/class-constant.php';
     25require_once Constant::get_plugin_dir('includes/helpers.php');
     26require_once Constant::get_plugin_dir('includes/class-autoloader.php');
    2627
    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     }
     28Autoloader::register();
    3129
    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 
     30new Plugin();
Note: See TracChangeset for help on using the changeset viewer.