Skip to content

Commit

Permalink
Merge branch 'release-2.0.0' of github.com:pantheon-systems/pantheon-…
Browse files Browse the repository at this point in the history
…advanced-page-cache into release-2.0.0
  • Loading branch information
jazzsequence committed May 24, 2024
2 parents 5bd113b + e0abcd5 commit fb9275b
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/composer.lock export-ignore
/CONTRIBUTING.md export-ignore
/gulpfile.mjs export-ignore
/package-lock.json export-ignore
#/package-lock.json export-ignore
/package.json export-ignore
/phpcs.xml.dist export-ignore
/phpunit.xml.dist export-ignore
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/composer-diff.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/composer-npm-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Composer and NPM Package Diff
on:
pull_request:
paths:
- 'composer.lock'
# - 'package-lock.json'
permissions:
contents: write
pull-requests: write
jobs:
composer-diff:
name: Composer Diff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate composer diff
id: composer_diff
uses: IonBazan/composer-diff-action@v1
- uses: marocchino/sticky-pull-request-comment@v2
if: ${{ steps.composer_diff.outputs.composer_diff_exit_code != 0 }}
with:
header: composer-diff
message: |
<strong>Composer Changes</strong>
${{ steps.composer_diff.outputs.composer_diff }}
# Removing because the workflow fails for some unknown reason, see https://github.com/pantheon-systems/pantheon-advanced-page-cache/actions/runs/9228002744/job/25391128483
# There's no support for this action, so we might need to build something new.
# npm-diff:
# name: NPM Lockfile Diff
# runs-on: ubuntu-latest
# continue-on-error: true
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Compile NPM packages
# run: npm ci
# - name: NPM Lockfile Changes
# uses: codepunkt/npm-lockfile-changes@main
# with:
# token: ${{ github.token }}
2 changes: 1 addition & 1 deletion bin/maybe-skip-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ should_run_tests=true

is_ignored_file(){
for ignore in "${ignored_paths[@]}"; do
if [[ "${1:-}" == "$ignore" ]]; then
if [[ "${1:-}" == *"$ignore"* ]]; then
return 0
fi
done
Expand Down
5 changes: 4 additions & 1 deletion gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import gulp from 'gulp';
import csso from 'gulp-csso';
import * as sassCompiler from 'sass';
import gulpSass from 'gulp-sass';
import rename from 'gulp-rename'

const sass = gulpSass(sassCompiler);

gulp.task('styles', () => {
return gulp.src('assets/sass/styles.scss') // Only compile the main file
.pipe(sass().on('error', sass.logError)) // Compile SASS to CSS
.pipe(gulp.dest('assets/css')) // Save unminified CSS
.pipe(csso()) // Minify CSS
.pipe(gulp.dest('assets/css')); // Save the CSS file
.pipe(rename({suffix: '.min'})) // Rename to styles.min.css
.pipe(gulp.dest('assets/css')); // Save the minified CSS file
});

gulp.task('clean', () => {
Expand Down
4 changes: 3 additions & 1 deletion inc/admin-interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ function enqueue_admin_assets() {

// If WP_DEBUG is true, append a timestamp to the end of the path so we get a fresh copy of the css.
$debug = defined( 'WP_DEBUG' ) && WP_DEBUG ? '-' . time() : '';
wp_enqueue_style( 'papc-admin', plugin_dir_url( __DIR__ ) . 'assets/css/styles.css', [], '2.0.0' . $debug );
// Use minified css unless SCRIPT_DEBUG is true.
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_style( 'papc-admin', plugin_dir_url( __DIR__ ) . "assets/css/styles$min.css", [], '2.0.0' . $debug );
}

/**
Expand Down
10 changes: 10 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"gulp-autoprefixer": "^9.0.0",
"gulp-concat": "^2.6.1",
"gulp-csso": "^4.0.1",
"gulp-rename": "^2.0.0",
"gulp-sass": "^5.1.0",
"node-sass": "^9.0.0",
"sass": "^1.77.1"
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Pantheon Advanced Page Cache integrates with WordPress plugins, including:
See [CONTRIBUTING.md](https://github.com/pantheon-systems/wp-saml-auth/blob/master/CONTRIBUTING.md) for information on contributing.

== Changelog ==
= 2.0.0 (23 May 2024) =
= 2.0.0-dev =
* Adds new admin alerts and Site Health tests about default cache max age settings and recommendations [[#268](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/268), [#271](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/271)]. The default Pantheon GCDN cache max age value has been updated to 1 week in the [Pantheon MU plugin](https://github.com/pantheon-systems/pantheon-mu-plugin). For more information, see the [release note](https://docs.pantheon.io/release-notes/2024/04/pantheon-mu-plugin-1-4-0-update).
* Updated UI in Pantheon Page Cache admin page when used in a Pantheon environment (with the Pantheon MU plugin). [[#272](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/272)]
* Automatically updates the cache max age to the recommended value (1 week) if it was saved at the old default value (600 seconds). [[#269](https://github.com/pantheon-systems/pantheon-advanced-page-cache/pull/269)]
Expand Down Expand Up @@ -442,7 +442,7 @@ See [CONTRIBUTING.md](https://github.com/pantheon-systems/wp-saml-auth/blob/mast
* Initial release.

== Upgrade Notice ==
= 2.0.0 (23 May 2024) =
= 2.0.0-dev =
This release requires a minimum WordPress version of 6.4.0. It uses Site Health checks and the `wp_admin_notices` function to alert users to the new cache max-age default settings and recommendations. The plugin will still function with earlier versions, but you will not get the benefit of the alerts and Site Health checks.

This version also automatically updates the cache max age (set in the [Pantheon Page Cache settings](https://docs.pantheon.io/guides/wordpress-configurations/wordpress-cache-plugin)) to the recommended value (1 week) if it was saved at the old default value (600 seconds). If the cache max age was set to any other value (or not set at all), it will not be changed. A one-time notice will be displayed in the admin interface to inform administrators of this change.
Expand Down

0 comments on commit fb9275b

Please sign in to comment.