Skip to content

Conversation

pfefferle
Copy link
Member

@pfefferle pfefferle commented May 9, 2025

This PR adds integration support for the LiteSpeed Cache plugin to prevent ActivityPub JSON responses from being cached incorrectly. The integration automatically adds Apache rewrite rules to the .htaccess file and includes a Site Health check to verify proper configuration.

Proposed changes:

  • Adds automatic .htaccess rule management for LiteSpeed Cache
  • Implements Site Health integration to monitor configuration status
  • Includes comprehensive test coverage for all functionality

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  1. Install LiteSpeed Cache plugin
  2. Verify htaccess rules were added to the TOP of the file
  3. Should see the # BEGIN ActivityPub LiteSpeed Cache section at the top, before WordPress rules
  4. Check Site Health shows green status
  5. Cleanup

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Add LiteSpeed Cache integration to prevent ActivityPub JSON responses from being cached incorrectly. Includes automatic .htaccess rules and Site Health check to ensure proper configuration.

@pfefferle pfefferle self-assigned this May 9, 2025
@github-actions github-actions bot added [Focus] Compatibility Ensuring the plugin plays well with other plugins [Status] In Progress labels May 9, 2025
Copy link
Member

@obenland obenland left a comment

Choose a reason for hiding this comment

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

I'm sensing a theme 🙂

Is there anything that needs to be done for nginx?

@pfefferle
Copy link
Member Author

I will check for an NGINX version, but this is still quite early in the progress... sadly insert_with_markers always "appends" the rules but the litespeed ones have to be at the top of the file.

Copy link

@Copilot Copilot AI left a comment

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 adds integration support for the LiteSpeed Cache plugin to prevent ActivityPub JSON responses from being cached incorrectly. The integration automatically adds Apache rewrite rules to the .htaccess file and includes a Site Health check to verify proper configuration.

  • Adds automatic .htaccess rule management for LiteSpeed Cache
  • Implements Site Health integration to monitor configuration status
  • Includes comprehensive test coverage for all functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
integration/class-litespeed-cache.php Core integration class implementing .htaccess rule management, Site Health checks, and configuration tracking
integration/load.php Initializes the LiteSpeed Cache integration when plugins are loaded
tests/phpunit/tests/integration/class-test-litespeed-cache.php Comprehensive test suite covering .htaccess manipulation, option management, and Site Health checks
Comments suppressed due to low confidence (1)

integration/class-litespeed-cache.php:1

  • Inconsistent capitalization of 'LiteSpeed'. Should be 'LiteSpeed Cache might not be' to match the official product name.
<?php

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

pfefferle and others added 3 commits October 23, 2025 12:28
Introduces is_plugin_active_with_fallback() to safely check plugin activation status outside admin context. Updates LiteSpeed Cache and Surge integrations to use this utility for improved reliability when checking if dependent plugins are active.
Replaces all instances of 'Litespeed Cache' with 'LiteSpeed Cache' in integration and test files for consistency and correct branding.
@pfefferle pfefferle marked this pull request as ready for review October 23, 2025 10:31
@pfefferle pfefferle requested a review from obenland October 23, 2025 10:31
Refactored the plugin activation check by renaming is_plugin_active_with_fallback to is_plugin_active in functions.php. Updated all references in LiteSpeed Cache and Surge integration classes to use the new function name for consistency and clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Focus] Compatibility Ensuring the plugin plays well with other plugins [Status] In Progress [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants