feat: Migrate to Google Merchant API and remove Composer dependencies

- Fix ISE 500 error on plugin activation:
  - Defer wc_get_logger() call in Logger class (lazy initialization)
  - Move plugin init to plugins_loaded hook with priority 20
  - Remove invalid Google_Service_ShoppingContent_Reports instantiation

- Migrate from deprecated Content API to new Merchant API:
  - Rewrite Google API class with direct REST calls
  - Implement JWT authentication using PHP OpenSSL
  - Use WordPress wp_remote_* functions for HTTP requests
  - Support Price Competitiveness reports for competitor pricing

- Remove all Composer dependencies:
  - Delete vendor/ directory (~50 packages)
  - Delete composer.json and composer.lock
  - Remove setup scripts and related documentation

- Plugin is now fully self-contained with no external dependencies

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 08:29:25 +01:00
parent 366352fb14
commit d1f3607895
32462 changed files with 344 additions and 4063131 deletions

View File

@@ -40,8 +40,19 @@ class Informatiq_SP_Logger {
*/
public function __construct() {
global $wpdb;
$this->wc_logger = wc_get_logger();
$this->table_name = $wpdb->prefix . 'informatiq_sp_logs';
$this->table_name = $wpdb->prefix . 'informatiq_sp_logs';
}
/**
* Get WC Logger instance (lazy initialization).
*
* @return WC_Logger|null
*/
private function get_wc_logger() {
if ( null === $this->wc_logger && function_exists( 'wc_get_logger' ) ) {
$this->wc_logger = wc_get_logger();
}
return $this->wc_logger;
}
/**
@@ -77,7 +88,10 @@ class Informatiq_SP_Logger {
* @param array $context Additional context.
*/
public function info( $message, $context = array() ) {
$this->wc_logger->info( $message, array_merge( array( 'source' => $this->source ), $context ) );
$logger = $this->get_wc_logger();
if ( $logger ) {
$logger->info( $message, array_merge( array( 'source' => $this->source ), $context ) );
}
}
/**
@@ -87,7 +101,10 @@ class Informatiq_SP_Logger {
* @param array $context Additional context.
*/
public function error( $message, $context = array() ) {
$this->wc_logger->error( $message, array_merge( array( 'source' => $this->source ), $context ) );
$logger = $this->get_wc_logger();
if ( $logger ) {
$logger->error( $message, array_merge( array( 'source' => $this->source ), $context ) );
}
}
/**
@@ -97,7 +114,10 @@ class Informatiq_SP_Logger {
* @param array $context Additional context.
*/
public function warning( $message, $context = array() ) {
$this->wc_logger->warning( $message, array_merge( array( 'source' => $this->source ), $context ) );
$logger = $this->get_wc_logger();
if ( $logger ) {
$logger->warning( $message, array_merge( array( 'source' => $this->source ), $context ) );
}
}
/**