Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure a unique local cache key #12

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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