Plugin Directory

Changeset 2775870


Ignore:
Timestamp:
08/26/2022 02:44:11 AM (4 years ago)
Author:
keyspider
Message:

1.1.0
Search form shortcode added
Search page shortcode updated

Location:
keyspider-search/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • keyspider-search/trunk/README.txt

    r2619722 r2775870  
    44Tags: search, site search, search indexing, relevant search, search by category, autocomplete, suggest, typeahead, instant search, custom search
    55Requires at least: 3.9
    6 Tested up to: 5.8.1
    7 Stable tag: 1.0.0
     6Tested up to: 6.0.1
     7Stable tag: 1.1.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4040
    4141
     42== Note ==
     43
     44We use jsdelivr Open Source CDN(https://cdn.jsdelivr.net/gh/keyspidr/Enduser-CDN-JS-library/keyspider-search-js-lib.js)to load Keyspider javascript library.
     45
     46
    4247== Installation ==
    4348
    44491. Go to [keyspider.io](https://keyspider.io/?utm_channel=wp-plugin-readme&utm_source=wordpress-org) and sign up for an account.
    45 2. After logging in to Keyspider Search, get your API Key from the dashboard. [more details](https://docs.keyspider.io/docs/api-key/)
     502. After logging in to Keyspider Search, get your API Key from the dashboard. [more details]https://docs.keyspider.io/docs/api-key/
    46513. Install the Keyspider Search WordPress plugin from the WordPress dashboard.
    47524. Activate the plugin through the 'plugins' menu in WordPress.
     
    58634. Provide accurate search results by adding synonyms.
    5964
     65
    6066== Frequently Asked Questions ==
    6167
     
    6470= How can I create a Keyspider Search account?  =
    6571
    66 Sign up at [keyspider.io](https://keyspider.io) for a free trial
     72Sign up at https://keyspider.io for a free trial
    6773
    6874= How to use the Keyspider Search plugin? =
    6975
    70 Please read the [documentation](https://docs.keyspider.io/docs/integrate-keyspider-search-on-your-wordpress-website/) to know how to use the Keyspider Search plugin on your site.
     76Please read the documentation(https://docs.keyspider.io/docs/integrate-keyspider-search-on-your-wordpress-website/) to know how to use the Keyspider Search plugin on your site.
    7177
    7278= Can I add a search page in the WordPress menu? =
     
    8793= 1.0.0 =
    8894* Initial release
     95
     96= 1.1.0 =
     97* Search form shortcode added
     98* Search page shortcode updated
  • keyspider-search/trunk/admin/class-keyspider-search-admin-action.php

    r2619714 r2775870  
    5050        $organization_id = sanitize_text_field(trim($_POST['keyspider_organization_id']));
    5151        $api_key = sanitize_text_field(trim($_POST['keyspider_api_key']));
     52        $keyspider_search_page = sanitize_text_field(trim($_POST['keyspider_search_page']));
    5253       
    5354        update_option( 'keyspider_organization_id' , $organization_id );
    5455        update_option( 'keyspider_api_key' , $api_key );
     56        update_option( 'keyspider_search_page' , $keyspider_search_page );
     57
    5558
    5659        $redirectParams['success'] = true;
  • keyspider-search/trunk/admin/templates/authorize.php

    r2619714 r2775870  
    4343
    4444                            <tr>
     45                                <th scope="row"><label for="keyspider_search_page">Search Page Path/Slug</label></th>
     46                                <td><input class="regular-text" type="text" id="keyspider_search_page" name="keyspider_search_page" value="<?php echo esc_attr(get_option('keyspider_search_page')); ?>"  autocomplete="off" /></td>
     47                            </tr>
     48
     49                            <tr>
    4550                                <th scope="row"></th>
    4651                                <td><input type="submit" name="Submit" value="Submit" class="button-primary" /></td>
  • keyspider-search/trunk/includes/class-keyspider-search.php

    r2619714 r2775870  
    6565     * the public-facing side of the site.
    6666     *
    67      * @since    1.0.0
     67     * @since    1.1.0
    6868     */
    6969    public function __construct() {
     
    7171            $this->version = KEYSPIDER_SEARCH_VERSION;
    7272        } else {
    73             $this->version = '1.0.0';
     73            $this->version = '1.1.0';
    7474        }
    7575        $this->plugin_name = 'keyspider-search';
  • keyspider-search/trunk/keyspider-search.php

    r2619714 r2775870  
    22
    33/**
    4  * The plugin bootstrap file
    5  *
    6  * This file is read by WordPress to generate the plugin information in the plugin
    7  * admin area. This file also includes all of the dependencies used by the plugin,
    8  * registers the activation and deactivation functions, and defines a function
    9  * that starts the plugin.
    104 *
    115 * @link              Keyspider
    12  * @since             1.0.0
     6 * @since             1.1.0
    137 * @package           Keyspider_Search
    148 *
    15  * @wordpress-plugin
    169 * Plugin Name:       Keyspider Search
    1710 * Plugin URI:        https://docs.keyspider.io/docs/integrate-keyspider-search-on-your-wordpress-website/
    18  * Description:       This is a short description of what the plugin does. It's displayed in the WordPress admin area.
    19  * Version:           1.0.0
     11 * Description:       The Keyspider Site Search WordPress plugin is a refined, customizable, and more relevant search engine that replaces the default WordPress search.
     12 * Version:           1.1.0
    2013 * Author:            Keyspider
    2114 * Author URI:        Keyspider.io
     
    3326/**
    3427 * Currently plugin version.
    35  * Start at version 1.0.0 and use SemVer - https://semver.org
     28 * Start at version 1.1.0 and use SemVer - https://semver.org
    3629 * Rename this for your plugin and update it as you release new versions.
    3730 */
    38 define( 'KEYSPIDER_SEARCH_VERSION', '1.0.0' );
     31define( 'KEYSPIDER_SEARCH_VERSION', '1.1.0' );
    3932
    4033/**
  • keyspider-search/trunk/public/class-keyspider-search-public.php

    r2674699 r2775870  
    119119         */
    120120
    121         wp_register_script( 'keyspider-search-js', 'https://cdn.jsdelivr.net/gh/keyspidr/Enduser-CDN-JS-library/keyspider-search-js-lib.js', null, $this->version, false );
    122         wp_enqueue_script('keyspider-search-js');
     121        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/keyspider-search-public.js', array( 'jquery' ), $this->version, false );
    123122
    124123    }
     
    148147        $organizationId = get_option('keyspider_organization_id');
    149148        $apiKey = get_option('keyspider_api_key');
     149        $keyspider_search_page = site_url().get_option('keyspider_search_page');
     150       
    150151
    151152        /*Parsing in Keyspider JS library*/
     
    153154        wp_enqueue_script( 'keyspider-js-footer' );
    154155        wp_add_inline_script( 'keyspider-js-footer', 'window.addEventListener("load", function () {
    155         window.searchInit && window.searchInit("'. esc_js($apiKey) .'", "'. esc_js($organizationId) .'");
     156        window.searchInit && window.searchInit("'. esc_js($apiKey) .'", "'. esc_js($organizationId) .'", "'. esc_js($keyspider_search_page) .'","q");
     157        window.searchOnlyInit && window.searchOnlyInit("'. esc_js($apiKey) .'", "'. esc_js($organizationId) .'", "'. esc_js($keyspider_search_page) .'","q");
    156158        });');
    157159
    158      
    159160    }
    160161
     
    178179        // register shortcode
    179180        add_shortcode('keyspidersearch', 'keyspider_searchform');
     181
     182
     183        function keyspider_searchform_widget() {
     184         
     185        // form html tags, it will use by keyspider library script and override HTML form
     186        $search_form = '<div class="dashboard-search-only"></div>';
     187         
     188        return $search_form;
     189        }
     190        // register shortcode
     191        add_shortcode('keyspidersearchform', 'keyspider_searchform_widget');
     192
    180193    }
    181194
  • keyspider-search/trunk/public/js/keyspider-search-public.js

    r2674699 r2775870  
    1313     **/
    1414    $(function() {
    15         //code here
     15        var script = document.createElement('script');
     16        script.type = 'text/javascript';
     17        script.src = "https://cdn.jsdelivr.net/gh/keyspidr/Enduser-CDN-JS-library/keyspider-search-js-lib.js";
     18        document.head.appendChild(script);
    1619    });
    1720     
  • keyspider-search/trunk/public/partials/keyspider-search-page-template.php

    r2619714 r2775870  
    1515    protected $templates;
    1616
    17     /**
    18      * Returns an instance of this class.
    19      */
    20     /*public static function get_instance() {
    21 
    22         if ( null == self::$instance ) {
    23             self::$instance = new PageTemplater();
    24         }
    25 
    26         return self::$instance;
    27 
    28     } */
    2917
    3018    /**
     
    153141
    154142}
    155 //add_action( 'plugins_loaded', array( 'PageTemplater', 'get_instance' ) );
Note: See TracChangeset for help on using the changeset viewer.