' . __('Settings','agg-advanced-settings') . '', ); return array_merge( $mylink, $links ); } // Prevent cloning public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'agg-advanced-settings' ) ); } // Prevent unserializing instances of this class public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'agg-advanced-settings' ) ); } // Ensure that only one instance of this class is loaded and can be loaded public static function instance() { if( is_null( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } // Show admin notices public function admin_notice() { global $current_screen; if ( $current_screen->parent_base == 'options-general' ) { echo '
' . __("Missing options? Please send suggestions to",'agg-advanced-settings') . ' ' . __("Plugin Author",'agg-advanced-settings') . '.
' . __('Welcome to Aggregator Advanced Settings. Need help? Contact the developer','agg-advanced-settings') . ' ' . __('here','agg-advanced-settings') . '.
'; } // Hide "Powered by WordPress" public function register_plugin_styles() { wp_register_style( 'agg-advanced-settings', plugins_url( 'aggregator-advanced-settings/agg-advanced-settings.css' ) ); wp_enqueue_style( 'agg-advanced-settings' ); } // Hide "Thank you for creating with WordPress" public function remove_footer_admin() { echo ''; } // Remove WordPress version number public function remove_version() { return ''; } // Redirect non-admin users public function no_admin_init() { // Is this the admin interface if ( // Look for the presence of /wp-admin/ in the url stripos($_SERVER['REQUEST_URI'],'/wp-admin') !== false && // Allow calls to async-upload.php stripos($_SERVER['REQUEST_URI'],'async-upload.php') == false && // Allow calls to admin-ajax.php stripos($_SERVER['REQUEST_URI'],'admin-ajax.php') == false ) { // Does the current user fail the required capability level if (!current_user_can('activate_plugins')) { // Send a temporary redirect wp_redirect(get_option('home'),302); } } } // Hide admin bar public function remove_admin_bar() { if (!current_user_can('administrator') && !is_admin()) { show_admin_bar(false); } } // Show all settings public function show_all_settings() { if (current_user_can('manage_options')) { global $submenu; $permalink = get_site_url() . '/wp-admin/options.php'; $submenu['options-general.php'][] = array( __("All Settings", 'agg-advanced-settings' ), 'manage_options', $permalink); } } // Disable search feature public function filter_query( $query, $error = true ) { if ( is_search() ) { $query->is_search = false; $query->query_vars['s'] = false; $query->query['s'] = false; // to error if ( $error == true ) $query->is_404 = true; } } // Disable search form public function filter_search() { return null; } // Disable search widget public function remove_search_widget() { unregister_widget('WP_Widget_Search'); } // Disable RSS feeds public function disable_feed() { wp_redirect( home_url() ); } // Custom login errors message public function custom_login_errors() { return get_option('agg_custom_errors_message'); } // Set login style public function set_login_stylesheet() { wp_enqueue_style( 'custom-login', wp_get_theme(get_option( 'agg_set_login_style' ))->get_theme_root_uri() . '/' . wp_get_theme(get_option( 'agg_set_login_style' ))->get_stylesheet() . '/style.css' ); } // Show custom logo in login public function custom_login_logo() { if ( has_custom_logo() ) { $image = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' ); ?> 255 || stripos($request_uri, 'eval(') || stripos($request_uri, 'CONCAT') || stripos($request_uri, 'UNION+SELECT') || stripos($request_uri, '(null)') || stripos($request_uri, 'base64_') || stripos($request_uri, '/localhost') || stripos($request_uri, '/pingserver') || stripos($request_uri, '/config.') || stripos($request_uri, '/wwwroot') || stripos($request_uri, '/makefile') || stripos($request_uri, 'crossdomain.') || stripos($request_uri, 'proc/self/environ') || stripos($request_uri, 'etc/passwd') || stripos($request_uri, '/https/') || stripos($request_uri, '/http/') || stripos($request_uri, '/ftp/') || stripos($request_uri, '/cgi/') || stripos($request_uri, '.cgi') || stripos($request_uri, '.exe') || stripos($request_uri, '.sql') || stripos($request_uri, '.ini') || stripos($request_uri, '.dll') || stripos($request_uri, '.asp') || stripos($request_uri, '.jsp') || stripos($request_uri, '/.bash') || stripos($request_uri, '/.git') || stripos($request_uri, '/.svn') || stripos($request_uri, '/.tar') || stripos($request_uri, ' ') || stripos($request_uri, '<') || stripos($request_uri, '>') || stripos($request_uri, '/=') || stripos($request_uri, '...') || stripos($request_uri, '+++') || stripos($request_uri, '://') || stripos($request_uri, '/&&') || // user agents stripos($user_agent, 'binlar') || stripos($user_agent, 'casper') || stripos($user_agent, 'cmswor') || stripos($user_agent, 'diavol') || stripos($user_agent, 'dotbot') || stripos($user_agent, 'finder') || stripos($user_agent, 'flicky') || stripos($user_agent, 'libwww') || stripos($user_agent, 'nutch') || stripos($user_agent, 'planet') || stripos($user_agent, 'purebot') || stripos($user_agent, 'pycurl') || stripos($user_agent, 'skygrid') || stripos($user_agent, 'sucker') || stripos($user_agent, 'turnit') || stripos($user_agent, 'vikspi') || stripos($user_agent, 'zmeu') || // query strings stripos($query_string, '?') || stripos($query_string, ':') || stripos($query_string, '[') || stripos($query_string, ']') || stripos($query_string, '../') || stripos($query_string, '127.0.0.1') || stripos($query_string, 'loopback') || stripos($query_string, '%0A') || stripos($query_string, '%0D') || stripos($query_string, '%22') || stripos($query_string, '%27') || stripos($query_string, '%3C') || stripos($query_string, '%3E') || stripos($query_string, '%00') || stripos($query_string, '%2e%2e') || stripos($query_string, 'union') || stripos($query_string, 'input_file') || stripos($query_string, 'execute') || stripos($query_string, 'mosconfig') || stripos($query_string, 'environ') || // stripos($query_string, 'scanner') || stripos($query_string, 'path=.') || stripos($query_string, 'mod=.') ) { @header('HTTP/1.1 403 Forbidden'); @header('Status: 403 Forbidden'); @header('Connection: Close'); @exit; } } } } } // End function reject_malicious_requests // Set user nicename to nickname public function disable_file_editor() { define( 'DISALLOW_FILE_EDIT', true ); } } // End class Agg_Advanced_Settings Agg_Advanced_Settings::instance(); /* EOF */ ?>