Skip to content

Commit 14bccd8

Browse files
committed
Merge branch 'develop' of github.com:ampproject/amp-wp into 1813-php73-for-travis
* 'develop' of github.com:ampproject/amp-wp: Correct license in composer.json as GPL-2.0-or-later Consolidate translator comments for forgotten URLs string Drop unnecessary sanitize_hex_color() polyfill and rename amp-post-template-actions.php to amp-post-template-functions.php. Fix composer.json indentation. Ensure all dependencies are PHP 5.4 compatible. Ensure FasterImage allows to set its user agent. Eliminate PHP 5.3-compatibility workarounds for closures Eliminate PHP 5.3-specific testsuite Ensure that Travis will npm install and composer install for each build Restore linebreaks in readme.md Exclude patches from build Improve phpdoc; catch Exception from fetch_images; add todo Remove unnecessary support for argument when fetching image dimensions and deprecate it on the public method. Fix FunctionCallSignature for new WP code style Fix MultipleStatementAlignment in autoloader manifest Pull in FasterImage library via Composer and apply manual changes via patch file. Remove now unnecessary FastImage library. Update minimum required PHP version to 5.4.
2 parents ac29cec + 84c1894 commit 14bccd8

33 files changed

+538
-1612
lines changed

.dev-lib

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
PATH_EXCLUDES_PATTERN=third_party/
21
DEFAULT_BASE_BRANCH=develop
32
ASSETS_DIR=wp-assets
43
PROJECT_SLUG=amp

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ notifications:
1212

1313
cache:
1414
directories:
15-
- node_modules
16-
- vendor
15+
- $HOME/.composer/cache
16+
- $HOME/.npm
17+
- $HOME/.nvm/.cache
1718
- $HOME/phpunit-bin
1819
- $HOME/deployment-targets
1920

@@ -35,8 +36,6 @@ jobs:
3536
- stage: test
3637
php: "7.3"
3738
env: WP_VERSION=5.0
38-
- php: "5.3"
39-
env: WP_VERSION=latest DEV_LIB_SKIP=composer,phpcs
4039
- php: "5.4"
4140
env: WP_VERSION=4.9 DEV_LIB_SKIP=composer,phpcs
4241
- php: "5.5"

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module.exports = function( grunt ) {
9292
versionAppend = new Date().toISOString().replace( /\.\d+/, '' ).replace( /-|:/g, '' ) + '-' + commitHash;
9393

9494
paths = lsOutput.trim().split( /\n/ ).filter( function( file ) {
95-
return ! /^(blocks|\.|bin|([^/]+)+\.(md|json|xml)|Gruntfile\.js|tests|wp-assets|dev-lib|readme\.md|composer\..*|webpack.*)/.test( file );
95+
return ! /^(blocks|\.|bin|([^/]+)+\.(md|json|xml)|Gruntfile\.js|tests|wp-assets|dev-lib|readme\.md|composer\..*|patches|webpack.*)/.test( file );
9696
} );
9797
paths.push( 'vendor/autoload.php' );
9898
paths.push( 'assets/js/*-compiled.js' );

amp.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
function _amp_print_php_version_admin_notice() {
2222
?>
2323
<div class="notice notice-error">
24-
<p><?php esc_html_e( 'The AMP plugin requires PHP 5.3+. Please contact your host to update your PHP version.', 'amp' ); ?></p>
24+
<p><?php esc_html_e( 'The AMP plugin requires PHP 5.4+. Please contact your host to update your PHP version.', 'amp' ); ?></p>
2525
</div>
2626
<?php
2727
}
28-
if ( version_compare( phpversion(), '5.3.6', '<' ) ) {
28+
if ( version_compare( phpversion(), '5.4', '<' ) ) {
2929
add_action( 'admin_notices', '_amp_print_php_version_admin_notice' );
3030
return;
3131
}
@@ -448,7 +448,6 @@ function amp_add_frontend_actions() {
448448
* @deprecated This function is not used when 'amp' theme support is added.
449449
*/
450450
function amp_add_post_template_actions() {
451-
require_once AMP__DIR__ . '/includes/amp-post-template-actions.php';
452451
require_once AMP__DIR__ . '/includes/amp-post-template-functions.php';
453452
amp_post_template_init_hooks();
454453
}

composer.json

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
11
{
2-
"name": "ampproject/amp-wp",
3-
"description": "WordPress plugin for adding AMP support.",
4-
"homepage": "https://github.com/ampproject/amp-wp",
5-
"type": "wordpress-plugin",
6-
"license": "GPL-2.0",
7-
"repositories": [
8-
{
9-
"type": "vcs",
10-
"url": "https://github.com/xwp/PHP-CSS-Parser"
11-
}
12-
],
13-
"require": {
14-
"php": "^5.3.6 || ^7.0",
15-
"sabberworm/php-css-parser": "8.1.1"
16-
},
17-
"require-dev": {
18-
"wp-coding-standards/wpcs": "1.2.1",
19-
"dealerdirect/phpcodesniffer-composer-installer": "0.4.4",
20-
"phpcompatibility/php-compatibility": "9.1.1"
2+
"name": "ampproject/amp-wp",
3+
"description": "WordPress plugin for adding AMP support.",
4+
"homepage": "https://github.com/ampproject/amp-wp",
5+
"type": "wordpress-plugin",
6+
"license": "GPL-2.0-or-later",
7+
"repositories": [
8+
{
9+
"type": "vcs",
10+
"url": "https://github.com/xwp/PHP-CSS-Parser"
2111
}
12+
],
13+
"require": {
14+
"php": "^5.4 || ^7.0",
15+
"sabberworm/php-css-parser": "8.1.1",
16+
"fasterimage/fasterimage": "1.2.0",
17+
"cweagans/composer-patches": "~1.0"
18+
},
19+
"require-dev": {
20+
"wp-coding-standards/wpcs": "1.2.1",
21+
"dealerdirect/phpcodesniffer-composer-installer": "0.4.4",
22+
"phpcompatibility/php-compatibility": "9.1.1"
23+
},
24+
"config": {
25+
"platform": {
26+
"php": "5.4"
27+
}
28+
},
29+
"extra": {
30+
"patches": {
31+
"fasterimage/fasterimage": {
32+
"FasterImage: Add support for SVG images and enable TLS verification": "patches/fasterimage-fixes.diff"
33+
}
34+
}
35+
}
2236
}

composer.lock

Lines changed: 149 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)