Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== GPSE Search ===
=== ACLabs Search for Google Custom Search ===
Contributors: ACLabs
Tags: search, google, gcse, programmable search, cse
Requires at least: 6.4
Expand All @@ -8,24 +8,24 @@ Requires PHP: 8.2
License: AGPL v3 or later
License URI: https://www.gnu.org/licenses/agpl-3.0.html

Redirects WordPress searches to display Google Programmable Search Engine (GCSE) results.
Redirects WordPress searches to display Google Custom Search results.

## Features

- **Seamless Integration**: Works with the standard WordPress Search block or your theme's search form.
- **Search Results Page**: Redirects all searches to a dedicated page of your choice.
- **Configurable**: Easy settings to add your Search Engine ID (CX) and select the results page.
- **Google-Powered Results**: Display Google CSE results using the GPSE Search Results block or `[gpse_results]` shortcode.
- **Google-Powered Results**: Display Google Custom Search results using the Google Custom Search Results block or `[gpse_results]` shortcode.

## Installation & Setup

1. **Install the Plugin**: Upload the `gpse` folder to your `/wp-content/plugins/` directory and activate it.
2. **Create a Results Page**:
* Create a new Page in WordPress (e.g., "Search Results").
* Add the **GPSE Search Results** block (or the `[gpse_results]` shortcode) to the page content.
* Add the **Google Custom Search Results** block (or the `[gpse_results]` shortcode) to the page content.
* Publish the page.
3. **Configure**:
* Go to **Settings > GPSE**.
* Go to **Settings > ACLabs Search**.
* Enter your **Google Search Engine ID (CX)**. (Get this from [programmablesearchengine.google.com](https://programmablesearchengine.google.com/)).
* Select your "Search Results" page from the dropdown.
* Save Changes.
Expand All @@ -37,4 +37,4 @@ Redirects WordPress searches to display Google Programmable Search Engine (GCSE)

* **Search Box**: Use the standard WordPress Search block or your theme's search form to allow users to search your site.
* **Redirection**: When a user searches (e.g., `/?s=myquery`), they are automatically redirected to your custom Results Page (e.g., `/search-results/?q=myquery`).
* **Google CSE Results**: The Results Page displays Google-powered search results using your configured Google Programmable Search Engine.
* **Google Custom Search Results**: The Results Page displays Google Custom Search results using your configured search engine.
4 changes: 2 additions & 2 deletions gpse/gpse.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: GPSE Search
* Description: Redirects WordPress searches to display Google Programmable Search Engine (GCSE) results.
* Plugin Name: ACLabs Search for Google Custom Search
* Description: Redirects WordPress searches to display Google Custom Search results.
* Version: 1.2.5
* Author: ACLabs
* Text Domain: gpse
Expand Down
10 changes: 5 additions & 5 deletions gpse/includes/class-wp-gpse-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public function add_settings_link( $links ) {
*/
public function add_plugin_page() {
add_options_page(
esc_html__( 'GPSE Settings', 'gpse' ),
esc_html__( 'GPSE', 'gpse' ),
esc_html__( 'ACLabs Search Settings', 'gpse' ),
esc_html__( 'ACLabs Search', 'gpse' ),
'manage_options',
'gpse',
array( $this, 'create_admin_page' )
Expand All @@ -80,7 +80,7 @@ public function create_admin_page() {
}
?>
<div class="wrap">
<h1><?php echo esc_html__( 'GPSE Search', 'gpse' ); ?></h1>
<h1><?php echo esc_html__( 'ACLabs Search for Google Custom Search', 'gpse' ); ?></h1>
<form method="post" action="options.php">
<?php
// settings_fields() handles nonce generation and verification automatically
Expand Down Expand Up @@ -175,7 +175,7 @@ public function page_init() {
* @return void
*/
public function section_info() {
echo esc_html__( 'Enter your Google Programmable Search Engine details below.', 'gpse' );
echo esc_html__( 'Enter your Google Custom Search Engine details below.', 'gpse' );
}

/**
Expand All @@ -191,7 +191,7 @@ public function cx_id_callback() {
$cx_id = get_option( 'wp_gpse_cx_id' );
?>
<input type="text" name="wp_gpse_cx_id" value="<?php echo esc_attr( $cx_id ); ?>" class="regular-text" />
<p class="description"><?php echo esc_html__( 'You can find this in your Google Programmable Search Engine control panel.', 'gpse' ); ?></p>
<p class="description"><?php echo esc_html__( 'You can find this in your Google Custom Search Engine control panel.', 'gpse' ); ?></p>
<?php
}

Expand Down
24 changes: 13 additions & 11 deletions gpse/readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
=== GPSE Search ===
=== ACLabs Search for Google Custom Search ===
Contributors: ACLabs
Tags: search, google, gcse, programmable search, cse
Requires at least: 6.4
Expand All @@ -8,11 +8,11 @@ Requires PHP: 8.2
License: AGPL v3 or later
License URI: https://www.gnu.org/licenses/agpl-3.0.html

Redirects WordPress searches to display Google Programmable Search Engine (GCSE) results.
Redirects WordPress searches to display Google Custom Search results.

== Description ==

Redirects WordPress searches to display Google Programmable Search Engine (GCSE) results. Works seamlessly with the standard WordPress Search block or your theme's search form.
Redirects WordPress searches to display Google Custom Search results. Works seamlessly with the standard WordPress Search block or your theme's search form.

Source code is publicly available on [GitHub](https://github.com/ACLabs-Code/wp-gpse).

Expand All @@ -21,23 +21,23 @@ Source code is publicly available on [GitHub](https://github.com/ACLabs-Code/wp-
* **Seamless Integration**: Works with the standard WordPress Search block or your theme's search form.
* **Search Results Page**: Redirects all searches to a dedicated page of your choice.
* **Configurable**: Easy settings to add your Search Engine ID (CX) and select the results page.
* **Google-Powered Results**: Display Google CSE results using the GPSE Search Results block or `[gpse_results]` shortcode.
* **Google-Powered Results**: Display Google Custom Search results using the Google Custom Search Results block or `[gpse_results]` shortcode.

=== How it Works ===

* **Search Box**: Use the standard WordPress Search block or your theme's search form to allow users to search your site.
* **Redirection**: When a user searches (e.g., `/?s=myquery`), they are automatically redirected to your custom Results Page (e.g., `/search-results/?q=myquery`).
* **Google CSE Results**: The Results Page displays Google-powered search results using your configured Google Programmable Search Engine.
* **Google Custom Search Results**: The Results Page displays Google Custom Search results using your configured search engine.

== Installation ==

1. **Install the Plugin**: Upload the `gpse` folder to your `/wp-content/plugins/` directory and activate it.
2. **Create a Results Page**:
* Create a new Page in WordPress (e.g., "Search Results").
* Add the **GPSE Search Results** block (or the `[gpse_results]` shortcode) to the page content.
* Add the **Google Custom Search Results** block (or the `[gpse_results]` shortcode) to the page content.
* Publish the page.
3. **Configure**:
* Go to **Settings > GPSE**.
* Go to **Settings > ACLabs Search**.
* Enter your **Google Search Engine ID (CX)**. (Get this from [programmablesearchengine.google.com](https://programmablesearchengine.google.com/)).
* Select your "Search Results" page from the dropdown.
* Save Changes.
Expand All @@ -47,20 +47,22 @@ Source code is publicly available on [GitHub](https://github.com/ACLabs-Code/wp-

== Third-Party Services ==

This plugin relies on Google Programmable Search Engine, an external service provided by Google LLC. When a visitor views your configured search results page, their browser loads a JavaScript file from `cse.google.com` and search queries are sent to Google's servers to retrieve results.
This plugin relies on Google Custom Search Engine, an external service provided by Google LLC. When a visitor views your configured search results page, their browser loads a JavaScript file from `cse.google.com` and search queries are sent to Google's servers to retrieve results.

By using this plugin you agree to be bound by Google's Terms of Service and acknowledge their Privacy Policy:

* [Google Terms of Service](https://policies.google.com/terms)
* [Google Privacy Policy](https://policies.google.com/privacy)
* [Google Programmable Search Engine](https://programmablesearchengine.google.com/)
* [Google Custom Search Engine](https://programmablesearchengine.google.com/)

== Changelog ==

= 1.2.6 =
* Renamed plugin to "ACLabs Search for Google Custom Search".
* Standardized terminology to "Google Custom Search" throughout.
* Confirmed compatibility with WordPress 7.0.
* Fixed URL encoding of Google CSE CX ID (rawurlencode instead of esc_attr).
* Removed spurious version query string from Google CSE script URL.
* Fixed URL encoding of Google Custom Search Engine CX ID.
* Removed spurious version query string from Google Custom Search script URL.
* Added `role: content` to block.json for correct editability in WordPress 7.0 contentOnly patterns.

= 1.2.5 =
Expand Down
2 changes: 1 addition & 1 deletion gpse/src/search-results/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"apiVersion": 3,
"name": "gpse/search-results",
"version": "1.0.0",
"title": "GPSE Search Results",
"title": "Google Custom Search Results",
"category": "widgets",
"icon": "welcome-widgets-menus",
"description": "Google Programmable Search Engine results list.",
Expand Down
2 changes: 1 addition & 1 deletion gpse/src/search-results/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Edit = () => {
<div { ...blockProps }>
<div className="gpse-block-placeholder">
<span className="dashicons dashicons-welcome-widgets-menus"></span>
{ __( 'GPSE Search Results', 'gpse' ) }
{ __( 'Google Custom Search Results', 'gpse' ) }
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion gpse/src/search-results/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe( 'gpse/search-results block metadata', () => {
} );

it( 'has correct title', () => {
expect( metadata.title ).toBe( 'GPSE Search Results' );
expect( metadata.title ).toBe( 'Google Custom Search Results' );
} );

it( 'uses Block API v3', () => {
Expand Down