Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Jan 9, 2023
2 parents 98b21a7 + 8874ec9 commit 6ceb390
Show file tree
Hide file tree
Showing 28 changed files with 8,328 additions and 330 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
/.git export-ignore
/.github export-ignore
/.wordpress-org export-ignore
/tests export-ignore

# Files to ignore
/.bowerrc export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.jshintrc export-ignore
/.wp-env.json export-ignore
/CHANGELOG.md export-ignore
/CODE_OF_CONDUCT.md export-ignore
/composer.json export-ignore
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/build-release-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build release zip

on:
workflow_dispatch:
push:
branches:
- trunk

jobs:
build:
name: Build release zip
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Generate ZIP file
uses: 10up/action-wordpress-plugin-build-zip@stable
env:
SLUG: eight-day-week-print-workflow
39 changes: 39 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: E2E test

on:
push:
branches:
- develop
- trunk
pull_request:
branches:
- develop
jobs:
cypress:
name: ${{ matrix.core.name }} / ${{ matrix.php.name }}
runs-on: ubuntu-latest
strategy:
matrix:
php:
- {name: 'PHP 7.4', version: '7.4'}
core:
- {name: 'WP stable', version: 'latest'}
- {name: 'WP 5.7', version: 'WordPress/WordPress#5.7'}
- {name: 'WP trunk', version: 'WordPress/WordPress#master'}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: Composer (optional)
run: composer install
continue-on-error: true
- name: Build (optional)
run: npm run build
continue-on-error: true
- name: Set the core version
run: ./tests/bin/set-core-version.js ${{ matrix.core.version }} ${{ matrix.php.version }}
- name: Set up WP environment
run: npm run env:start
- name: Test
run: npm run cypress:run
30 changes: 30 additions & 0 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: No Response

# **What it does**: Closes issues where the original author doesn't respond to a request for information.
# **Why we have it**: To remove the need for maintainers to remember to check back on issues periodically to see if contributors have responded.
# **Who does it impact**: Everyone that works on docs or docs-internal.

on:
issue_comment:
types: [created]
schedule:
# Schedule for five minutes after the hour, every hour
- cron: '5 * * * *'

jobs:
noResponse:
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/[email protected]
with:
token: ${{ github.token }}
daysUntilClose: 14 # Number of days of inactivity before an Issue is closed for lack of response
responseRequiredLabel: "needs:feedback" # Label indicating that a response from the original author is required
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information. With only the
information that is currently in the issue, we don't have enough information
to take action. Please reach out if you have or find the answers we need so
that we can investigate further. See [this blog post on bug reports and the
importance of repro steps](https://www.lee-dohm.com/2015/01/04/writing-good-bug-reports/)
for more information about the kind of information that may be helpful.
2 changes: 1 addition & 1 deletion .github/workflows/push-asset-readme-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- trunk
jobs:
master:
trunk:
name: Push to trunk
runs-on: ubuntu-latest
steps:
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/wordpress-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "WordPress version checker"
on:
push:
branches:
- develop
- trunk
pull_request:
branches:
- develop
schedule:
- cron: '0 0 * * 1'

jobs:
wordpress-version-checker:
runs-on: ubuntu-latest
steps:
- name: WordPress version checker
uses: skaut/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ phpunit.xml
release
vendor
.DS_Store

# E2E testing
tests/cypress/downloads
tests/cypress/screenshots
tests/cypress/videos
10 changes: 10 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"plugins": ["."],
"env": {
"tests": {
"mappings": {
"wp-cli.yml": "./tests/bin/wp-cli.yml"
}
}
}
}
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased]

## [1.2.1] - 2023-01-09
**Note that this release bumps the WordPress minimum version from 4.6 to 5.7 and the PHP minimum version from 5.6 to 7.4.**

### Added
- Setup E2E tests using Cypress (props [@dhanendran](https://github.com/dhanendran), [@iamdharmesh](https://github.com/iamdharmesh) via [#92](https://github.com/10up/eight-day-week/pull/92)).
- Filter example usages from the Observer (props [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#97](https://github.com/10up/eight-day-week/pull/97)).

### Changed
- Bump WordPress minimum version from 4.6 to 5.7 and PHP minimum version from 5.6 to 7.4 (props [@zamanq](https://github.com/zamanq), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul) via [#96](https://github.com/10up/eight-day-week/pull/96)).
- Update Support Level from `Active` to `Stable` (props [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter) via [#94](https://github.com/10up/eight-day-week/pull/94)).
- Bump WordPress "tested up to" version to 6.1 props [@jayedul](https://github.com/jayedul), [@dkotter](https://github.com/dkotter) via [#102](https://github.com/10up/eight-day-week/pull/102)).

### Security
- Remove `shelljs` and bump `grunt-contrib-jshint` from 2.1.0 to 3.2.0 (props [@dependabot](https://github.com/apps/dependabot) via [#99](https://github.com/10up/eight-day-week/pull/99)).
- Bump `got` from 10.7.0 to 11.8.5 and `@wordpress/env` from 4.9.0 to 5.7.0 (props [@dependabot](https://github.com/apps/dependabot) via [#100](https://github.com/10up/eight-day-week/pull/100)).
- Bump `simple-git` from 3.10.0 to 3.15.1 (props [@dependabot](https://github.com/apps/dependabot) via [#103](https://github.com/10up/eight-day-week/pull/103)).

## [1.2.0] - 2022-06-23
### Added
- Dependency security scanning (props [@jeffpaul](https://github.com/jeffpaul), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#81](https://github.com/10up/eight-day-week/pull/81)).
Expand Down Expand Up @@ -69,6 +86,7 @@ All notable changes to this project will be documented in this file, per [the Ke
- Initial Release

[Unreleased]: https://github.com/10up/eight-day-week/compare/trunk...develop
[1.2.1]: https://github.com/10up/eight-day-week/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/10up/eight-day-week/compare/1.1.3...1.2.0
[1.1.3]: https://github.com/10up/eight-day-week/compare/1.1.2...1.1.3
[1.1.2]: https://github.com/10up/eight-day-week/compare/1.1.1...1.1.2
Expand Down
8 changes: 5 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ The `develop` branch is the development branch which means it contains the next
1. Props: update CREDITS.md file with any new contributors, confirm maintainers are accurate.
1. New files: Check to be sure any new files/paths that are unnecessary in the production version are included in `.gitattributes`.
1. Readme updates: Make any other readme changes as necessary. `README.md` is geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different.
1. Merge: Make a non-fast-forward merge from your release branch to `develop`, then do the same for `develop` into `trunk` (`git checkout trunk && git merge --no-ff develop`). `trunk` contains the stable development version.
1. Test: While still on the `trunk` branch, test for functionality locally. If all is well, push to GitHub.
1. Merge: Make a non-fast-forward merge from your release branch to `develop` (or merge the pull request), then do the same for `develop` into `trunk`, ensuring you pull the most recent changes into `develop` first (`git checkout develop && git pull origin develop && git checkout trunk && git merge --no-ff develop`). `trunk` contains the stable development version.
1. Push: Push your `trunk` branch to GitHub (e.g. `git push origin trunk`).
1. [Compare](https://github.com/10up/eight-day-week/compare/trunk...develop) trunk to develop to ensure no additional changes were missed.
1. Test the pre-release ZIP locally by [downloading](https://github.com/10up/eight-day-week/actions/workflows/build-release-zip.yml) it from the Build release zip action artifact and installing it locally. Ensure this zip has all the files we expect, that it installs and activates correctly and that all basic functionality is working
1. Release: Create a [new release](https://github.com/10up/eight-day-week/releases/new), naming the tag and the release with the new version number, and targeting the `trunk` branch. Paste the changelog from `CHANGELOG.md` into the body of the release and include a link to the closed issues on the `X.Y.Z` milestone (e.g. `https://github.com/10up/eight-day-week/milestone/2?closed=1`).
1. SVN: Wait for the [GitHub Action](https://github.com/10up/eight-day-week/actions) to finish deploying to the WordPress.org repository. If all goes well, users with SVN commit access for that plugin will receive an emailed diff of changes.
1. Check WordPress.org: Ensure that the changes are live on https://wordpress.org/plugins/eight-day-week-print-workflow/. This may take a few minutes.
1. Check WordPress.org: Ensure that the changes are live on [WordPress.org](https://wordpress.org/plugins/eight-day-week-print-workflow/). This may take a few minutes.
1. Close milestone: Edit the [milestone](https://github.com/10up/eight-day-week/milestone/#) with release date (in the `Due date (optional)` field) and link to GitHub release (in the `Description` field), then close `X.Y.Z` milestone.
1. Punt incomplete items: If any open issues or PRs which were milestoned for `X.Y.Z` do not make it into the release, update their milestone to `X.Y.Z+1`, `X.Y+1.0`, `X+1.0.0` or `Future Release`.
2 changes: 1 addition & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following individuals are responsible for curating the list of issues, respo

Thank you to all the people and companies who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc.

[10up (@10up)](https://github.com/10up), [Observer Media (@observermedia)](https://github.com/observermedia), [Josh Levinson (@joshlevinson)](https://github.com/joshlevinson), [Brent Schultz (@brs14ku)](https://github.com/brs14ku), [Jeff Sternberg (@sternb0t)](https://github.com/sternb0t), [Anthony Castro (@anthony-j-castro)](https://github.com/anthony-j-castro), [Josh Pollock (@Shelob9)](https://github.com/Shelob9), [Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Matthias Wehrlein (@maryisdead)](https://github.com/maryisdead), [Chris Wallace (@chriswallace)](https://github.com/chriswallace), [Jared Williams (@Jared-Williams)](https://github.com/Jared-Williams), [Helen Hou-Sandí (@helen)](https://github.com/helen), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Mohit Dadhich (@mohitwp)](https://github.com/mohitwp), [Max Lyuchin (@cadic)](https://github.com/cadic), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Vikram Moparthy (@vikrampm1)](https://github.com/vikrampm1).
[10up (@10up)](https://github.com/10up), [Observer Media (@observermedia)](https://github.com/observermedia), [Josh Levinson (@joshlevinson)](https://github.com/joshlevinson), [Brent Schultz (@brs14ku)](https://github.com/brs14ku), [Jeff Sternberg (@sternb0t)](https://github.com/sternb0t), [Anthony Castro (@anthony-j-castro)](https://github.com/anthony-j-castro), [Josh Pollock (@Shelob9)](https://github.com/Shelob9), [Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Matthias Wehrlein (@maryisdead)](https://github.com/maryisdead), [Chris Wallace (@chriswallace)](https://github.com/chriswallace), [Jared Williams (@Jared-Williams)](https://github.com/Jared-Williams), [Helen Hou-Sandí (@helen)](https://github.com/helen), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Mohit Dadhich (@mohitwp)](https://github.com/mohitwp), [Max Lyuchin (@cadic)](https://github.com/cadic), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Vikram Moparthy (@vikrampm1)](https://github.com/vikrampm1), [Dhanendran Rajagopal (@dhanendran)](https://github.com/dhanendran), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Quamruz Zaman (@zamanq)](https://github.com/zamanq), [Jayedul Kabir (@jayedul)](https://github.com/jayedul), [Darin Kotter (@dkotter)](https://github.com/dkotter).

## Libraries

Expand Down
81 changes: 79 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> Optimize publication workflows by using WordPress as your print CMS.
[![Support Level](https://img.shields.io/badge/support-active-green.svg)](#support-level) [![Release Version](https://img.shields.io/github/release/10up/eight-day-week.svg)](https://github.com/10up/eight-day-week/releases/latest) ![WordPress tested up to version](https://img.shields.io/wordpress/plugin/tested/eight-day-week-print-workflow?label=WordPress) [![GPLv2 License](https://img.shields.io/github/license/10up/eight-day-week.svg)](https://github.com/10up/eight-day-week/blob/develop/LICENSE.md)
[![Support Level](https://img.shields.io/badge/support-stable-blue.svg)](#support-level) [![E2E tests](https://github.com/10up/eight-day-week/actions/workflows/cypress.yml/badge.svg)](https://github.com/10up/eight-day-week/actions/workflows/cypress.yml) [![Release Version](https://img.shields.io/github/release/10up/eight-day-week.svg)](https://github.com/10up/eight-day-week/releases/latest) ![WordPress tested up to version](https://img.shields.io/wordpress/plugin/tested/eight-day-week-print-workflow?label=WordPress) [![GPLv2 License](https://img.shields.io/github/license/10up/eight-day-week.svg)](https://github.com/10up/eight-day-week/blob/develop/LICENSE.md)

## Table of Contents
* [Overview](#overview)
Expand Down Expand Up @@ -104,6 +104,83 @@ The information displayed in the list of Print Issues is filterable. Custom colu

The export of posts in a Print Issue is highly customizeable, from the file name of the zip, to the file name of the individual files, to the contents of the files themselves. The best reference would be to read through `includes/functions/plugins/article-export.php`. [Here's](https://github.com/10up/eight-day-week/wiki/Sample-Eight-Day-Week-filters-for-the-Observer) a few examples used on the *Observer*.

### Sample Eight Day Week filters for the Observer

Examples from Observer's eight-day-week-filters.php:

```php
<?php

add_filter( 'Eight_Day_Week\Plugins\Article_Export\xml_outer_elements', function( $elements, $article ) {
$elements['subHeadline'] = get_post_meta( $article->ID, 'nyo_dek', true );
return $elements;
}, 10, 2 );

add_filter( 'Eight_Day_Week\Plugins\Article_Export\xml_outer_elements', function( $elements, $article ) {
if( function_exists( '\Eight_Day_Week\Plugins\Article_Byline\get_article_byline' ) ) {
$elements['byline'] = \Eight_Day_Week\Plugins\Article_Byline\get_article_byline( $article );
}
return $elements;
}, 10, 2 );

add_filter( 'Eight_Day_Week\Plugins\Article_Export\xpath_extract', function( $extract ) {
$extract[] = [
'tag_name' => 'pullQuote',
'container' => 'pullQuotes',
'query' => '//p[contains(@class, "pullquote")]'
];
return $extract;
} );

add_filter( 'Eight_Day_Week\Plugins\Article_Export\dom', function ( $dom ) {
$swap_tag_name = 'emphasized';

$extract_map = [
'strong' => [
'solo' => 'bold',
'inner' => 'em'
],
'em' => [
'solo' => 'italics',
'inner' => 'strong'
],
];

foreach ( $extract_map as $tag_name => $map ) {
$nodes = $dom->getElementsByTagName( $tag_name );
$length = $nodes->length;

for ( $i = $length; -- $i >= 0; ) {
$el = $nodes->item( $i );
$emphasized = $el->getElementsByTagName( $map['inner'] );
if ( $emphasized->length ) {
$em = $dom->createElement( $swap_tag_name );
$em->nodeValue = $el->nodeValue;
try {
$el->parentNode->replaceChild( $em, $el );
} catch ( \Exception $e ) {

}
continue;
}

$new = $dom->createElement( $map['solo'] );
$new->nodeValue = $el->nodeValue;
try {
$el->parentNode->replaceChild( $new, $el );
} catch ( \Exception $e ) {

}

}

}

return $dom;

} );
```

## Known Caveats/Issues

### Gutenberg exports
Expand All @@ -112,7 +189,7 @@ Gutenberg-based exports include some additional metadata/details that a Classic

## Support Level

**Active:** 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome.
**Stable:** 10up is not planning to develop any new features for this, but will still respond to bug reports and security concerns. We welcome PRs, but any that include new features should be small and easy to integrate and should not include breaking changes. We otherwise intend to keep this tested up to the most recent version of WordPress.

## Changelog

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
],
"minimum-stability": "dev",
"require": {
"php": ">=5.4"
"php": ">=7.4"
},
"require-dev": {
"antecedent/patchwork": "2.1.*",
Expand Down
4 changes: 2 additions & 2 deletions eight-day-week.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Eight Day Week
* Description: Tools that help improve digital & print workflows.
* Version: 1.2.0
* Version: 1.2.1
* Author: 10up
* Author URI: http://10up.com
* License: GPLv2+
Expand Down Expand Up @@ -34,7 +34,7 @@
require_once __DIR__ . '/plugins.php';

// Useful global constants
define( 'EDW_VERSION', '1.2.0' );
define( 'EDW_VERSION', '1.2.1' );
define( 'EDW_URL', Eight_Day_Week\plugins_url( __FILE__ ) );
define( 'EDW_PATH', dirname( __FILE__ ) . '/' );
define( 'EDW_INC', EDW_PATH . 'includes/' );
Expand Down
Loading

0 comments on commit 6ceb390

Please sign in to comment.