diff --git a/composer.json b/composer.json index 0ec29b1..bbd2081 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,9 @@ "php" : ">=5.3", "pimple/pimple" : "~2.0" }, + "suggest": { + "rarst/update-blocker": "Prevents invalid updates from official repositories" + }, "autoload" : { "classmap": ["php/"] } diff --git a/php/class-plugin.php b/php/class-plugin.php index 4d492fb..173d78f 100644 --- a/php/class-plugin.php +++ b/php/class-plugin.php @@ -15,6 +15,7 @@ class Plugin extends \Pimple { public function run() { add_action( 'init', array( $this, 'init' ) ); + add_filter( 'update_blocker_blocked', array( $this, 'update_blocker_blocked' ) ); } /** @@ -34,6 +35,20 @@ public function init() { } } + /** + * @see https://github.com/Rarst/update-blocker + * + * @param array $blocked + * + * @return array + */ + public function update_blocker_blocked( $blocked ) { + + $blocked['plugins'][] = plugin_basename( dirname( __DIR__ ) . '/fragment-cache.php' ); + + return $blocked; + } + /** * Add (or override) cache handler and enable it. * diff --git a/readme.md b/readme.md index 1aaf846..6a5fa94 100644 --- a/readme.md +++ b/readme.md @@ -46,6 +46,10 @@ add_filter( 'fc_skip_cache', function ( $skip, $type, $name, $args, $salt ) { # Changelog +## 1.2 + + - added [Update Blocker](https://github.com/Rarst/update-blocker) support + ## 1.1 - anonymized fragment generation in front end for consistency