diff --git a/.github/workflows/all-pr-tests.yml b/.github/workflows/all-pr-tests.yml new file mode 100644 index 0000000..6a9f2bf --- /dev/null +++ b/.github/workflows/all-pr-tests.yml @@ -0,0 +1,44 @@ +name: "All Pull Request Tests" + +on: + pull_request: + branches: + - develop + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + # We use a single job to ensure that all steps run in the same environment and + # reduce the number of minutes used. + pr-tests: + # Don't run on draft PRs + if: github.event.pull_request.draft == false + # Timeout after 10 minutes + timeout-minutes: 10 + # Define a matrix of PHP/WordPress versions to test against + strategy: + fail-fast: false + matrix: + php: [8.2] + wordpress: ["latest"] + runs-on: ubuntu-latest + # Cancel any existing runs of this workflow + concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}-P${{ matrix.php }}-WP${{ matrix.wordpress }} + cancel-in-progress: true + # Name the job in the matrix + name: "PR Tests PHP ${{ matrix.php }} WordPress ${{ matrix.wordpress }}" + steps: + - uses: actions/checkout@v4 + + - name: Run General Tests + # See https://github.com/alleyinteractive/action-test-general for more options + uses: alleyinteractive/action-test-general@develop + + - name: Run PHP Tests + # See https://github.com/alleyinteractive/action-test-php for more options + uses: alleyinteractive/action-test-php@develop + with: + php-version: '${{ matrix.php }}' + wordpress-version: '${{ matrix.wordpress }}' + skip-wordpress-install: 'true' + skip-services: 'true' # Skip MySQL unless the library is not using SQLite testing. diff --git a/.github/workflows/coding-quality.yml b/.github/workflows/coding-quality.yml deleted file mode 100644 index 0d6c2f9..0000000 --- a/.github/workflows/coding-quality.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Code Quality - -on: - push: - branches: - - main - pull_request: - -jobs: - code-quality: - uses: alleyinteractive/.github/.github/workflows/php-code-quality.yml@main diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml deleted file mode 100644 index 3a27ce6..0000000 --- a/.github/workflows/coding-standards.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Coding Standards - -on: - push: - branches: - - develop - pull_request: - -jobs: - coding-standards: - uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b295e3..c1ae69f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to `WP Plugin Loader` will be documented in this file. +## 0.1.5 - 2024-09-25 + +- Ensure that the default cache key is unique to each installation. Previously + caching could be polluted across different installations on the same server. + ## 0.1.4 - 2024-04-24 - Fix to actually allow caching to be enabled. diff --git a/src/class-wp-plugin-loader.php b/src/class-wp-plugin-loader.php index c01a868..a5606db 100644 --- a/src/class-wp-plugin-loader.php +++ b/src/class-wp-plugin-loader.php @@ -77,7 +77,7 @@ public function prevent_activations( bool $prevent = true ): static { * @return static */ public function enable_caching( ?string $prefix = null ): static { - return $this->set_cache_prefix( $prefix ?? 'wp-plugin-loader-' ); + return $this->set_cache_prefix( $prefix ?? 'wpl-' . basename( ABSPATH ) . '-' ); } /**