Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d8baa6d
Add local dev environment, test harnesses and linters
yellowby Nov 17, 2026
e5732c4
Add baseline test coverage
yellowby Nov 17, 2026
fa0f98f
Upgrade to WordPress 7.1 and current build tooling
yellowby Nov 17, 2026
480d8e5
Cover Iframely cards and their options in the tests
yellowby Nov 17, 2026
8f1fe48
Cover continuous use of the embed options in the tests
yellowby Nov 17, 2026
c47e513
Keep expired embeds until a refresh succeeds
yellowby Nov 17, 2026
098dba8
Check and encode the options of an embed before they reach the API
yellowby Nov 17, 2026
f918ec3
Set the options of an embed in the block URL when they change
yellowby Nov 17, 2026
1b1f851
Treat only the preview request of the editor as an editor preview
yellowby Nov 17, 2026
fcd6ff6
Verify the API key only on a real answer of the API
yellowby Nov 17, 2026
7d97150
Keep other plugins' embed results, and keep Iframely out of whole feeds
yellowby Nov 17, 2026
a2461b2
Make the editor script hold up without the CDN and against stray mess…
yellowby Nov 17, 2026
c79d210
Keep the extra query string intact and accept only offered lifetimes
yellowby Nov 17, 2026
c649c9b
Show the onboarding with the notices of the page
yellowby Nov 17, 2026
d2db28a
Make the [iframely] shortcode use Iframely whatever the providers set…
yellowby Nov 17, 2026
0413731
Fix paragraphs after the last AMP embed and the Settings link on a ne…
yellowby Nov 17, 2026
74432c1
Show the fallback link of an embed without its options
yellowby Nov 17, 2026
ca8bca4
Escape what the admin pages print
yellowby Nov 17, 2026
27fd8c2
Remove the settings when the plugin is deleted
yellowby Nov 17, 2026
204f8aa
Remove unused code and settle what the static analysis reports
yellowby Nov 17, 2026
c230a07
Correct two texts, the names of two images and how translations load
yellowby Nov 17, 2026
b91f962
Format the code with the project's own tools
yellowby Nov 17, 2026
05247b6
Fix what the linters could not fix on their own
yellowby Nov 17, 2026
43db0fd
Replace the gulp release script with one that reads .distignore
yellowby Nov 17, 2026
ea418be
Add a CI workflow
yellowby Nov 17, 2026
63b4b3f
Move the release script and Plugin Check from tests/bin to tools
yellowby Nov 17, 2026
0aeaa30
Prepare version 1.2.0
yellowby Nov 17, 2026
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
65 changes: 65 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Files and directories that must not be shipped in the plugin package.
# Used by `npm run release` and understood by `wp dist-archive` and the wordpress.org
# deploy GitHub Actions. See tools/lib/distignore.js for the forms an entry can take.

# Version control and editors
/.git
/.github
/.gitignore
/.gitattributes
/.editorconfig
/.idea
/.vscode
/.devcontainer

# Dependencies
/node_modules
/vendor

# Sources that are compiled into build/
/src
/webpack.config.js

# Tooling and configuration
/.distignore
/eslint.config.cjs
/.stylelintrc.json
/.wp-env.json
/.wp-env.tests.json
/.wp-env.override.json
/.wp-env.tests.override.json
/composer.json
/composer.lock
/vitest.config.mjs
/package.json
/package-lock.json
/phpcs.xml
/phpcs.xml.dist
/phpstan.neon
/phpstan.neon.dist
/phpunit.xml
/phpunit.xml.dist
/playwright.config.js
/tools

# Tests and their output
/tests
/artifacts
/playwright-report
/test-results
/.phpunit.result.cache

# Release tooling and wordpress.org assets (deployed separately to SVN /assets)
/release
/svn

# Translation sources: wordpress.org serves language packs; only the .pot ships
/lang/*.po
/lang/*.mo

# Repository documentation (readme.txt is the one that ships)
/README.md

# Local secrets
/.env
/.env.*
110 changes: 110 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
checks:
name: Linters, unit tests, package
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7

- uses: actions/setup-node@v7
with:
node-version: 26
cache: npm

- run: npm ci

- name: Formatting
run: npx prettier --check src tests/js tests/e2e tests/bin tools

- name: Scripts and styles
run: npm run lint:js && npm run lint:css

- name: Unit tests
run: npm run test:js

# PHP and its tools run inside the tests site, like on a developer's machine.
- name: Start the tests site
run: npm run env:start:tests

- name: Install the PHP tools
run: npm run composer install

- name: PHP coding standard
run: npm run lint:php

- name: PHP static analysis
run: npm run lint:phpstan

- name: Plugin Check
run: npm run lint:plugin-check

# Fails when build/ is not what the sources build to.
- name: Package
run: npm run release

# The plugin as it would be released, for a look or a manual test: a folder to
# put into wp-content/plugins.
- name: Keep the package
uses: actions/upload-artifact@v7
with:
name: iframely
path: release/trunk
if-no-files-found: error
retention-days: 14

tests:
name: Tests (${{ matrix.combination }})
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
# The WordPress and PHP versions behind each name are in tests/bin/matrix.js.
combination: [default, floor, latest]
steps:
- uses: actions/checkout@v7

- uses: actions/setup-node@v7
with:
node-version: 26
cache: npm

- run: npm ci

- name: Install the browser
run: npx playwright install --with-deps chromium

- name: PHPUnit on a single site and on multisite, end-to-end tests
run: npm run test:matrix -- ${{ matrix.combination }} --keep

# Runs only where the repository has an IFRAMELY_API_KEY secret; without one the
# command says so and passes. Pull requests from forks do not get the secret.
- name: Check the mocks against the real API
if: matrix.combination == 'default'
env:
IFRAMELY_API_KEY: ${{ secrets.IFRAMELY_API_KEY }}
run: npm run test:php:live

- name: Keep the traces of failed end-to-end tests
if: failure()
uses: actions/upload-artifact@v7
with:
name: artifacts-${{ matrix.combination }}
path: artifacts
if-no-files-found: ignore
retention-days: 7
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,19 @@ assets/js/iframely.js
# local
.idea
release

# PHP dev dependencies (installed through wp-env, see README)
/vendor/

# Test and lint output
/artifacts/
/playwright-report/
/test-results/
.phpunit.result.cache
/phpunit.xml
/phpcs.xml
/phpstan.neon

# Local wp-env overrides
.wp-env.override.json
.wp-env.tests.override.json
21 changes: 21 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "@wordpress/stylelint-config/scss",
"rules": {
"at-rule-empty-line-before": [
"always",
{
"except": ["blockless-after-blockless", "first-nested"],
"ignore": ["after-comment"],
"ignoreAtRules": ["else"]
}
],
"rule-empty-line-before": [
"always",
{
"except": ["first-nested"],
"ignore": ["after-comment"]
}
],
"selector-class-pattern": null
}
}
17 changes: 17 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://schemas.wp.org/trunk/wp-env.json",
"core": "WordPress/WordPress#7.1.4",
"phpVersion": "8.3",
"port": 8888,
"testsEnvironment": false,
"mappings": {
"wp-content/plugins/iframely": "."
},
"config": {
"WP_DEBUG_LOG": true
},
"lifecycleScripts": {
"afterStart": "npx wp-env run cli wp plugin activate iframely",
"afterReset": "npx wp-env run cli wp plugin activate iframely"
}
}
18 changes: 18 additions & 0 deletions .wp-env.tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://schemas.wp.org/trunk/wp-env.json",
"core": "WordPress/WordPress#7.1.4",
"phpVersion": "8.3",
"port": 8889,
"testsEnvironment": false,
"mappings": {
"wp-content/plugins/iframely": ".",
"wp-content/mu-plugins": "./tests/e2e/mu-plugins"
},
"config": {
"WP_DEBUG_LOG": true
},
"lifecycleScripts": {
"afterStart": "npx wp-env --config=.wp-env.tests.json run cli wp plugin activate iframely",
"afterReset": "npx wp-env --config=.wp-env.tests.json run cli wp plugin activate iframely"
}
}
Loading
Loading