Skip to content

Harden demo meta installation to avoid SQL syntax errors on activation#568

Merged
Soare-Robert-Daniel merged 4 commits into
developmentfrom
codex/fix-sql-syntax-error-on-activation
Apr 8, 2026
Merged

Harden demo meta installation to avoid SQL syntax errors on activation#568
Soare-Robert-Daniel merged 4 commits into
developmentfrom
codex/fix-sql-syntax-error-on-activation

Conversation

@Codex

@Codex Codex AI commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Activation was logging a SQL syntax error because the demo meta insert was built via raw string concatenation; apostrophes in seeded data ("It's a test field") broke the query even though activation succeeded.

  • Safe insert path: Replace raw INSERT ... SET construction with $wpdb->insert using %s formats, skipping productmeta_id and forcing productmeta_name to the demo title to avoid collisions.
  • Input validation: Validate json_decode() result and json_last_error() before calling ppom_decode_entities() to prevent PHP warnings on malformed JSON.
  • Insert result tracking: Introduced an $inserted counter so ppom_demo_meta_installed is only set when at least one row was successfully inserted, preventing silent failures from blocking future retry attempts.
  • Tests: Added tests/unit/test-demo-meta-install.php covering happy path insertion, the already-installed guard, productmeta_name override, productmeta_id non-reuse, and idempotency.

Example:

$data = array(
    'productmeta_name' => 'PPOM Demo Field',
    'the_meta'         => $decoded_meta_json,
    // ...
);
$wpdb->insert( $wpdb->prefix . PPOM_TABLE_META, $data, array( '%s', '%s' ) );

[!WARNING]

@Codex Codex AI changed the title [WIP] Fix SQL syntax error in log after plugin activation Harden demo meta installation to avoid SQL syntax errors on activation Apr 7, 2026
@Codex Codex AI requested a review from Soare-Robert-Daniel April 7, 2026 07:28
Codex AI and others added 2 commits April 8, 2026 13:16
Co-authored-by: Soare-Robert-Daniel <17597852+Soare-Robert-Daniel@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the plugin activation demo-meta seeding to avoid SQL syntax errors caused by raw query string concatenation (e.g., apostrophes in seeded values), by switching to $wpdb->insert and adding basic decoded-data validation.

Changes:

  • Replace raw INSERT ... SET SQL concatenation with $wpdb->insert() using %s formats while skipping productmeta_id.
  • Force productmeta_name to a fixed demo title to avoid collisions.
  • Add a guard intended to bail out when the decoded demo JSON is not a usable array.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread classes/plugin.class.php Outdated
Comment on lines +906 to +908
$ppom_meta = self::ppom_decode_entities( $ppom_meta );

if ( empty( $ppom_meta ) || ! is_array( $ppom_meta ) ) {

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new validation is too late to prevent warnings when the JSON is invalid: if json_decode() returns null/false, ppom_decode_entities() is still called with a non-iterable and will trigger a PHP warning in foreach. Validate json_decode()’s return (and ideally json_last_error()) before calling ppom_decode_entities(), or make ppom_decode_entities() safely handle non-array/non-object inputs.

Suggested change
$ppom_meta = self::ppom_decode_entities( $ppom_meta );
if ( empty( $ppom_meta ) || ! is_array( $ppom_meta ) ) {
if ( JSON_ERROR_NONE !== json_last_error() || ! is_array( $ppom_meta ) ) {
return;
}
$ppom_meta = self::ppom_decode_entities( $ppom_meta );
if ( empty( $ppom_meta ) ) {

Copilot uses AI. Check for mistakes.
Comment thread classes/plugin.class.php Outdated
Comment on lines 933 to 938
if ( ! empty( $data ) ) {
$wpdb->insert( $table, $data, $format );
}
}

update_option( 'ppom_demo_meta_installed', 1 );

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ppom_demo_meta_installed is set even if one or more inserts fail (e.g., schema mismatch, missing table, or unknown columns), which can leave the site in a state where demo meta wasn’t installed but future activations won’t retry. Consider tracking insert results (check $wpdb->insert() return value / $wpdb->last_error) and only update the option if all rows were inserted successfully (or at least if one insert succeeded), otherwise bail without setting the flag.

Copilot uses AI. Check for mistakes.
@Soare-Robert-Daniel

Copy link
Copy Markdown
Contributor

@copilot can you fix the PHPCS check and the verifie if the code review is eligible (if yes, you can fix it)

…o_meta

Agent-Logs-Url: https://github.com/Codeinwp/woocommerce-product-addon/sessions/458beb36-d813-49da-b146-cde293b9c3cb

Co-authored-by: Soare-Robert-Daniel <17597852+Soare-Robert-Daniel@users.noreply.github.com>

Copilot AI commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

@copilot can you fix the PHPCS check and the verifie if the code review is eligible (if yes, you can fix it)

Fixed in c69d895:

  • PHPCS error: Removed the commented-out debug line (// ppom_pa( $ppom_meta ); exit;)
  • PHPCS warning: Added // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery before the $wpdb->insert() call
  • Code review feedback applied:
    • Moved is_array() + json_last_error() validation before ppom_decode_entities() to avoid PHP warnings on invalid JSON
    • Introduced an $inserted counter so ppom_demo_meta_installed is only set when at least one row was successfully inserted

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/123inkt/php-codesniffer-baseline/zipball/00d7cd414cc0fc12e88ee3321d92fe3d2313a9e7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/2b1d206d81b74ed999023cffd924f862ff2753c8
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/b598aa890815b8df16363271b659d73280129101
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/c216317e96c8b3f5932808f9b0f1f7a14e3bbf55
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/845eb62303d2ca9b289ef216356568ccc075ffd1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/e0f0e5a3dc819a4a0f8d679a0f2453d941976e18
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/7a979711c87d8202b52f56c56bd719d09d8ed7f5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/bd53f24e7528422ac51d64dc8d53e8d4c4a877b3
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7795ec6fa05663d716a549d0b44e47ffc8b0d4a6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/4a088f125c970d6d6ea52c927f96fe39b330d0f1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/damian-elenbaas/elementor-stubs/zipball/fef2a9b04a59ccac73d11cce3756bbd82e8bcfe7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/ef96143054f60a2f0b2cfe8351f5d78448729e98
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/f12220f303e0d7c0844c0e5e957b0c3cee48d2f7
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/phpstan/phpstan/zipball/d01bebe3edfd4d49b9666ee5b8271ddca561042f
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/diff/zipball/98ff311ca519c3aa73ccd3de053bdb377171d7b6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/environment/zipball/56932f6049a0482853056ffd617c91ffcc754205
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/exporter/zipball/1939bc8fd1d39adcfa88c5b35335910869214c56
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/global-state/zipball/91c7c47047a971f02de57ed6f040087ef110c5d9
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/ac5b293dba925751b808e02923399fb44ff0d541
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/1d439c229e61f244ff1f211e5c99737f90c67def
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/40a4ed114a4aea5afd6df8d0f0c9cd3033097f66
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/69deeb8664f611f156a924154985fbd4911eb36b
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a691211e94ff39a34811abd521c31bd5b305b0bb
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/phpunit/zipball/172ba97bcf97ae6ef86ca256adf77aece8a143fe
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/9bfd3c6f1f08c026f542032dfb42813544f7d64c
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/72a7f7674d053d548003b16ff5a106e7e0e06eee
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/type/zipball/18f071c3a29892b037d35e6b20ddf3ea39b42874
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/a15e970b8a0bf64cfa5e86d941f5e6b08855f369
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/aa722f037b2d034828cd6c55ebe9e5c74961927e
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)
  • https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/ZKaYoq /usr/bin/composer install --quiet 42b2d8718f780b80c98c8cbb8a2f00ca136823f5d46318d2d11661839e936c1c by/cde9ac89d5189/usr/lib/git-core/git-remote-https db60a8c55da9db91ba22ae490a455d029ed/cd3bc22729531dc3b26a68d91108c523e5004d231a86c07b�� (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@Soare-Robert-Daniel

Copy link
Copy Markdown
Contributor

@copilot can you create a phpunit test for this demo db creation?

Agent-Logs-Url: https://github.com/Codeinwp/woocommerce-product-addon/sessions/18ed4b12-d03d-44aa-a395-6b2dadc64161

Co-authored-by: Soare-Robert-Daniel <17597852+Soare-Robert-Daniel@users.noreply.github.com>

Copilot AI commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

@copilot can you create a phpunit test for this demo db creation?

Added in ece7afctests/unit/test-demo-meta-install.php covers:

  • happy path: rows are inserted when the flag is absent and the demo JSON file exists
  • installed-flag guard: no rows inserted when ppom_demo_meta_installed is already set
  • option set after insert: confirms the option is written after a successful install
  • name override: every row uses 'PPOM Demo Field' instead of the original JSON name
  • ID non-reuse: auto-assigned DB ID differs from the productmeta_id in the seed file (183)
  • idempotency: a second call doesn't duplicate rows

@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review April 8, 2026 11:50
@pirate-bot

Copy link
Copy Markdown
Contributor

Plugin build for ece7afc is ready 🛎️!

@Soare-Robert-Daniel Soare-Robert-Daniel merged commit b6dc92e into development Apr 8, 2026
12 checks passed
@Soare-Robert-Daniel Soare-Robert-Daniel deleted the codex/fix-sql-syntax-error-on-activation branch April 8, 2026 11:55
@pirate-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 34.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Indicate that an issue has been resolved and released in a particular version of the product.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants