Merge pull request #194 from markcheret/3.0-backport-fixes
Backport 2.7.4 fixes and workflows to 3.0 codebase
This commit is contained in:
commit
0b16939166
12 changed files with 933 additions and 6088 deletions
3
.github/FUNDING.yml
vendored
Normal file
3
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
custom: ['https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6Z6CZDW8PPBBJ']
|
53
.github/workflows/pre-release.yml
vendored
53
.github/workflows/pre-release.yml
vendored
|
@ -1,53 +0,0 @@
|
||||||
name: Pre-release Handler
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build the Plugin for pre-release
|
|
||||||
if: "github.event.release.prerelease"
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
composer install --no-dev --optimize-autoloader --no-progress
|
|
||||||
|
|
||||||
- name: Build Plugin
|
|
||||||
run: |
|
|
||||||
composer run build
|
|
||||||
|
|
||||||
- name: Rename dist/ folder
|
|
||||||
run: |
|
|
||||||
mv dist/ footnotes/
|
|
||||||
|
|
||||||
- name: Create release archive
|
|
||||||
uses: montudor/action-zip@v0.1.0
|
|
||||||
with:
|
|
||||||
args: zip -X -r footnotes-${{ github.event.release.tag_name }}.zip footnotes
|
|
||||||
|
|
||||||
- name: Upload archive as artifact
|
|
||||||
uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: footnotes-${{ github.event.release.tag_name }}
|
|
||||||
path: footnotes-${{ github.event.release.tag_name }}.zip
|
|
||||||
|
|
||||||
- name: Upload archive to release
|
|
||||||
uses: JasonEtco/upload-to-release@master
|
|
||||||
with:
|
|
||||||
args: footnotes-${{ github.event.release.tag_name }}.zip application/zip
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
#- name: Deploy release to Wordpress.org
|
|
||||||
# uses: 10up/action-wordpress-plugin-deploy@stable
|
|
||||||
# with:
|
|
||||||
# generate-zip: true
|
|
||||||
# env:
|
|
||||||
# SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
|
|
||||||
# SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
|
|
87
.github/workflows/release-handler.yml
vendored
Normal file
87
.github/workflows/release-handler.yml
vendored
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
# This workflow handles GitHub releases and pre-releases.
|
||||||
|
# It builds the Plugin, zips up an archive to add to the
|
||||||
|
# release entry on GitHub and (in the case of a full release)
|
||||||
|
# pushes the release to the WP Plugin Directory SVN repo.
|
||||||
|
|
||||||
|
name: Release Handler
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_plugin:
|
||||||
|
name: Build the Plugin for pre-release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
composer install --no-dev --optimize-autoloader --no-progress
|
||||||
|
|
||||||
|
- name: Build Plugin
|
||||||
|
run: |
|
||||||
|
composer run build
|
||||||
|
|
||||||
|
- name: Rename Plugin folder
|
||||||
|
run: |
|
||||||
|
mv dist/ footnotes/
|
||||||
|
|
||||||
|
- name: Upload Plugin artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: footnotes-${{ github.event.release.tag_name }}
|
||||||
|
path: footnotes
|
||||||
|
|
||||||
|
create_archive:
|
||||||
|
name: Create an archive for the release and add it to GitHub
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build_plugin
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download Plugin artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: footnotes-${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
|
- name: Create release archive
|
||||||
|
uses: montudor/action-zip@v0.1.0
|
||||||
|
with:
|
||||||
|
args: zip -X -r footnotes-${{ github.event.release.tag_name }}.zip footnotes
|
||||||
|
|
||||||
|
#- name: Upload archive as artifact
|
||||||
|
# uses: actions/upload-artifact@v2
|
||||||
|
# with:
|
||||||
|
# name: footnotes-${{ github.event.release.tag_name }}
|
||||||
|
# path: footnotes-${{ github.event.release.tag_name }}.zip
|
||||||
|
|
||||||
|
- name: Upload archive to release
|
||||||
|
uses: JasonEtco/upload-to-release@master
|
||||||
|
with:
|
||||||
|
args: footnotes-${{ github.event.release.tag_name }}.zip application/zip
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
release_to_svn:
|
||||||
|
name: Push the release to the WordPress Plugin Directory repo.
|
||||||
|
if: "!github.event.release.prerelease"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: create_archive
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Download Plugin artifact
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: footnotes-${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
|
- name: Deploy release to Wordpress.org
|
||||||
|
id: deploy
|
||||||
|
uses: 10up/action-wordpress-plugin-deploy@stable
|
||||||
|
env:
|
||||||
|
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
|
||||||
|
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
|
||||||
|
SLUG: footnotes/branches/svn-test
|
||||||
|
ASSETS_DIR: assets
|
9
.github/workflows/snyk.yml
vendored
9
.github/workflows/snyk.yml
vendored
|
@ -1,6 +1,6 @@
|
||||||
name: Snyk
|
name: Snyk
|
||||||
|
|
||||||
on: push
|
on: pull_request
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
security:
|
security:
|
||||||
|
@ -13,7 +13,12 @@ jobs:
|
||||||
|
|
||||||
- name: Run Snyk to check for vulnerabilities
|
- name: Run Snyk to check for vulnerabilities
|
||||||
uses: snyk/actions/php@master
|
uses: snyk/actions/php@master
|
||||||
|
continue-on-error: true # To make sure that SARIF upload gets called
|
||||||
env:
|
env:
|
||||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||||
with:
|
with:
|
||||||
args: --all-projects
|
args: --all-projects --sarif-file-output=snyk.sarif
|
||||||
|
- name: Upload result to GitHub Code Scanning
|
||||||
|
uses: github/codeql-action/upload-sarif@v1
|
||||||
|
with:
|
||||||
|
sarif_file: snyk.sarif
|
||||||
|
|
|
@ -1,40 +1,23 @@
|
||||||
# Contributor Covenant Code of Conduct
|
# Code of Conduct
|
||||||
|
|
||||||
## Our Pledge
|
## Our Pledge
|
||||||
|
|
||||||
We as members, contributors, and leaders pledge to make participation in our
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
community a harassment-free experience for everyone, regardless of age, body
|
community a safe and enjoyable experience for *everyone*.
|
||||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
||||||
identity and expression, level of experience, education, socio-economic status,
|
|
||||||
nationality, personal appearance, race, religion, or sexual identity
|
|
||||||
and orientation.
|
|
||||||
|
|
||||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
diverse, inclusive, and healthy community.
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
## Our Standards
|
## Our Standards
|
||||||
|
|
||||||
Examples of behavior that contributes to a positive environment for our
|
All participants in this community must abide by the following policy:
|
||||||
community include:
|
|
||||||
|
|
||||||
* Demonstrating empathy and kindness toward other people
|
> Be excellent to each other
|
||||||
* Being respectful of differing opinions, viewpoints, and experiences
|
|
||||||
* Giving and gracefully accepting constructive feedback
|
|
||||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
||||||
and learning from the experience
|
|
||||||
* Focusing on what is best not just for us as individuals, but for the
|
|
||||||
overall community
|
|
||||||
|
|
||||||
Examples of unacceptable behavior include:
|
Treat everyone with respect. Participate while acknowledging that everyone
|
||||||
|
deserves to be here — and each of us has the right to enjoy our experience
|
||||||
* The use of sexualized language or imagery, and sexual attention or
|
without fear. Consider what you are saying and how it would feel if it were
|
||||||
advances of any kind
|
said to or about you.
|
||||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
||||||
* Public or private harassment
|
|
||||||
* Publishing others' private information, such as a physical or email
|
|
||||||
address, without their explicit permission
|
|
||||||
* Other conduct which could reasonably be considered inappropriate in a
|
|
||||||
professional setting
|
|
||||||
|
|
||||||
## Enforcement Responsibilities
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
@ -52,6 +35,7 @@ decisions when appropriate.
|
||||||
|
|
||||||
This Code of Conduct applies within all community spaces, and also applies when
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
an individual is officially representing the community in public spaces.
|
an individual is officially representing the community in public spaces.
|
||||||
|
|
||||||
Examples of representing our community include using an official e-mail address,
|
Examples of representing our community include using an official e-mail address,
|
||||||
posting via an official social media account, or acting as an appointed
|
posting via an official social media account, or acting as an appointed
|
||||||
representative at an online or offline event.
|
representative at an online or offline event.
|
||||||
|
@ -59,8 +43,8 @@ representative at an online or offline event.
|
||||||
## Enforcement
|
## Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
reported to the community leaders responsible for enforcement at
|
reported to the project leader, [Mark Cheret][mailto:mark@cheret.de].
|
||||||
mark@cheret.de.
|
|
||||||
All complaints will be reviewed and investigated promptly and fairly.
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
All community leaders are obligated to respect the privacy and security of the
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
@ -114,15 +98,10 @@ the community.
|
||||||
|
|
||||||
## Attribution
|
## Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
This Code of Conduct is adapted from the [Contributor Covenant][covenant],
|
||||||
version 2.0, available at
|
version 2.0, [Mozilla's code of conduct enforcement ladder][mozilla] and the
|
||||||
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
|
[Google Event Community Guidelines and Anti-Harassment Policy][google].
|
||||||
|
|
||||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
[covenant]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
|
||||||
enforcement ladder](https://github.com/mozilla/diversity).
|
[mozilla]: https://github.com/mozilla/diversity
|
||||||
|
[google]: https://www.google.com/events/policy/anti-harassmentpolicy.html
|
||||||
[homepage]: https://www.contributor-covenant.org
|
|
||||||
|
|
||||||
For answers to common questions about this code of conduct, see the FAQ at
|
|
||||||
<https://www.contributor-covenant.org/faq>. Translations are available at
|
|
||||||
<https://www.contributor-covenant.org/translations>.
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
![GitHub contributors](https://img.shields.io/github/contributors/markcheret/footnotes?style=flat-square) ![GitHub commits since tagged version](https://img.shields.io/github/commits-since/markcheret/footnotes/2.7.3?style=flat-square) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/markcheret/footnotes?style=flat-square) ![issues](https://img.shields.io/github/issues/markcheret/footnotes?style=flat-square) ![PRs](https://img.shields.io/github/issues-pr/markcheret/footnotes?style=flat-square)
|
![GitHub contributors](https://img.shields.io/github/contributors/markcheret/footnotes?style=flat-square) ![GitHub commits since tagged version](https://img.shields.io/github/commits-since/markcheret/footnotes/2.7.3?style=flat-square) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/markcheret/footnotes?style=flat-square) ![issues](https://img.shields.io/github/issues/markcheret/footnotes?style=flat-square) ![PRs](https://img.shields.io/github/issues-pr/markcheret/footnotes?style=flat-square)
|
||||||
|
|
||||||
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/markcheret/footnotes?style=flat-square) [![OSSAR](https://github.com/markcheret/footnotes/actions/workflows/ossar-analysis.yml/badge.svg)](https://github.com/markcheret/footnotes/actions/workflows/ossar-analysis.yml) [![PHP Composer](https://github.com/markcheret/footnotes/actions/workflows/php.yml/badge.svg)](https://github.com/markcheret/footnotes/actions/workflows/php.yml)
|
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/markcheret/footnotes?style=flat-square) [![OSSAR](https://github.com/markcheret/footnotes/actions/workflows/ossar-analysis.yml/badge.svg)](https://github.com/markcheret/footnotes/actions/workflows/ossar-analysis.yml) [![Code Linting](https://github.com/markcheret/footnotes/actions/workflows/php.yml/badge.svg)](https://github.com/markcheret/footnotes/actions/workflows/lint-code.yml)
|
||||||
|
|
||||||
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![Coverage Status](https://coveralls.io/repos/github/markcheret/footnotes/badge.svg?branch=main)](https://coveralls.io/github/markcheret/footnotes?branch=main)
|
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![Coverage Status](https://coveralls.io/repos/github/markcheret/footnotes/badge.svg?branch=main)](https://coveralls.io/github/markcheret/footnotes?branch=main)
|
||||||
<!-- markdownlint-enable MD013 -->
|
<!-- markdownlint-enable MD013 -->
|
||||||
|
|
|
@ -65,7 +65,7 @@ echo "- Checking versions..."
|
||||||
|
|
||||||
STABLE_TAG="$(grep "Stable Tag:" src/readme.txt)"
|
STABLE_TAG="$(grep "Stable Tag:" src/readme.txt)"
|
||||||
ROOT_HEADER_VERSION="$(grep " Version:" src/footnotes.php | grep -Po " Version: \d+\.\d+(\.\d+)?[a-z]?$")"
|
ROOT_HEADER_VERSION="$(grep " Version:" src/footnotes.php | grep -Po " Version: \d+\.\d+(\.\d+)?[a-z]?$")"
|
||||||
JS_VERSION="$(grep "version :" src/js/wysiwyg-editor.js)"
|
JS_VERSION="$(grep "version:" src/js/wysiwyg-editor.js)"
|
||||||
|
|
||||||
# Step 3(b): Check that all version declarations exists
|
# Step 3(b): Check that all version declarations exists
|
||||||
|
|
||||||
|
|
6789
package-lock.json
generated
6789
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -56,10 +56,12 @@
|
||||||
"husky": "^4.3.8",
|
"husky": "^4.3.8",
|
||||||
"lint-staged": "^10.5.4",
|
"lint-staged": "^10.5.4",
|
||||||
"markdownlint-cli": "^0.27.1",
|
"markdownlint-cli": "^0.27.1",
|
||||||
|
"merge": "^2.1.1",
|
||||||
"minify": "^7.0.1",
|
"minify": "^7.0.1",
|
||||||
"node-sass": "^5.0.0",
|
"node-sass": "^5.0.0",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.2.1",
|
||||||
"stylelint": "^13.12.0",
|
"stylelint": "^13.12.0",
|
||||||
|
"stylelint-a11y": "^1.2.3",
|
||||||
"stylelint-config-rational-order": "^0.1.2",
|
"stylelint-config-rational-order": "^0.1.2",
|
||||||
"stylelint-config-recommended": "^3.0.0",
|
"stylelint-config-recommended": "^3.0.0",
|
||||||
"stylelint-config-wordpress": "^17.0.0",
|
"stylelint-config-wordpress": "^17.0.0",
|
||||||
|
@ -73,9 +75,6 @@
|
||||||
"path": "./node_modules/cz-conventional-changelog"
|
"path": "./node_modules/cz-conventional-changelog"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
|
||||||
"stylelint-a11y": "^1.2.3"
|
|
||||||
},
|
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
return {
|
return {
|
||||||
longname: 'footnotes',
|
longname: 'footnotes',
|
||||||
author: 'Mark Cheret',
|
author: 'Mark Cheret',
|
||||||
authorurl: 'https://cheret.org/footnotes/',
|
authorurl: 'https://cheret.tech/footnotes/',
|
||||||
infourl: 'https://wordpress.org/plugins/footnotes/',
|
infourl: 'https://wordpress.org/plugins/footnotes/',
|
||||||
version: '2.7.4d',
|
version: '2.7.4d',
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* Requires at least: 3.9
|
* Requires at least: 3.9
|
||||||
* Requires PHP: 7.0
|
* Requires PHP: 7.0
|
||||||
* Author: Mark Cheret
|
* Author: Mark Cheret
|
||||||
* Author URI: https://cheret.org/footnotes
|
* Author URI: https://cheret.tech/footnotes
|
||||||
* Text Domain: footnotes
|
* Text Domain: footnotes
|
||||||
* Domain Path: /languages
|
* Domain Path: /languages
|
||||||
* License: GPL v3
|
* License: GPL v3
|
||||||
|
@ -111,6 +111,8 @@ require_once plugin_dir_path( __FILE__ ) . 'includes/class-core.php';
|
||||||
*
|
*
|
||||||
* Since everything within the plugin is registered via hooks, then kicking off
|
* Since everything within the plugin is registered via hooks, then kicking off
|
||||||
* the plugin from this point in the file does not affect the page life cycle.
|
* the plugin from this point in the file does not affect the page life cycle.
|
||||||
|
* This takes place after the `plugins_loaded` hook, so that other Plugins may
|
||||||
|
* filter options.
|
||||||
*
|
*
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*/
|
*/
|
||||||
|
@ -124,4 +126,4 @@ function run_footnotes(): void {
|
||||||
$footnotes = new includes\Core();
|
$footnotes = new includes\Core();
|
||||||
$footnotes->run();
|
$footnotes->run();
|
||||||
}
|
}
|
||||||
run_footnotes();
|
add_action( 'plugins_loaded', run_footnotes() );
|
||||||
|
|
8
src/wpml-config.xml
Normal file
8
src/wpml-config.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<wpml-config>
|
||||||
|
<admin-texts>
|
||||||
|
<key name="footnotes_storage">
|
||||||
|
<key name="footnote_inputfield_references_label" />
|
||||||
|
<key name="footnote_inputfield_readon_label" />
|
||||||
|
</key>
|
||||||
|
</admin-texts>
|
||||||
|
</wpml-config>
|
Reference in a new issue