Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b478333
chore: Internal Testing & Validation WPGraphQL Logging Plugin- Interf…
theodesp Oct 22, 2025
34ce41f
Updated packages. Fixed some QA issues.
colinmurphy Oct 22, 2025
ffd97dc
Fix for codeception to correctly workout percentage of code coverage.
colinmurphy Oct 22, 2025
b53a0c4
Update plugin docs and metadata for beta release. Updated PHP Doc Blo…
colinmurphy Oct 22, 2025
e191652
QA fix.
colinmurphy Oct 22, 2025
6a5c3ab
Rename admin view templates to WPGraphQLLogger*
colinmurphy Oct 22, 2025
feadd4b
Refactored error_log to only log when WP_DEBUG is defined.
colinmurphy Oct 22, 2025
99a6c7c
Make config cache duration filterable
colinmurphy Oct 22, 2025
cebd24d
Add whitelist validation for ORDER BY in find_logs
colinmurphy Oct 22, 2025
da046e8
Minor fixes. Fixed settings filter name.
colinmurphy Oct 23, 2025
3823a78
Add buffer handler to reduce database write operations for performance.
colinmurphy Oct 24, 2025
e921f18
Fixed typo.
colinmurphy Oct 24, 2025
e9c1dcb
extend recommended rules
ahuseyn Oct 27, 2025
8c617e4
Fix formatting issue.
colinmurphy Oct 28, 2025
d3822e6
Fixed issuef for passing variable by reference when the value is null…
colinmurphy Oct 28, 2025
3b760f9
Add log entity interface and WordPress DB entity
colinmurphy Oct 28, 2025
96078dd
Refactor logging interfaces and add database log service
colinmurphy Oct 28, 2025
e96004f
Fixed codeception test coverage.
colinmurphy Oct 28, 2025
ea512f1
Added LogStoreService. Refactored Download Service.
colinmurphy Oct 28, 2025
b29d376
Refactor DataDeletionScheduler to use LogServiceInterface
colinmurphy Oct 28, 2025
a925460
Refactor ViewLogsPage to use LogServiceInterface
colinmurphy Oct 28, 2025
9b5ee54
Added missing test for getting log service.
colinmurphy Oct 28, 2025
47bb318
Revert test as typo with changing signature and not needed.
colinmurphy Oct 28, 2025
0305fca
Refactored DownloadLogService to inject service.
colinmurphy Oct 29, 2025
f311a4f
Refactored ListTable to use LogServiceInterface. Refactored argument …
colinmurphy Oct 29, 2025
77fb41e
Refactored WordPressDatabaseHandler to use Log Store Service
colinmurphy Oct 29, 2025
060dc8b
Updated API Interfaces and updated the logic for activate/de-activate…
colinmurphy Oct 29, 2025
dd5ae29
Removed DatabaseEntity and LogsRepository from tests.
colinmurphy Oct 29, 2025
c58952b
Refactor database logging to use WordPressDatabaseEntity
colinmurphy Oct 29, 2025
af2055b
Update docs.
colinmurphy Oct 29, 2025
f659144
Fixed DatabaseEntity name in psalm config file.
colinmurphy Oct 29, 2025
4af2e08
Fixed some issues with Database Log Service.
colinmurphy Oct 29, 2025
da1b11c
Removed filters.
colinmurphy Oct 29, 2025
b027cf8
Add SRI to external scripts.
colinmurphy Oct 30, 2025
bb690c1
Added nonce to download action.
colinmurphy Oct 30, 2025
cb4d9d9
Add nonce verification for admin list
colinmurphy Oct 30, 2025
778a93e
Removed some filters. Fixed sort by issue.
colinmurphy Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions plugins/wpgraphql-logging/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,3 @@
### Patch Changes

- [#403](https://github.com/wpengine/hwptoolkit/pull/403) [`821908b`](https://github.com/wpengine/hwptoolkit/commit/821908b7a7b8743a44cdbdbd98eedfff7faac34a) Thanks [@colinmurphy](https://github.com/colinmurphy)! - chore: Added admin view, filters and CSV downloads.

## 0.0.1-beta

- Proof of concept. A plugin for logging data for WPGraphQL.
29 changes: 15 additions & 14 deletions plugins/wpgraphql-logging/bin/run-codeception.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ run_tests() {
fi

if [[ -n "$COVERAGE" ]]; then
if [[ -n "$COVERAGE_OUTPUT" ]]; then
local coverage="--coverage --coverage-xml $COVERAGE_OUTPUT"
else
local coverage="--coverage --coverage-xml $suites-coverage.xml"
fi
# Generate coverage in default output locations (XML + HTML)
local coverage="--coverage --coverage-xml --coverage-html"
fi

# If maintenance mode is active, de-activate it
if $(wp maintenance-mode is-active --allow-root); then
if wp maintenance-mode is-active --allow-root >/dev/null 2>&1; then
echo "Deactivating maintenance mode"
wp maintenance-mode deactivate --allow-root
fi
Expand All @@ -69,15 +66,19 @@ run_tests() {
# Check code coverage if coverage was requested
if [[ -n "$COVERAGE" ]]; then

if [[ -n "$COVERAGE_OUTPUT" ]]; then
coverage_percent=$(grep -oP '(\d+\.\d+)%' "tests/_output/coverage/index.html" | head -1 | tr -d '%')
else
coverage_percent=$(grep -oP 'line-rate="(\d+\.\d+)"' "tests/_output/coverage.xml" | head -1 | grep -oP '\d+\.\d+')
# Convert to percent
if [[ -n "$coverage_percent" ]]; then
coverage_percent=$(awk "BEGIN { printf \"%.2f\", $coverage_percent * 100 }")
# Prefer XML summary for robustness; fallback to HTML if present
if [[ -f "tests/_output/coverage.xml" ]]; then
# Extract total statements and covered statements from the summary metrics line
total_statements=$(grep -Eo 'statements="[0-9]+"' "tests/_output/coverage.xml" | head -1 | grep -Eo '[0-9]+')
total_covered=$(grep -Eo 'coveredstatements="[0-9]+"' "tests/_output/coverage.xml" | head -1 | grep -Eo '[0-9]+')
if [[ -n "$total_statements" && -n "$total_covered" && "$total_statements" -gt 0 ]]; then
coverage_percent=$(awk "BEGIN { printf \"%.2f\", ($total_covered / $total_statements) * 100 }")
fi
fi

if [[ -z "$coverage_percent" && -f "tests/_output/coverage/index.html" ]]; then
coverage_percent=$(grep -Eo '[0-9]+\.[0-9]+%' "tests/_output/coverage/index.html" | head -1 | tr -d '%')
fi
if [[ -z "$coverage_percent" ]]; then
echo "Warning: Could not determine code coverage percentage."
exit 1
Expand Down Expand Up @@ -122,7 +123,7 @@ cleanup_after() {
if [[ "$USING_XDEBUG" == '1' ]]; then
echo "Disabling XDebug 3"
rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
else98
else
echo "Disabling pcov/clobber"
docker-php-ext-disable pcov
sed -i '/pcov.enabled=1/d' /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini
Expand Down
Loading