Commit 7c4bcf6
Plugin review sweep: security, performance, a11y (1.45.0)
Addresses the full punch list from the code review across PHP backend and
JS frontend. No schema changes, no feature changes — every change lands in
an existing file.
Security
- RTG_AI: prefer RTG_ANTHROPIC_API_KEY constant over wp_options
- Guest rate limiter uses a UA+IP fingerprint instead of raw REMOTE_ADDR
- handle_tire_delete() validates tire_id before the nonce check
- log_security_event() emits a compact JSON line to error_log under WP_DEBUG
Performance
- Dashboard stats cached in a 5-minute transient, flushed on tire/rating writes
- New get_tires_with_ratings() JOIN replaces the N+1 in the AI context builder
- Link checker set_time_limit is bounded by BATCH_SIZE × REQUEST_TIMEOUT
and wrapped in function_exists() for locked-down hosts
- Card cache LRU tightened to 20 entries with single-entry eviction
- IntersectionObserver gets disconnectImageObserver() + pagehide cleanup
Accessibility
- Pagination: role="navigation", aria-label, role="status" live region, and
data-pagination delegation (no more per-render .onclick assignments)
- Image modal: focus trap, tabindex, return-focus-on-close
Refactors
- RTG_Database::validate_tire_id() — one regex, threaded through 15+ callsites
- get_filtered_tires() split into build_filter_where_clause() +
build_filter_sort_clause()
- initializeSmartSearch() uses tracked removeEventListener instead of cloneNode
- Inline style.cssText in cards.js replaced with .info-tooltip-trigger and
.tire-card-tag-list classes in rivian-tires.css
Version
- Bumped 1.44.2 → 1.45.0 in plugin header, RTG_VERSION, package.json, lockfile
- CHANGELOG entry added
Verification
- npm run build ✓ (7 targets)
- npm test ✓ 83/83
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent e901fc9 commit 7c4bcf6
15 files changed
Lines changed: 434 additions & 173 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
7 | 85 | | |
8 | 86 | | |
9 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2860 | 2860 | | |
2861 | 2861 | | |
2862 | 2862 | | |
2863 | | - | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
2864 | 2902 | | |
2865 | 2903 | | |
2866 | 2904 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
51 | 68 | | |
52 | 69 | | |
53 | 70 | | |
| |||
364 | 381 | | |
365 | 382 | | |
366 | 383 | | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | 384 | | |
393 | 385 | | |
394 | 386 | | |
| |||
432 | 424 | | |
433 | 425 | | |
434 | 426 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | 427 | | |
461 | 428 | | |
462 | 429 | | |
| |||
527 | 494 | | |
528 | 495 | | |
529 | 496 | | |
530 | | - | |
531 | | - | |
| 497 | + | |
532 | 498 | | |
533 | 499 | | |
534 | 500 | | |
| |||
593 | 559 | | |
594 | 560 | | |
595 | 561 | | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
600 | 570 | | |
601 | 571 | | |
602 | 572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
272 | 299 | | |
273 | 300 | | |
274 | 301 | | |
275 | 302 | | |
276 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
277 | 312 | | |
278 | 313 | | |
| 314 | + | |
279 | 315 | | |
280 | 316 | | |
| 317 | + | |
| 318 | + | |
281 | 319 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | 320 | | |
290 | 321 | | |
291 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
292 | 326 | | |
293 | | - | |
294 | 327 | | |
295 | 328 | | |
296 | 329 | | |
| 330 | + | |
297 | 331 | | |
298 | 332 | | |
| 333 | + | |
| 334 | + | |
299 | 335 | | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | 336 | | |
308 | 337 | | |
309 | 338 | | |
| |||
0 commit comments