Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed Jan 20, 2023
2 parents 9ccd6e6 + 5b186a8 commit 18acb0f
Show file tree
Hide file tree
Showing 54 changed files with 1,437 additions and 476 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"globals": {
"adminAutoshareForTwitter": "readonly",
"jQuery": "readonly",
"wp": "readonly"
"wp": "readonly",
"FormData": "readonly",
"fetch": "readonly",
"ajaxurl": "readonly"
},
"extends": "plugin:@wordpress/eslint-plugin/recommended"
}
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# These owners will be the default owners for everything in the repo. Unless a later match takes precedence, @iamdharmesh, as primary maintainer will be requested for review when someone opens a Pull Request.
* @iamdharmesh

# GitHub and WordPress.org specifics
/.github/ @jeffpaul
/.wordpress-org/ @jeffpaul
CODE_OF_CONDUCT.md @jeffpaul
LICENSE.md @jeffpaul
6 changes: 5 additions & 1 deletion .github/workflows/build-release-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Build release zip

on:
workflow_dispatch:
workflow_call:
push:
branches:
- trunk
Expand Down Expand Up @@ -31,7 +32,10 @@ jobs:
env:
cache-name: cache-node-modules
with:
path: node_modules
path: |
node_modules
~/.cache
~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: Setup node version and npm cache
Expand Down
51 changes: 40 additions & 11 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ on:
pull_request:
branches:
- develop
paths:
- '**.js'
- '**.php'
- '**.css'

jobs:
build:
uses: 10up/autoshare-for-twitter/.github/workflows/build-release-zip.yml@develop

cypress:
needs: build
runs-on: ubuntu-latest

strategy:
Expand All @@ -22,26 +30,47 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install dependencies
run: npm i && npm i -g [email protected]
- name: Download build zip
uses: actions/download-artifact@v3
with:
name: ${{ github.event.repository.name }}
path: ${{ github.event.repository.name }}

- name: Display structure of downloaded files
run: ls -R
working-directory: ${{ github.event.repository.name }}

- name: Build asset
run: npm run build
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
node_modules
~/.cache
~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: Add dependencies
run: composer install -o --no-dev --ignore-platform-reqs
- name: Install dependencies
run: npm install

- name: Set the core version
run: ./tests/bin/set-core-version.js ${{ matrix.core.version }}
- name: Set the core version and plugins config
run: ./tests/bin/set-wp-config.js --core=${{ matrix.core.version }} --plugins=./${{ github.event.repository.name }},https://downloads.wordpress.org/plugin/classic-editor.1.6.1.zip

- name: Set up WP environment
run: npm run env:start

- name: Test
run: cypress run --config-file tests/cypress/config.json --env TWITTER_API_KEY=${{ secrets.TWITTER_API_KEY }},TWITTER_API_SECRET=${{ secrets.TWITTER_API_SECRET }},TWITTER_ACCESS_TOKEN=${{ secrets.TWITTER_ACCESS_TOKEN }},TWITTER_ACCESS_SECRET=${{ secrets.TWITTER_ACCESS_SECRET }}

run: npm run cypress:run
env:
CYPRESS_TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
CYPRESS_TWITTER_API_SECRET: ${{ secrets.TWITTER_API_SECRET }}
CYPRESS_TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
CYPRESS_TWITTER_ACCESS_SECRET: ${{ secrets.TWITTER_ACCESS_SECRET }}

- name: Upload artifacts
uses: actions/upload-artifact@v2
if: failure()
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
pull_request:
branches:
- develop
paths: # Note: Update paths here will also require updating paths in ignore.eslint.yml.
- '**.js'

jobs:
eslint:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/ignore-eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: ESLint

on:
pull_request:
branches:
- develop
paths-ignore:
- '**.js'

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- run: 'echo "No ESLint check required"'
14 changes: 14 additions & 0 deletions .github/workflows/ignore-phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: PHPCS

on:
pull_request:
branches:
- develop
paths-ignore:
- '**.php'

jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- run: 'echo "No PHPCS check required"'
18 changes: 18 additions & 0 deletions .github/workflows/ignore-phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PHPUnit

on:
pull_request:
branches:
- develop
paths-ignore:
- '**.php'

jobs:
phpunit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0']
steps:
- run: 'echo "No PHPUnit check required"'
2 changes: 2 additions & 0 deletions .github/workflows/php-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
pull_request:
branches:
- develop
paths:
- '**.php'

jobs:
php_compatibility:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
pull_request:
branches:
- develop
paths: # Note: Update paths here will also require updating paths in ignore.phpcs.yml.
- '**.php'

jobs:
phpcs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
pull_request:
branches:
- develop
paths: # Note: Update paths here will also require updating paths in ignore.phpunit.yml.
- '**.php'

jobs:
phpunit:
Expand Down
Binary file added .wordpress-org/screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased] - TBD

## [1.2.1] - 2022-12-05
## [1.3.0] - 2023-01-19
### Added
- "Tweet now" functionality (props [@Sidsector9](https://github.com/Sidsector9), [@iamdharmesh](https://github.com/iamdharmesh), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@linawiezkowiak](https://github.com/linawiezkowiak), [@oszkarnagy](https://github.com/oszkarnagy) via [#188](https://github.com/10up/autoshare-for-twitter/pull/188)).
- Toggle for adding/removing featured image from the tweet (props [@Sidsector9](https://github.com/Sidsector9), [@iamdharmesh](https://github.com/iamdharmesh), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@linawiezkowiak](https://github.com/linawiezkowiak), [@oszkarnagy](https://github.com/oszkarnagy) via [#188](https://github.com/10up/autoshare-for-twitter/pull/188)).
- Show Twitter status logs for the draft post if the post has been switched back to Draft from Published, and has already been Tweeted (props [@iamdharmesh](https://github.com/iamdharmesh), [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@linawiezkowiak](https://github.com/linawiezkowiak), [@oszkarnagy](https://github.com/oszkarnagy) via [#215](https://github.com/10up/autoshare-for-twitter/pull/215)).
- Plugin screenshots to readme files (props [@iamdharmesh](https://github.com/iamdharmesh) via [#218](https://github.com/10up/autoshare-for-twitter/pull/218)).

### Changed
- UI Improvements in Tweet status (props [@Sidsector9](https://github.com/Sidsector9), [@iamdharmesh](https://github.com/iamdharmesh), [@cadic](https://github.com/cadic), [@jeffpaul](https://github.com/jeffpaul), [@linawiezkowiak](https://github.com/linawiezkowiak), [@oszkarnagy](https://github.com/oszkarnagy) via [#188](https://github.com/10up/autoshare-for-twitter/pull/188)).
- UI Improvements in tweet message character count (props [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9), [@ravinderk](https://github.com/ravinderk), [@jeffpaul](https://github.com/jeffpaul), [@linawiezkowiak](https://github.com/linawiezkowiak), [@oszkarnagy](https://github.com/oszkarnagy) via [#214](https://github.com/10up/autoshare-for-twitter/pull/214)).
- Run GitHub Action workflows only when it required (props [@iamdharmesh](https://github.com/iamdharmesh), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#204](https://github.com/10up/autoshare-for-twitter/pull/204)).
- Migrated Cypress from 9.0.0 to 11.2.0 (props [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9) via [#205](https://github.com/10up/autoshare-for-twitter/pull/205)).
- Run E2E tests on the zip generated by "Build release zip" action (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9) via [#206](https://github.com/10up/autoshare-for-twitter/pull/206)).

### Fixed
- E2E tests fail in the CI with warm cache (props [@cadic](https://github.com/cadic), [@iamdharmesh](https://github.com/iamdharmesh) via [#212](https://github.com/10up/autoshare-for-twitter/pull/212)).

### Security
- Bump `decode-uri-component` from 0.2.0 to 0.2.2 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#208](https://github.com/10up/autoshare-for-twitter/pull/208)).
- Bump `simple-git` from 3.14.1 to 3.15.1 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#210](https://github.com/10up/autoshare-for-twitter/pull/210)).

## [1.2.1] - 2022-12-07
**Note that this release bumps the WordPress minimum from 5.3 to 5.7 and PHP minimum from 7.2 to 7.4.**

### Added
Expand Down Expand Up @@ -159,6 +180,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Initial closed source release (props [@scottlee](https://github.com/scottlee/)).

[Unreleased]: https://github.com/10up/autoshare-for-twitter/compare/trunk...develop
[1.3.0]: https://github.com/10up/autoshare-for-twitter/compare/1.2.1...1.3.0
[1.2.1]: https://github.com/10up/autoshare-for-twitter/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/10up/autoshare-for-twitter/compare/1.1.2...1.2.0
[1.1.2]: https://github.com/10up/autoshare-for-twitter/compare/1.1.1...1.1.2
Expand Down
4 changes: 2 additions & 2 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ The following acknowledges the Maintainers for this repository, those who have C

The following individuals are responsible for curating the list of issues, responding to pull requests, and ensuring regular releases happen.

[Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh).
[Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul).

## Contributors

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

[Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [John Watkins (@johnwatkins0)](https://github.com/johnwatkins0), [Scott Lee (@scottlee)](https://github.com/scottlee), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Stephanie Campbell (@sncampbell)](https://github.com/sncampbell), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Ricky Lee Whittemore (@rickalee)](https://github.com/rickalee), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Lina Wiezkowiak (@linawiezkowiak)](https://github.com/linawiezkowiak), [Oszkar Nagy (@oszkarnagy)](https://github.com/oszkarnagy), [Helen Hou-Sandi (@helen)](https://github.com/helen), [Thrijith Thankachan (@thrijith)](https://github.com/thrijith), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Sudip Dadhaniya (@sudip-10up)](https://github.com/sudip-10up), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Max Lyuchin (@cadic)](https://github.com/cadic), [Vikram Moparthy (@vikrampm1)](https://github.com/vikrampm1), [GitHub Dependabot (@dependabot)](https://github.com/apps/dependabot).
[Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [John Watkins (@johnwatkins0)](https://github.com/johnwatkins0), [Scott Lee (@scottlee)](https://github.com/scottlee), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Stephanie Campbell (@sncampbell)](https://github.com/sncampbell), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [Ricky Lee Whittemore (@rickalee)](https://github.com/rickalee), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [Lina Wiezkowiak (@linawiezkowiak)](https://github.com/linawiezkowiak), [Oszkar Nagy (@oszkarnagy)](https://github.com/oszkarnagy), [Helen Hou-Sandi (@helen)](https://github.com/helen), [Thrijith Thankachan (@thrijith)](https://github.com/thrijith), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Sudip Dadhaniya (@sudip-10up)](https://github.com/sudip-10up), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Max Lyuchin (@cadic)](https://github.com/cadic), [Vikram Moparthy (@vikrampm1)](https://github.com/vikrampm1), [GitHub Dependabot (@dependabot)](https://github.com/apps/dependabot), [Ravinder Kumar (@ravinderk)](https://github.com/ravinderk).

## Libraries

Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,24 @@ add_filter( 'dt_blacklisted_meta', function( $blacklisted_metas ) {
} )
```

| Autoshare for Twitter Settings, found under `Settings` > `Autoshare for Twitter`. |
| --------------- |
|[![Autoshare for Twitter Settings, found under `Settings` > `Autoshare for Twitter`.](.wordpress-org/screenshot-1.png)](.wordpress-org/screenshot-1.png)|

| Create post screen with Autoshare for Twitter options | Published post screen with Autoshare for Twitter options. |
| -------------- | ---------------- |
| [![Create post screen with Autoshare for Twitter options](.wordpress-org/screenshot-2.png)](.wordpress-org/screenshot-2.png) | [![Published post screen with Autoshare for Twitter options.](.wordpress-org/screenshot-3.png)](.wordpress-org/screenshot-3.png) |

## Requirements

- PHP 7.4+
- [WordPress](http://wordpress.org) 5.7+

## Installation

1. Upload the entire `/autoshare-for-twitter` directory to the `/wp-content/plugins/` directory.
2. Activate the plugin
3. Register post type support for types that should be allowed to autoshare. `add_post_type_support( 'post', 'autoshare-for-twitter' );`
1. Install the plugin via the plugin installer, either by searching for it or uploading a .ZIP file.
2. Activate the plugin.
3. Save Twitter connection settings, found under `Settings` > `Autoshare for Twitter`.

## FAQs

Expand Down
Loading

0 comments on commit 18acb0f

Please sign in to comment.