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

Bump WordPress and PHP minimum #917

Merged
merged 29 commits into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f52af91
Update readme files with minimum supported versions.
peterwilsoncc Aug 3, 2022
04a1580
Update workflows using PHP or WP versions.
peterwilsoncc Aug 3, 2022
5db745c
Remove redundent applications password plugin.
peterwilsoncc Aug 3, 2022
f6aaf1e
Prevent activation on old versions.
peterwilsoncc Aug 3, 2022
725da61
Update PHP versions in docunit file.
peterwilsoncc Aug 3, 2022
a3bcc0a
Use two letter version numbers for version compare.
peterwilsoncc Aug 3, 2022
1723f1b
`wp_is_application_passwords_available()` exists in all supported ver…
peterwilsoncc Aug 3, 2022
3437cc2
Simplify `is_using_gutenberg()` for WP5.7+ support only.
peterwilsoncc Aug 3, 2022
958538f
Merge branch 'develop' into fix/requirement-bump
peterwilsoncc Aug 16, 2022
7ab4015
Add mocked functions required for updated Gutenberg detection.
peterwilsoncc Aug 16, 2022
6187c56
Show notice if version requirements fail.
peterwilsoncc Aug 16, 2022
4dbb6e3
Remove note about application password merge.
peterwilsoncc Aug 16, 2022
856f9fb
Refer to application passwords feature rather than plugin.
peterwilsoncc Aug 16, 2022
135e1d4
Improve strings for minimum requirements.
peterwilsoncc Aug 17, 2022
66008eb
Move bootstrapping to dedicated file.
peterwilsoncc Aug 17, 2022
ba86310
Use internal helper function to determine if post type is supported.
peterwilsoncc Aug 17, 2022
2a7eed0
Delay calling `is_using_gutenberg` until `use_block_editor_for_post_t…
peterwilsoncc Aug 17, 2022
0026bd1
Add sniff for main file’s bespoke compatibility requirements.
peterwilsoncc Aug 17, 2022
9415023
Document main plugin file’s bespoke compatibility requirements.
peterwilsoncc Aug 17, 2022
3fef859
Remove application password plugin reference in admin.
peterwilsoncc Aug 18, 2022
7f53170
Include authentication endpoint in distributor endpoint.
peterwilsoncc Aug 18, 2022
8ff14ee
Defer to `use_block_editor_for_post_type()` if it exists.
peterwilsoncc Aug 18, 2022
74a5c78
Merge branch 'develop' into fix/requirement-bump
peterwilsoncc Aug 18, 2022
7be0237
Avoid deprecated `gutenberg_get_jed_locale_data()`.
peterwilsoncc Aug 19, 2022
c1c93fb
Add minimum requirements to main plugin file.
peterwilsoncc Aug 22, 2022
9dfd669
Update package-lock file for npm 8.x.
peterwilsoncc Aug 22, 2022
4af2c14
Update CSS directory.
peterwilsoncc Aug 22, 2022
4d8679b
Fix minimum requirements in main plugin file.
peterwilsoncc Aug 22, 2022
e3c3999
Improve notes about local environment.
peterwilsoncc Aug 23, 2022
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
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ jobs:
- name: Check PHPCS standard
run: ./vendor/bin/phpcs -i

- name: Check Compatibility of main plugin file.
run: ./vendor/bin/phpcs ./distributor.php --runtime-set testVersion 5.6- --standard=PHPCompatibilityWP

- name: PHPCS check
uses: chekalsky/phpcs-action@v1
with:
Expand Down
10 changes: 5 additions & 5 deletions Dockunit.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"containers": [
{
"prettyName": "PHP 5.6",
"image": "php:5.6",
"prettyName": "PHP 7.4",
"image": "php:7.4",
"beforeScripts": [
"php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\"",
"php composer-setup.php --install-dir=/usr/local/bin --filename=composer",
Expand All @@ -14,8 +14,8 @@
"testCommand": "phpunit"
},
{
"prettyName": "PHP 7.0",
"image": "php:7.0",
"prettyName": "PHP 8.1",
"image": "php:8.1",
"beforeScripts": [
"php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\"",
"php composer-setup.php --install-dir=/usr/local/bin --filename=composer",
Expand All @@ -27,4 +27,4 @@
"testCommand": "phpunit"
}
]
}
}
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Distributor is built with the same extensible approach as WordPress itself, with

## Requirements

* PHP 5.6+
* [WordPress](http://wordpress.org) 4.7+
* External connections require HTTP Basic Authentication or [WordPress.com OAuth2](https://developer.wordpress.com/docs/oauth2/) (must be on [WordPress VIP](https://wpvip.com/)) be set up on the remote website. For Basic Auth, we recommend the [Application Passwords](https://wordpress.org/plugins/application-passwords/) plugin (note that other plugins like JWT Auth will likely cause issues for external connections) though if you're running WordPress 5.6 or above then Application Passwords is already installed.
* PHP 7.4+
* [WordPress](http://wordpress.org) 5.7+
* External connections require HTTP Basic Authentication or [WordPress.com OAuth2](https://developer.wordpress.com/docs/oauth2/) (must be on [WordPress VIP](https://wpvip.com/)) be set up on the remote website. For Basic Auth, we recommend using [Application Passwords](https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/#Getting-Credentials) built in to WordPress.
* For external connections, Distributor needs to be installed on BOTH sides of the connection.

## Installation
Expand Down Expand Up @@ -169,9 +169,15 @@ Enabling this will also provide more debugging information in your error log for

### Application Passwords and WordPress 5.6

In WordPress 5.6, Application Passwords was merged into WordPress core with some limitations. From 5.6, Application Passwords is enabled by default only for live sites with HTTPS. To enable Application Passwords for development sites, you will need the following snippet:
Application passwords are only available for live sites running over an HTTPS connection.

For your local development environment will need these snippets to enable application passwords without the need for an HTTPS connection. A local development environment is one that "can reach the internet but **is not reachable from the internet**".
peterwilsoncc marked this conversation as resolved.
Show resolved Hide resolved

```php
// In your local environment's wp-config.php file.
define( 'WP_ENVIRONMENT_TYPE', 'local' );

// In a custom plugin on your local environment.
add_filter( 'wp_is_application_passwords_available', '__return_true' );

add_action( 'wp_authorize_application_password_request_errors', function( $error ) {
Expand Down
4 changes: 1 addition & 3 deletions assets/js/gutenberg-syndicated-post.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { dispatch } from '@wordpress/data';
import { __, setLocaleData, sprintf } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';

const { dtGutenberg } = window;

setLocaleData( dtGutenberg.i18n, 'distributor' );

if (
'0' !== dtGutenberg.originalSourceId ||
'0' !== dtGutenberg.originalBlogId
Expand Down
19 changes: 2 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,9 @@
"email": "[email protected]"
}
],
"repositories": [
{
"type":"package",
"package": {
"name": "georgestephanis/application-passwords",
"version":"0.1.3",
"source": {
"url": "https://github.com/WordPress/application-passwords.git",
"type": "git",
"reference":"0eef095b4dc984c26ee8149c01a323be83da715a"
}
}
}
],
"require": {
"php": ">=5.6",
"php": ">=7.4",
"yahnis-elsts/plugin-update-checker": "4.9",
"georgestephanis/application-passwords": "0.1.3",
"ext-json": "*"
},
"autoload": {
Expand All @@ -43,7 +28,7 @@
"automattic/vipwpcs": "^2.3"
},
"scripts": {
"lint": "phpcs . --runtime-set testVersion 5.6-",
"lint": "phpcs . --runtime-set testVersion 7.4-",
"lint-fix": "phpcbf .",
"test": "@php phpunit"
},
Expand Down
Loading