Skip to content

Commit

Permalink
Merge pull request #12 from alleyinteractive/hotfix/cache-key
Browse files Browse the repository at this point in the history
Ensure a unique local cache key
  • Loading branch information
srtfisher authored Sep 25, 2024
2 parents c0363df + 2f659e3 commit e390024
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 23 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/all-pr-tests.yml
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 0 additions & 11 deletions .github/workflows/coding-quality.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/workflows/coding-standards.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/class-wp-plugin-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) . '-' );
}

/**
Expand Down

0 comments on commit e390024

Please sign in to comment.