From ce09e65634e378af390ebcb0030c23cc522a2efa Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 25 Sep 2024 10:49:46 -0400 Subject: [PATCH 1/3] Ensure a unique local cache key --- CHANGELOG.md | 5 +++++ src/class-wp-plugin-loader.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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 ) . '-' ); } /** From bad0c9d9abf64fe8fe8a23df93d4163461269255 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 25 Sep 2024 10:51:12 -0400 Subject: [PATCH 2/3] Modern ci workflowe --- .github/workflows/all-pr-tests.yml | 44 ++++++++++++++++++++++++++ .github/workflows/coding-quality.yml | 11 ------- .github/workflows/coding-standards.yml | 11 ------- 3 files changed, 44 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/all-pr-tests.yml delete mode 100644 .github/workflows/coding-quality.yml delete mode 100644 .github/workflows/coding-standards.yml diff --git a/.github/workflows/all-pr-tests.yml b/.github/workflows/all-pr-tests.yml new file mode 100644 index 0000000..359fe9b --- /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.1, 8.2, 8.3] + 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 From 2f659e34905f846f35da9df0b45b15bdd455b0f2 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Wed, 25 Sep 2024 10:51:47 -0400 Subject: [PATCH 3/3] Limit matrix --- .github/workflows/all-pr-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all-pr-tests.yml b/.github/workflows/all-pr-tests.yml index 359fe9b..6a9f2bf 100644 --- a/.github/workflows/all-pr-tests.yml +++ b/.github/workflows/all-pr-tests.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - php: [8.1, 8.2, 8.3] + php: [8.2] wordpress: ["latest"] runs-on: ubuntu-latest # Cancel any existing runs of this workflow