Changeset 3304572
- Timestamp:
- 06/02/2025 03:02:00 AM (10 months ago)
- Location:
- aacomingsoon
- Files:
-
- 3 added
- 2 edited
-
tags/1.0.1 (added)
-
tags/1.0.1/aacomingsoon.php (added)
-
tags/1.0.1/readme.txt (added)
-
trunk/aacomingsoon.php (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
aacomingsoon/trunk/aacomingsoon.php
r1053485 r3304572 1 1 <?php 2 /** 3 * Plugin Name: AA Coming Soon 4 * Plugin URI: https://wordpress.org/plugins/aacomingsoon/ 5 * Description: It's a simple coming soon extension from AA Extension House . 6 * Version: 1.1 7 * Author: aaextention 8 * Author URI: http://webdesigncr3ator.com 9 * Support Email : contact2us.aa@gmail.com 10 * License: GPL2 11 **/ 2 /* 3 Plugin Name: AA Coming Soon 4 Plugin URI: https://wordpress.org/plugins/aacomingsoon/ 5 Description: It's a simple coming soon extension from AA Extension House . 6 Version: 1.0.1 7 Author: Syed Ashik Mahmud 8 Author URI: https://aaextensions.com 9 License: GPL2 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 Text Domain: aa-coming-soon 12 Domain Path: /languages 13 */ 12 14 15 if (!defined('ABSPATH')) exit; 13 16 14 // /Algorithm15 //create a option page with image upload option 16 // make a statement with is_home() 17 // display it and wp die() 17 // ===== Load Plugin Textdomain ===== 18 add_action('plugins_loaded', function() { 19 load_plugin_textdomain('aa-coming-soon', false, dirname(plugin_basename(__FILE__)) . '/languages'); 20 }); 18 21 19 // create custom plugin settings menu 20 add_action('admin_menu', 'baw_create_menu'); 21 22 function baw_create_menu() { 23 24 //create new top-level menu 25 add_menu_page('Coming soon', 'Coming Soon', 'administrator', __FILE__, 'baw_settings_page'); 26 27 //call register settings function 28 add_action( 'admin_init', 'register_mysettings' ); 22 // ===== Admin Panel ===== 23 add_action('admin_menu', 'aa_coming_soon_menu'); 24 function aa_coming_soon_menu() { 25 add_menu_page(__('Coming Soon Settings', 'aa-coming-soon'), __('Coming Soon', 'aa-coming-soon'), 'manage_options', 'aa-coming-soon', 'aa_coming_soon_settings_page', 'dashicons-clock', 90); 26 add_action('admin_init', 'aa_register_settings'); 29 27 } 30 28 31 32 function register_mysettings() { 33 //register our settings 34 register_setting( 'baw-settings-group', 'new_option_name' ); 35 register_setting( 'baw-settings-group', 'some_other_option' ); 36 register_setting( 'baw-settings-group', 'third_option' ); 37 //register_setting( 'baw-settings-group', 'option_etc' ); 29 function aa_register_settings() { 30 $options = [ 31 'aa_cs_enable', 'aa_cs_image', 'aa_cs_logo', 'aa_cs_opening_date', 32 'aa_cs_message', 'aa_cs_button_text', 'aa_cs_button_url', 33 'aa_cs_show_countdown', 'aa_cs_overlay_color', 'aa_cs_text_color', 34 'aa_cs_facebook', 'aa_cs_twitter', 'aa_cs_linkedin', 'aa_cs_instagram', 35 'aa_cs_youtube', 'aa_cs_github', 'aa_cs_display_for_loggedin', 36 'aa_cs_enable_custom_css', 'aa_cs_custom_css' 37 ]; 38 foreach ($options as $opt) { 39 register_setting('aa_coming_soon_group', $opt); 40 } 38 41 } 39 42 40 function baw_settings_page() { 41 ?> 42 <div class="wrap"> 43 <h2>Comming soon</h2> 43 function aa_coming_soon_settings_page() { 44 ?> 45 <div class="wrap"> 46 <h1><?php _e('AA Coming Soon Settings', 'aa-coming-soon'); ?></h1> 47 <form method="post" action="options.php"> 48 <?php settings_fields('aa_coming_soon_group'); ?> 49 <table class="form-table"> 50 <!-- Existing settings fields --> 51 <tr><th><?php _e('Enable Custom CSS', 'aa-coming-soon'); ?></th><td><input type="checkbox" name="aa_cs_enable_custom_css" value="1" <?php checked(1, get_option('aa_cs_enable_custom_css'), true); ?> /></td></tr> 52 <tr><th><?php _e('Custom CSS', 'aa-coming-soon'); ?></th><td><textarea name="aa_cs_custom_css" rows="8" class="large-text code"><?php echo esc_textarea(get_option('aa_cs_custom_css')); ?></textarea></td></tr> 53 </table> 54 <?php submit_button(); ?> 55 </form> 56 </div> 44 57 45 <form method="post" action="options.php"> 46 <?php settings_fields( 'baw-settings-group' ); ?> 47 <?php do_settings_sections( 'baw-settings-group' ); ?> 48 <table class="form-table"> 49 <tr valign="top"> 50 <th scope="row">Image Link</th> 51 <td><input type="text" name="new_option_name" value="<?php echo esc_attr( get_option('new_option_name') ); ?>" /></td> 52 </tr> 53 54 <tr valign="top"> 55 <th scope="row">Put the data when you will be open your site</th> 56 <td><input type="text" name="some_other_option" value="<?php echo esc_attr( get_option('some_other_option') ); ?>" /></td> 57 </tr> 58 <tr valign="top"> 59 <th scope="row">Isert 1 to enable the coming soon</th> 60 <td><input type="text" name="third_option" value="<?php echo esc_attr( get_option('third_option') ); ?>" /></td> 61 </tr> 62 63 64 </table> 65 66 <?php submit_button(); ?> 67 68 </form> 69 </div> 70 <?php } 71 72 add_action("wp_head","abc"); 73 74 function abc(){ 75 ///is home 76 if(!is_user_logged_in()){ 77 if( !is_admin() && esc_attr( get_option('third_option') ) == "1"){ 78 echo "<!--doctype html--><head><title>Offline</title></head><center style='background:#f1f1f1;'><h1>".get_bloginfo('blogname')."</h1>"; 79 //echo "<img src='".esc_attr( get_option('new_option_name') )."'/>"; 80 echo "<style>body{background:url(".esc_attr( get_option('new_option_name') ).")}</style>"; 81 echo "<br>".get_bloginfo('description')."<br>"; 82 echo "The site will be open at ".esc_attr( get_option('some_other_option') ); 83 echo "</center>"; 84 85 die(); 86 } 58 <script> 59 jQuery(document).ready(function($){ 60 $('.upload-btn').click(function(e){ 61 e.preventDefault(); 62 var target = $($(this).data('target')); 63 var image = wp.media({ title: '<?php _e('Upload Image', 'aa-coming-soon'); ?>', multiple: false }).open() 64 .on('select', function() { 65 var uploaded = image.state().get('selection').first(); 66 target.val(uploaded.toJSON().url); 67 }); 68 }); 69 }); 70 </script> 71 <?php 87 72 } 88 73 74 // ===== Frontend Coming Soon ===== 75 add_action('template_redirect', 'aa_show_coming_soon'); 76 function aa_show_coming_soon() { 77 $display_loggedin = get_option('aa_cs_display_for_loggedin') != 1; 78 if (($display_loggedin && is_user_logged_in()) || is_admin()) return; 79 if (get_option('aa_cs_enable') != 1) return; 80 81 $bg = esc_url(get_option('aa_cs_image')); 82 $logo = esc_url(get_option('aa_cs_logo')); 83 $text_color = esc_attr(get_option('aa_cs_text_color', '#ffffff')); 84 $overlay = esc_attr(get_option('aa_cs_overlay_color', '#000000')); 85 $msg = wp_kses_post(get_option('aa_cs_message')); 86 $btn_text = esc_html(get_option('aa_cs_button_text')); 87 $btn_url = esc_url(get_option('aa_cs_button_url')); 88 $date = esc_attr(get_option('aa_cs_opening_date')); 89 $countdown = get_option('aa_cs_show_countdown'); 90 $title = esc_html(get_bloginfo('name')); 91 $desc = esc_html(get_bloginfo('description')); 92 93 $facebook = esc_url(get_option('aa_cs_facebook')); 94 $twitter = esc_url(get_option('aa_cs_twitter')); 95 $linkedin = esc_url(get_option('aa_cs_linkedin')); 96 $instagram = esc_url(get_option('aa_cs_instagram')); 97 $youtube = esc_url(get_option('aa_cs_youtube')); 98 $github = esc_url(get_option('aa_cs_github')); 99 $enable_custom_css = get_option('aa_cs_enable_custom_css'); 100 $custom_css = get_option('aa_cs_custom_css'); 101 102 if ($enable_custom_css && !empty($custom_css)) { 103 echo '<style>' . wp_strip_all_tags($custom_css) . '</style>'; 104 } 105 106 wp_die(" 107 <!DOCTYPE html> 108 <html " . get_language_attributes() . "> 109 <head> 110 <meta charset='" . get_bloginfo("charset") . "'> 111 <meta name='viewport' content='width=device-width, initial-scale=1.0'> 112 <link href='https://cdn.lineicons.com/4.0/lineicons.css' rel='stylesheet'> 113 <style> 114 body { 115 margin: 0; 116 padding: 0; 117 background: url('$bg') no-repeat center center fixed; 118 background-size: cover; 119 color: $text_color; 120 font-family: sans-serif; 121 } 122 .overlay { 123 background: $overlay; 124 position: fixed; 125 top: 0; left: 0; 126 width: 100%; height: 100%; 127 display: flex; 128 align-items: center; 129 justify-content: center; 130 flex-direction: column; 131 text-align: center; 132 padding: 20px; 133 } 134 .overlay img.logo { 135 max-width: 200px; 136 margin-bottom: 20px; 137 } 138 .overlay h1 { 139 font-size: 2.5em; 140 margin: 0.2em 0; 141 } 142 .overlay p { 143 font-size: 1.2em; 144 margin-bottom: 1em; 145 } 146 .countdown, .button, .social { 147 margin-top: 1em; 148 } 149 .button a { 150 background: #fff; 151 color: #000; 152 padding: 10px 20px; 153 text-decoration: none; 154 border-radius: 5px; 155 } 156 .social a { 157 margin: 0 10px; 158 color: $text_color; 159 font-size: 1.5em; 160 } 161 @media (max-width: 768px) { 162 .overlay h1 { font-size: 2em; } 163 .overlay p, .button a, .social a { font-size: 1em; } 164 } 165 </style> 166 </head> 167 <body> 168 <div class='overlay'> 169 " . ($logo ? "<img class='logo' src='$logo' alt='Logo'>" : '') . " 170 <h1>$title</h1> 171 <p>$desc</p> 172 <p>$msg</p> 173 " . ($countdown && $date ? "<div class='countdown'><strong>" . __('Launching on:', 'aa-coming-soon') . "</strong> $date</div>" : '') . " 174 " . ($btn_text && $btn_url ? "<div class='button'><a href='$btn_url'>$btn_text</a></div>" : '') . " 175 <div class='social'> 176 " . ($facebook ? "<a href='$facebook' target='_blank'><i class='lni lni-facebook-filled'></i></a>" : '') . " 177 " . ($twitter ? "<a href='$twitter' target='_blank'><i class='lni lni-twitter-filled'></i></a>" : '') . " 178 " . ($linkedin ? "<a href='$linkedin' target='_blank'><i class='lni lni-linkedin-original'></i></a>" : '') . " 179 " . ($instagram ? "<a href='$instagram' target='_blank'><i class='lni lni-instagram'></i></a>" : '') . " 180 " . ($youtube ? "<a href='$youtube' target='_blank'><i class='lni lni-youtube'></i></a>" : '') . " 181 " . ($github ? "<a href='$github' target='_blank'><i class='lni lni-github-original'></i></a>" : '') . " 182 </div> 183 </div> 184 </body> 185 </html> 186 "); 89 187 } 188 ?> -
aacomingsoon/trunk/readme.txt
r1053485 r3304572 1 1 === AA Coming Soon === 2 Contributors: aaexten tion3 Donate link: https:// www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ashik685%40gmail%2ecom&lc=US&item_name=Donate%20AA%20Extension%20%21&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest4 Tags: aaextension,coming soon, welcome , maintenance5 Requires at least: 3.86 Tested up to: 4.07 Stable tag: 1. 12 Contributors: aaextensions 3 Donate link: https://aaextensions.com 4 Tags: coming soon, welcome , maintenance 5 Requires at least: 5.2 6 Tested up to: 6.8.1 7 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 License URI: http ://www.gnu.org/licenses/gpl-2.0.html9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 It's a simple coming soon extension by AA Extension. But it is still in development. 11 12 AA Coming Soon – Maintenance & Coming Soon Page by AA Extensions 12 13 13 14 == Description == 14 15 15 16 16 This plugin is created for making sure that, a coming soon page for your website. It is still in development phase. We try to make it most simple as we do same thing for our other plugins. 17 Coming Soon by AA Extensions – a simple, elegant maintenance page for your site. Lightweight, easy setup, perfect for pre-launch! 17 18 18 19 19 ### AA Coming Soon Plugin by http://webdesigncr3ator.com 20 = Features = 20 21 21 <br /> 22 <ol> 23 <li>Simple and lightweight Coming Soon extension for WordPress</li> 24 <li>Admin settings panel with easy configuration</li> 25 <li>Enable or disable Coming Soon mode</li> 26 <li>Upload custom background image</li> 27 <li>Upload custom logo image</li> 28 <li>Set a custom launch/opening date</li> 29 <li>Add a customizable message</li> 30 <li>Add a Call-To-Action (CTA) button with custom text and URL</li> 31 <li>Option to show or hide a countdown timer for the launch date</li> 32 <li>Customize overlay color and text color for the coming soon page</li> 33 <li>Display social media icons with links for Facebook, Twitter, LinkedIn, Instagram, YouTube, and GitHub</li> 34 <li>Option to show or hide coming soon page for logged-in users</li> 35 <li>Enable custom CSS for advanced styling</li> 36 <li>Custom CSS textarea for easy addition of styles</li> 37 <li>Responsive design optimized for mobile devices</li> 38 <li>Multilingual support via plugin text domain for translations</li> 39 </ol> 22 40 23 24 <strong>Plugin Features</strong><br /> 25 26 * Coming soon 41 = How to use it = 42 <ol> 43 <li><strong>Install and Activate the Plugin:</strong> 44 <ul> 45 <li>Go to your WordPress dashboard.</li> 46 <li>Navigate to <em>Plugins > Add New</em>.</li> 47 <li>Search for "AA Coming Soon" and install it.</li> 48 <li>Activate the plugin after installation.</li> 49 </ul> 50 </li> 51 <li><strong>Access the Plugin Settings:</strong> 52 <ul> 53 <li>In the WordPress dashboard, go to <em>Coming Soon</em> from the admin menu.</li> 54 </ul> 55 </li> 56 <li><strong>Enable Coming Soon Mode:</strong> 57 <ul> 58 <li>Check the option to enable the coming soon page.</li> 59 </ul> 60 </li> 61 <li><strong>Customize the Appearance:</strong> 62 <ul> 63 <li>Upload a background image for the coming soon page.</li> 64 <li>Upload a logo image to display on the page.</li> 65 <li>Set the overlay and text colors as desired.</li> 66 </ul> 67 </li> 68 <li><strong>Configure Content:</strong> 69 <ul> 70 <li>Enter a custom message to display to visitors.</li> 71 <li>Add a launch/opening date for the countdown timer.</li> 72 <li>Enable the countdown timer if you want it shown.</li> 73 <li>Add a button text and URL to create a call-to-action link.</li> 74 </ul> 75 </li> 76 <li><strong>Set Social Media Links:</strong> 77 <ul> 78 <li>Enter URLs for your Facebook, Twitter, LinkedIn, Instagram, YouTube, and GitHub profiles to show social icons.</li> 79 </ul> 80 </li> 81 <li><strong>Manage Visibility:</strong> 82 <ul> 83 <li>Choose whether logged-in users see the coming soon page or the regular site.</li> 84 </ul> 85 </li> 86 <li><strong>Add Custom CSS (Optional):</strong> 87 <ul> 88 <li>Enable the custom CSS option.</li> 89 <li>Enter your CSS code in the provided textarea to style the page further.</li> 90 </ul> 91 </li> 92 <li><strong>Save Settings:</strong> 93 <ul> 94 <li>Click the <em>Save Changes</em> button to apply your settings.</li> 95 </ul> 96 </li> 97 <li><strong>Visit Your Site:</strong> 98 <ul> 99 <li>Check your website in a new browser window or incognito mode to see the coming soon page live.</li> 100 </ul> 101 </li> 102 </ol> 27 103 28 104 … … 36 112 == Installation == 37 113 38 1. Install as regular WordPress plugin.<br /> 39 2. Go your plugin setting via WordPress Dashboard and find "<strong>AA Coming Soon</strong>" activate it.<br /> 114 <ol> 115 <li><strong>Download the Plugin:</strong> 116 <ul> 117 <li>Download the AA Coming Soon plugin ZIP file from the WordPress plugin repository or the plugin author’s website.</li> 118 </ul> 119 </li> 120 <li><strong>Log in to Your WordPress Admin Dashboard:</strong> 121 <ul> 122 <li>Go to <code>yourwebsite.com/wp-admin</code> and log in with your admin credentials.</li> 123 </ul> 124 </li> 125 <li><strong>Upload and Install the Plugin:</strong> 126 <ul> 127 <li>Navigate to <em>Plugins > Add New</em>.</li> 128 <li>Click the <em>Upload Plugin</em> button at the top.</li> 129 <li>Choose the downloaded ZIP file and click <em>Install Now</em>.</li> 130 </ul> 131 </li> 132 <li><strong>Activate the Plugin:</strong> 133 <ul> 134 <li>Once installation is complete, click <em>Activate Plugin</em>.</li> 135 </ul> 136 </li> 137 <li><strong>Verify Installation:</strong> 138 <ul> 139 <li>Look for the <em>Coming Soon</em> menu item in your WordPress admin sidebar to confirm successful installation.</li> 140 </ul> 141 </li> 142 </ol> 40 143 41 <br />42 144 43 145 … … 50 152 51 153 52 = 1.0 = 53 * 2/11/2014 Initial release. 154 = Version 1.0.1 = 155 <ul> 156 <li>Improved admin settings UI for better usability.</li> 157 <li>Fixed minor bugs related to media upload button.</li> 158 <li>Enhanced security by validating and sanitizing inputs.</li> 159 <li>Added option to enable custom CSS for advanced styling.</li> 160 <li>Updated social media icons with new LineIcons version.</li> 161 <li>Improved responsiveness of the coming soon page on mobile devices.</li> 162 </ul> 163 164 54 165
Note: See TracChangeset
for help on using the changeset viewer.