Skip to content

Silver Assist Post Revalidate v1.4.0

Choose a tag to compare

@github-actions github-actions released this 13 Oct 00:27
· 83 commits to master since this release

What's New in v1.4.0

Added

  • Configuration Class: New centralized post type management system
    • Singleton Pattern: Configuration::instance() for centralized access
    • Post Type Methods: get_enabled_post_types(), is_post_type_enabled($type)
    • Label Helpers: get_post_type_label($type), get_post_type_label_plural($type)
    • Future-Ready: Prepared with @todo comments for settings UI integration
    • Type-Safe: Uses WordPress WP_Post_Type objects
    • Test Coverage: 10 unit tests covering all Configuration methods
  • Manual Revalidation UI: New admin interface for manual cache revalidation
    • Row Actions: "Revalidate" link in post list table (alongside Edit, Quick Edit, Trash, View)
    • Meta Box: "Revalidate" button in post editor sidebar (Gutenberg + Classic Editor)
    • AJAX Support: Real-time revalidation with loading states and feedback
    • Admin Notices: WordPress-style success/error messages
    • Non-AJAX Fallback: Row action works without JavaScript (accessibility)
    • Security: Nonce validation + edit_posts capability checks on all endpoints
    • Trigger Tracking: Log entries now include trigger field ('manual' vs 'auto')
    • Comprehensive Tests: 10 integration tests for complete feature coverage
  • New Class: ManualRevalidation handles all manual revalidation functionality
  • New JavaScript: manual-revalidate.js provides AJAX handler for meta box button
  • Performance Test Suite: Comprehensive benchmark tests for performance optimization
    • 6 Performance Tests: Bulk operations, memory limits, N+1 queries, transient performance, single operations, log rotation
    • Baseline Metrics: Establishes performance benchmarks for future optimization work
    • Test Coverage: All tests passing with metrics within acceptable limits
      • Bulk revalidation: 395ms for 100 posts (target <10s) ✅
      • Memory usage: <10MB for 100 entries ✅
      • N+1 queries: No linear scaling detected ✅
      • Transient operations: 35ms for 100 operations ✅
      • Single revalidation: 4.82ms (target <100ms) ✅
      • Log rotation: 482ms with FIFO verified ✅

Changed

  • Post Type Management: Refactored to use Configuration class (no more hardcoded 'post')
    • All post type checks now use Configuration::is_post_type_enabled()
    • Removed hardcoded 'post' strings from Revalidate.php
    • Removed hardcoded 'post' strings from ManualRevalidation.php
    • Dynamic post type in meta box registration
    • Dynamic post type in redirect URLs
    • Prepared for future custom post types support
  • JavaScript Namespace: Renamed global functions to avoid collision with other Silver Assist plugins
    • Function: silverAssistCheckUpdates()silverAssistRevalidateCheckUpdates()
    • Data object: silverAssistCheckUpdatesDatasilverAssistRevalidateCheckUpdatesData
    • Each Silver Assist plugin now uses plugin-specific function names
    • Prevents function overwriting when multiple plugins are active
  • Revalidate Class: Extended with trigger parameter support
    • Added revalidate_path($path, $trigger = 'auto') method
    • Updated revalidate_paths() to accept $trigger parameter
    • Log entries now include 'trigger' field for analytics
    • Backward compatible: default trigger is 'auto'
  • Test Infrastructure: Updated factory calls from $this->factory to static::factory() across all test files
    • Fixes deprecation warnings in recent PHPUnit versions
    • Updated in: ManualRevalidation_Test, TransientCooldown_Test, Revalidate_Test, Performance_Test

Improved

  • Update Check UX: Replaced JavaScript alert() calls with WordPress-style admin notices
    • Added showAdminNotice() helper function for consistent UI
    • Success/info notices auto-dismiss after 5 seconds
    • Error/warning notices require manual dismissal
    • Smooth fade animations for better user experience
    • Added "Checking for updates..." notice during AJAX request
    • Added 2-second delay before redirect when update available

Fixed

  • Settings Hub Integration: Added missing echo statement in update check callback
    • Settings Hub requires callbacks to echo JavaScript, not return it
    • Ensures "Check Updates" button functions correctly in Settings Hub dashboard
  • PHPStan Compliance: Fixed type error in ManualRevalidation.php - cast post ID to string for esc_attr()
  • Code Quality: All PHPStan level 8 checks passing

Installation

  1. Download silver-assist-post-revalidate-v1.4.0.zip
  2. Go to WordPress Admin > Plugins > Add New > Upload Plugin
  3. Choose the downloaded ZIP file and click "Install Now"
  4. Activate the plugin
  5. Configure your revalidation endpoint at Settings > Post Revalidate

Automatic Updates

This plugin includes automatic update functionality. You'll receive notifications in your WordPress admin when new versions are available.

Requirements

  • PHP 8.2 or higher
  • WordPress 6.5 or higher

Support