承接 wpupdatephp/wp-update-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wpupdatephp/wp-update-php

最新稳定版本:1.1.1

Composer 安装命令:

composer require wpupdatephp/wp-update-php

包简介

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

README 文档

README

Library to be bundled with WordPress plugins to enforce users to upgrade their PHP versions or switch to a decent host.

Installation

We recommend installing the library using Composer, as follows.

composer require wpupdatephp/wp-update-php

Another option is to download the class file manually.

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.

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

Example:

$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.

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

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.

License

(GPLv2 license or later)

WP Update PHP Library Copyright (C) 2015 Coen Jacobs

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.

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.

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

统计信息

  • 总下载量: 27.07k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 78
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 78
  • Watchers: 2
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2015-02-13