Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions AGENTS.md

Large diffs are not rendered by default.

898 changes: 617 additions & 281 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ahegyes/wordpress-framework",
"description": "A modular framework for WordPress plugins that read as hand-written WordPress code: five packages, each building only on the one below it, with each plugin shipping its own scoped copy.",
"type": "project",
"license": "GPL-2.0-or-later",
"license": "GPL-3.0-or-later",
"homepage": "https://github.com/ahegyes/wordpress-framework",
"authors": [
{
Expand Down
204 changes: 77 additions & 127 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@ahegyes/wordpress-framework",
"private": true,
"description": "Development tooling for the wp-framework-* WordPress plugin framework monorepo.",
"license": "GPL-2.0-or-later",
"license": "GPL-3.0-or-later",
"repository": {
"type": "git",
"url": "git+https://github.com/ahegyes/wordpress-framework.git"
Expand Down
898 changes: 617 additions & 281 deletions packages/bootstrap/LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if ( ! Requirements::check_floors( __FILE__ ) ) {
require_once __DIR__ . '/functions.php';
```

The updater offers the plugin's GitHub releases through WordPress's own update screens while the plugin's `Update URI` header points at its github.com repository. It installs the release asset named after the plugin's text domain, such as `acme-persona-bootstrap.zip`, and the `dws_github_updater_config_{text-domain}` filter changes the repository, the asset or the channel, or turns updates off. It offers only tags such as `v2.1.0` or `v2.1.0-rc.1`, whose optional suffix is `-dev`, `-alpha`, `-beta` or `-rc` in any letter case, optionally numbered, because PHP's `version_compare()` ranks other suffixes above their release.
The updater offers the plugin's GitHub releases through WordPress's own update screens while the plugin's `Update URI` header points at its github.com repository. It installs the release asset named after the plugin's text domain, such as `acme-persona-bootstrap.zip`, and the `dws_github_updater/config/{text-domain}` filter changes the repository, the asset or the channel, or turns updates off. It offers only tags such as `v2.1.0` or `v2.1.0-rc.1`, whose optional suffix is `-dev`, `-alpha`, `-beta` or `-rc` in any letter case, optionally numbered, because PHP's `version_compare()` ranks other suffixes above their release.

## Contract and versioning

Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ahegyes/wp-framework-bootstrap",
"description": "The code a WordPress plugin runs before its autoloader. It parses on PHP 7.4, so a site below the plugin's floors gets a notice instead of a fatal error and still receives the release that fixes it.",
"type": "library",
"license": "GPL-2.0-or-later",
"license": "GPL-3.0-or-later",
"homepage": "https://github.com/ahegyes/wordpress-framework",
"require": {
"php": ">=7.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/src/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected static function get_updater_config( string $plugin_file ): ?array {
* @param array{enabled: bool, repository: string, asset: string, channel: 'stable'|'prerelease'} $config Whether updates are offered, the owner/name repository, the release asset's file name, and the channel: 'stable' follows the latest release, 'prerelease' the highest of the ten newest releases.
* @param string $plugin_basename The plugin's basename.
*/
$config = apply_filters( "dws_github_updater_config_$slug", $defaults, plugin_basename( $plugin_file ) ); // @phpstan-ignore WPCompat.parameterNotAvailable.applyfilters.args (WordPress 6.0 only formalized the arguments that older versions already passed on.)
$config = apply_filters( "dws_github_updater/config/$slug", $defaults, plugin_basename( $plugin_file ) ); // @phpstan-ignore WPCompat.parameterNotAvailable.applyfilters.args (WordPress 6.0 only formalized the arguments that older versions already passed on.)
if ( ! \is_array( $config ) ) {
return null;
}
Expand Down
898 changes: 617 additions & 281 deletions packages/core/LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ahegyes/wp-framework-core",
"description": "The plugin kernel. A plugin is composed of small components that load only where they apply, on WordPress's own APIs, with the infrastructure WordPress leaves every plugin to rebuild.",
"type": "library",
"license": "GPL-2.0-or-later",
"license": "GPL-3.0-or-later",
"homepage": "https://github.com/ahegyes/wordpress-framework",
"require": {
"php": ">=8.5",
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/AdminNotice/AdminNotices.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ protected function select( bool $block_editor ): array {
* @since 2.0.0
* @version 2.0.0
*
* @param bool $visible Whether the notice shows; only true shows it.
* @param string $id The notice's id.
* @param string $scope The notice's scope.
* @param bool $show Whether the notice shows. Only true shows it.
* @param string $id The notice's id.
* @param string $scope The notice's scope.
*/
if ( true === apply_filters( "{$this->prefix}_notice_visible", true, $notice->id, $scope->value ) ) {
if ( true === apply_filters( "{$this->prefix}/admin_notice/should_show", true, $notice->id, $scope->value ) ) {
$selected[] = $notice;
}
}
Expand Down Expand Up @@ -540,7 +540,7 @@ public function rest_dismiss( \WP_REST_Request $request ): \WP_REST_Response|\WP
* @param int $user_id The user who dismissed it.
* @param int $owner The notice's owner: 0 for a request notice, otherwise the user, blog or network id.
*/
do_action( "{$this->prefix}_notice_dismissed", $id, $scope->value, $user_id, $owner );
do_action( "{$this->prefix}/admin_notice/dismissed", $id, $scope->value, $user_id, $owner );
}

return new \WP_REST_Response( array( 'changed' => $changed ) );
Expand Down Expand Up @@ -785,7 +785,7 @@ protected function get_message( Notice $notice ): string {
* @param string $id The notice's id.
* @param string $scope The notice's scope.
*/
$message = apply_filters( "{$this->prefix}_notice_message", $notice->message, $notice->id, $notice->scope->value );
$message = apply_filters( "{$this->prefix}/admin_notice/message", $notice->message, $notice->id, $notice->scope->value );
return \is_string( $message ) ? $message : $notice->message;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Migration/MigrationRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ protected function get_time(): float {
* @return non-empty-string
*/
protected function get_hook(): string {
return "{$this->option}_run";
return "{$this->option}/migration/run";
}

// endregion
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/PluginBoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static function () use ( $plugin_file ): void {
*
* @param \Throwable $exception The failure that stopped the composition.
*/
do_action( "{$this->prefix}_initialization_failure", $exception );
do_action( "{$this->prefix}/boot/failed", $exception );
if ( self::is_development_environment() ) {
throw $exception;
}
Expand All @@ -125,7 +125,7 @@ static function () use ( $plugin_file ): void {
* @since 2.0.0
* @version 2.0.0
*/
do_action( "{$this->prefix}_initialization_blocked" );
do_action( "{$this->prefix}/boot/blocked" );
return;
}

Expand All @@ -137,7 +137,7 @@ static function () use ( $plugin_file ): void {
* @since 2.0.0
* @version 2.0.0
*/
do_action( "{$this->prefix}_initialized" );
do_action( "{$this->prefix}/boot/succeeded" );
}

/**
Expand Down
Loading
Loading