diff --git a/gpse/includes/class-wp-gpse-admin.php b/gpse/includes/class-wp-gpse-admin.php index bd6976e..a20e8eb 100644 --- a/gpse/includes/class-wp-gpse-admin.php +++ b/gpse/includes/class-wp-gpse-admin.php @@ -238,10 +238,13 @@ public function results_page_callback() { ?>

[gpse_results]' + echo wp_kses( + sprintf( + /* translators: %s: shortcode tag [gpse_results] */ + __( 'Select the page where you have placed the %s shortcode. Native searches will be redirected here.', 'gpse' ), + '[gpse_results]' + ), + array( 'code' => array() ) ); ?>

diff --git a/gpse/includes/class-wp-gpse-frontend.php b/gpse/includes/class-wp-gpse-frontend.php index c9f760c..397c201 100644 --- a/gpse/includes/class-wp-gpse-frontend.php +++ b/gpse/includes/class-wp-gpse-frontend.php @@ -46,6 +46,11 @@ public function init() { * @return void */ public function enqueue_styles() { + $results_page_id = get_option( 'wp_gpse_results_page_id' ); + if ( empty( $results_page_id ) || ! is_page( $results_page_id ) ) { + return; + } + wp_enqueue_style( 'gpse-style', GPSE_URL . 'assets/css/gpse.css', array(), GPSE_VERSION ); // Get margin value and ensure it's a positive integer (defense in depth) @@ -68,6 +73,11 @@ public function enqueue_styles() { * @return void */ public function enqueue_google_script() { + $results_page_id = get_option( 'wp_gpse_results_page_id' ); + if ( empty( $results_page_id ) || ! is_page( $results_page_id ) ) { + return; + } + $cx_id = get_option( 'wp_gpse_cx_id' ); if ( ! empty( $cx_id ) ) { wp_enqueue_script( @@ -91,6 +101,11 @@ public function enqueue_google_script() { * @return void */ public function enqueue_init_script() { + $results_page_id = get_option( 'wp_gpse_results_page_id' ); + if ( empty( $results_page_id ) || ! is_page( $results_page_id ) ) { + return; + } + wp_enqueue_script( 'gpse-init', GPSE_URL . 'assets/js/gpse-init.js', diff --git a/gpse/languages/gpse.pot b/gpse/languages/gpse.pot index cb744f4..554a6a5 100644 --- a/gpse/languages/gpse.pot +++ b/gpse/languages/gpse.pot @@ -1,124 +1,79 @@ -# Copyright (C) 2026 Gemini -# This file is distributed under the AGPL v3 or later. +# Copyright (C) 2026 GPSE Search +# This file is distributed under the same license as the GPSE Search package. msgid "" msgstr "" -"Project-Id-Version: GPSE Search 1.1.0\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/gpse\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"Project-Id-Version: GPSE Search\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2026-01-15T07:38:16+00:00\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.12.0\n" -"X-Domain: gpse\n" - -#. Plugin Name of the plugin -#: gpse.php -#: includes/class-wp-gpse-admin.php:83 -msgid "GPSE Search" -msgstr "" - -#. Description of the plugin -#: gpse.php -msgid "Replaces the standard WordPress search with a Google Programmable Search Engine (GCSE)." -msgstr "" - -#. Author of the plugin -#: gpse.php -msgid "Gemini" -msgstr "" - -#: includes/class-wp-gpse-admin.php:43 +"Language-Team: ACLabs\n" +"Last-Translator: ACLabs\n" +"POT-Creation-Date: 2026-03-23 02:41+0000\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: *.js\n" +"X-Poedit-SourceCharset: UTF-8\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: gpse/includes/class-wp-gpse-admin.php:43 msgid "Settings" msgstr "" -#: includes/class-wp-gpse-admin.php:59 +#: gpse/includes/class-wp-gpse-admin.php:59 msgid "GPSE Settings" msgstr "" -#: includes/class-wp-gpse-admin.php:60 +#: gpse/includes/class-wp-gpse-admin.php:60 msgid "GPSE" msgstr "" -#: includes/class-wp-gpse-admin.php:79 +#: gpse/includes/class-wp-gpse-admin.php:79 msgid "You do not have sufficient permissions to access this page." msgstr "" -#: includes/class-wp-gpse-admin.php:138 +#: gpse/includes/class-wp-gpse-admin.php:83 +msgid "GPSE Search" +msgstr "" + +#: gpse/includes/class-wp-gpse-admin.php:138 msgid "Configuration" msgstr "" -#: includes/class-wp-gpse-admin.php:145 +#: gpse/includes/class-wp-gpse-admin.php:145 msgid "Search Engine ID (CX)" msgstr "" -#: includes/class-wp-gpse-admin.php:153 +#: gpse/includes/class-wp-gpse-admin.php:153 msgid "Search Results Page" msgstr "" -#: includes/class-wp-gpse-admin.php:161 +#: gpse/includes/class-wp-gpse-admin.php:161 msgid "Autocomplete Top Margin (px)" msgstr "" -#: includes/class-wp-gpse-admin.php:178 +#: gpse/includes/class-wp-gpse-admin.php:178 msgid "Enter your Google Programmable Search Engine details below." msgstr "" -#: includes/class-wp-gpse-admin.php:194 +#: gpse/includes/class-wp-gpse-admin.php:194 msgid "You can find this in your Google Programmable Search Engine control panel." msgstr "" -#: includes/class-wp-gpse-admin.php:219 +#: gpse/includes/class-wp-gpse-admin.php:219 msgid "Select a page" msgstr "" #. translators: %s: shortcode tag [gpse_results] -#: includes/class-wp-gpse-admin.php:243 -#, php-format +#: gpse/includes/class-wp-gpse-admin.php:244 msgid "Select the page where you have placed the %s shortcode. Native searches will be redirected here." msgstr "" -#: includes/class-wp-gpse-admin.php:264 +#: gpse/includes/class-wp-gpse-admin.php:267 msgctxt "pixels unit abbreviation" msgid "px" msgstr "" -#: includes/class-wp-gpse-admin.php:265 +#: gpse/includes/class-wp-gpse-admin.php:268 msgid "Adjust this if the autocomplete dropdown covers your search input. Default is 15." msgstr "" - -#: build/search-form/index.js:1 -#: src/search-form/index.js:13 -msgid "GPSE Search Form" -msgstr "" - -#: build/search-results/index.js:1 -#: src/search-results/index.js:13 -msgid "GPSE Search Results" -msgstr "" - -#: build/search-form/block.json -#: src/search-form/block.json -msgctxt "block title" -msgid "GPSE Search Form" -msgstr "" - -#: build/search-form/block.json -#: src/search-form/block.json -msgctxt "block description" -msgid "Google Programmable Search Engine form." -msgstr "" - -#: build/search-results/block.json -#: src/search-results/block.json -msgctxt "block title" -msgid "GPSE Search Results" -msgstr "" - -#: build/search-results/block.json -#: src/search-results/block.json -msgctxt "block description" -msgid "Google Programmable Search Engine results list." -msgstr "" diff --git a/gpse/readme.txt b/gpse/readme.txt index 81210cc..c10869f 100644 --- a/gpse/readme.txt +++ b/gpse/readme.txt @@ -2,7 +2,7 @@ Contributors: ACLabs Tags: search, google, gcse, programmable search, cse Requires at least: 6.4 -Tested up to: 6.9.4 +Tested up to: 6.9 Stable tag: 1.2.4 Requires PHP: 8.2 License: AGPL v3 or later @@ -14,6 +14,8 @@ Redirects WordPress searches to display Google Programmable Search Engine (GCSE) 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. +Source code is publicly available on [GitHub](https://github.com/ACLabs-Code/wp-gpse). + === Features === * **Seamless Integration**: Works with the standard WordPress Search block or your theme's search form. @@ -43,10 +45,15 @@ Redirects WordPress searches to display Google Programmable Search Engine (GCSE) * Add the standard WordPress **Search** block to your site (header, sidebar, page, etc.). * Or use your theme's built-in search form. -== Screenshots == +== 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. + +By using this plugin you agree to be bound by Google's Terms of Service and acknowledge their Privacy Policy: -1. Plugin settings page — enter your Google Search Engine ID and select the results page. -2. Search results page — displays Google Programmable Search Engine results inline. +* [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/) == Changelog ==