2017 © Pedro Peláez
 

library wp-update-php

Library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting

image

wpupdatephp/wp-update-php

Library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting

  • Friday, August 25, 2017
  • by wpupdatephp
  • Repository
  • 3 Watchers
  • 80 Stars
  • 6,134 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 12 Forks
  • 3 Open issues
  • 7 Versions
  • 15 % Grown

The README.md

WPupdatePHP library

Library to be bundled with WordPress plugins to enforce users to upgrade their PHP versions or switch to a decent host., (*1)

Installation

We recommend installing the library using Composer, as follows., (*2)

composer require wpupdatephp/wp-update-php

Another option is to download the class file manually., (*3)

Usage

Usage of this library depends on how you start your plugin. The core does_it_meet_required_php_version method does all the checking for you and adds an admin notice in case the version requirement is not met., (*4)

For example, when you start your plugin by instantiating a new object, you should wrap a conditional check around it., (*5)

Example:, (*6)

$updatePhp = new WPUpdatePhp( '5.6.0' );

if ( $updatePhp->does_it_meet_required_php_version() ) {
    // Instantiate new object here
}

// The version check has failed, an admin notice has been thrown

Including the library file

Adding the library via Composer has preference. The Composer autoloader will automatically take care of preventing including two classes with the same name., (*7)

In case you want to include the file manually, please wrap the include or require call in a class_exists conditional, like so:, (*8)

if ( ! class_exists( 'WPUpdatePhp' ) ) {
    // do the file include or require here
}

Setting the name of the plugin

The notice that will be thrown can also contain the name of the plugin. Use the set_plugin_name( $name ) method on the WPUpdatePhp object to provide the name. This call needs to be made before the does_it_meet_required_php_version() method is called to check versions., (*9)

License

(GPLv2 license or later), (*10)

WP Update PHP Library Copyright (C) 2015 Coen Jacobs, (*11)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version., (*12)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details., (*13)

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/., (*14)

The Versions

25/08 2017

dev-big-2.0-release

dev-big-2.0-release

Library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

25/08 2017

dev-dynamic-checks

dev-dynamic-checks

Library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

14/07 2017

dev-master

9999999-dev

Library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting

  Sources   Download

GPL-2.0+

The Development Requires

06/04 2017

dev-notices-refactor

dev-notices-refactor

Library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting

  Sources   Download

GPL-2.0+

The Development Requires

08/03 2017

1.1.1

1.1.1.0

Library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting

  Sources   Download

GPL-2.0+

The Development Requires

04/07 2016

1.1.0

1.1.0.0

Library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting

  Sources   Download

GPL-2.0+

The Development Requires

13/02 2015

1.0.0

1.0.0.0

Library to be bundled with WordPress plugins to enforce users to upgrade to PHP 5.4 hosting

  Sources   Download

The Development Requires