Changeset 3271799
- Timestamp:
- 04/13/2025 12:44:52 PM (12 months ago)
- Location:
- search-engines-blocked-in-header
- Files:
-
- 10 added
- 3 edited
-
assets/Screenshot-1.png (modified) (previous)
-
assets/Screenshot-2.png (added)
-
tags/2.0.0 (added)
-
tags/2.0.0/css (added)
-
tags/2.0.0/css/sebih_custom.css (added)
-
tags/2.0.0/languages (added)
-
tags/2.0.0/readme.txt (added)
-
tags/2.0.0/search-engines-blocked-in-header.php (added)
-
trunk/css (added)
-
trunk/css/sebih_custom.css (added)
-
trunk/languages (added)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/search-engines-blocked-in-header.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
search-engines-blocked-in-header/trunk/readme.txt
r3183019 r3271799 1 2 1 === Search Engines Blocked in Header === 3 Contributors: lumiblog, divibanks 4 Donate Link: https:// wordpress.org/support/plugin/footnotes-made-easy/5 Tags: privacy, blocked, toolbar, seo, search engines blocked 6 Requires PHP: 7.0 7 Requires at least: 3.2 8 Tested up to: 6. 79 Stable tag: 1.1.010 License: GPLv2 or later 11 License URI: https://www.gnu.org/licenses/gpl-2.0.html 2 Contributors: lumiblog, divibanks 3 Donate Link: https://github.com/sponsors/divibanks 4 Tags: privacy, blocked, toolbar, seo, search engines blocked 5 Requires PHP: 7.0 6 Requires at least: 3.2 7 Tested up to: 6.8 8 Stable tag: 2.0.0 9 License: GPLv2 or later 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 12 11 13 12 Display the 'Search Engines Discouraged' notification in the WordPress Toolbar if the blog_public option has been checked. … … 20 19 21 20 * **Convenient Notification**: Keep track of your site's search engine visibility status directly in the WordPress Toolbar. 21 * **Visual Alert**: Red background styling ensures the message is highly visible and easy to notice. 22 22 * **Seamless Integration**: The plugin seamlessly integrates with WordPress, providing a hassle-free experience. 23 * **Custom CSS**: Styles are now separated into an external stylesheet for better organization and maintainability. 24 * **Versioned Assets**: Ensures proper cache busting and fresh styles are always loaded. 23 25 * **Easy Accessibility**: Instantly access the "Search Engines Discouraged" notification without navigating through multiple screens. 24 26 * **Translation Support**: Easily translates the notification message to your preferred language to match your site's language. … … 26 28 By simply activating this plugin, you'll have immediate access to vital information about whether search engines are discouraged from indexing your site. This is particularly useful for site administrators and super admins who need to monitor the visibility settings of their WordPress sites closely. 27 29 28 See the demo:29 30 [youtube https://www.youtube.com/watch?v=hT6qMvC5SnU]31 32 30 == Installation == 33 31 34 1. Upload `search-engines-blocked-in-header` directory to the `/wp-content/plugins/` directory 35 2. Activate the plugin through the 'Plugins' menu in WordPress 32 1. Upload `search-engines-blocked-in-header` directory to the `/wp-content/plugins/` directory 33 2. Activate the plugin through the 'Plugins' menu in WordPress 36 34 3. We're all done. 37 35 … … 48 46 == Screenshots == 49 47 50 1. Notification is shown on the admin bar 48 1. **Go to Settings > Reading** to `Discourage search engines from indexing this site` 49 2. Notification is shown on the admin bar 50 51 51 52 52 == Changelog == 53 54 = 2.0.0 = 55 * Added: Red background color for better visibility of the admin bar notification 56 * Added: External stylesheet (sebih_custom.css) for cleaner code and maintainability 57 * Added: Versioned asset loading to solve browser cache issues 58 * Updated: Plugin tested and confirmed to be compatible with PHP 8.4 59 * Updated: Plugin tested and confirmed to be compatible with WordPress 6.8 53 60 54 61 = 1.1.0 = … … 58 65 == Upgrade Notice == 59 66 60 = 1.1.0 = 61 * Updated readme file 62 * Updated compatibility with WordPress 6.7 67 = 2.0.0 = 68 * Added red styling and visual improvements 69 * Refactored CSS into external file for better maintenance 70 * Confirmed compatibility with PHP 8.4 and WordPress 6.8 -
search-engines-blocked-in-header/trunk/search-engines-blocked-in-header.php
r3183019 r3271799 1 1 <?php 2 2 /* 3 Plugin Name: Search Engines Blocked in Header 4 Plugin URI: https://github.com/divibanks/search-engines-blocked-in-header 5 Description: Display the 'Search Engines Discouraged' (or any translation) notification in the WordPress Toolbar if blog_public option has been checked. 6 Author: Patrick Lumumba 7 Version: 1.1.0 8 Author URI: https://lumumbas.blog 9 Text Domain: search-engines-blocked-in-header 10 Domain Path: /languages/ 3 * Plugin Name: Search Engines Blocked in Header 4 * Plugin URI: https://github.com/divibanks/search-engines-blocked-in-header 5 * Description: Display the 'Search Engines Discouraged' notification in the WordPress Toolbar if blog_public option is unchecked. 6 * Author: Patrick Lumumba 7 * Version: 2.0.0 8 * Author URI: https://lumumbas.blog 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 * Text Domain: search-engines-blocked-in-header 12 * 13 * @package search-engines-blocked-in-header 11 14 */ 12 15 … … 15 18 } 16 19 17 add_action( 'admin_bar_menu', 'nostromo_search_engines_blocked', 1000 ); 18 function nostromo_search_engines_blocked() { 19 global $wp_admin_bar, $wpdb; 20 /** 21 * Add notice to admin bar if search engines are discouraged 22 */ 23 add_action( 'admin_bar_menu', 'sebih_search_engines_blocked', 1000 ); 24 function sebih_search_engines_blocked() { 25 global $wp_admin_bar; 26 20 27 if ( ! is_super_admin() || ! is_admin_bar_showing() ) { 21 28 return; 22 29 } 23 $url = '/wp-admin/options-reading.php'; 30 24 31 if ( ! get_option( 'blog_public' ) ) { 25 $wp_admin_bar->add_menu( array( 'id' => 'search_engines_blocked', 26 'title' => __( 'Search Engines Discouraged', 'search-engines-blocked-in-header' ), 27 'href' => $url 32 $wp_admin_bar->add_menu( array( 33 'id' => 'search_engines_blocked', 34 'title' => __( 'Search Engines Discouraged', 'search-engines-blocked-in-header' ), 35 'href' => admin_url( 'options-reading.php' ), 36 'meta' => array( 37 'class' => 'sebih-toolbar-alert' 38 ) 28 39 ) ); 29 40 } 30 41 } 31 42 32 /* Load Text Domain */ 43 /** 44 * Load plugin text domain 45 */ 33 46 add_action( 'plugins_loaded', 'sebih_load_textdomain' ); 34 47 function sebih_load_textdomain() { 35 48 load_plugin_textdomain( 'search-engines-blocked-in-header', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 36 49 } 37 ?> 50 51 /** 52 * Enqueue custom CSS 53 */ 54 add_action( 'admin_enqueue_scripts', 'sebih_enqueue_assets' ); 55 function sebih_enqueue_assets() { 56 if ( ! get_option( 'blog_public' ) && is_admin_bar_showing() ) { 57 wp_enqueue_style( 58 'sebih-custom-css', 59 plugin_dir_url( __FILE__ ) . 'css/sebih_custom.css', 60 array(), 61 '1.0.0' // Version added to avoid caching issues 62 ); 63 } 64 }
Note: See TracChangeset
for help on using the changeset viewer.