tormjens / Smart-Plugin-Upgrader

A plugin/theme upgrader class for WordPress.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Smart-Plugin-Upgrader

To use to programmatically install or upgrade plugins.

Usage

This will only work for plugins with a certain folder/file naming prefix. It has to look like this:

my-plugin-name/my-plugin-name.php

Will probably work for all themes, as they require a style.css file.

Initialize the plugin upgrade instance. The class takes two parameters; download url and slug. Both are required.

For plugins:

$upgrader = new Smart_Upgrader( 'http://example.com/my-plugin.zip', 'my-plugin' ); 

For themes:

$upgrader = new Smart_Upgrader_Theme( 'http://example.com/my-theme.zip', 'my-theme' ); 

To install the plugin/theme:

$upgrader->install(); // returns a boolean

To upgrade the plugin/theme:

$upgrader->upgrade(); // returns a boolean

To activate the plugin/theme:

$upgrader->activate(); // returns a boolean

About

A plugin/theme upgrader class for WordPress.


Languages

Language:PHP 100.0%