-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #972 from WordPress/move/auto-sizes
Move `auto-sizes` to plugins folder
- Loading branch information
Showing
18 changed files
with
234 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Unit Testing for Plugins | ||
|
||
on: | ||
push: | ||
branches: | ||
- trunk | ||
- 'release/**' | ||
# Only run if PHP-related files changed. | ||
paths: | ||
- '.github/workflows/php-test-plugins.yml' | ||
- 'plugins/**.php' | ||
- '.wp-env.json' | ||
- '**/package.json' | ||
- 'package-lock.json' | ||
- 'phpunit.xml.dist' | ||
- 'tests/multisite.xml' | ||
- 'composer.json' | ||
- 'composer.lock' | ||
pull_request: | ||
branches: | ||
- trunk | ||
- 'release/**' | ||
- 'feature/**' | ||
# Only run if PHP-related files changed. | ||
paths: | ||
- '.github/workflows/php-test-plugins.yml' | ||
- 'plugins/**.php' | ||
- '.wp-env.json' | ||
- '**/package.json' | ||
- 'package-lock.json' | ||
- 'phpunit.xml.dist' | ||
- 'tests/multisite.xml' | ||
- 'composer.json' | ||
- 'composer.lock' | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
php-test-plugins: | ||
name: "PHP ${{ matrix.php }} / WP ${{ matrix.wp }}" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0'] | ||
wp: [ 'latest' ] | ||
include: | ||
- php: '7.4' | ||
wp: '6.3' | ||
- php: '8.3' | ||
wp: 'trunk' | ||
env: | ||
WP_ENV_PHP_VERSION: ${{ matrix.php }} | ||
WP_ENV_CORE: ${{ matrix.wp == 'trunk' && 'WordPress/WordPress' || format( 'https://wordpress.org/wordpress-{0}.zip', matrix.wp ) }} | ||
steps: | ||
- uses: styfle/[email protected] | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node.js (.nvmrc) | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: npm | ||
- name: npm install | ||
run: npm ci | ||
- name: Install WordPress | ||
run: npm run wp-env start | ||
# Note that `composer update` is required instead of `composer install` | ||
# for the sake of PHP versions older than 8.1, which is the version of | ||
# PHP that the composer.lock was created for. | ||
- name: Composer update | ||
run: npm run wp-env run tests-cli -- --env-cwd="wp-content/plugins/$(basename $(pwd))" composer update --no-interaction | ||
- name: Running single site unit tests for Auto-sizes for Lazy-Loaded Images Plugin | ||
run: npm run test-php -- -- -- --testsuite auto-sizes | ||
- name: Running multisite unit tests for Auto-sizes for Lazy-Loaded Images Plugin | ||
run: npm run test-php-multisite -- -- -- --testsuite auto-sizes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
{ | ||
"images/dominant-color-images": { | ||
"slug": "dominant-color-images", | ||
"version": "1.0.1" | ||
"modules": { | ||
"images/dominant-color-images": { | ||
"slug": "dominant-color-images", | ||
"version": "1.0.1" | ||
}, | ||
"images/webp-uploads": { | ||
"slug": "webp-uploads", | ||
"version": "1.0.5" | ||
} | ||
}, | ||
"images/webp-uploads": { | ||
"slug": "webp-uploads", | ||
"version": "1.0.5" | ||
} | ||
"plugins": [ "auto-sizes" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Plugin Name: Auto-sizes for Lazy-loaded Images | ||
* Plugin URI: https://github.com/WordPress/performance/tree/trunk/modules/images/auto-sizes | ||
* Description: This plugin implements the HTML spec for adding `sizes="auto"` to lazy-loaded images. | ||
* Requires at least: 6.3 | ||
* Requires PHP: 7.0 | ||
* Version: 1.0.0 | ||
* Author: WordPress Performance Team | ||
* Author URI: https://make.wordpress.org/performance/ | ||
* License: GPLv2 or later | ||
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html | ||
* Text Domain: auto-sizes | ||
* | ||
* @package auto-sizes | ||
*/ | ||
|
||
// Exit if accessed directly. | ||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
// Define the constant. | ||
if ( defined( 'IMAGE_AUTO_SIZES_VERSION' ) ) { | ||
return; | ||
} | ||
|
||
define( 'IMAGE_AUTO_SIZES_VERSION', '1.0.0' ); | ||
|
||
require_once __DIR__ . '/hooks.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.