2017 © Pedro PelĂĄez
 

wordpress-plugin update-blocker

Lightweight generic blocker of updates from official WordPress repositories

image

rarst/update-blocker

Lightweight generic blocker of updates from official WordPress repositories

  • Saturday, September 3, 2016
  • by Rarst
  • Repository
  • 9 Watchers
  • 42 Stars
  • 2,979 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 7 % Grown

The README.md

Update Blocker — for WP repositories

Update Blocker is a lightweight generic blocker of plugin, theme, and core updates from official WordPress repositories., (*1)

It was created as shared reusable plugin for the sake of no longer reinventing that particular wheel., (*2)

Goals

  • single main file
  • mu-plugins–friendly
  • no hard dependencies

Not goals

  • interface
  • elaborate API
  • as–library use
  • unreasonable compat

Installation

Plugin

  1. Download ZIP.
  2. Unpack files from inside into wp-content/plugins/update-blocker.

MU-plugin

  1. Download update-blocker.php.
  2. Place into wp-content/mu-plugins.
  3. Edit settings for blocks in the file.

Composer

Create project in the wp-content/plugins:, (*3)

composer create-project rarst/update-blocker:~1.0

Or require in composer.json of site project:, (*4)

{
    "require": {
        "rarst/update-blocker": "~1.0"
    }
}

Requiring on plugin/theme level is not implemented, use suggest:, (*5)

{
    "suggest": {
        "rarst/update-blocker": "Prevents invalid updates from official repositories"
    }
}

Configuration

Plugin's settings have following structure:, (*6)

array(
    'all'     => false,
    'files'   => array( '.git', '.svn', '.hg' ),
    'plugins' => array( 'update-blocker/update-blocker.php' ),
    'themes'  => array(),
    'core'    => false,
)
  • all — boolean, disables updates completely
  • files — array of plugin/theme root–relative files to detect for block
  • plugins — array of plugin base names (folder-name/plugin-name.php) to block
  • themes — array of theme slugs (theme-name) to block
  • core — boolean, disables core updates

Settings pass through update_blocker_blocked filter., (*7)

Processed data passes through update_blocker_plugins and update_blocker_themes filters during update checks., (*8)

Plugin opt–in

add_filter( 'update_blocker_blocked', function( $blocked ) {
    $blocked['plugins'][] = plugin_basename( __FILE__ ); // or just folder-name/plugin-name.php string
    return $blocked;
} );

Theme opt–in

add_filter( 'update_blocker_blocked', function( $blocked ) {
    $blocked['themes'][] = 'theme-name';
    return $blocked;
} );

Core opt–in

add_filter( 'update_blocker_blocked', function ( $blocked ) {
    $blocked['core'] = true;
    return $blocked;
} );

License

  • MIT

The Versions

03/09 2016

dev-master

9999999-dev https://github.com/Rarst/update-blocker

Lightweight generic blocker of updates from official WordPress repositories

  Sources   Download

MIT

The Requires

 

wordpress

03/09 2016

1.1

1.1.0.0 https://github.com/Rarst/update-blocker

Lightweight generic blocker of updates from official WordPress repositories

  Sources   Download

MIT

The Requires

 

wordpress

26/06 2014

1.0

1.0.0.0 https://github.com/Rarst/update-blocker

Lightweight generic blocker of updates from official WordPress repositories

  Sources   Download

MIT

The Requires

 

wordpress