Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releases 3.6.2 and 3.6.3 #1075

Merged
merged 30 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
75437da
Increase composer.json required PHP version to 7.4
alecgeatches Apr 22, 2024
fdce51c
Update README to match required PHP version 7.4
alecgeatches Apr 22, 2024
da21813
Remove PHP 7.1 from integration tests
alecgeatches Apr 22, 2024
fd9b266
PHP 7.4: Use array_key_first()
GaryJones Apr 23, 2024
2c4c9ec
PHP 7.4: Use instanceof
GaryJones Apr 23, 2024
5692feb
PHP 7.4: Use null coalescing
GaryJones Apr 23, 2024
c1d7f63
PHP 7.4: Add return types
GaryJones Apr 23, 2024
1109da9
PHP 7.4: Collapse nested dirname() calls
GaryJones Apr 23, 2024
947b3f2
CI: Remove MySQL workaround for PHP <= 7.3
GaryJones Apr 23, 2024
b392dc2
Merge pull request #1039 from Automattic/release/3.6.1
alecgeatches Apr 25, 2024
5578234
Merge pull request #1034 from Automattic/fix/minimum-php-version
GaryJones Apr 26, 2024
48213c5
Increase WordPress required version to 5.9
alecgeatches Apr 22, 2024
8c72d73
Update integration tests to use WordPress 5.9
alecgeatches Apr 22, 2024
a6f2bb5
Remove unnecessary phpunit versions for WordPress 5.9
alecgeatches Apr 22, 2024
fa6df03
CI: Update tested versions
GaryJones Apr 26, 2024
3ddc38c
Merge pull request #1035 from Automattic/fix/minimum-wordpress-version
GaryJones Apr 28, 2024
9ae8c78
Composer: Update dev-dependencies
GaryJones Apr 29, 2024
23a10e3
PHPCS: Consolidate config into config file
GaryJones Apr 29, 2024
662dab6
Support for Yoast %%name%% variable
claudiulodro May 14, 2024
878034a
Merge pull request #1046 from Automattic/add/yoast-replacement
claudiulodro May 16, 2024
03800e2
CI: Update deploy.yml
GaryJones May 21, 2024
217267a
CI: Update integrate.yml action versios
GaryJones May 21, 2024
b2777ba
Merge pull request #1042 from Automattic/fix/update-dependencies
GaryJones May 21, 2024
1c29766
Merge pull request #1048 from Automattic/update/integration-depedency…
GaryJones May 21, 2024
37065d2
Contents edited to consolidate instructions within the Wiki and bring…
yolih Aug 13, 2024
d5f9404
add: created a new CLI cmd to backfill missing author terms for posts…
eddiesshop Oct 9, 2024
fea7157
Fix/missing wp user type (#988)
eddiesshop Oct 9, 2024
35aeda1
bumping version to 3.6.2 (#1064)
leogermani Oct 10, 2024
fc8067a
fix: prevent the backfill from running forever. (#1065)
eddiesshop Oct 24, 2024
7ee34f5
Bump versions to 3.6.3 (#1070)
leogermani Oct 28, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: Deploy to WordPress.org
on:
release:
types: [released]
# Allow manually triggering the workflow.
# Allow manual triggering of the workflow.
workflow_dispatch:
jobs:
release:
name: New release to WordPress.org
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Push to WordPress.org
uses: 10up/action-wordpress-plugin-deploy@stable
env:
Expand Down
40 changes: 16 additions & 24 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,28 @@ jobs:

strategy:
matrix:
wordpress: [ '5.7', '6.3' ]
php: [ '7.1', '7.4', '8.0', '8.2' ]
allowed_failure: [ false ]
include:
# Check lowest supported WP version, with the lowest supported PHP.
- wordpress: '5.9'
php: '7.4'
allowed_failure: false
# Check latest WP with the highest supported PHP.
- wordpress: 'latest'
php: 'latest'
allowed_failure: false
# Check upcoming WP.
- php: '8.2'
wordpress: 'trunk'
- wordpress: 'trunk'
php: 'latest'
allowed_failure: true
# Check upcoming PHP.
- php: '8.3'
wordpress: 'latest'
allowed_failure: true
exclude:
# WordPress 5.7 doesn't support PHP 8.2.
- php: '8.2'
wordpress: '5.7'
# Check upcoming PHP - only needed when a new version has been forked (typically Sep-Nov)
# - wordpress: 'trunk'
# php: 'nightly'
# allowed_failure: true
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
Expand All @@ -43,13 +44,8 @@ jobs:
ini-values: ${{ matrix.ini-values }}
coverage: ${{ matrix.coverage }}

- name: Install PHPUnit 7.x for WP < 5.9
if: ${{ matrix.wordpress < 5.9 }}
# Ignore platform requirements, so that PHPUnit 7.5 can be installed on PHP 8.0 (and above).
run: composer require --dev phpunit/phpunit:"^7.5" --ignore-platform-req=php+ --no-update --no-scripts --no-interaction

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
composer-options: --ignore-platform-req=php+

Expand All @@ -67,10 +63,6 @@ jobs:
- name: Start MySQL service
run: sudo systemctl start mysql.service

- name: Setting mysql_native_password for PHP <= 7.3
if: ${{ matrix.php <= 7.3 }}
run: mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'";

- name: Install WordPress environment
run: composer prepare ${{ matrix.wordpress }}

Expand Down
30 changes: 20 additions & 10 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
<ruleset name="WordPress Coding Standards for Plugins">
<description>Generally-applicable sniffs for WordPress plugins</description>

<rule ref="WordPress-Extra" />
<rule ref="WordPress-Docs" />
<rule ref="WordPress-VIP-Go" />
<rule ref="WordPress">
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
</rule>

<!-- Rules: WordPress Coding Standards - see
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards -->
<!-- <rule ref="WordPress-Extra">--> <!-- Includes WordPress-Core -->
<!-- <exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />-->
<!-- </rule>-->
<!--<rule ref="WordPress-Docs"/>-->
<!-- For help in understanding this minimum_supported_wp_version:
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#setting-minimum-supported-wp-version-for-all-sniffs-in-one-go-wpcs-0140 -->
<config name="minimum_supported_wp_version" value="5.9"/>

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
Expand All @@ -17,18 +23,22 @@
</rule>

<rule ref="PHPCompatibilityWP"/>
<config name="testVersion" value="7.2-"/>

<arg name="extensions" value="php"/>
<config name="testVersion" value="7.4-"/>

<!-- Show sniff codes in all reports -->
<arg value="s"/>
<!-- How to scan -->
<arg value="sp"/> <!-- Show sniff and progress -->
<arg value="n"/> <!-- No warnings -->
<arg name="colors"/> <!-- Show results with colors. Disable if working on Windows -->
<arg name="basepath" value="."/> <!-- Strip the file paths down to the relevant bit -->
<arg name="parallel" value="8"/> <!-- Enables parallel processing when available for faster results -->
<arg name="extensions" value="php"/> <!-- Limit to PHP files -->

<!-- Allow invoking just `phpcs` on command line without assuming STDIN for file input. -->
<file>.</file>

<exclude-pattern>*/dev-lib/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/dist/*</exclude-pattern>
</ruleset>
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.6.3] - 2024-10-25

### Fixed

* Prevent terms backfill CLI command to enter an infinite loop when a post is assigned to a user that no longer exists #1065

## [3.6.2] - 2024-10-10

### Added

* Support for Yoast Name variable #1046
* New CLI cmd to backfill missing author terms for posts #1060

### Fixed

* Correctly populates the post_author column for linked authors #988

### Maintenance
* Increase minimum supported WordPress version to 5.9 #1035

## [3.6.1] - 2024-04-25

### Fixed
Expand Down Expand Up @@ -494,7 +514,9 @@ Props to the many people who helped make this release possible: [catchmyfame](ht
**1.1.0 (Apr. 14, 2009)**
* Initial beta release.

[3.6.1]: https://github.com/automattic/co-authors-plus/compare/3.6.0..3.6.1
[3.6.3]: https://github.com/automattic/co-authors-plus/compare/3.6.2...3.6.3
[3.6.2]: https://github.com/automattic/co-authors-plus/compare/3.6.1...3.6.2
[3.6.1]: https://github.com/automattic/co-authors-plus/compare/3.6.0...3.6.1
[3.6.0]: https://github.com/automattic/co-authors-plus/compare/3.5.15...3.6.0
[3.5.15]: https://github.com/automattic/co-authors-plus/compare/3.5.14...3.5.15
[3.5.14]: https://github.com/automattic/co-authors-plus/compare/3.5.13...3.5.14
Expand Down
108 changes: 12 additions & 96 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Co-Authors Plus

Stable tag: 3.6.1
Requires at least: 4.1
Tested up to: 6.5
Requires PHP: 5.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: authors, users, multiple authors, co-authors, multi-author, publishing
Stable tag: 3.6.3
Requires at least: 5.9
Tested up to: 6.6
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: authors, users, multiple authors, co-authors, multi-author, publishing
Contributors: batmoo, danielbachhuber, automattic, GaryJ

Assign multiple bylines to posts, pages, and custom post types with a search-as-you-type input box.
Expand All @@ -19,9 +19,9 @@ Add writers as bylines without creating WordPress user accounts. Simply [create

On the frontend, use the [Co-Authors Plus template tags](https://github.com/Automattic/Co-Authors-Plus/wiki/Template-tags) to list co-authors anywhere you'd normally list the author.

This plugin is an almost complete rewrite of the [Co-Authors](https://wordpress.org/plugins/co-authors/) plugin originally developed by Weston Ruter (2007). The original plugin was inspired by the '[Multiple Authors](https://txfx.net/2005/08/16/new-plugin-multiple-authors/)' plugin by Mark Jaquith (2005).
**For more detailed documentation refer to [the GitHub Wiki for this plugin](https://github.com/Automattic/Co-Authors-Plus/wiki).**

Refer to our [wiki](https://github.com/Automattic/Co-Authors-Plus/wiki) for detailed documentation.
Co-Authors Plus is an almost complete rewrite of the [Co-Authors](https://wordpress.org/plugins/co-authors/) plugin originally developed by Weston Ruter (2007). The original plugin was inspired by the '[Multiple Authors](https://txfx.net/2005/08/16/new-plugin-multiple-authors/)' plugin by Mark Jaquith (2005).

## Installation

Expand All @@ -48,7 +48,7 @@ When a user is deleted from WordPress, they will be removed from all posts for w

### Can I use Co-Authors Plus with WordPress multisite?

Yes! Co-Authors Plus can be activated on a site-by-site basis or network-activated. If you create guest authors, however, those guest authors will exist on a site-by-site basis.
Yes! You can [use Co-Authors Plus on WordPress multisite](https://github.com/Automattic/Co-Authors-Plus/wiki#wordpress-multisites). Co-Authors Plus can be activated on a site-by-site basis or network-activated. If you create guest authors, however, those guest authors will exist on a site-by-site basis.

### Who needs permission to do what?

Expand All @@ -58,97 +58,13 @@ A WordPress user will need the `list_users` capability to create new guest autho

### Can I easily create a list of all co-authors?

Yes! A template tag called `coauthors_wp_list_authors()` accepts many of the same arguments as `wp_list_authors()`. Look in `template-tags.php` for more details.
Yes! You can [create a list of all co-authors with a template tag](https://github.com/Automattic/Co-Authors-Plus/wiki/Template-tags#create-a-list-of-all-co-authors) `coauthors_wp_list_authors()` template tag. This template tag accepts many of the same arguments as `wp_list_authors()`. Look in `template-tags.php` for more details.

### Can I disable Guest Authors?

Yes! Guest authors can be disabled entirely through a filter. Having the following line load on `init` will do the trick:
Yes! You can disable guest authors entirely through a filter. Having the following line load on `init` will do the trick:
`add_filter( 'coauthors_guest_authors_enabled', '__return_false' )`

## Change Log

[View the change log](https://github.com/Automattic/Co-Authors-Plus/blob/master/CHANGELOG.md).

## Blocks

### Co-Authors

Use this block to create a repeating template that displays the co-authors of a post. By default it contains the Co-Author Name block, but you can add any other block you want to the template. If you choose another Co-Author block like avatar, biography or image it will automatically be supplied the author `context` that it needs. This works similarly to creating a Post Template in a Query Loop block.

The Co-Authors Block supports two layouts:

#### Inline Layout

Use the inline layout to display co-authors in a list on a single wrapping line.

You can control the characters displayed before, between and after co-authors in the list using the block settings, or change the defaults using the following server-side filters:

```
coauthors_default_before
coauthors_default_between
coauthors_default_between_last
coauthors_default_after
```

#### Block Layout

Use the block layout to display co-authors in a vertical stack. While using the block layout you can use block spacing settings to control the vertical space between co-authors.

Then you can create your own layout using blocks like group, row or stack and it will be applied to each co-author, similar to applying a layout to each post in a query loop.

### Co-Author Name

This block displays a co-author's `Display Name` and optionally turns it into a link to their author archive.

Using the block's advanced settings you can select which HTML element is used to output the name. This is useful in contexts such as an author archive where you might want their name to be a heading.

### Co-Author Avatar

Like the post author avatar, or comment author avatar, this block displays a small scale square image of a co-author and utilizes the Gravatar default avatars as configured in your site's discussion options.

To customize the available sizes, use the [rest_avatar_sizes](https://developer.wordpress.org/reference/hooks/rest_avatar_sizes/) filter.

### Co-Author Biography

This block outputs the biographical information for a co-author based on either their user or guest author data.

The content is wrapped in paragraph elements using `wpautop` and is escaped using `wp_kses_post`.

### Co-Author Featured Image

This block requires the use of Guest Authors. Because guest author avatars are uploaded to the WordPress media library, there are more options for displaying these images.

This block utilizes the image sizes configured in your theme and your site's media settings to present a guest author's avatar at a larger scale or higher resolution. It does not support Gravatars.

## Block Context

### Post, Page, Query Loop

By default, all blocks receive the post context. The job of the Co-Authors Block is to use this context to find the relevant authors and provide context to its inner blocks.

### Author Archive

If you want to display data about the author on their own archive, use the individual co-author blocks directly without wrapping them in the Co-Authors Block. During requests for an author archive the correct context is derived from the `author_name` query variable and provided to all blocks that declare their use of the context `co-authors-plus/author`.

### Extending

If you make a custom block and want to use the author context, add `co-authors-plus/author` to the `usesContext` property in your block.json file.

Example:
```json
{
"usesContext": ["co-authors-plus/author"]
}
```

## Block Example Data

When working with Full Site Editing, or in the post editor before the authors are loaded, example data is used. The example data provided with the co-author blocks resembles a response to the `/coauthors/v1/coauthors/:user-nicename` REST API endpoint.

### Extending

If you have written a plugin that modifies the REST API response, you can similarly modify the example data either on the server-side using the filter `coauthors_blocks_store_data` or the client-side using the filter `co-authors-plus.author-placeholder`.

## Block Non-support

To declare a lack of support for Co-Author Plus blocks on your site, use the filter `coauthors_plus_support_blocks` to return `false`.
6 changes: 3 additions & 3 deletions co-authors-plus.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* Plugin Name: Co-Authors Plus
* Plugin URI: https://wordpress.org/plugins/co-authors-plus/
* Description: Allows multiple authors to be assigned to a post. This plugin is an extended version of the Co-Authors plugin developed by Weston Ruter.
* Version: 3.6.1
* Requires at least: 5.7
* Version: 3.6.3
* Requires at least: 5.9
* Requires PHP: 7.4
* Author: Mohammad Jangda, Daniel Bachhuber, Automattic
* Author URI: https://automattic.com
Expand All @@ -21,7 +21,7 @@
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/

const COAUTHORS_PLUS_VERSION = '3.6.1';
const COAUTHORS_PLUS_VERSION = '3.6.3';
const COAUTHORS_PLUS_FILE = __FILE__;

require_once __DIR__ . '/template-tags.php';
Expand Down
16 changes: 7 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@
},
"require": {
"composer/installers": "~1.0",
"php": ">=5.6"
"php": ">=7.4"
},
"require-dev": {
"automattic/vipwpcs": "^2.2",
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7",
"automattic/vipwpcs": "^3",
"dms/phpunit-arraysubset-asserts": "^0.5.0",
"php-parallel-lint/php-parallel-lint": "^1.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpunit/phpunit": "^5 || ^6 || ^7 || ^8 || ^9",
"squizlabs/php_codesniffer": "^3.5",
"phpunit/phpunit": "^9",
"wp-cli/extension-command": "^2.0",
"wp-cli/wp-cli-tests": "^3",
"wp-coding-standards/wpcs": "^2.3.0",
"wp-cli/wp-cli-tests": "^v4",
"wp-coding-standards/wpcs": "^3.1",
"yoast/wp-test-utils": "^1.2"
},
"autoload": {
Expand All @@ -58,10 +56,10 @@
"@php ./vendor/bin/phpunit --exclude=ms-excluded"
],
"cs": [
"@php ./vendor/bin/phpcs -p -s -v -n . --standard=\"WordPress-VIP-Go\" --extensions=php --ignore=\"/vendor/*,/node_modules/*,/tests/*\""
"@php ./vendor/bin/phpcs"
],
"cbf": [
"@php ./vendor/bin/phpcbf -p -s -v -n . --standard=\"WordPress-VIP-Go\" --extensions=php --ignore=\"/vendor/*,/node_modules/*,/tests/*\""
"@php ./vendor/bin/phpcbf"
],
"lint": [
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git"
Expand Down
4 changes: 2 additions & 2 deletions 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
@@ -1,6 +1,6 @@
{
"name": "co-authors-plus",
"version": "3.6.1",
"version": "3.6.3",
"description": "Allows multiple authors to be assigned to a post.",
"license": "GPL-2.0-or-later",
"private": true,
Expand Down
Loading
Loading