Changeset 3735480
- Timestamp:
- 10/08/2026 08:32:48 PM (2 weeks ago)
- Location:
- gemini-enterprise-for-cx
- Files:
-
- 100 added
- 30 deleted
- 8 edited
- 1 copied
-
tags/1.1.0 (copied) (copied from gemini-enterprise-for-cx/trunk )
-
tags/1.1.0/assets/js (deleted)
-
tags/1.1.0/build (added)
-
tags/1.1.0/build/scripts (added)
-
tags/1.1.0/build/scripts/admin (added)
-
tags/1.1.0/build/scripts/admin/index.js (added)
-
tags/1.1.0/build/scripts/admin/index.js.map (added)
-
tags/1.1.0/build/scripts/admin/index.min.asset.php (added)
-
tags/1.1.0/build/scripts/admin/index.min.js (added)
-
tags/1.1.0/build/scripts/admin/index.min.js.map (added)
-
tags/1.1.0/build/scripts/editor-blocks (added)
-
tags/1.1.0/build/scripts/editor-blocks/index.js (added)
-
tags/1.1.0/build/scripts/editor-blocks/index.js.map (added)
-
tags/1.1.0/build/scripts/editor-blocks/index.min.asset.php (added)
-
tags/1.1.0/build/scripts/editor-blocks/index.min.js (added)
-
tags/1.1.0/build/scripts/editor-blocks/index.min.js.map (added)
-
tags/1.1.0/build/scripts/storefront (added)
-
tags/1.1.0/build/scripts/storefront/index.js (added)
-
tags/1.1.0/build/scripts/storefront/index.js.map (added)
-
tags/1.1.0/build/scripts/storefront/index.min.asset.php (added)
-
tags/1.1.0/build/scripts/storefront/index.min.js (added)
-
tags/1.1.0/build/scripts/storefront/index.min.js.map (added)
-
tags/1.1.0/changelog.txt (modified) (1 diff)
-
tags/1.1.0/composer.json (added)
-
tags/1.1.0/gecx-agent.php (modified) (4 diffs)
-
tags/1.1.0/includes/Admin (added)
-
tags/1.1.0/includes/Admin.php (added)
-
tags/1.1.0/includes/Admin/Connection.php (added)
-
tags/1.1.0/includes/Admin/Console_Sync.php (added)
-
tags/1.1.0/includes/Admin/Product_Prompts.php (added)
-
tags/1.1.0/includes/Admin/Settings_Page.php (added)
-
tags/1.1.0/includes/Auth.php (added)
-
tags/1.1.0/includes/REST (added)
-
tags/1.1.0/includes/REST/Auth_Context.php (added)
-
tags/1.1.0/includes/REST/Cart_Session.php (added)
-
tags/1.1.0/includes/REST/Console_API.php (added)
-
tags/1.1.0/includes/REST/Order_Webhook.php (added)
-
tags/1.1.0/includes/REST/REST_API.php (added)
-
tags/1.1.0/includes/REST/Session_Attribution.php (added)
-
tags/1.1.0/includes/Storefront.php (added)
-
tags/1.1.0/includes/class-gecx-admin-connection.php (deleted)
-
tags/1.1.0/includes/class-gecx-admin-console-sync.php (deleted)
-
tags/1.1.0/includes/class-gecx-admin-product-prompts.php (deleted)
-
tags/1.1.0/includes/class-gecx-admin-settings-page.php (deleted)
-
tags/1.1.0/includes/class-gecx-admin.php (deleted)
-
tags/1.1.0/includes/class-gecx-auth.php (deleted)
-
tags/1.1.0/includes/class-gecx-rest-api.php (deleted)
-
tags/1.1.0/includes/class-gecx-rest-auth-context.php (deleted)
-
tags/1.1.0/includes/class-gecx-rest-cart-session.php (deleted)
-
tags/1.1.0/includes/class-gecx-rest-console-api.php (deleted)
-
tags/1.1.0/includes/class-gecx-rest-order-webhook.php (deleted)
-
tags/1.1.0/includes/class-gecx-rest-session-attribution.php (deleted)
-
tags/1.1.0/includes/class-gecx-storefront.php (deleted)
-
tags/1.1.0/languages (deleted)
-
tags/1.1.0/readme.txt (modified) (2 diffs)
-
tags/1.1.0/uninstall.php (modified) (10 diffs)
-
tags/1.1.0/vendor (added)
-
tags/1.1.0/vendor/autoload.php (added)
-
tags/1.1.0/vendor/composer (added)
-
tags/1.1.0/vendor/composer/ClassLoader.php (added)
-
tags/1.1.0/vendor/composer/InstalledVersions.php (added)
-
tags/1.1.0/vendor/composer/LICENSE (added)
-
tags/1.1.0/vendor/composer/autoload_classmap.php (added)
-
tags/1.1.0/vendor/composer/autoload_namespaces.php (added)
-
tags/1.1.0/vendor/composer/autoload_psr4.php (added)
-
tags/1.1.0/vendor/composer/autoload_real.php (added)
-
tags/1.1.0/vendor/composer/autoload_static.php (added)
-
tags/1.1.0/vendor/composer/installed.json (added)
-
tags/1.1.0/vendor/composer/installed.php (added)
-
tags/1.1.0/vendor/composer/platform_check.php (added)
-
trunk/assets/js (deleted)
-
trunk/build (added)
-
trunk/build/scripts (added)
-
trunk/build/scripts/admin (added)
-
trunk/build/scripts/admin/index.js (added)
-
trunk/build/scripts/admin/index.js.map (added)
-
trunk/build/scripts/admin/index.min.asset.php (added)
-
trunk/build/scripts/admin/index.min.js (added)
-
trunk/build/scripts/admin/index.min.js.map (added)
-
trunk/build/scripts/editor-blocks (added)
-
trunk/build/scripts/editor-blocks/index.js (added)
-
trunk/build/scripts/editor-blocks/index.js.map (added)
-
trunk/build/scripts/editor-blocks/index.min.asset.php (added)
-
trunk/build/scripts/editor-blocks/index.min.js (added)
-
trunk/build/scripts/editor-blocks/index.min.js.map (added)
-
trunk/build/scripts/storefront (added)
-
trunk/build/scripts/storefront/index.js (added)
-
trunk/build/scripts/storefront/index.js.map (added)
-
trunk/build/scripts/storefront/index.min.asset.php (added)
-
trunk/build/scripts/storefront/index.min.js (added)
-
trunk/build/scripts/storefront/index.min.js.map (added)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/composer.json (added)
-
trunk/gecx-agent.php (modified) (4 diffs)
-
trunk/includes/Admin (added)
-
trunk/includes/Admin.php (added)
-
trunk/includes/Admin/Connection.php (added)
-
trunk/includes/Admin/Console_Sync.php (added)
-
trunk/includes/Admin/Product_Prompts.php (added)
-
trunk/includes/Admin/Settings_Page.php (added)
-
trunk/includes/Auth.php (added)
-
trunk/includes/REST (added)
-
trunk/includes/REST/Auth_Context.php (added)
-
trunk/includes/REST/Cart_Session.php (added)
-
trunk/includes/REST/Console_API.php (added)
-
trunk/includes/REST/Order_Webhook.php (added)
-
trunk/includes/REST/REST_API.php (added)
-
trunk/includes/REST/Session_Attribution.php (added)
-
trunk/includes/Storefront.php (added)
-
trunk/includes/class-gecx-admin-connection.php (deleted)
-
trunk/includes/class-gecx-admin-console-sync.php (deleted)
-
trunk/includes/class-gecx-admin-product-prompts.php (deleted)
-
trunk/includes/class-gecx-admin-settings-page.php (deleted)
-
trunk/includes/class-gecx-admin.php (deleted)
-
trunk/includes/class-gecx-auth.php (deleted)
-
trunk/includes/class-gecx-rest-api.php (deleted)
-
trunk/includes/class-gecx-rest-auth-context.php (deleted)
-
trunk/includes/class-gecx-rest-cart-session.php (deleted)
-
trunk/includes/class-gecx-rest-console-api.php (deleted)
-
trunk/includes/class-gecx-rest-order-webhook.php (deleted)
-
trunk/includes/class-gecx-rest-session-attribution.php (deleted)
-
trunk/includes/class-gecx-storefront.php (deleted)
-
trunk/languages (deleted)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/uninstall.php (modified) (10 diffs)
-
trunk/vendor (added)
-
trunk/vendor/autoload.php (added)
-
trunk/vendor/composer (added)
-
trunk/vendor/composer/ClassLoader.php (added)
-
trunk/vendor/composer/InstalledVersions.php (added)
-
trunk/vendor/composer/LICENSE (added)
-
trunk/vendor/composer/autoload_classmap.php (added)
-
trunk/vendor/composer/autoload_namespaces.php (added)
-
trunk/vendor/composer/autoload_psr4.php (added)
-
trunk/vendor/composer/autoload_real.php (added)
-
trunk/vendor/composer/autoload_static.php (added)
-
trunk/vendor/composer/installed.json (added)
-
trunk/vendor/composer/installed.php (added)
-
trunk/vendor/composer/platform_check.php (added)
Legend:
- Unmodified
- Added
- Removed
-
gemini-enterprise-for-cx/tags/1.1.0/changelog.txt
r3721834 r3735480 1 1 *** Gemini Enterprise for CX Changelog *** 2 3 2026-10-08 - version 1.1.0 4 * Load the plugin's classes with a Composer autoloader, shipped in `vendor/`, under the `Google\Gemini_Enterprise_For_CX` namespace. The global `GECX_*` classes are removed without aliases, so code that referenced them must use the namespaced classes. No behavior changes. 5 * Build the admin, storefront and block editor scripts with the WordPress build tooling. They now load minified from `build/scripts/` instead of `assets/js/` (unminified when `SCRIPT_DEBUG` is on), with dependencies and versions taken from the generated asset files. Script handles are unchanged; if a caching or optimization plugin excludes `assets/js/storefront.js` by path, exclude `build/scripts/storefront/` instead. 6 * Make the settings page's error messages and the descriptions of the Launcher and Suggested Prompts blocks translatable, and translate the Suggested Prompts block label as a single string. 7 * Load translations for the admin, storefront and block editor scripts from WordPress.org language packs, and drop the bundled `languages/` folder and the `Domain Path` header. 8 * Declare compatibility with WooCommerce 11.2. 2 9 3 10 2026-09-30 - version 1.0.1 -
gemini-enterprise-for-cx/tags/1.1.0/gecx-agent.php
r3721834 r3735480 15 15 * Requires at least: 6.2 16 16 * Requires PHP: 7.4 17 * Version: 1. 0.117 * Version: 1.1.0 18 18 * Author: Google LLC 19 19 * Author URI: https://cloud.google.com/gemini … … 21 21 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 22 22 * Text Domain: gemini-enterprise-for-cx 23 * Domain Path: /languages24 23 * WC requires at least: 7.1 25 * WC tested up to: 11. 124 * WC tested up to: 11.2 26 25 */ 27 26 … … 33 32 34 33 if ( ! defined( 'GECX_VERSION' ) ) { 35 define( 'GECX_VERSION', '1. 0.1' );34 define( 'GECX_VERSION', '1.1.0' ); 36 35 } 37 36 38 37 39 38 40 // Load core classes. 41 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gecx-auth.php'; 42 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gecx-rest-api.php'; 43 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gecx-admin.php'; 44 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gecx-storefront.php'; 39 // Load Composer autoloader. 40 if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { 41 require_once __DIR__ . '/vendor/autoload.php'; 42 } 45 43 46 44 // Register activation and deactivation hooks. 47 register_activation_hook( __FILE__, [ 'GECX_Admin', 'activate_plugin' ] ); 48 register_deactivation_hook( __FILE__, [ 'GECX_Admin', 'deactivate_plugin' ] ); 49 50 /* 51 * There is deliberately no load_plugin_textdomain() call here. 52 * 53 * Since WordPress 4.6 a plugin hosted on WordPress.org has its translations 54 * loaded automatically, keyed on the plugin slug, and Plugin Check flags the 55 * manual call as discouraged. It would also load nothing: the only thing this 56 * plugin ships under /languages is the .pot template, which is a source for 57 * translators rather than a catalogue WordPress can read. 58 * 59 * The 'Text Domain' and 'Domain Path' headers above are still required. They 60 * are what WordPress.org keys translations on, and what wp_set_script_translations() 61 * resolves JSON catalogues against for the admin and storefront bundles. 62 */ 45 register_activation_hook( __FILE__, [ Google\Gemini_Enterprise_For_CX\Admin::class, 'activate_plugin' ] ); 46 register_deactivation_hook( __FILE__, [ Google\Gemini_Enterprise_For_CX\Admin::class, 'deactivate_plugin' ] ); 63 47 64 48 /** 65 49 * Initializes the plugin's components if WooCommerce is active. 66 50 * 67 * Every component assumes WooCommerce: GECX_Rest_API hooks WooCommerce68 * filters and calls WC(), GECX_Storefront renders on WooCommerce templates,69 * GECX_Admin adds fields to the WooCommerce product editor, and GECX_Auth51 * Every component assumes WooCommerce: REST_API hooks WooCommerce 52 * filters and calls WC(), Storefront renders on WooCommerce templates, 53 * Admin adds fields to the WooCommerce product editor, and Auth 70 54 * authenticates WooCommerce Store API requests. The "Requires Plugins" header 71 55 * keeps WordPress from activating this plugin without WooCommerce, but that … … 84 68 } 85 69 86 new G ECX_Auth();87 new G ECX_Rest_API();88 new G ECX_Admin( __FILE__ );89 new G ECX_Storefront( __FILE__ );70 new Google\Gemini_Enterprise_For_CX\Auth(); 71 new Google\Gemini_Enterprise_For_CX\REST\REST_API(); 72 new Google\Gemini_Enterprise_For_CX\Admin( __FILE__ ); 73 new Google\Gemini_Enterprise_For_CX\Storefront( __FILE__ ); 90 74 } 91 75 add_action( 'plugins_loaded', 'gecx_init_components' ); -
gemini-enterprise-for-cx/tags/1.1.0/readme.txt
r3721834 r3735480 1 1 === Gemini Enterprise for CX === 2 2 Contributors: google 3 Tags: woocommerce, marketing, ai, agent, chatbot3 Tags: woocommerce, ai, chatbot, ai agent, shopping assistant 4 4 Requires at least: 6.2 5 5 WC requires at least: 7.1 6 WC tested up to: 11. 16 WC tested up to: 11.2 7 7 Tested up to: 7.1 8 8 Requires PHP: 7.4 9 Stable tag: 1. 0.19 Stable tag: 1.1.0 10 10 License: GPLv3 11 11 License URI: https://www.gnu.org/licenses/gpl-3.0.html 12 12 13 A dd an AI shopping agent from Google Cloud to your WooCommerce store. It answers product questions, gives advice and adds items to the cart.13 AI shopping assistant and chatbot for your WooCommerce store, from Google Cloud. Answers product questions, gives advice and adds items to the cart. 14 14 15 15 == Description == 16 16 17 Gemini Enterprise for CX connects your WooCommerce store to Google's Gemini Enterprise for CX (GECX) service. It adds a chat widget to your storefront where shoppers talk to an AI agent that knows your products and store policies and can add items to their cart.17 Gemini Enterprise for CX adds an AI shopping assistant to your WooCommerce store. Shoppers open a chat widget on your storefront and talk to an AI agent that knows your products and store policies, answers their questions and manages their cart. The agent runs on Google's Gemini Enterprise for CX (GECX) service. 18 18 19 19 The plugin is an interface to the Gemini Enterprise for CX software as a service (SaaS) provided by Google Cloud. Connecting a store requires a Google account with access to Gemini Enterprise for CX. … … 133 133 The complete release history is kept in changelog.txt at the plugin root. 134 134 135 = 1.1.0 = 136 * Load the plugin's classes with a Composer autoloader, shipped in `vendor/`, under the `Google\Gemini_Enterprise_For_CX` namespace. The global `GECX_*` classes are removed without aliases, so code that referenced them must use the namespaced classes. No behavior changes. 137 * Build the admin, storefront and block editor scripts with the WordPress build tooling. They now load minified from `build/scripts/` instead of `assets/js/` (unminified when `SCRIPT_DEBUG` is on), with dependencies and versions taken from the generated asset files. Script handles are unchanged; if a caching or optimization plugin excludes `assets/js/storefront.js` by path, exclude `build/scripts/storefront/` instead. 138 * Make the settings page's error messages and the descriptions of the Launcher and Suggested Prompts blocks translatable, and translate the Suggested Prompts block label as a single string. 139 * Load translations for the admin, storefront and block editor scripts from WordPress.org language packs, and drop the bundled `languages/` folder and the `Domain Path` header. 140 * Declare compatibility with WooCommerce 11.2. 141 135 142 = 1.0.1 = 136 143 * Admin JWTs now last 60 minutes instead of 5, so a merchant who leaves the Gemini Enterprise for CX console to build an agent can still link it when they return. -
gemini-enterprise-for-cx/tags/1.1.0/uninstall.php
r3720294 r3735480 10 10 */ 11 11 12 use Google\Gemini_Enterprise_For_CX\Auth; 13 12 14 // If run outside of WordPress uninstallation, die. 13 15 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 14 die;16 die; 15 17 } 16 18 … … 18 20 19 21 // WordPress loads uninstall.php standalone, so none of the plugin's classes are 20 // autoloaded here. The uninstall notification is authenticated with a JWT signed 21 // by the store's own private key, which means the auth class has to be pulled in 22 // by hand before that key is deleted further down. 23 if ( ! class_exists( 'GECX_Auth' ) && file_exists( __DIR__ . '/includes/class-gecx-auth.php' ) ) { 24 require_once __DIR__ . '/includes/class-gecx-auth.php'; 22 // autoloaded by default. Load Composer autoloader to access plugin classes. 23 if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { 24 require_once __DIR__ . '/vendor/autoload.php'; 25 25 } 26 26 … … 69 69 $gecx_agent_name = get_option( 'gecx_agent_name', '' ); 70 70 // Same allowlist as every other outbound call; '' means do not notify. 71 $gecx_console_url = class_exists( 'GECX_Auth' ) ? GECX_Auth::get_console_base_url() : '';71 $gecx_console_url = class_exists( Auth::class ) ? Auth::get_console_base_url() : ''; 72 72 $gecx_store_url = function_exists( 'home_url' ) ? home_url() : ''; 73 73 … … 85 85 } catch ( \Exception $e ) { 86 86 // Uninstall must finish regardless, but record why the webhook survived. 87 if ( class_exists( 'GECX_Auth') ) {88 GECX_Auth::log( 'Uninstall could not delete the stored webhook: ' . $e->getMessage(), 'debug' );87 if ( class_exists( Auth::class ) ) { 88 Auth::log( 'Uninstall could not delete the stored webhook: ' . $e->getMessage(), 'debug' ); 89 89 } 90 90 } … … 106 106 } 107 107 } catch ( \Throwable $e ) { 108 if ( class_exists( 'GECX_Auth') ) {109 GECX_Auth::log( 'Uninstall could not query webhooks: ' . $e->getMessage(), 'debug' );108 if ( class_exists( Auth::class ) ) { 109 Auth::log( 'Uninstall could not query webhooks: ' . $e->getMessage(), 'debug' ); 110 110 } 111 111 } … … 173 173 174 174 $gecx_jwt = ''; 175 if ( $gecx_was_connected && '' !== $gecx_console_url && class_exists( 'GECX_Auth') ) {176 $gecx_jwt = (string) GECX_Auth::generate_existing_rs256_admin_jwt();175 if ( $gecx_was_connected && '' !== $gecx_console_url && class_exists( Auth::class ) ) { 176 $gecx_jwt = (string) Auth::generate_existing_rs256_admin_jwt(); 177 177 } 178 178 … … 198 198 199 199 if ( $gecx_budget_spent ) { 200 if ( class_exists( 'GECX_Auth') ) {201 GECX_Auth::log( 'Uninstall notification skipped for ' . $gecx_store_url . ': too little of the notification time budget remains to complete a request.', 'warning' );200 if ( class_exists( Auth::class ) ) { 201 Auth::log( 'Uninstall notification skipped for ' . $gecx_store_url . ': too little of the notification time budget remains to complete a request.', 'warning' ); 202 202 } 203 203 } elseif ( 'https' === $gecx_scheme && ( function_exists( 'wp_http_validate_url' ) ? wp_http_validate_url( $gecx_webhook_url ) : filter_var( $gecx_webhook_url, FILTER_VALIDATE_URL ) ) ) { … … 207 207 // 208 208 // wp_safe_remote_post() rather than wp_remote_post(), matching 209 // the two GECX_Admin_Console_Sync call sites: the destination comes from an209 // the two Admin\Console_Sync call sites: the destination comes from an 210 210 // option, so the resolved host is validated against the private 211 211 // and loopback ranges. redirection 0 because the request … … 231 231 // Done after the notification above, which the backend may verify by 232 232 // fetching /wp-json/gecx/v1/public-key with those keys. 233 if ( class_exists( 'GECX_Auth') ) {234 GECX_Auth::revoke_woocommerce_api_keys();235 } 236 // Literal names: GECX_Auth is not guaranteed to be loaded here.233 if ( class_exists( Auth::class ) ) { 234 Auth::revoke_woocommerce_api_keys(); 235 } 236 // Literal names: Auth is not guaranteed to be loaded here. 237 237 delete_option( 'gecx_merchant_unlinked' ); 238 238 delete_option( 'gecx_merchant_disabled' ); … … 281 281 if ( function_exists( 'delete_transient' ) ) { 282 282 delete_transient( 'gecx_admin_notice_error' ); 283 delete_transient( class_exists( 'GECX_Auth' ) && defined( 'GECX_Auth::GUEST_JWT_CACHE_TRANSIENT' ) ? GECX_Auth::GUEST_JWT_CACHE_TRANSIENT : 'gecx_guest_jwt_cache' );283 delete_transient( class_exists( Auth::class ) && defined( Auth::class . '::GUEST_JWT_CACHE_TRANSIENT' ) ? Auth::GUEST_JWT_CACHE_TRANSIENT : 'gecx_guest_jwt_cache' ); 284 284 } 285 285 -
gemini-enterprise-for-cx/trunk/changelog.txt
r3721834 r3735480 1 1 *** Gemini Enterprise for CX Changelog *** 2 3 2026-10-08 - version 1.1.0 4 * Load the plugin's classes with a Composer autoloader, shipped in `vendor/`, under the `Google\Gemini_Enterprise_For_CX` namespace. The global `GECX_*` classes are removed without aliases, so code that referenced them must use the namespaced classes. No behavior changes. 5 * Build the admin, storefront and block editor scripts with the WordPress build tooling. They now load minified from `build/scripts/` instead of `assets/js/` (unminified when `SCRIPT_DEBUG` is on), with dependencies and versions taken from the generated asset files. Script handles are unchanged; if a caching or optimization plugin excludes `assets/js/storefront.js` by path, exclude `build/scripts/storefront/` instead. 6 * Make the settings page's error messages and the descriptions of the Launcher and Suggested Prompts blocks translatable, and translate the Suggested Prompts block label as a single string. 7 * Load translations for the admin, storefront and block editor scripts from WordPress.org language packs, and drop the bundled `languages/` folder and the `Domain Path` header. 8 * Declare compatibility with WooCommerce 11.2. 2 9 3 10 2026-09-30 - version 1.0.1 -
gemini-enterprise-for-cx/trunk/gecx-agent.php
r3721834 r3735480 15 15 * Requires at least: 6.2 16 16 * Requires PHP: 7.4 17 * Version: 1. 0.117 * Version: 1.1.0 18 18 * Author: Google LLC 19 19 * Author URI: https://cloud.google.com/gemini … … 21 21 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 22 22 * Text Domain: gemini-enterprise-for-cx 23 * Domain Path: /languages24 23 * WC requires at least: 7.1 25 * WC tested up to: 11. 124 * WC tested up to: 11.2 26 25 */ 27 26 … … 33 32 34 33 if ( ! defined( 'GECX_VERSION' ) ) { 35 define( 'GECX_VERSION', '1. 0.1' );34 define( 'GECX_VERSION', '1.1.0' ); 36 35 } 37 36 38 37 39 38 40 // Load core classes. 41 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gecx-auth.php'; 42 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gecx-rest-api.php'; 43 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gecx-admin.php'; 44 require_once plugin_dir_path( __FILE__ ) . 'includes/class-gecx-storefront.php'; 39 // Load Composer autoloader. 40 if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { 41 require_once __DIR__ . '/vendor/autoload.php'; 42 } 45 43 46 44 // Register activation and deactivation hooks. 47 register_activation_hook( __FILE__, [ 'GECX_Admin', 'activate_plugin' ] ); 48 register_deactivation_hook( __FILE__, [ 'GECX_Admin', 'deactivate_plugin' ] ); 49 50 /* 51 * There is deliberately no load_plugin_textdomain() call here. 52 * 53 * Since WordPress 4.6 a plugin hosted on WordPress.org has its translations 54 * loaded automatically, keyed on the plugin slug, and Plugin Check flags the 55 * manual call as discouraged. It would also load nothing: the only thing this 56 * plugin ships under /languages is the .pot template, which is a source for 57 * translators rather than a catalogue WordPress can read. 58 * 59 * The 'Text Domain' and 'Domain Path' headers above are still required. They 60 * are what WordPress.org keys translations on, and what wp_set_script_translations() 61 * resolves JSON catalogues against for the admin and storefront bundles. 62 */ 45 register_activation_hook( __FILE__, [ Google\Gemini_Enterprise_For_CX\Admin::class, 'activate_plugin' ] ); 46 register_deactivation_hook( __FILE__, [ Google\Gemini_Enterprise_For_CX\Admin::class, 'deactivate_plugin' ] ); 63 47 64 48 /** 65 49 * Initializes the plugin's components if WooCommerce is active. 66 50 * 67 * Every component assumes WooCommerce: GECX_Rest_API hooks WooCommerce68 * filters and calls WC(), GECX_Storefront renders on WooCommerce templates,69 * GECX_Admin adds fields to the WooCommerce product editor, and GECX_Auth51 * Every component assumes WooCommerce: REST_API hooks WooCommerce 52 * filters and calls WC(), Storefront renders on WooCommerce templates, 53 * Admin adds fields to the WooCommerce product editor, and Auth 70 54 * authenticates WooCommerce Store API requests. The "Requires Plugins" header 71 55 * keeps WordPress from activating this plugin without WooCommerce, but that … … 84 68 } 85 69 86 new G ECX_Auth();87 new G ECX_Rest_API();88 new G ECX_Admin( __FILE__ );89 new G ECX_Storefront( __FILE__ );70 new Google\Gemini_Enterprise_For_CX\Auth(); 71 new Google\Gemini_Enterprise_For_CX\REST\REST_API(); 72 new Google\Gemini_Enterprise_For_CX\Admin( __FILE__ ); 73 new Google\Gemini_Enterprise_For_CX\Storefront( __FILE__ ); 90 74 } 91 75 add_action( 'plugins_loaded', 'gecx_init_components' ); -
gemini-enterprise-for-cx/trunk/readme.txt
r3721834 r3735480 1 1 === Gemini Enterprise for CX === 2 2 Contributors: google 3 Tags: woocommerce, marketing, ai, agent, chatbot3 Tags: woocommerce, ai, chatbot, ai agent, shopping assistant 4 4 Requires at least: 6.2 5 5 WC requires at least: 7.1 6 WC tested up to: 11. 16 WC tested up to: 11.2 7 7 Tested up to: 7.1 8 8 Requires PHP: 7.4 9 Stable tag: 1. 0.19 Stable tag: 1.1.0 10 10 License: GPLv3 11 11 License URI: https://www.gnu.org/licenses/gpl-3.0.html 12 12 13 A dd an AI shopping agent from Google Cloud to your WooCommerce store. It answers product questions, gives advice and adds items to the cart.13 AI shopping assistant and chatbot for your WooCommerce store, from Google Cloud. Answers product questions, gives advice and adds items to the cart. 14 14 15 15 == Description == 16 16 17 Gemini Enterprise for CX connects your WooCommerce store to Google's Gemini Enterprise for CX (GECX) service. It adds a chat widget to your storefront where shoppers talk to an AI agent that knows your products and store policies and can add items to their cart.17 Gemini Enterprise for CX adds an AI shopping assistant to your WooCommerce store. Shoppers open a chat widget on your storefront and talk to an AI agent that knows your products and store policies, answers their questions and manages their cart. The agent runs on Google's Gemini Enterprise for CX (GECX) service. 18 18 19 19 The plugin is an interface to the Gemini Enterprise for CX software as a service (SaaS) provided by Google Cloud. Connecting a store requires a Google account with access to Gemini Enterprise for CX. … … 133 133 The complete release history is kept in changelog.txt at the plugin root. 134 134 135 = 1.1.0 = 136 * Load the plugin's classes with a Composer autoloader, shipped in `vendor/`, under the `Google\Gemini_Enterprise_For_CX` namespace. The global `GECX_*` classes are removed without aliases, so code that referenced them must use the namespaced classes. No behavior changes. 137 * Build the admin, storefront and block editor scripts with the WordPress build tooling. They now load minified from `build/scripts/` instead of `assets/js/` (unminified when `SCRIPT_DEBUG` is on), with dependencies and versions taken from the generated asset files. Script handles are unchanged; if a caching or optimization plugin excludes `assets/js/storefront.js` by path, exclude `build/scripts/storefront/` instead. 138 * Make the settings page's error messages and the descriptions of the Launcher and Suggested Prompts blocks translatable, and translate the Suggested Prompts block label as a single string. 139 * Load translations for the admin, storefront and block editor scripts from WordPress.org language packs, and drop the bundled `languages/` folder and the `Domain Path` header. 140 * Declare compatibility with WooCommerce 11.2. 141 135 142 = 1.0.1 = 136 143 * Admin JWTs now last 60 minutes instead of 5, so a merchant who leaves the Gemini Enterprise for CX console to build an agent can still link it when they return. -
gemini-enterprise-for-cx/trunk/uninstall.php
r3720294 r3735480 10 10 */ 11 11 12 use Google\Gemini_Enterprise_For_CX\Auth; 13 12 14 // If run outside of WordPress uninstallation, die. 13 15 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 14 die;16 die; 15 17 } 16 18 … … 18 20 19 21 // WordPress loads uninstall.php standalone, so none of the plugin's classes are 20 // autoloaded here. The uninstall notification is authenticated with a JWT signed 21 // by the store's own private key, which means the auth class has to be pulled in 22 // by hand before that key is deleted further down. 23 if ( ! class_exists( 'GECX_Auth' ) && file_exists( __DIR__ . '/includes/class-gecx-auth.php' ) ) { 24 require_once __DIR__ . '/includes/class-gecx-auth.php'; 22 // autoloaded by default. Load Composer autoloader to access plugin classes. 23 if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { 24 require_once __DIR__ . '/vendor/autoload.php'; 25 25 } 26 26 … … 69 69 $gecx_agent_name = get_option( 'gecx_agent_name', '' ); 70 70 // Same allowlist as every other outbound call; '' means do not notify. 71 $gecx_console_url = class_exists( 'GECX_Auth' ) ? GECX_Auth::get_console_base_url() : '';71 $gecx_console_url = class_exists( Auth::class ) ? Auth::get_console_base_url() : ''; 72 72 $gecx_store_url = function_exists( 'home_url' ) ? home_url() : ''; 73 73 … … 85 85 } catch ( \Exception $e ) { 86 86 // Uninstall must finish regardless, but record why the webhook survived. 87 if ( class_exists( 'GECX_Auth') ) {88 GECX_Auth::log( 'Uninstall could not delete the stored webhook: ' . $e->getMessage(), 'debug' );87 if ( class_exists( Auth::class ) ) { 88 Auth::log( 'Uninstall could not delete the stored webhook: ' . $e->getMessage(), 'debug' ); 89 89 } 90 90 } … … 106 106 } 107 107 } catch ( \Throwable $e ) { 108 if ( class_exists( 'GECX_Auth') ) {109 GECX_Auth::log( 'Uninstall could not query webhooks: ' . $e->getMessage(), 'debug' );108 if ( class_exists( Auth::class ) ) { 109 Auth::log( 'Uninstall could not query webhooks: ' . $e->getMessage(), 'debug' ); 110 110 } 111 111 } … … 173 173 174 174 $gecx_jwt = ''; 175 if ( $gecx_was_connected && '' !== $gecx_console_url && class_exists( 'GECX_Auth') ) {176 $gecx_jwt = (string) GECX_Auth::generate_existing_rs256_admin_jwt();175 if ( $gecx_was_connected && '' !== $gecx_console_url && class_exists( Auth::class ) ) { 176 $gecx_jwt = (string) Auth::generate_existing_rs256_admin_jwt(); 177 177 } 178 178 … … 198 198 199 199 if ( $gecx_budget_spent ) { 200 if ( class_exists( 'GECX_Auth') ) {201 GECX_Auth::log( 'Uninstall notification skipped for ' . $gecx_store_url . ': too little of the notification time budget remains to complete a request.', 'warning' );200 if ( class_exists( Auth::class ) ) { 201 Auth::log( 'Uninstall notification skipped for ' . $gecx_store_url . ': too little of the notification time budget remains to complete a request.', 'warning' ); 202 202 } 203 203 } elseif ( 'https' === $gecx_scheme && ( function_exists( 'wp_http_validate_url' ) ? wp_http_validate_url( $gecx_webhook_url ) : filter_var( $gecx_webhook_url, FILTER_VALIDATE_URL ) ) ) { … … 207 207 // 208 208 // wp_safe_remote_post() rather than wp_remote_post(), matching 209 // the two GECX_Admin_Console_Sync call sites: the destination comes from an209 // the two Admin\Console_Sync call sites: the destination comes from an 210 210 // option, so the resolved host is validated against the private 211 211 // and loopback ranges. redirection 0 because the request … … 231 231 // Done after the notification above, which the backend may verify by 232 232 // fetching /wp-json/gecx/v1/public-key with those keys. 233 if ( class_exists( 'GECX_Auth') ) {234 GECX_Auth::revoke_woocommerce_api_keys();235 } 236 // Literal names: GECX_Auth is not guaranteed to be loaded here.233 if ( class_exists( Auth::class ) ) { 234 Auth::revoke_woocommerce_api_keys(); 235 } 236 // Literal names: Auth is not guaranteed to be loaded here. 237 237 delete_option( 'gecx_merchant_unlinked' ); 238 238 delete_option( 'gecx_merchant_disabled' ); … … 281 281 if ( function_exists( 'delete_transient' ) ) { 282 282 delete_transient( 'gecx_admin_notice_error' ); 283 delete_transient( class_exists( 'GECX_Auth' ) && defined( 'GECX_Auth::GUEST_JWT_CACHE_TRANSIENT' ) ? GECX_Auth::GUEST_JWT_CACHE_TRANSIENT : 'gecx_guest_jwt_cache' );283 delete_transient( class_exists( Auth::class ) && defined( Auth::class . '::GUEST_JWT_CACHE_TRANSIENT' ) ? Auth::GUEST_JWT_CACHE_TRANSIENT : 'gecx_guest_jwt_cache' ); 284 284 } 285 285
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)