Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stevegrunwell/wp-cache-remember
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0
Choose a base ref
...
head repository: stevegrunwell/wp-cache-remember
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref

Commits on Feb 17, 2018

  1. Copy the full SHA
    6cb5ef6 View commit details
  2. Copy the full SHA
    2fb2c8d View commit details

Commits on Apr 14, 2018

  1. Copy the full SHA
    40dc228 View commit details
  2. If a callback throws an Exception or returns a WP_Error object, the v…

    …alue should not be cached.
    stevegrunwell committed Apr 14, 2018
    Copy the full SHA
    2ce88d3 View commit details
  3. Copy the full SHA
    58d0b46 View commit details
  4. Merge pull request #1 from stevegrunwell/fix/no-caching-on-error

    Don't cache exceptions nor WP_Error objects
    stevegrunwell authored Apr 14, 2018
    Copy the full SHA
    1492646 View commit details
  5. Copy the full SHA
    34920f1 View commit details
  6. Copy the full SHA
    1d3f623 View commit details
  7. Copy the full SHA
    37cf22c View commit details

Commits on May 24, 2018

  1. Copy the full SHA
    18fcf75 View commit details

Commits on Jun 14, 2018

  1. Copy the full SHA
    0f0e8a5 View commit details
  2. Copy the full SHA
    e206144 View commit details
  3. Instead of accepting any Composer arguments, explicitly run composer …

    …update --prefer-lowest if the COMPOSER_LOWEST env variable is set
    stevegrunwell committed Jun 14, 2018
    Copy the full SHA
    f4ec33b View commit details
  4. Copy the full SHA
    a4e116e View commit details
  5. Merge pull request #4 from stevegrunwell/feature/loosen-composer-requ…

    …irements
    
    Loosen Composer requirements
    stevegrunwell authored Jun 14, 2018
    Copy the full SHA
    d762c23 View commit details
  6. Copy the full SHA
    c5f7574 View commit details
  7. Merge pull request #3 from aaemnnosttv/pr/composer-installers-version

    Loosen version constraint for composer/installers
    stevegrunwell authored Jun 14, 2018
    Copy the full SHA
    b678557 View commit details
  8. Copy the full SHA
    837c48e View commit details
  9. Version bump to 1.1.1

    stevegrunwell committed Jun 14, 2018
    Copy the full SHA
    a7d3826 View commit details
  10. Copy the full SHA
    f37b8e7 View commit details

Commits on Dec 5, 2019

  1. PHPCS/Composer: update PHPCS related dependencies

    * Switches the repo over to use `PHPCompatibilityWP` rather than `PHPCompatibility`.
        As this repo and ruleset is for a WordPress project, using the `PHPCompatibilityWP` ruleset is the better choice to prevent false positives for PHP functions and constants which are back-filled by WP.
    * Switches the dependency over to use the repo in the `PHPCompatibility` organisation rather than the one in `wimg`'s personal account.
    * Use the latest version of PHPCompatibility.
        You were missing out on a lot of new checks, including the checks to make sure your code is compatible with PHP 7.4.
    * Minor ruleset tweaks to allow the tests to also be checked for PHPCompatibility.
    * Use the latest version of the DealerDirect Composer PHPCS plugin.
        Composer treats minors < 1.0 as majors, so you need to explicitly update.
    * Use the latest version of WPCS.
        Includes a few minor function call layout updates in the tests to comply.
    
    Ref:
    * https://github.com/PHPCompatibility/PHPCompatibilityWP
    * PHPCompatibility/PHPCompatibility#688
    * https://github.com/WordPress/WordPress-Coding-Standards/releases/
    jrfnl committed Dec 5, 2019
    Copy the full SHA
    b2387f2 View commit details
  2. Travis: add builds to test against PHP 7.3-7.4

    Includes:
    * Removing `sudo: false`. Sudo hasn't been supported on Travis for quite a while now.
    * Making the _remove Xdebug_ command more stable when using recent PHP versions for which Xdebug may not be available yet.
    
    Note: for now running code coverage on PHP 7.3 rather than PHP 7.4 as Xdebug has not been installed on the PHP 7.4 Travis image yet.
    jrfnl committed Dec 5, 2019
    Copy the full SHA
    bb748cb View commit details
  3. Merge pull request #5 from jrfnl/feature/update-phpcs-dependencies

    PHPCS/Composer: update PHPCS related dependencies
    stevegrunwell authored Dec 5, 2019
    Copy the full SHA
    72150a7 View commit details
  4. Copy the full SHA
    1e0be5d View commit details
  5. Merge pull request #6 from jrfnl/feature/test-against-recent-php-vers…

    …ions
    
    Travis: add builds to test against PHP 7.3-7.4
    stevegrunwell authored Dec 5, 2019
    Copy the full SHA
    d0cde9d View commit details

Commits on May 25, 2022

  1. Copy the full SHA
    36c698c View commit details
  2. Merge pull request #7 from macbookandrew/develop

    update dependency version constraints
    stevegrunwell authored May 25, 2022
    Copy the full SHA
    cde9a1b View commit details

Commits on May 27, 2022

  1. release 1.1.2

    macbookandrew committed May 27, 2022
    Copy the full SHA
    bcce326 View commit details
  2. update changelog

    macbookandrew committed May 27, 2022
    Copy the full SHA
    9d4904f View commit details

Commits on Jul 8, 2022

  1. Merge pull request #8 from macbookandrew/develop

    release 1.1.2
    stevegrunwell authored Jul 8, 2022
    Copy the full SHA
    7ad1da1 View commit details
Showing with 434 additions and 111 deletions.
  1. +15 −5 .travis.yml
  2. +39 −0 CHANGELOG.md
  3. +3 −0 README.md
  4. +4 −4 composer.json
  5. +261 −93 composer.lock
  6. +2 −1 phpcs.xml.dist
  7. +1 −1 tests/bootstrap.php
  8. +33 −1 tests/test-object-cache.php
  9. +33 −1 tests/test-site-transients.php
  10. +33 −1 tests/test-transients.php
  11. +10 −4 wp-cache-remember.php
20 changes: 15 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
sudo: false
language: php
dist: trusty

@@ -12,10 +11,16 @@ cache:
matrix:
fast_finish: true
include:
- php: 7.2
- php: 7.4
env: WP_VERSION=trunk
- php: 7.2
- php: 7.4
env: WP_VERSION=trunk COMPOSER_LOWEST=1
- php: 7.3
env: WP_VERSION=latest RUN_PHPCS=1 RUN_CODE_COVERAGE=1
- php: 7.3
env: WP_VERSION=latest
- php: 7.2
env: WP_VERSION=latest
- php: 7.1
env: WP_VERSION=latest
- php: 7.0
@@ -29,14 +34,19 @@ before_script:
chmod +x coveralls.phar
mkdir -p build/logs
else
phpenv config-rm xdebug.ini
phpenv config-rm xdebug.ini || echo 'No xdebug config.'
fi
- |
if [[ ! -z "$WP_VERSION" ]]; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
composer global require "phpunit/phpunit=4.8.*|5.7.*"
fi
- composer install --prefer-dist --no-suggest --no-autoloader
- |
if [[ ${COMPOSER_LOWEST} ]]; then
composer update $COMPOSER_ARGS
else
composer install --prefer-dist --no-suggest --no-autoloader
fi
script:
- |
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.1.2] - 2022-05-26

* Update PHP compatiblity checks ([#6], props @jrfnl)
* Update test builds ([#6], props @jrfnl)
* Allow recent versions of [composer/installers](https://github.com/composer/installers) and [dealerdirect/phpcodesniffer-composer-installer](https://github.com/PHPCSStandards/composer-installer) packages ([#7], props @macbookandrew)

## [1.1.1] - 2018-06-14

* Lower the minimum version of [composer/installers](https://github.com/composer/installers) to `^1.0` ([#2], props @aaemnnosttv).

## [1.1.0] - 2018-04-14

* Bypass the caching operation if a callback either throws an Exception or returns a `WP_Error` object ([#1]).
* Add a formal changelog to the project, following the [Keep a Changelog standard](http://keepachangelog.com/en/1.0.0/).

## [1.0.0] - 2018-02-16

Initial public release of the package, including the following functions:

* `wp_cache_remember()`
* `wp_cache_forget()`
* `remember_transient()`
* `forget_transient()`
* `remember_site_transient()`
* `forget_site_transient()`

[Unreleased]: https://github.com/stevegrunwell/wp-cache-remember/compare/master...develop
[1.1.1]: https://github.com/stevegrunwell/wp-cache-remember/releases/tag/v1.1.1
[1.1.0]: https://github.com/stevegrunwell/wp-cache-remember/releases/tag/v1.1.0
[1.0.0]: https://github.com/stevegrunwell/wp-cache-remember/releases/tag/v1.0.0
[#1]: https://github.com/stevegrunwell/wp-cache-remember/pull/1
[#2]: https://github.com/stevegrunwell/wp-cache-remember/issues/2
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.org/stevegrunwell/wp-cache-remember.svg?branch=develop)](https://travis-ci.org/stevegrunwell/wp-cache-remember)
[![Coverage Status](https://coveralls.io/repos/github/stevegrunwell/wp-cache-remember/badge.svg?branch=develop)](https://coveralls.io/github/stevegrunwell/wp-cache-remember?branch=develop)
[![GitHub release](https://img.shields.io/github/release/stevegrunwell/wp-cache-remember.svg)](https://github.com/stevegrunwell/wp-cache-remember/releases)

WP Cache Remember is a simple WordPress include to introduce convenient new caching functions.

@@ -86,6 +87,8 @@ WP Cache Remember provides the following functions for WordPress:
* [`remember_site_transient()`](#remember_site_transient)
* [`forget_site_transient()`](#forget_site_transient)

Each function checks the response of the callback for a `WP_Error` object, ensuring you're not caching temporary errors for long periods of time. PHP Exceptions will also not be cached.

### wp_cache_remember()

Retrieve a value from the object cache. If it doesn't exist, run the `$callback` to generate and cache the value.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -23,12 +23,12 @@
"minimum-stability": "stable",
"require": {
"php": ">=5.2",
"composer/installers": "^1.5"
"composer/installers": "^1.0||^2.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
"wimg/php-compatibility": "^8.1",
"wp-coding-standards/wpcs": "^0.14"
"dealerdirect/phpcodesniffer-composer-installer": "^0.5||^0.6||^0.7",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"wp-coding-standards/wpcs": "^2.2"
},
"autoload": {
"files": ["wp-cache-remember.php"]
Loading