diff --git a/.distignore b/.distignore index 4eb6476a..45fc7d69 100644 --- a/.distignore +++ b/.distignore @@ -9,11 +9,7 @@ # DO NOT EXCLUDE /vendor # Files -.babelrc -.distignore -.eslintignore -.eslintrc.json -.gitignore +.* CHANGELOG.md CODE_OF_CONDUCT.md composer.json @@ -28,5 +24,3 @@ phpunit.xml README.md webpack.config.js webpack.gutenberg.config.js -.wp-env.json -.nvmrc diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 86a59515..28449559 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -8,10 +8,6 @@ on: pull_request: branches: - develop - paths: - - '**.js' - - '**.php' - - '**.css' jobs: build: diff --git a/.github/workflows/wordpress-latest.yml b/.github/workflows/wordpress-version-checker.yml similarity index 80% rename from .github/workflows/wordpress-latest.yml rename to .github/workflows/wordpress-version-checker.yml index b134ea59..34e44107 100644 --- a/.github/workflows/wordpress-latest.yml +++ b/.github/workflows/wordpress-version-checker.yml @@ -10,11 +10,14 @@ on: schedule: - cron: '0 0 * * 1' +permissions: + issues: write + jobs: wordpress-version-checker: runs-on: ubuntu-latest steps: - name: WordPress version checker - uses: skaut/wordpress-version-checker@v1.2.0 + uses: skaut/wordpress-version-checker@master with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.wordpress-version-checker.json b/.wordpress-version-checker.json new file mode 100644 index 00000000..b20af627 --- /dev/null +++ b/.wordpress-version-checker.json @@ -0,0 +1,3 @@ +{ + "channel": "rc" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 05491f0e..f5f36c06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] - TBD -## [2.1.0] - 2023-07-05 +## [2.1.1] - 2023-08-XX + +### Changed +- Improved setup instructions and error handing (props [@johnwatkins0](https://github.com/johnwatkins0), [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul) via [#255](https://github.com/10up/autoshare-for-twitter/pull/255)). +- Bump WordPress "tested up to" version 6.3 (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul) via [#265](https://github.com/10up/autoshare-for-twitter/pull/265)). + +### Fixed +- The custom tweet message does not work with scheduled posts (props [@GeoffLambert77](https://github.com/GeoffLambert77), [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9) via [#267](https://github.com/10up/autoshare-for-twitter/pull/267)). +- Connected Twitter accounts visibility in the classic editor (props [@iamdharmesh](https://github.com/iamdharmesh), [@Sidsector9](https://github.com/Sidsector9) via [#269](https://github.com/10up/autoshare-for-twitter/pull/269)). +- Better error handling for environments that don't match our minimum PHP version (props [@dkotter](https://github.com/dkotter), [@rahulsprajapati](https://github.com/rahulsprajapati), [@iamdharmesh](https://github.com/iamdharmesh) via [#258](https://github.com/10up/autoshare-for-twitter/pull/258)). +- Ensure our E2E tests work properly on WordPress 6.3 (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#264](https://github.com/10up/autoshare-for-twitter/pull/264)). + +### Security +- Bump `tough-cookie` from 2.5.0 to 4.1.3 and `@cypress/request` from 2.88.10 to 2.88.12 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#266](https://github.com/10up/autoshare-for-twitter/pull/266)). +- Bump `word-wrap` from 1.2.3 to 1.2.4 (props [@dependabot[bot]](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#257](https://github.com/10up/autoshare-for-twitter/pull/257)). + +## [2.1.0] - 2023-07-06 ### Added - Support for tweeting via multiple Twitter accounts (props [@iamdharmesh](https://github.com/iamdharmesh), [@jeffpaul](https://github.com/jeffpaul), [@Sidsector9](https://github.com/Sidsector9) via [#238](https://github.com/10up/autoshare-for-twitter/pull/238)). - Obfuscation of saved Twitter keys in the UI (props [@lgrzegorski](https://github.com/lgrzegorski), [@bmarshall511](https://github.com/bmarshall511), [@iamdharmesh](https://github.com/iamdharmesh) via [#245](https://github.com/10up/autoshare-for-twitter/pull/245)). @@ -210,6 +226,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 +[2.1.1]: https://github.com/10up/autoshare-for-twitter/compare/2.1.0...2.1.1 [2.1.0]: https://github.com/10up/autoshare-for-twitter/compare/2.0.0...2.1.0 [2.0.0]: https://github.com/10up/autoshare-for-twitter/compare/1.3.0...2.0.0 [1.3.0]: https://github.com/10up/autoshare-for-twitter/compare/1.2.1...1.3.0 diff --git a/CREDITS.md b/CREDITS.md index d75a654f..edac58f5 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -10,7 +10,7 @@ The following individuals are responsible for curating the list of issues, respo 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), [Ravinder Kumar (@ravinderk)](https://github.com/ravinderk), [Lukasz Grzegorski (@lgrzegorski)](https://github.com/lgrzegorski), [Ben Marshall (@bmarshall511)](https://github.com/bmarshall511), [Miguel Estrada (@mae829)](https://github.com/mae829). +[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), [Lukasz Grzegorski (@lgrzegorski)](https://github.com/lgrzegorski), [Ben Marshall (@bmarshall511)](https://github.com/bmarshall511), [Miguel Estrada (@mae829)](https://github.com/mae829), [Rahul Prajapati (@rahulsprajapati)](https://github.com/rahulsprajapati), [@GeoffLambert77](https://github.com/GeoffLambert77). ## Libraries diff --git a/assets/js/admin-autoshare-for-twitter-classic-editor.js b/assets/js/admin-autoshare-for-twitter-classic-editor.js index cbf5ad2f..cb7843c3 100644 --- a/assets/js/admin-autoshare-for-twitter-classic-editor.js +++ b/assets/js/admin-autoshare-for-twitter-classic-editor.js @@ -238,6 +238,9 @@ ( ( response.success && response.data.message ) || ( false === response.success && false === response.data.is_retweeted) ) ) { $('.autoshare-for-twitter-status-logs-wrapper').html(response.data.message); + if ( response.data.is_retweeted ) { + $tweetText.val(''); // Reset the tweet text. + } } else { $("#autoshare-for-twitter-error-message").html(adminAutoshareForTwitter.unknownErrorText); } diff --git a/autoshare-for-twitter.php b/autoshare-for-twitter.php index ee8c4e84..ca4fa110 100644 --- a/autoshare-for-twitter.php +++ b/autoshare-for-twitter.php @@ -3,7 +3,7 @@ * Plugin Name: Autoshare for Twitter * Description: Automatically tweets the post title or custom message and a link to the post. * Disclaimer: TWITTER, TWEET, RETWEET and the Twitter logo are trademarks of Twitter, Inc. or its affiliates. - * Version: 2.1.0 + * Version: 2.1.1 * Requires at least: 5.7 * Requires PHP: 7.4 * Author: 10up @@ -15,16 +15,61 @@ * @package TenUp\AutoshareForTwitter */ +namespace TenUp\AutoshareForTwitter; + if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } define( 'AUTOSHARE_FOR_TWITTER', __FILE__ ); -define( 'AUTOSHARE_FOR_TWITTER_VERSION', '2.1.0' ); +define( 'AUTOSHARE_FOR_TWITTER_VERSION', '2.1.1' ); define( 'AUTOSHARE_FOR_TWITTER_URL', plugin_dir_url( __FILE__ ) ); define( 'AUTOSHARE_FOR_TWITTER_PATH', plugin_dir_path( __FILE__ ) ); define( 'AUTOSHARE_FOR_TWITTER_INC', AUTOSHARE_FOR_TWITTER_PATH . 'includes/' ); +/** + * Get the minimum version of PHP required by this plugin. + * + * @return string Minimum version required. + */ +function minimum_php_requirement() { + return '7.4'; +} + +/** + * Whether PHP installation meets the minimum requirements + * + * @return bool True if meets minimum requirements, false otherwise. + */ +function site_meets_php_requirements() { + return version_compare( phpversion(), minimum_php_requirement(), '>=' ); +} + +// Ensuring our PHP version requirement is met first before loading plugin. +if ( ! site_meets_php_requirements() ) { + add_action( + 'admin_notices', + function() { + ?> +
+ +
+