diff --git a/.github/workflows/lang.yml b/.github/workflows/lang.yml
index 9979c489..27ada92b 100644
--- a/.github/workflows/lang.yml
+++ b/.github/workflows/lang.yml
@@ -21,11 +21,7 @@ jobs:
- name: Install Composer Dependencies
if: steps.composer-lang-cache.outputs.cache-hit != 'true'
run: composer install; composer require --dev wp-cli/wp-cli-bundle
- - run: ./vendor/bin/wp i18n make-pot wp-content/themes/humanity-theme wp-content/themes/humanity-theme/languages/amnesty.pot --domain=amnesty --exclude=private
- - run: ./vendor/bin/wp i18n update-po wp-content/themes/humanity-theme/languages/amnesty.pot
- - run: ./vendor/bin/wp i18n make-mo wp-content/themes/humanity-theme/languages
- - run: ./vendor/bin/wp i18n make-json wp-content/themes/humanity-theme/languages --no-purge
- - run: ./vendor/bin/wp i18n make-php wp-content/themes/humanity-theme/languages
+ - run: composer lang
- uses: actions/upload-artifact@v4
with:
name: humanity-theme
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d58e83ba..d0181d86 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,18 @@
+### v3.0.5
+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
+
+CI:
+- Update language file compilation scripts
+
### v3.0.3
Fixes:
- Remove old WooCommerce references
diff --git a/composer.json b/composer.json
index f2c9dce7..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": {
@@ -13,17 +16,19 @@
},
"scripts": {
"lint": "./vendor/bin/phpcs wp-content/themes/humanity-theme",
+ "lang": ["@makePot", "@updatePoMo"],
"makePot": "wp i18n make-pot wp-content/themes/humanity-theme wp-content/themes/humanity-theme/languages/amnesty.pot --domain=amnesty --exclude=private",
"updatePoMo": [
"wp i18n update-po wp-content/themes/humanity-theme/languages/amnesty.pot",
"wp i18n make-mo wp-content/themes/humanity-theme/languages",
- "wp i18n make-json wp-content/themes/humanity-theme/languages --no-purge",
+ "wp i18n make-json wp-content/themes/humanity-theme/languages",
"wp i18n make-php wp-content/themes/humanity-theme/languages"
]
},
"scripts-descriptions": {
"lint": "Runs PHP coding standard checks",
+ "lang": "Runs makePot and updatePoMo",
"makePot": "Re-generates the POT language file",
- "UpdatePoMo": "Updates PO, MO, JSON, and PHP translation files"
+ "updatePoMo": "Updates PO, MO, JSON, and PHP translation files"
}
}
diff --git a/composer.lock b/composer.lock
index 58bd8fc7..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",
@@ -447,16 +675,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 +750,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",
@@ -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$
+
+
+
+
diff --git a/private/package.json b/private/package.json
index cbb44a54..e0a5f670 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",
@@ -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 354fa127..38266a5f 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"
@@ -1623,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
@@ -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"
@@ -7635,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"
@@ -7687,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
@@ -8447,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
@@ -9051,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
@@ -9809,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
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/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 );
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 ) ) {
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 @@
-query_var ) {
+ return sprintf( '%s_name', $taxonomy->query_var );
+ }
+
+ return sprintf( '%s_name', $taxonomy?->codename ?? $taxonomy->name );
+ }
+}
+
if ( ! function_exists( 'amnesty_register_taxonomy_query_vars' ) ) {
/**
* Register query vars for taxonomy names for the RSS feeds
@@ -17,8 +34,13 @@ function amnesty_register_taxonomy_query_vars(): void {
$taxonomies = get_taxonomies( [ 'public' => true ], 'objects' );
+ /**
+ * The taxonomy object
+ *
+ * @var WP_Taxonomy $taxonomy
+ */
foreach ( $taxonomies as $taxonomy ) {
- $wp->add_query_var( sprintf( '%s_name', $taxonomy->query_var ) );
+ $wp->add_query_var( amnesty_get_taxonomy_qvar( $taxonomy ) );
}
}
}
@@ -43,8 +65,14 @@ function amnesty_add_taxonomy_filters_to_rss( WP_Query $query ): void {
$taxonomies = get_taxonomies( [ 'public' => true ], 'objects' );
$query_taxes = [];
+ /**
+ * The taxonomy object
+ *
+ * @var WP_Taxonomy $taxonomy
+ */
foreach ( $taxonomies as $taxonomy ) {
- $qvar = get_query_var( sprintf( '%s_name', $taxonomy->query_var ) );
+ $qvar = amnesty_get_taxonomy_qvar( $taxonomy );
+ $qvar = amnesty_get_query_var( $qvar );
if ( ! $qvar ) {
continue;
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;
}
diff --git a/wp-content/themes/humanity-theme/style.css b/wp-content/themes/humanity-theme/style.css
index d8ff25e1..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.3
+ * Version: 3.0.5
* Author: Amnesty International
* Author URI: https://www.amnesty.org
* License: GPL-2.0-or-later