Merge branch 'fairpm:main' into main

This commit is contained in:
Marc Armengou 2025-08-04 11:59:29 +02:00 committed by GitHub
commit a6cf5abe3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 59 additions and 19 deletions

39
.github/workflows/bump-version.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: Bump version for release
on:
workflow_dispatch:
inputs:
version:
description: 'New version being released (e.g. "1.0.0")'
required: true
type: string
jobs:
log-the-inputs:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Bump version
run: |
# Replace the "Version:" header in plugin.php
sed -i "s/^ \* Version: .*/ \* Version: ${{ inputs.version }}/" plugin.php
# Replace the VERSION const in plugin.php
sed -i "s/^const VERSION = '.*/const VERSION = '${{ inputs.version }}';/" plugin.php
echo "Bumped version to ${{ inputs.version }}"
env:
VERSION: ${{ inputs.version }}
- name: Create pull request
uses: peter-evans/create-pull-request@v7
with:
branch: bump-version
commit-message: "Bump version to ${{ inputs.version }}"
title: "[bump-version] Bump version to ${{ inputs.version }}"
body: "Bump version to ${{ inputs.version }}. Triggered by ${{ github.triggering_actor }}."
base: main
signoff: true
delete-branch: true

View file

@ -35,6 +35,7 @@ The FAIR plugin implements federated or local versions of the following features
* Browser and server health checks
* Other APIs such as the Credits API, Secret Keys API, and Importers API
* Twemoji images for emojis
* Installation and updating of packages direct from their source repository, without talking to any centralized server
The default FAIR provider in this plugin is [AspireCloud from AspirePress](https://aspirepress.org/). The AspirePress team were key in helping the FAIR project get off the ground. As the FAIR project grows and other providers come online you will be able to configure your chosen FAIR provider within the plugin.
@ -44,14 +45,6 @@ In addition to the key FAIR implementations, a few other features in WordPress a
* Media features provided by OpenVerse are disabled, pending discussion and work by the FAIR working group
* Ping services are configured to use IndexNow in place of Pingomatic
### Experimental Features
As FAIR works towards our plans for full decentralized package management, some features are marked as experimental. These features must be manually opted-in to during development.
* `FAIR_EXPERIMENTAL_PACKAGES` - Define as `true` to enable decentralized package installation, via direct DID input.
## Data Privacy
* See Also: [Linux Foundation Projects Privacy Policy](https://lfprojects.org/policies/privacy-policy/)

View file

@ -33,13 +33,11 @@ function bootstrap() {
Disable_Openverse\bootstrap();
Icons\bootstrap();
Importers\bootstrap();
if ( defined( 'FAIR_EXPERIMENTAL_PACKAGES' ) && FAIR_EXPERIMENTAL_PACKAGES ) {
Packages\bootstrap();
Updater\bootstrap();
}
Packages\bootstrap();
Pings\bootstrap();
Salts\bootstrap();
Settings\bootstrap();
Updater\bootstrap();
Upgrades\bootstrap();
User_Notification\bootstrap();
Version_Check\bootstrap();

View file

@ -87,9 +87,9 @@ class MetadataDocument {
/**
* Sections.
*
* @var string[]
* @var stdClass
*/
public $sections = [];
public $sections;
/**
* Releases.

View file

@ -122,7 +122,17 @@ function fetch_package_metadata( string $id ) {
}
$repo_url = $service->serviceEndpoint;
return fetch_metadata_doc( $repo_url );
$metadata = fetch_metadata_doc( $repo_url );
if ( is_wp_error( $metadata ) ) {
return $metadata;
}
if ( $metadata->id !== $id ) {
return new WP_Error( 'fair.packages.fetch_metadata.mismatch', __( 'Fetched metadata does not match the requested DID.', 'fair' ) );
}
return $metadata;
}
/**

View file

@ -9,7 +9,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2025-07-28T13:58:12+00:00\n"
"POT-Creation-Date: 2025-07-29T21:26:29+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.12.0\n"
"X-Domain: fair\n"
@ -342,7 +342,7 @@ msgid "Updates served from the <a href=\"%1$s\">FAIR Package Manager</a> and <a
msgstr ""
#: inc/version-check/namespace.php:100
msgctxt "browser version check"
msgctxt "operating system check"
msgid "your platform"
msgstr ""

View file

@ -2,7 +2,7 @@
/**
* Plugin Name: FAIR - Federated and Independent Repositories
* Description: Make your site more FAIR.
* Version: 0.3.0
* Version: 0.4.1
* Author: FAIR Contributors
* License: GPLv2
* Requires at least: 5.4
@ -17,7 +17,7 @@
namespace FAIR;
const VERSION = '0.3.0';
const VERSION = '0.4.1';
const PLUGIN_DIR = __DIR__;
const PLUGIN_FILE = __FILE__;