From e114a0c3b718baec0018f6476a05b962ab029aed Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 5 Feb 2025 08:31:23 -0700 Subject: [PATCH 1/5] Version bump to 2.3.0 --- autoshare-for-twitter.php | 4 ++-- composer.json | 2 +- package-lock.json | 4 ++-- package.json | 2 +- readme.txt | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/autoshare-for-twitter.php b/autoshare-for-twitter.php index 6b0fadb6..cad08421 100644 --- a/autoshare-for-twitter.php +++ b/autoshare-for-twitter.php @@ -3,7 +3,7 @@ * Plugin Name: Autopost for X (formerly Autoshare for Twitter) * Description: Automatically shares the post title or custom message and a link to the post to X/Twitter. * Disclaimer: TWITTER, TWEET, RETWEET and the Twitter logo are trademarks of Twitter, Inc. or its affiliates. - * Version: 2.2.1 + * Version: 2.3.0 * Requires at least: 6.5 * Requires PHP: 7.4 * Author: 10up @@ -22,7 +22,7 @@ } define( 'AUTOSHARE_FOR_TWITTER', __FILE__ ); -define( 'AUTOSHARE_FOR_TWITTER_VERSION', '2.2.1' ); +define( 'AUTOSHARE_FOR_TWITTER_VERSION', '2.3.0' ); 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/' ); diff --git a/composer.json b/composer.json index 7da4491b..3b20b337 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "platform": { "php": "7.4" }, - "autoloader-suffix": "10upAutoshareForTwitterV221", + "autoloader-suffix": "10upAutoshareForTwitterV230", "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true } diff --git a/package-lock.json b/package-lock.json index 2e2bc020..aa11d576 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@10up/autoshare-for-twitter", - "version": "2.2.1", + "version": "2.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@10up/autoshare-for-twitter", - "version": "2.2.1", + "version": "2.3.0", "devDependencies": { "@10up/cypress-wp-utils": "^0.2.0", "@wordpress/env": "^9.2.0", diff --git a/package.json b/package.json index 779ec023..909f3e1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@10up/autoshare-for-twitter", - "version": "2.2.1", + "version": "2.3.0", "description": "Automatically shares a post title, URL, and optional description to X/Twitter.", "scripts": { "start": "wp-scripts start", diff --git a/readme.txt b/readme.txt index 4930f1d2..cdf76e96 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: 10up, johnwatkins0, adamsilverstein, scottlee, dinhtungdu, jeffpaul, dharm1025 Tags: twitter, tweet, share, social media, posse Tested up to: 6.7 -Stable tag: 2.2.1 +Stable tag: 2.3.0 License: GPL-2.0-or-later License URI: https://spdx.org/licenses/GPL-2.0-or-later.html From 6cbf6dda79bb84aaa46404a7878b77873401bac8 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 5 Feb 2025 08:31:45 -0700 Subject: [PATCH 2/5] Update changelogs --- CHANGELOG.md | 23 +++++++++++++++++++++++ readme.txt | 17 +++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 916a4711..7c476d9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] - TBD +## [2.3.0] - 2025-02-06 +**Note that this version bumps the WordPress minimum supported version from 5.7 to 6.5.** + +### Added +- Expose the X headers to the `autoshare_for_twitter_after_status_update` hook (props [@s3rgiosan](https://github.com/s3rgiosan), [@iamdharmesh](https://github.com/iamdharmesh) via [#353](https://github.com/10up/autoshare-for-twitter/pull/353)). +- Admin dashboard widget for easy access to API usage statistics (props [@s3rgiosan](https://github.com/s3rgiosan), [@iamdharmesh](https://github.com/iamdharmesh) via [#354](https://github.com/10up/autoshare-for-twitter/pull/354)). + +### Changed +- Display API usage statistics in the "Autopost to X/Twitter" block editor panel (props [@s3rgiosan](https://github.com/s3rgiosan), [@iamdharmesh](https://github.com/iamdharmesh) via [#354](https://github.com/10up/autoshare-for-twitter/pull/354)). +- Bump WordPress "tested up to" version 6.7 (props [@sudip-md](https://github.com/sudip-md), [@dkotter](https://github.com/dkotter), [@thrijith](https://github.com/thrijith), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh) via [#335](https://github.com/10up/autoshare-for-twitter/pull/335), [#347](https://github.com/10up/autoshare-for-twitter/pull/347), [#348](https://github.com/10up/autoshare-for-twitter/pull/348)). +- Bump WordPress minimum from 5.7 to 6.5 (props [@thrijith](https://github.com/thrijith), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh) via [#347](https://github.com/10up/autoshare-for-twitter/pull/347), [#348](https://github.com/10up/autoshare-for-twitter/pull/348)). + +### Security +- Bump `braces` from 3.0.2 to 3.0.3, `pac-resolver` from 7.0.0 to 7.0.1, `socks` from 2.7.1 to 2.8.3, `ws` from 7.5.9 to 7.5.10 and removes `ip` (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#327](https://github.com/10up/autoshare-for-twitter/pull/327)). +- Bump `axios` from 1.6.7 to 1.7.4 (props [@dependabot](https://github.com/apps/dependabot), [@faisal-alvi](https://github.com/faisal-alvi), [@dkotter](https://github.com/dkotter) via [#336](https://github.com/10up/autoshare-for-twitter/pull/336), [#337](https://github.com/10up/autoshare-for-twitter/pull/337)). +- Bump `webpack` from 5.90.0 to 5.94.0 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#339](https://github.com/10up/autoshare-for-twitter/pull/339)). +- Bump `ws` from 7.5.10 to 8.18.0, `serve-static` from 1.15.0 to 1.16.2 and `express` from 4.19.2 to 4.21.0 (props [@dependabot](https://github.com/apps/dependabot), [@Sidsector9](https://github.com/Sidsector9) via [#343](https://github.com/10up/autoshare-for-twitter/pull/343)). + +### Developer +- Add details around X API rate limits to the README (props [@s3rgiosan](https://github.com/s3rgiosan), [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter) via [#352](https://github.com/10up/autoshare-for-twitter/pull/352)). +- Update README with banner image and badge updates (props [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter) via [#340](https://github.com/10up/autoshare-for-twitter/pull/340), [#344](https://github.com/10up/autoshare-for-twitter/pull/344)). + ## [2.2.1] - 2024-07-08 ### Changed - Bump WordPress "tested up to" version 6.5 (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter), [@sudip-md](https://github.com/sudip-md), [@jeffpaul](https://github.com/jeffpaul) via [#319](https://github.com/10up/autoshare-for-twitter/pull/319)). @@ -269,6 +291,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.3.0]: https://github.com/10up/autoshare-for-twitter/compare/2.2.1...2.3.0 [2.2.1]: https://github.com/10up/autoshare-for-twitter/compare/2.2.0...2.2.1 [2.2.0]: https://github.com/10up/autoshare-for-twitter/compare/2.1.1...2.2.0 [2.1.1]: https://github.com/10up/autoshare-for-twitter/compare/2.1.0...2.1.1 diff --git a/readme.txt b/readme.txt index cdf76e96..eb6ad00c 100644 --- a/readme.txt +++ b/readme.txt @@ -109,6 +109,19 @@ To avoid encountering this error in the future and to have higher usage limits, == Changelog == += 2.3.0 - 2025-02-06 = +**Note that this version bumps the WordPress minimum supported version from 5.7 to 6.5.** + +* **Added:** Expose the X headers to the `autoshare_for_twitter_after_status_update` hook (props [@s3rgiosan](https://github.com/s3rgiosan), [@iamdharmesh](https://github.com/iamdharmesh) via [#353](https://github.com/10up/autoshare-for-twitter/pull/353)). +* **Added:** Admin dashboard widget for easy access to API usage statistics (props [@s3rgiosan](https://github.com/s3rgiosan), [@iamdharmesh](https://github.com/iamdharmesh) via [#354](https://github.com/10up/autoshare-for-twitter/pull/354)). +* **Changed:** Display API usage statistics in the "Autopost to X/Twitter" block editor panel (props [@s3rgiosan](https://github.com/s3rgiosan), [@iamdharmesh](https://github.com/iamdharmesh) via [#354](https://github.com/10up/autoshare-for-twitter/pull/354)). +* **Changed:** Bump WordPress "tested up to" version 6.7 (props [@sudip-md](https://github.com/sudip-md), [@dkotter](https://github.com/dkotter), [@thrijith](https://github.com/thrijith), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh) via [#335](https://github.com/10up/autoshare-for-twitter/pull/335), [#347](https://github.com/10up/autoshare-for-twitter/pull/347), [#348](https://github.com/10up/autoshare-for-twitter/pull/348)). +* **Changed:** Bump WordPress minimum from 5.7 to 6.5 (props [@thrijith](https://github.com/thrijith), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh) via [#347](https://github.com/10up/autoshare-for-twitter/pull/347), [#348](https://github.com/10up/autoshare-for-twitter/pull/348)). +* **Security:** Bump `braces` from 3.0.2 to 3.0.3, `pac-resolver` from 7.0.0 to 7.0.1, `socks` from 2.7.1 to 2.8.3, `ws` from 7.5.9 to 7.5.10 and removes `ip` (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#327](https://github.com/10up/autoshare-for-twitter/pull/327)). +* **Security:** Bump `axios` from 1.6.7 to 1.7.4 (props [@dependabot](https://github.com/apps/dependabot), [@faisal-alvi](https://github.com/faisal-alvi), [@dkotter](https://github.com/dkotter) via [#336](https://github.com/10up/autoshare-for-twitter/pull/336), [#337](https://github.com/10up/autoshare-for-twitter/pull/337)). +* **Security:** Bump `webpack` from 5.90.0 to 5.94.0 (props [@dependabot](https://github.com/apps/dependabot), [@iamdharmesh](https://github.com/iamdharmesh) via [#339](https://github.com/10up/autoshare-for-twitter/pull/339)). +* **Security:** Bump `ws` from 7.5.10 to 8.18.0, `serve-static` from 1.15.0 to 1.16.2 and `express` from 4.19.2 to 4.21.0 (props [@dependabot](https://github.com/apps/dependabot), [@Sidsector9](https://github.com/Sidsector9) via [#343](https://github.com/10up/autoshare-for-twitter/pull/343)). + = 2.2.1 - 2024-07-08 = * **Changed:** Bump WordPress "tested up to" version 6.5 (props [@iamdharmesh](https://github.com/iamdharmesh), [@dkotter](https://github.com/dkotter), [@sudip-md](https://github.com/sudip-md), [@jeffpaul](https://github.com/jeffpaul) via [#319](https://github.com/10up/autoshare-for-twitter/pull/319)). * **Fixed:** Ampersands no longer converted to HTML entities when adding query parameters to the post URL with the `autoshare_for_twitter_post_url` filter (props [@justinmaurerdotdev](https://github.com/justinmaurerdotdev), [@iamdharmesh](https://github.com/iamdharmesh) via [#324](https://github.com/10up/autoshare-for-twitter/pull/324)). @@ -137,6 +150,10 @@ To avoid encountering this error in the future and to have higher usage limits, Further changelog entries can be found in the [CHANGELOG.md](https://github.com/10up/autoshare-for-twitter/blob/trunk/CHANGELOG.md) file. == Upgrade Notice == + += 2.3.0 = +This release bumps the WordPress minimum from 5.7 to 6.5. + = 2.2.0 = Autoshare for Twitter rebranded / renamed to Autopost for X. From 7de2c2663a1384d3b47182f02152e18d31756ce0 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 5 Feb 2025 08:33:08 -0700 Subject: [PATCH 3/5] Update CREDITS.md --- CREDITS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CREDITS.md b/CREDITS.md index d1131836..a501631f 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -12,7 +12,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), [Rahul Prajapati (@rahulsprajapati)](https://github.com/rahulsprajapati), [@GeoffLambert77](https://github.com/GeoffLambert77), [Morgan Hartnett](https://www.morganhartnett.com/), [Justin Maurer (@justinmaurerdotdev)](https://github.com/justinmaurerdotdev), [Mikael Buxton (@sunnmagic)](https://github.com/sunnmagic), [Sudip Dadhaniya (@sudip-md)](https://github.com/sudip-md), [Konstantinos Galanakis (@kmgalanakis)](https://github.com/kmgalanakis). +[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), [Morgan Hartnett](https://www.morganhartnett.com/), [Justin Maurer (@justinmaurerdotdev)](https://github.com/justinmaurerdotdev), [Mikael Buxton (@sunnmagic)](https://github.com/sunnmagic), [Sudip Dadhaniya (@sudip-md)](https://github.com/sudip-md), [Konstantinos Galanakis (@kmgalanakis)](https://github.com/kmgalanakis), [Sérgio Santos (@s3rgiosan)](https://github.com/s3rgiosan). ## Libraries From 9aeba79bfe6f0bd690006f3dd48444bc2606cdca Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 5 Feb 2025 08:39:19 -0700 Subject: [PATCH 4/5] Switch PHPUnit test install script to use git instead of svn --- bin/install-wp-tests.sh | 236 +++++++++++++++++++++------------------- 1 file changed, 125 insertions(+), 111 deletions(-) diff --git a/bin/install-wp-tests.sh b/bin/install-wp-tests.sh index bd592b1c..4b2eba08 100644 --- a/bin/install-wp-tests.sh +++ b/bin/install-wp-tests.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash if [ $# -lt 3 ]; then - echo "usage: $0 [db-host] [wp-version] [skip-database-creation]" - exit 1 + echo "usage: $0 [db-host] [wp-version] [skip-database-creation]" + exit 1 fi DB_NAME=$1 @@ -18,136 +18,150 @@ WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/} download() { - if [ `which curl` ]; then - curl -s "$1" > "$2"; - elif [ `which wget` ]; then - wget -nv -O "$2" "$1" - fi + if [ `which curl` ]; then + curl -s "$1" > "$2"; + elif [ `which wget` ]; then + wget -nv -O "$2" "$1" + fi +} + +# Check if git is installed +check_git_installed() { + if ! command -v git > /dev/null; then + echo "Error: git is not installed. Please install git and try again." + exit 1 + fi } if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then - WP_BRANCH=${WP_VERSION%\-*} - WP_TESTS_TAG="branches/$WP_BRANCH" + WP_BRANCH=${WP_VERSION%\-*} + WP_TESTS_TAG="branches/$WP_BRANCH" elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then - WP_TESTS_TAG="branches/$WP_VERSION" + WP_TESTS_TAG="branches/$WP_VERSION" elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then - if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then - # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x - WP_TESTS_TAG="tags/${WP_VERSION%??}" - else - WP_TESTS_TAG="tags/$WP_VERSION" - fi + if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then + # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x + WP_TESTS_TAG="tags/${WP_VERSION%??}" + else + WP_TESTS_TAG="tags/$WP_VERSION" + fi elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then - WP_TESTS_TAG="trunk" + WP_BRANCH="trunk" + WP_TESTS_TAG="trunk" else - # http serves a single offer, whereas https serves multiple. we only want one - download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json - grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json - LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') - if [[ -z "$LATEST_VERSION" ]]; then - echo "Latest WordPress version could not be found" - exit 1 - fi - WP_TESTS_TAG="tags/$LATEST_VERSION" + # http serves a single offer, whereas https serves multiple. we only want one + download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json + grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json + LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') + if [[ -z "$LATEST_VERSION" ]]; then + echo "Latest WordPress version could not be found" + exit 1 + fi + WP_BRANCH=$LATEST_VERSION + WP_TESTS_TAG="tags/$LATEST_VERSION" fi set -ex install_wp() { - if [ -d $WP_CORE_DIR ]; then - return; - fi - - mkdir -p $WP_CORE_DIR - - if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then - mkdir -p $TMPDIR/wordpress-nightly - download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip - unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/ - mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR - else - if [ $WP_VERSION == 'latest' ]; then - local ARCHIVE_NAME='latest' - elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then - # https serves multiple offers, whereas http serves single. - download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json - if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then - # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x - LATEST_VERSION=${WP_VERSION%??} - else - # otherwise, scan the releases and get the most up to date minor version of the major release - local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` - LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) - fi - if [[ -z "$LATEST_VERSION" ]]; then - local ARCHIVE_NAME="wordpress-$WP_VERSION" - else - local ARCHIVE_NAME="wordpress-$LATEST_VERSION" - fi - else - local ARCHIVE_NAME="wordpress-$WP_VERSION" - fi - download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz - tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR - fi - - download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php + if [ -d $WP_CORE_DIR ]; then + return; + fi + + mkdir -p $WP_CORE_DIR + + if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then + mkdir -p $TMPDIR/wordpress-nightly + download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip + unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/ + mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR + else + if [ $WP_VERSION == 'latest' ]; then + local ARCHIVE_NAME='latest' + elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then + # https serves multiple offers, whereas http serves single. + download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json + if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then + # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x + LATEST_VERSION=${WP_VERSION%??} + else + # otherwise, scan the releases and get the most up to date minor version of the major release + local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` + LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) + fi + if [[ -z "$LATEST_VERSION" ]]; then + local ARCHIVE_NAME="wordpress-$WP_VERSION" + else + local ARCHIVE_NAME="wordpress-$LATEST_VERSION" + fi + else + local ARCHIVE_NAME="wordpress-$WP_VERSION" + fi + download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz + tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR + fi + + download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php } install_test_suite() { - # portable in-place argument for both GNU sed and Mac OSX sed - if [[ $(uname -s) == 'Darwin' ]]; then - local ioption='-i.bak' - else - local ioption='-i' - fi - - # set up testing suite if it doesn't yet exist - if [ ! -d $WP_TESTS_DIR ]; then - # set up testing suite - mkdir -p $WP_TESTS_DIR - svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes - svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data - fi - - if [ ! -f wp-tests-config.php ]; then - download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php - # remove all forward slashes in the end - WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") - sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php - fi + # portable in-place argument for both GNU sed and Mac OSX sed + if [[ $(uname -s) == 'Darwin' ]]; then + local ioption='-i.bak' + else + local ioption='-i' + fi + + # set up testing suite if it doesn't yet exist + if [ ! -d $WP_TESTS_DIR ]; then + # set up testing suite + mkdir -p $WP_TESTS_DIR + check_git_installed + git clone --depth 1 --branch $WP_BRANCH https://github.com/wordpress/wordpress-develop $TMPDIR/wordpress-develop + rm -r $TMPDIR/wordpress-develop/.git + mv $TMPDIR/wordpress-develop/tests/phpunit/includes/ $WP_TESTS_DIR/includes + mv $TMPDIR/wordpress-develop/tests/phpunit/data/ $WP_TESTS_DIR/data + rm -r $TMPDIR/wordpress-develop + fi + + if [ ! -f wp-tests-config.php ]; then + download https://raw.githubusercontent.com/wordpress/wordpress-develop/${WP_BRANCH}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php + # remove all forward slashes in the end + WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") + sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php + fi } install_db() { - if [ ${SKIP_DB_CREATE} = "true" ]; then - return 0 - fi - - # parse DB_HOST for port or socket references - local PARTS=(${DB_HOST//\:/ }) - local DB_HOSTNAME=${PARTS[0]}; - local DB_SOCK_OR_PORT=${PARTS[1]}; - local EXTRA="" - - if ! [ -z $DB_HOSTNAME ] ; then - if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then - EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" - elif ! [ -z $DB_SOCK_OR_PORT ] ; then - EXTRA=" --socket=$DB_SOCK_OR_PORT" - elif ! [ -z $DB_HOSTNAME ] ; then - EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" - fi - fi - - # create database - mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA + if [ ${SKIP_DB_CREATE} = "true" ]; then + return 0 + fi + + # parse DB_HOST for port or socket references + local PARTS=(${DB_HOST//\:/ }) + local DB_HOSTNAME=${PARTS[0]}; + local DB_SOCK_OR_PORT=${PARTS[1]}; + local EXTRA="" + + if ! [ -z $DB_HOSTNAME ] ; then + if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then + EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" + elif ! [ -z $DB_SOCK_OR_PORT ] ; then + EXTRA=" --socket=$DB_SOCK_OR_PORT" + elif ! [ -z $DB_HOSTNAME ] ; then + EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" + fi + fi + + # create database + mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA } install_wp From f4f524b5b3a5a6b8bd2bf9931a721badd2a32664 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Wed, 5 Feb 2025 10:46:34 -0700 Subject: [PATCH 5/5] Update release date --- CHANGELOG.md | 2 +- readme.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c476d9a..48796997 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] - TBD -## [2.3.0] - 2025-02-06 +## [2.3.0] - 2025-02-05 **Note that this version bumps the WordPress minimum supported version from 5.7 to 6.5.** ### Added diff --git a/readme.txt b/readme.txt index eb6ad00c..2e47247e 100644 --- a/readme.txt +++ b/readme.txt @@ -109,7 +109,7 @@ To avoid encountering this error in the future and to have higher usage limits, == Changelog == -= 2.3.0 - 2025-02-06 = += 2.3.0 - 2025-02-05 = **Note that this version bumps the WordPress minimum supported version from 5.7 to 6.5.** * **Added:** Expose the X headers to the `autoshare_for_twitter_after_status_update` hook (props [@s3rgiosan](https://github.com/s3rgiosan), [@iamdharmesh](https://github.com/iamdharmesh) via [#353](https://github.com/10up/autoshare-for-twitter/pull/353)).