__construct(); } /** * PHP5 constructor method. * * @since 0.1.0 */ function __construct() { // Add our plugin settings screen. add_action( 'admin_menu', array( $this, 'add_settings_screen' ) ); // Add our assorted plugin settings. add_action( 'admin_init', array( $this, 'add_individual_settings' ) ); // Load up our admin scripts add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) ); } /** * Javascript for settings screen. * * @since 0.1.0 */ public function scripts() { wp_enqueue_script( 'all-site-search-admin', plugins_url( 'all-site-search/scripts/all-site-search-admin.js' ), array( 'jquery' ), '0.2' ); } /** * Run the HTTP request and return the status results. * * @since 0.1.0 */ public function http_request( $email_address, $password, $check ) { $http_query = http_build_query( array( 'co' => 'f', 'fd' => 'allss_wpreg', 'tf' => 'als_wpreg', 'gi2' => get_site_url(), 'gi5' => $password, 'gi1' => $email_address, //'test' => 1, )); $url_base = 'http://www.allsitesearch.com/msearch?'; $url_complete = $url_base . $http_query; // Check if this is a check and we have data if ( $check == '1' ) { if ( $email_address != '' ) { $return['status'] = 1; $return['message'] = 'OK'; } else { $return['status'] = 0; $return['message'] = 'Failure. Not registered'; } } // wp_remote_get with response else { $response = wp_remote_get( $url_complete ); $response_content = $response['body']; // Let's format our returned response. if ( $response_content == 'OK') { $return['status'] = 1; $return['message'] = $response_content; } else if ( $response_content == 'Failure. Site already exists as registered' ) { $return['status'] = 1; $return['message'] = 'OK'; } else { $return['status'] = 0; $return['message'] = $response_content; } } return $return; } /** * Request to AllSiteSearch.com conditional. * * @since 0.1.0 */ public function should_display_registration( $email_address, $password ) { $http_return = $this->http_request( $email_address, $password, '1' ); // If the return is successful, then we don't need to display registration fields. if ( $http_return['status'] == 1 ) { $return = false; } else { $return = true; } return $return; } /** * Add our settings screen. * * @since 0.1.0 */ public function add_settings_screen() { add_options_page( 'All Site Search Options', 'All Site Search', 'manage_options', 'all_site_search', array( $this, 'settings_screen_display' ) ); } /** * The settings screen markup and sections. * * @since 0.1.0 */ public function settings_screen_display() { ?>
All Site Search is a free off-site All-Content Search Technology. Installing it will provide your site visitors with the most extensive and very best search experience. Satisfied visitors are returning visitors.
Note: Before continuing here,
1. Goto Settings / Permalinks and click in "Post name" and then on "Save Changes".
2. Under Pages, do Add New and create a page named: Search Site, with settings: Parent = no parent, Template = default.
3. When you (below) will do "Search Results Page", then choose "Search Site".
To install All Site Search on your site, fill out the fields below and click on the Register button, then fill out the fields for the plugin itself and click on the Save Changes button.