From 2196991b8400a4b5da70db3eaf3732f0c3589899 Mon Sep 17 00:00:00 2001 From: Jay McPartland Date: Fri, 17 Jul 2026 14:20:02 +0100 Subject: [PATCH 01/13] Remove cache file --- wp-content/themes/humanity-theme/functions.php | 1 - .../themes/humanity-theme/includes/root/caching.php | 13 ------------- 2 files changed, 14 deletions(-) delete mode 100644 wp-content/themes/humanity-theme/includes/root/caching.php diff --git a/wp-content/themes/humanity-theme/functions.php b/wp-content/themes/humanity-theme/functions.php index c7515d20..ace73c4b 100644 --- a/wp-content/themes/humanity-theme/functions.php +++ b/wp-content/themes/humanity-theme/functions.php @@ -13,7 +13,6 @@ */ #region root require_once realpath( __DIR__ . '/includes/root/compatibility.php' ); -require_once realpath( __DIR__ . '/includes/root/caching.php' ); require_once realpath( __DIR__ . '/includes/root/localisation.php' ); require_once realpath( __DIR__ . '/includes/root/accessibility.php' ); require_once realpath( __DIR__ . '/includes/root/permalinks.php' ); diff --git a/wp-content/themes/humanity-theme/includes/root/caching.php b/wp-content/themes/humanity-theme/includes/root/caching.php deleted file mode 100644 index 1e92f68c..00000000 --- a/wp-content/themes/humanity-theme/includes/root/caching.php +++ /dev/null @@ -1,13 +0,0 @@ - Date: Wed, 12 Aug 2026 11:04:05 +0100 Subject: [PATCH 02/13] Fixup caching in image data class --- .../includes/helpers/class-get-image-data.php | 44 +++++++++++++------ 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/wp-content/themes/humanity-theme/includes/helpers/class-get-image-data.php b/wp-content/themes/humanity-theme/includes/helpers/class-get-image-data.php index d3d7c99b..7f05646b 100644 --- a/wp-content/themes/humanity-theme/includes/helpers/class-get-image-data.php +++ b/wp-content/themes/humanity-theme/includes/helpers/class-get-image-data.php @@ -98,6 +98,13 @@ public function credit(): string { return ''; } + $cache_key = hash( 'xxh3', __FUNCTION__ . $this->image_id . get_current_blog_id() ); + $cached = (string) wp_cache_get( $cache_key ); + + if ( $cached ) { + return wp_kses_post( $cached ); + } + $image = get_post( $this->image_id ); $credit = ''; @@ -113,13 +120,6 @@ public function credit(): string { return $credit; } - $cache_key = hash( 'xxh3', __FUNCTION__ . $this->image_id . get_current_blog_id() ); - $cached = wp_cache_get( $cache_key ); - - if ( $cached ) { - return $cached; - } - $site_object = new Site(); $switcher = new SingleSwitcher(); $attachment = new Attachment( $site_object, $switcher ); @@ -165,9 +165,21 @@ public function credit(): string { * @return string */ public function alt_text(): string { + if ( 0 === $this->image_id ) { + return ''; + } + + $cache_key = hash( 'xxh3', __FUNCTION__ . $this->image_id . get_current_blog_id() ); + $cached = (string) wp_cache_get( $cache_key ); + + if ( $cached ) { + return wp_kses_post( $cached ); + } + $alt_text = get_post_meta( $this->image_id, '_wp_attachment_image_alt', true ) ?: ''; if ( ! class_exists( '\MultisiteGlobalMedia\Plugin', false ) ) { + wp_cache_add( $cache_key, $alt_text ); return $alt_text; } @@ -184,6 +196,7 @@ public function alt_text(): string { // if the image ID doesn't include plugin's prefix if ( ! $prefix->invoke( $attachment, $this->image_id, $site_object->idSitePrefix() ) ) { + wp_cache_add( $cache_key, $alt_text ); return $alt_text; } @@ -195,6 +208,8 @@ public function alt_text(): string { $alt_text = get_post_meta( $source_image_id, '_wp_attachment_image_alt', true ) ?: ''; $switcher->restoreBlog(); + wp_cache_add( $cache_key, $alt_text ); + return $alt_text; } @@ -208,6 +223,13 @@ public function caption(): string { return ''; } + $cache_key = hash( 'xxh3', __FUNCTION__ . $this->image_id . get_current_blog_id() ); + $cached = (string) wp_cache_get( $cache_key ); + + if ( $cached ) { + return wp_kses_post( $cached ); + } + $image = get_post( $this->image_id ); $caption = ''; @@ -216,16 +238,10 @@ public function caption(): string { } if ( ! class_exists( '\MultisiteGlobalMedia\Plugin', false ) ) { + wp_cache_add( $cache_key, $caption ); return $caption; } - $cache_key = hash( 'xxh3', sprintf( '%s:%s', __FUNCTION__, $this->image_id ) ); - $cached = wp_cache_get( $cache_key ); - - if ( $cached ) { - return $cached; - } - $site_object = new Site(); $switcher = new SingleSwitcher(); $attachment = new Attachment( $site_object, $switcher ); From eea98d401099d538a557e270b61303d7e229f86c Mon Sep 17 00:00:00 2001 From: Jay McPartland Date: Wed, 12 Aug 2026 11:04:34 +0100 Subject: [PATCH 03/13] Update changelog and bump version for release --- CHANGELOG.md | 5 +++++ wp-content/themes/humanity-theme/style.css | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 493936ad..091848ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### v3.0.5 +Performance: +- Many caching improvements across blocks and helper functions +- Add new fast cross-blog helper functions + ### v3.0.4 Fixes: - Taxonomy filters on RSS feed diff --git a/wp-content/themes/humanity-theme/style.css b/wp-content/themes/humanity-theme/style.css index f26cd324..ceba6751 100644 --- a/wp-content/themes/humanity-theme/style.css +++ b/wp-content/themes/humanity-theme/style.css @@ -2,7 +2,7 @@ * Theme Name: Humanity Theme * Theme URI: https://github.com/amnestywebsite/humanity-theme * Description: The Amnesty International WordPress Humanity Theme - * Version: 3.0.4 + * Version: 3.0.5 * Author: Amnesty International * Author URI: https://www.amnesty.org * License: GPL-2.0-or-later From 9103d78e92284b6de4b10e0ed971c3ba34d90f5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 18:00:42 +0000 Subject: [PATCH 04/13] Bump @babel/core from 7.29.0 to 7.29.6 in /private Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.29.0 to 7.29.6. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.29.6/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-version: 7.29.6 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- private/package.json | 2 +- private/yarn.lock | 98 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 85 insertions(+), 15 deletions(-) diff --git a/private/package.json b/private/package.json index cbb44a54..a973a86a 100644 --- a/private/package.json +++ b/private/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "@babel/cli": "^7.28.6", - "@babel/core": "^7.29.0", + "@babel/core": "^7.29.6", "@babel/eslint-parser": "^7.28.6", "@babel/plugin-proposal-pipeline-operator": "^7.28.6", "@babel/plugin-transform-class-properties": "^7.28.6", diff --git a/private/yarn.lock b/private/yarn.lock index 354fa127..330bd777 100644 --- a/private/yarn.lock +++ b/private/yarn.lock @@ -70,6 +70,17 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/code-frame@npm:7.29.7" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.29.7" + js-tokens: "npm:^4.0.0" + picocolors: "npm:^1.1.1" + checksum: 10c0/169fc2080169a40c1760155eaaaf739bcb882df0bec76a83adbda5493645bc17270a3434b8848c494b1933e96fe1d147370001e3cda09a39f43ae30f08ef2069 + languageName: node + linkType: hard + "@babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.22.9, @babel/compat-data@npm:^7.23.3, @babel/compat-data@npm:^7.23.5": version: 7.23.5 resolution: "@babel/compat-data@npm:7.23.5" @@ -107,16 +118,16 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.29.0": - version: 7.29.0 - resolution: "@babel/core@npm:7.29.0" +"@babel/core@npm:^7.29.6": + version: 7.29.6 + resolution: "@babel/core@npm:7.29.6" dependencies: "@babel/code-frame": "npm:^7.29.0" - "@babel/generator": "npm:^7.29.0" + "@babel/generator": "npm:^7.29.6" "@babel/helper-compilation-targets": "npm:^7.28.6" "@babel/helper-module-transforms": "npm:^7.28.6" - "@babel/helpers": "npm:^7.28.6" - "@babel/parser": "npm:^7.29.0" + "@babel/helpers": "npm:^7.29.2" + "@babel/parser": "npm:^7.29.3" "@babel/template": "npm:^7.28.6" "@babel/traverse": "npm:^7.29.0" "@babel/types": "npm:^7.29.0" @@ -126,7 +137,7 @@ __metadata: gensync: "npm:^1.0.0-beta.2" json5: "npm:^2.2.3" semver: "npm:^6.3.1" - checksum: 10c0/5127d2e8e842ae409e11bcbb5c2dff9874abf5415e8026925af7308e903f4f43397341467a130490d1a39884f461bc2b67f3063bce0be44340db89687fd852aa + checksum: 10c0/0179b763970e9e00e35e9ff137fa4536dba45bb8d5a8e93835f72eacedf0ee1098e6012b3e82be2715d2560bab79eb1514003e1cd88e4245f8f9f67d5175df3f languageName: node linkType: hard @@ -183,6 +194,19 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.29.6": + version: 7.29.7 + resolution: "@babel/generator@npm:7.29.7" + dependencies: + "@babel/parser": "npm:^7.29.7" + "@babel/types": "npm:^7.29.7" + "@jridgewell/gen-mapping": "npm:^0.3.12" + "@jridgewell/trace-mapping": "npm:^0.3.28" + jsesc: "npm:^3.0.2" + checksum: 10c0/9bf72b01b5bd0ea5b1288a0e37dbd360bff2f2b1ce73342c0d40fb3db2ec3dc004ada5ffa925c5e12939a416eed59e600d562b8ecd938ce0d27dfd0eb6c6c2b7 + languageName: node + linkType: hard + "@babel/helper-annotate-as-pure@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-annotate-as-pure@npm:7.22.5" @@ -562,6 +586,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/helper-string-parser@npm:7.29.7" + checksum: 10c0/194bc0f1716e396d5ffde56ad6119745fb9557662c98611590e5e454906783a4ccb21ce93056b8eb69a4909044834e45d96e50ac695bbe9e3221648fe033c06c + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.22.20": version: 7.22.20 resolution: "@babel/helper-validator-identifier@npm:7.22.20" @@ -576,6 +607,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/helper-validator-identifier@npm:7.29.7" + checksum: 10c0/4795354e7ae0dcafa72de1cd04ec51252dc1498517170beaf019e03effc5b7bf13c6b21a3949a77e07b8125be7f106ed1131350d8ebd4566ae874094a726d62b + languageName: node + linkType: hard + "@babel/helper-validator-option@npm:^7.22.15, @babel/helper-validator-option@npm:^7.23.5": version: 7.23.5 resolution: "@babel/helper-validator-option@npm:7.23.5" @@ -623,13 +661,13 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.28.6": - version: 7.28.6 - resolution: "@babel/helpers@npm:7.28.6" +"@babel/helpers@npm:^7.29.2": + version: 7.29.7 + resolution: "@babel/helpers@npm:7.29.7" dependencies: - "@babel/template": "npm:^7.28.6" - "@babel/types": "npm:^7.28.6" - checksum: 10c0/c4a779c66396bb0cf619402d92f1610601ff3832db2d3b86b9c9dd10983bf79502270e97ac6d5280cea1b1a37de2f06ecbac561bd2271545270407fbe64027cb + "@babel/template": "npm:^7.29.7" + "@babel/types": "npm:^7.29.7" + checksum: 10c0/218e8d10953647c9f44775f5a022b227a182674853b5ea8631889deb7e1a3e4bc870388aaecf59bb8bd92a87f9a96220ed3f70a35bffec6bcf9169ecb67891ac languageName: node linkType: hard @@ -664,6 +702,17 @@ __metadata: languageName: node linkType: hard +"@babel/parser@npm:^7.29.3, @babel/parser@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/parser@npm:7.29.7" + dependencies: + "@babel/types": "npm:^7.29.7" + bin: + parser: ./bin/babel-parser.js + checksum: 10c0/65133038f80b54a714d6027cb77cee3f9a6b5c4c6842ce674301e13947cbcbfa8055e63acaf1b84c085d34226a14425b2c2b97b829e0e226d2e8f1299942a51d + languageName: node + linkType: hard + "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.28.5": version: 7.28.5 resolution: "@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.28.5" @@ -2572,6 +2621,17 @@ __metadata: languageName: node linkType: hard +"@babel/template@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/template@npm:7.29.7" + dependencies: + "@babel/code-frame": "npm:^7.29.7" + "@babel/parser": "npm:^7.29.7" + "@babel/types": "npm:^7.29.7" + checksum: 10c0/8bb7f900dcab0e9e1c5ffbc33ca10e0d26b7b2e2ca804becb73ee771b9c4ed6e2908a4ae4a14c08560febb45d2b6b9a173955e42ad404d05f8b04840a14d9c58 + languageName: node + linkType: hard + "@babel/traverse@npm:^7.23.5": version: 7.23.5 resolution: "@babel/traverse@npm:7.23.5" @@ -2626,6 +2686,16 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.29.7": + version: 7.29.7 + resolution: "@babel/types@npm:7.29.7" + dependencies: + "@babel/helper-string-parser": "npm:^7.29.7" + "@babel/helper-validator-identifier": "npm:^7.29.7" + checksum: 10c0/b6623994c69717fa27294f5fa46d59140338e2d86c6c1c13085c84ef7d53086ee357fbf4fe9abe3dd3da75734dc77c4c0df2f90fb29e667558bb3b3fb705e88f + languageName: node + linkType: hard + "@braintree/sanitize-url@npm:^7.1.2": version: 7.1.2 resolution: "@braintree/sanitize-url@npm:7.1.2" @@ -7598,7 +7668,7 @@ __metadata: resolution: "humanity-theme@workspace:." dependencies: "@babel/cli": "npm:^7.28.6" - "@babel/core": "npm:^7.29.0" + "@babel/core": "npm:^7.29.6" "@babel/eslint-parser": "npm:^7.28.6" "@babel/plugin-proposal-pipeline-operator": "npm:^7.28.6" "@babel/plugin-transform-class-properties": "npm:^7.28.6" From 1022fbe191f03cd7eaf326bb45d47192b2a98be1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 07:24:26 +0000 Subject: [PATCH 05/13] Bump immutable from 5.1.5 to 5.1.9 in /private Bumps [immutable](https://github.com/immutable-js/immutable-js) from 5.1.5 to 5.1.9. - [Release notes](https://github.com/immutable-js/immutable-js/releases) - [Changelog](https://github.com/immutable-js/immutable-js/blob/main/CHANGELOG.md) - [Commits](https://github.com/immutable-js/immutable-js/compare/v5.1.5...v5.1.9) --- updated-dependencies: - dependency-name: immutable dependency-version: 5.1.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- private/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/private/yarn.lock b/private/yarn.lock index 330bd777..e6b20388 100644 --- a/private/yarn.lock +++ b/private/yarn.lock @@ -7757,9 +7757,9 @@ __metadata: linkType: hard "immutable@npm:^5.0.2": - version: 5.1.5 - resolution: "immutable@npm:5.1.5" - checksum: 10c0/8017ece1578e3c5939ba3305176aee059def1b8a90c7fa2a347ef583ebbd38cbe77ce1bbd786a5fab57e2da00bbcb0493b92e4332cdc4e1fe5cfb09a4688df31 + version: 5.1.9 + resolution: "immutable@npm:5.1.9" + checksum: 10c0/ae7032b60b81b682f3e7e4df13e1ec9a401a603eb81b15bb3e37331ed6666e318c71994c6936e1462eb443d32d04769396562a7e2669da22457c8ba279c03ad2 languageName: node linkType: hard From 22a27c133adb62f5cad3825cfcb1a6e75f34c86f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 04:27:35 +0000 Subject: [PATCH 06/13] Bump brace-expansion from 1.1.13 to 1.1.18 in /private Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.13 to 1.1.18. - [Release notes](https://github.com/juliangruber/brace-expansion/releases) - [Commits](https://github.com/juliangruber/brace-expansion/commits) --- updated-dependencies: - dependency-name: brace-expansion dependency-version: 1.1.18 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- private/yarn.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/private/yarn.lock b/private/yarn.lock index e6b20388..c6abe058 100644 --- a/private/yarn.lock +++ b/private/yarn.lock @@ -1672,16 +1672,16 @@ __metadata: linkType: hard "@babel/plugin-transform-modules-systemjs@npm:^7.23.3": - version: 7.23.3 - resolution: "@babel/plugin-transform-modules-systemjs@npm:7.23.3" + version: 7.29.4 + resolution: "@babel/plugin-transform-modules-systemjs@npm:7.29.4" dependencies: - "@babel/helper-hoist-variables": "npm:^7.22.5" - "@babel/helper-module-transforms": "npm:^7.23.3" - "@babel/helper-plugin-utils": "npm:^7.22.5" - "@babel/helper-validator-identifier": "npm:^7.22.20" + "@babel/helper-module-transforms": "npm:^7.28.6" + "@babel/helper-plugin-utils": "npm:^7.28.6" + "@babel/helper-validator-identifier": "npm:^7.28.5" + "@babel/traverse": "npm:^7.29.0" peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 10c0/0d55280a276510222c8896bf4e581acb84824aa5b14c824f7102242ad6bc5104aaffe5ab22fe4d27518f4ae2811bd59c36d0c0bfa695157f9cfce33f0517a069 + checksum: 10c0/1da94f89ef8ba1aa1501136a80eb4c010c6a19f5550e10db84677b3ccb7a4934c8098f2b5134def87cf513bf05747ffa523d33722a1ea5a5c8ef956e9136c4c2 languageName: node linkType: hard From 23929358b860e0ab422d59b3331a09781800f919 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 09:35:08 +0000 Subject: [PATCH 07/13] Bump js-yaml from 4.1.1 to 4.3.1 in /private Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 4.1.1 to 4.3.1. - [Changelog](https://github.com/nodeca/js-yaml/blob/4.3.1/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/4.1.1...4.3.1) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.3.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- private/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/private/yarn.lock b/private/yarn.lock index c6abe058..3f7dbc01 100644 --- a/private/yarn.lock +++ b/private/yarn.lock @@ -8517,13 +8517,13 @@ __metadata: linkType: hard "js-yaml@npm:^4.1.0": - version: 4.1.1 - resolution: "js-yaml@npm:4.1.1" + version: 4.3.1 + resolution: "js-yaml@npm:4.3.1" dependencies: argparse: "npm:^2.0.1" bin: js-yaml: bin/js-yaml.js - checksum: 10c0/561c7d7088c40a9bb53cc75becbfb1df6ae49b34b5e6e5a81744b14ae8667ec564ad2527709d1a6e7d5e5fa6d483aa0f373a50ad98d42fde368ec4a190d4fae7 + checksum: 10c0/13c500ca322e0c3f8c81686e6ecda96d2ea37b45247a420c17c7db36932d6965cc27391abc2d1a104501600e7f0d947a5f8b7be6db619c4fefa87901b3512807 languageName: node linkType: hard From 225f89e09c6d94d9a95ad4aee848cb0bca7b3336 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 09:35:14 +0000 Subject: [PATCH 08/13] Bump postcss from 8.5.10 to 8.5.23 in /private Bumps [postcss](https://github.com/postcss/postcss) from 8.5.10 to 8.5.23. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.5.10...8.5.23) --- updated-dependencies: - dependency-name: postcss dependency-version: 8.5.23 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- private/package.json | 2 +- private/yarn.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/private/package.json b/private/package.json index a973a86a..e0a5f670 100644 --- a/private/package.json +++ b/private/package.json @@ -46,7 +46,7 @@ "file-loader": "^6.2.0", "mini-css-extract-plugin": "^2.10.0", "node-normalize-scss": "^8.1.2", - "postcss": "^8.5.6", + "postcss": "^8.5.23", "postcss-banner": "^4.0.1", "postcss-loader": "^8.2.1", "postcss-pxtorem": "^6.1.0", diff --git a/private/yarn.lock b/private/yarn.lock index 3f7dbc01..38266a5f 100644 --- a/private/yarn.lock +++ b/private/yarn.lock @@ -7705,7 +7705,7 @@ __metadata: mini-css-extract-plugin: "npm:^2.10.0" node-normalize-scss: "npm:^8.1.2" object-fit-images: "npm:^3.2.4" - postcss: "npm:^8.5.6" + postcss: "npm:^8.5.23" postcss-banner: "npm:^4.0.1" postcss-loader: "npm:^8.2.1" postcss-pxtorem: "npm:^6.1.0" @@ -9121,12 +9121,12 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.11": - version: 3.3.11 - resolution: "nanoid@npm:3.3.11" +"nanoid@npm:^3.3.16": + version: 3.3.17 + resolution: "nanoid@npm:3.3.17" bin: nanoid: bin/nanoid.cjs - checksum: 10c0/40e7f70b3d15f725ca072dfc4f74e81fcf1fbb02e491cf58ac0c79093adc9b0a73b152bcde57df4b79cd097e13023d7504acb38404a4da7bc1cd8e887b82fe0b + checksum: 10c0/06f7949c7cce5c92c6aea66022f29a1eae7f56e05acbfddf1e049e819b4bf234c44a765cc44da7163482b111677948514012e27acdfa56f95309295768bdae32 languageName: node linkType: hard @@ -9879,14 +9879,14 @@ __metadata: languageName: node linkType: hard -"postcss@npm:^8.5.6": - version: 8.5.6 - resolution: "postcss@npm:8.5.6" +"postcss@npm:^8.5.23": + version: 8.5.23 + resolution: "postcss@npm:8.5.23" dependencies: - nanoid: "npm:^3.3.11" + nanoid: "npm:^3.3.16" picocolors: "npm:^1.1.1" source-map-js: "npm:^1.2.1" - checksum: 10c0/5127cc7c91ed7a133a1b7318012d8bfa112da9ef092dddf369ae699a1f10ebbd89b1b9f25f3228795b84585c72aabd5ced5fc11f2ba467eedf7b081a66fad024 + checksum: 10c0/ed714e635b330bb42666ecdd0c0b4f30224ded15b0b0052d6bc2b92832f2cf17d1c1141359453f96f0a84f8fbf4c405a74df187f559163b8f31131b2535455aa languageName: node linkType: hard From 290a6c39699059f9c9a64d02a41bdfe6f20d5950 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Aug 2026 08:47:49 +0000 Subject: [PATCH 09/13] Bump squizlabs/php_codesniffer from 3.13.5 to 3.13.6 Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.13.5 to 3.13.6. - [Release notes](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases) - [Changelog](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/4.x/CHANGELOG-3.x.md) - [Commits](https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.13.5...3.13.6) --- updated-dependencies: - dependency-name: squizlabs/php_codesniffer dependency-version: 3.13.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 58bd8fc7..3c395f73 100644 --- a/composer.lock +++ b/composer.lock @@ -447,16 +447,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.13.5", + "version": "3.13.6", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4" + "reference": "4c378e1a528ea066890fc2397cbdd2f94eb2fc91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4", - "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/4c378e1a528ea066890fc2397cbdd2f94eb2fc91", + "reference": "4c378e1a528ea066890fc2397cbdd2f94eb2fc91", "shasum": "" }, "require": { @@ -522,7 +522,7 @@ "type": "thanks_dev" } ], - "time": "2025-11-04T16:30:35+00:00" + "time": "2026-08-06T00:17:32+00:00" }, { "name": "wp-coding-standards/wpcs", From 0dc97fb58b9da625c1806cf67eff242c9b726001 Mon Sep 17 00:00:00 2001 From: Jay McPartland Date: Thu, 13 Aug 2026 12:01:03 +0100 Subject: [PATCH 10/13] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 091848ba..d0181d86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ Performance: - Many caching improvements across blocks and helper functions - Add new fast cross-blog helper functions +Build: +- Upgrade dependencies + ### v3.0.4 Fixes: - Taxonomy filters on RSS feed From 9e8f730defff947fbe6b1ee76b655ddff0904fb9 Mon Sep 17 00:00:00 2001 From: amnesty-dev <297112456+amnesty-dev@users.noreply.github.com> Date: Thu, 16 Jul 2026 14:05:03 +0200 Subject: [PATCH 11/13] extend Coding Standards to check PHP compatibility --- composer.json | 5 +- composer.lock | 238 ++++++++++++++++++++++++++++++++- phpcs-testVersion-override.xml | 4 + phpcs.xml | 4 + 4 files changed, 247 insertions(+), 4 deletions(-) create mode 100644 phpcs-testVersion-override.xml diff --git a/composer.json b/composer.json index 140d6d2e..31618b52 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,10 @@ "license": "none", "minimum-stability": "stable", "require-dev": { - "bigbite/phpcs-config": "v2.0.0" + "bigbite/phpcs-config": "v2.0.0", + "phpcompatibility/php-compatibility": "^10.0.0@dev", + "phpcompatibility/phpcompatibility-paragonie": "^2.0@dev", + "phpcompatibility/phpcompatibility-wp": "^3.0@dev" }, "config": { "allow-plugins": { diff --git a/composer.lock b/composer.lock index 3c395f73..8af56d71 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "326359f9cf92a432bd65811fafc51be7", + "content-hash": "34d14c2abccf4ac3ef194abdd8acba1e", "packages": [], "packages-dev": [ { @@ -214,6 +214,234 @@ ], "time": "2025-11-11T04:32:07+00:00" }, + { + "name": "phpcompatibility/php-compatibility", + "version": "10.0.0-alpha2", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "e0f0e5a3dc819a4a0f8d679a0f2453d941976e18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/e0f0e5a3dc819a4a0f8d679a0f2453d941976e18", + "reference": "e0f0e5a3dc819a4a0f8d679a0f2453d941976e18", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.1.2", + "squizlabs/php_codesniffer": "^3.13.3 || ^4.0" + }, + "replace": { + "wimg/php-compatibility": "*" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.2.0", + "phpcsstandards/phpcsdevtools": "^1.2.3", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4 || ^10.5.32 || ^11.3.3", + "yoast/phpunit-polyfills": "^1.1.5 || ^2.0.5 || ^3.1.0" + }, + "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-master": "9.x-dev", + "dev-develop": "10.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "https://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibility/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-11-28T11:36:33+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "2.0.0-alpha2", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "7a979711c87d8202b52f56c56bd719d09d8ed7f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/7a979711c87d8202b52f56c56bd719d09d8ed7f5", + "reference": "7a979711c87d8202b52f56c56bd719d09d8ed7f5", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^10.0@dev" + }, + "require-dev": { + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-11-29T13:09:49+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "3.0.0-alpha2", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "bd53f24e7528422ac51d64dc8d53e8d4c4a877b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/bd53f24e7528422ac51d64dc8d53e8d4c4a877b3", + "reference": "bd53f24e7528422ac51d64dc8d53e8d4c4a877b3", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^10.0@dev", + "phpcompatibility/phpcompatibility-paragonie": "^2.0@dev" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcompatibility", + "type": "thanks_dev" + } + ], + "time": "2025-12-16T13:35:20+00:00" + }, { "name": "phpcsstandards/phpcsextra", "version": "1.5.0", @@ -593,10 +821,14 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "phpcompatibility/php-compatibility": 20, + "phpcompatibility/phpcompatibility-paragonie": 20, + "phpcompatibility/phpcompatibility-wp": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": {}, "platform-dev": {}, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } diff --git a/phpcs-testVersion-override.xml b/phpcs-testVersion-override.xml new file mode 100644 index 00000000..dffb5640 --- /dev/null +++ b/phpcs-testVersion-override.xml @@ -0,0 +1,4 @@ + + + + diff --git a/phpcs.xml b/phpcs.xml index 2c45c1b8..4793e122 100755 --- a/phpcs.xml +++ b/phpcs.xml @@ -4,4 +4,8 @@ *.l10n.php$ + + + + From 634688f9d3b39a4bcf8a27f14b868222ffb03f85 Mon Sep 17 00:00:00 2001 From: amnesty-dev <297112456+amnesty-dev@users.noreply.github.com> Date: Thu, 16 Jul 2026 14:05:45 +0200 Subject: [PATCH 12/13] use Exception instead of DateMalformedStringException only introduced in PHP 8.3 --- .../humanity-theme/patterns/attachment-published-date.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-content/themes/humanity-theme/patterns/attachment-published-date.php b/wp-content/themes/humanity-theme/patterns/attachment-published-date.php index 9cbd407c..fabc4146 100644 --- a/wp-content/themes/humanity-theme/patterns/attachment-published-date.php +++ b/wp-content/themes/humanity-theme/patterns/attachment-published-date.php @@ -36,7 +36,7 @@ $datetime = new DateTime( $post->post_date_gmt, new DateTimeZone( 'GMT' ) ); $datetime->setTimezone( wp_timezone() ); $format = get_option( 'date_format' ); -} catch ( DateMalformedStringException $e ) { +} catch ( Exception $e ) { return; } From 550900aaa58ce32cf4de109217d48c7816e1aa97 Mon Sep 17 00:00:00 2001 From: amnesty-dev <297112456+amnesty-dev@users.noreply.github.com> Date: Thu, 16 Jul 2026 14:07:49 +0200 Subject: [PATCH 13/13] Explicitly mark parameters nullable. Implicitly marking a parameter as nullable is deprecated since PHP 8.4. --- .../themes/humanity-theme/includes/helpers/site.php | 4 ++-- .../themes/humanity-theme/includes/helpers/taxonomies.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-content/themes/humanity-theme/includes/helpers/site.php b/wp-content/themes/humanity-theme/includes/helpers/site.php index 5b932278..09042421 100644 --- a/wp-content/themes/humanity-theme/includes/helpers/site.php +++ b/wp-content/themes/humanity-theme/includes/helpers/site.php @@ -47,7 +47,7 @@ function current_url() { * * @return string */ - function get_site_language_code( int $blog_id = null ): string { + function get_site_language_code( ?int $blog_id = null ): string { if ( is_multisite() && $blog_id ) { switch_to_blog( $blog_id ); } @@ -78,7 +78,7 @@ function get_site_language_code( int $blog_id = null ): string { * * phpcs:disable Generic.Metrics.CyclomaticComplexity.TooHigh */ - function get_site_language_name( int $blog_id = null ): string { + function get_site_language_name( ?int $blog_id = null ): string { // phpcs:enable Generic.Metrics.CyclomaticComplexity.TooHigh if ( ! is_int( $blog_id ) ) { diff --git a/wp-content/themes/humanity-theme/includes/helpers/taxonomies.php b/wp-content/themes/humanity-theme/includes/helpers/taxonomies.php index d5409e69..63f92311 100644 --- a/wp-content/themes/humanity-theme/includes/helpers/taxonomies.php +++ b/wp-content/themes/humanity-theme/includes/helpers/taxonomies.php @@ -571,7 +571,7 @@ function amnesty_get_locations_by_type( array $args = [] ): array { * * @return string */ - function amnesty_get_location_type( WP_Term $location = null ): string { + function amnesty_get_location_type( ?WP_Term $location = null ): string { $location = $location ?: get_queried_object(); if ( ! is_a( $location, WP_Term::class ) ) { @@ -592,7 +592,7 @@ function amnesty_get_location_type( WP_Term $location = null ): string { * * @return bool */ - function amnesty_location_is_region( WP_Term $location = null ): bool { + function amnesty_location_is_region( ?WP_Term $location = null ): bool { return 'region' === amnesty_get_location_type( $location ); } } @@ -607,7 +607,7 @@ function amnesty_location_is_region( WP_Term $location = null ): bool { * * @return bool */ - function amnesty_location_is_subregion( WP_Term $location = null ): bool { + function amnesty_location_is_subregion( ?WP_Term $location = null ): bool { return 'subregion' === amnesty_get_location_type( $location ); } } @@ -623,7 +623,7 @@ function amnesty_location_is_subregion( WP_Term $location = null ): bool { * * @return array|null */ - function amnesty_get_regional_media_contact( WP_Term $location = null ): ?array { + function amnesty_get_regional_media_contact( ?WP_Term $location = null ): ?array { $location = $location ?: get_queried_object(); if ( ! is_a( $location, WP_Term::class ) ) {