diff --git a/.github/workflows/mt-code-review.yml b/.github/workflows/mt-code-review.yml deleted file mode 100644 index dd672a3e..00000000 --- a/.github/workflows/mt-code-review.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: MT Code Review -on: - pull_request: - paths-ignore: - - 'lang/**' - - '**.txt' - - '**.md' - - '.editorconfig' - - 'CODEOWNERS' -jobs: - phpcs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: moderntribe/action-tribe-phpcs@master - with: - github-bot-token: ${{ secrets.GH_BOT_TOKEN }} diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml new file mode 100644 index 00000000..d9a3e987 --- /dev/null +++ b/.github/workflows/prepare-release-branch.yml @@ -0,0 +1,84 @@ +name: Prepare Release Branch +env: + PR_PREFIX: 'Pods Gravity Forms ' + PR_LABELS: 'Type: Release' + MILESTONE_PREFIX: 'Pods Gravity Forms ' + BRANCH_PREFIX: 'release/' + WPORG_PLUGIN_FILE: 'pods-gravity-forms.php' + WPORG_PLUGIN_VERSION_CONSTANT_NAME: 'PODS_GF_VERSION' +on: + workflow_dispatch: + inputs: + new_plugin_version: + description: 'New plugin version (without the "-a-1"), defaults to the next incremental version from package.json' + required: false + version_increment: + description: 'OR Version increment scheme (if incrementing the package.json version; patch=x.x.x, minor=x.x, major=x.0)' + required: true + type: choice + default: 'patch' + options: + - 'major' + - 'minor' + - 'patch' +jobs: + prepare_release_branch: + runs-on: ubuntu-latest + steps: + - name: Checkout the code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_BOT_PUSH }} + - name: Maybe use the version number from inputs + if: ${{ github.event.inputs.new_plugin_version != null && github.event.inputs.new_plugin_version != '' }} + shell: bash + run: | + echo "PLUGIN_VERSION=${{ github.event.inputs.new_plugin_version }}" >> $GITHUB_ENV + - name: Maybe lookup the version number from package.json + id: version-lookup + if: ${{ github.event.inputs.new_plugin_version == null || github.event.inputs.new_plugin_version == '' }} + shell: bash + run: | + echo "CURRENT_VERSION=$(jq -r .version package.json)" >> $GITHUB_OUTPUT + - name: Maybe get the next version information + if: ${{ steps.version-lookup.outputs.CURRENT_VERSION != null && steps.version-lookup.outputs.CURRENT_VERSION != '' }} + uses: reecetech/version-increment@2023.10.2 + id: version-increment + with: + scheme: semver + increment: ${{ github.event.inputs.version_increment }} + - name: Maybe store the next version + if: ${{ steps.version-increment.outputs.version != null && steps.version-increment.outputs.version != '' }} + shell: bash + run: | + echo "PLUGIN_VERSION=${{ steps.version-increment.outputs.version }}" >> $GITHUB_ENV + - name: What are we doing? + run: | + echo PLUGIN_VERSION: ${{ env.PLUGIN_VERSION }} + - name: Run wporg-replace + uses: sc0ttkclark/wporg-replace@v1.0.7 + with: + plugin_version: '${{ env.PLUGIN_VERSION }}-a-1' + plugin_version_constant_name: ${{ env.WPORG_PLUGIN_VERSION_CONSTANT_NAME }} + plugin_file: ${{ env.WPORG_PLUGIN_FILE }} + plugin_path: ${{ github.workspace }} + - name: Create Milestone + id: create-milestone + uses: WyriHaximus/github-action-create-milestone@v1.2.0 + continue-on-error: true + with: + title: '${{ env.MILESTONE_PREFIX }}${{ env.PLUGIN_VERSION }}' + env: + GITHUB_TOKEN: ${{ secrets.GH_BOT_PUSH }} + - name: Create Pull Request + id: create-pull-request + uses: peter-evans/create-pull-request@v5.0.2 + with: + token: ${{ secrets.GH_BOT_PUSH }} + branch: '${{ env.BRANCH_PREFIX }}${{ env.PLUGIN_VERSION }}' + commit-message: 'Set version to ${{ env.PLUGIN_VERSION }}-a-1' + title: '${{ env.PR_PREFIX }}${{ env.PLUGIN_VERSION }}' + labels: ${{ env.PR_LABELS }} + assignees: ${{ github.actor }} + milestone: ${{ steps.create-milestone.outputs.number }} + draft: true diff --git a/.github/workflows/wordpress-plugin-deploy.yml b/.github/workflows/wordpress-plugin-deploy.yml index d4c496ed..bcd53b00 100644 --- a/.github/workflows/wordpress-plugin-deploy.yml +++ b/.github/workflows/wordpress-plugin-deploy.yml @@ -1,16 +1,20 @@ name: Deploy to WordPress.org on: - push: - tags: - - "*" + release: + types: [published] jobs: tag: name: New tag runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - name: Check the version number from package.json + shell: bash + run: echo "PLUGIN_VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV + - name: Checkout the code + uses: actions/checkout@v4 - name: WordPress Plugin Deploy uses: 10up/action-wordpress-plugin-deploy@master env: SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + VERSION: ${{ env.PLUGIN_VERSION }} diff --git a/.github/workflows/wordpress-version-checker.yml b/.github/workflows/wordpress-version-checker.yml new file mode 100644 index 00000000..169065bb --- /dev/null +++ b/.github/workflows/wordpress-version-checker.yml @@ -0,0 +1,20 @@ +name: "WordPress version checker" +on: + push: + branches: + - main + - release/* + schedule: + - cron: '0 0 * * *' + +permissions: + issues: write + +jobs: + wordpress-version-checker: + runs-on: ubuntu-latest + steps: + - name: WordPress version checker + uses: skaut/wordpress-version-checker@v1.0.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/wporg-update-versions.yml b/.github/workflows/wporg-update-versions.yml new file mode 100644 index 00000000..dbbb3c37 --- /dev/null +++ b/.github/workflows/wporg-update-versions.yml @@ -0,0 +1,61 @@ +name: WordPress.org Update Versions +env: + WPORG_PLUGIN_FILE: 'pods-alternative-cache.php' + WPORG_PLUGIN_VERSION_CONSTANT_NAME: 'PODS_ALT_CACHE_VERSION' +on: + workflow_dispatch: + inputs: + plugin_version: + description: 'Plugin version' + required: false + tested_wp_version: + description: 'Tested up to WP version' + required: false + minimum_wp_version: + description: 'Minimum WP version' + required: false + minimum_php_version: + description: 'Minimum PHP version' + required: false + pull_request: + paths: + - 'package.json' +jobs: + wporg_replace: + runs-on: ubuntu-latest + steps: + - name: What are we doing? + run: | + echo plugin_version: ${{ github.event.inputs.plugin_version }} + echo tested_wp_version: ${{ github.event.inputs.tested_wp_version }} + echo minimum_wp_version: ${{ github.event.inputs.minimum_wp_version }} + echo minimum_php_version: ${{ github.event.inputs.minimum_php_version }} + - name: Checkout the code + uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_BOT_PUSH }} + - name: Check the version number from package.json + shell: bash + run: echo "PLUGIN_VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV + - name: Run wporg-replace + uses: sc0ttkclark/wporg-replace@v1.0.7 + with: + plugin_version: ${{ (github.event.inputs.plugin_version != '') && github.event.inputs.plugin_version || env.PLUGIN_VERSION }} + plugin_version_constant_name: ${{ env.WPORG_PLUGIN_VERSION_CONSTANT_NAME }} + tested_wp_version: ${{ github.event.inputs.tested_wp_version }} + minimum_wp_version: ${{ github.event.inputs.minimum_wp_version }} + minimum_php_version: ${{ github.event.inputs.minimum_php_version }} + plugin_file: ${{ env.WPORG_PLUGIN_FILE }} + plugin_path: ${{ github.workspace }} + - name: Commit changes + id: auto-commit-action + uses: stefanzweifel/git-auto-commit-action@v4 + with: + file_pattern: ${{ env.WPORG_PLUGIN_FILE }} readme.txt package.json + commit_message: Update wporg version(s) + - name: "Run if changes have been detected" + if: steps.auto-commit-action.outputs.changes_detected == 'true' + run: echo "Changes!" + - name: "Run if no changes have been detected" + if: steps.auto-commit-action.outputs.changes_detected == 'false' + run: echo "No Changes!" diff --git a/classes/Pods/Alternative/Cache/Storage.php b/classes/Pods/Alternative/Cache/Storage.php index 363a209f..3ba82f80 100644 --- a/classes/Pods/Alternative/Cache/Storage.php +++ b/classes/Pods/Alternative/Cache/Storage.php @@ -47,7 +47,7 @@ public function deactivate( $network_wide = false ) { * @return mixed|null */ public function get_value( $cache_key, $group ) { - return $this->fallback_set( null, $cache_key, $group ); + return $this->fallback_set( null, $cache_key, null, $group ); } /** @@ -95,8 +95,8 @@ public function fallback_set( $return, $cache_key, $cache_value, $group, $expire * * @return bool */ - public function set_value( $cache_key, $value, $expires, $group ) { - return $this->fallback_set( false, $cache_key, $value, $group, $expires ); + public function set_value( $cache_key, $cache_value, $expires, $group ) { + return $this->fallback_set( false, $cache_key, $cache_value, $group, $expires ); } /** diff --git a/package.json b/package.json index 940779a7..e1210ab6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pods-alternative-cache", - "version": "2.1.7", + "version": "2.1.8", "description": "Alternative caching engine for Pods for large sites on hosts with hard limits on how much you can store in the object cache.", "author": "Pods Foundation, Inc", "homepage": "https://pods.io", diff --git a/pods-alternative-cache.php b/pods-alternative-cache.php index f6adcaa2..fa88cb60 100644 --- a/pods-alternative-cache.php +++ b/pods-alternative-cache.php @@ -3,12 +3,12 @@ Plugin Name: Pods Alternative Cache Plugin URI: https://pods.io/2014/04/16/introducing-pods-alternative-cache/ Description: Alternative caching engine for Pods for large sites on hosts with hard limits on how much you can store in the object cache -Version: 2.1.7 +Version: 2.1.8 Author: Pods Framework Team Author URI: https://pods.io/ */ -define( 'PODS_ALT_CACHE_VERSION', '2.1.7' ); +define( 'PODS_ALT_CACHE_VERSION', '2.1.8' ); define( 'PODS_ALT_CACHE_DIR', plugin_dir_path( __FILE__ ) ); /** diff --git a/readme.txt b/readme.txt index 9ada332c..5b560da4 100644 --- a/readme.txt +++ b/readme.txt @@ -3,9 +3,9 @@ Contributors: sc0ttkclark Donate link: https://friends.pods.io/ Tags: pods, cache, wpengine Requires at least: 3.8 -Tested up to: 6.2 +Tested up to: 6.5 Requires PHP: 5.6 -Stable tag: 2.1.7 +Stable tag: 2.1.8 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -76,6 +76,12 @@ Disable object cache fallback, when File writes fail: == Changelog == += 2.1.8 - March 24th, 2024 = + +* Fixed: Resolved a PHP notices with the storage set method. (@sc0ttkclark) +* Fixed: Resolved an issue which was causing the cache group not be utilized properly when setting the fallback value. (@sc0ttkclark) +* Fixed: Tested on WP 6.5 and PHP 7.2+. (@sc0ttkclark) + = 2.1.7 - March 13th, 2023 = * Fixed: Caught a bug hanging around for a few years that only happened in edge cases -- checking if file/directory still exists before trying to delete/remove it. (@sc0ttkclark)