fix: address PR #383 post-merge review feedback#399
Merged
Conversation
…ets-heading class
…ead of string literal
93ad6c5 to
3e33cbc
Compare
PHPUnit Test FailureOne or more PHP version targets failed in this workflow run. See all PHPUnit errors (click to expand)Affected PHP version: PHPUnit\Framework\ExpectationFailedException
Code_Snippets\Tests\Cloud_API_Featured_Test::test_empty_filters_produce_same_cache_key
Empty filter values should hash identically to no filters.
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'cs_featured_snippets_v1779809218531.1_p1_pp10_d751713988987e9331980363e24189ce'
+'cs_featured_snippets_v1779809218531_p1_pp10_d751713988987e9331980363e24189ce'
/home/runner/work/code-snippets/code-snippets/tests/phpunit/test-cloud-api-featured.php:383
phpvfscomposer:///home/runner/work/code-snippets/code-snippets/src/vendor/phpunit/phpunit/phpunit:106Please review the failing jobs and fix the issues before merging. |
Playwright Test FailureOne or more Playwright targets failed in this workflow run. See all Playwright errors (click to expand)Affected Playwright test: Affected Playwright test: Affected Playwright test: Please review the failing jobs and fix the issues before merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses unresolved reviewer feedback from PR #383. PHP, test, and standards fixes only — JS/TS refactoring handled separately by maintainer in core-beta.
PHP
DELETE FROM wp_options WHERE option_name LIKEwith version-counter cache invalidation (cs_featured_cache_versionoption bumped on flush, old keys expire naturally via WordPress transient expiry)array_filterbefore hashing cache key to prevent cache fragmentationget_cloud_types(),get_cloud_categories()methods and their/types,/categoriesREST routes (filters delivered inline via response body, no JS consumer exists)get_filter_argsdocstrings: descriptions now say "ID" instead of "name (comma-separated)" matching actual accepted inputCloud_Snippetsdocblock:$snippetstyped asCloud_Snippet[], remove dead$successpropertyFEATURED_VERSION_OPTIONas public constant, reference fromUninstallerinstead of duplicated string literaldelete_option()forcs_featured_cache_versionin uninstall cleanup pathJS (minor, non-architectural)
code-snippetstext domain to error banner i18n string inCloudSearch.tsxnoopenertotarget="_blank"rel attribute inSearchResult.tsxconnectCloudproperty fromWindow.tstype (never localized from PHP)Tests
.cloud-featured-headingto.cloud-snippets-headingwithhasTextfilterclear_caches()invalidates featured cache (next call re-fetches)Backwards compatibility
Cloud_API::get_cloud_types(),Cloud_API::get_cloud_categories(), and their REST routes were introduced in PR #383 oncore-betaonly, never shipped to production. No external consumers — confirmed via grep. Filter options are delivered inline in every search and featured API response.New
cs_featured_cache_versionoption added towp_options. Cleaned up inUninstaller::uninstall_current_site().Test results
npm run lint— 0 errors, 1 pre-existing PHPCS warning (Cloud_API direct DB query — removed by this PR)npm run test:php— 86 tests, 201 assertions, 0 failuresnpm run test:playwright— 63 passed, 9 pre-existing failures (download bulk actions + quicknav timeouts). All 6 community-featured tests pass