PHP Class HM\BackUpWordPress\Plugin

Show file Open project: humanmade/backupwordpress

Public Methods

Method Description
constants ( ) Define all the constants.
display_feature_message ( )
get_instance ( ) : Plugin Insures we always return the same object.
hooks ( ) Hook into WordPress page lifecycle and execute BackUpWordPress functions.
init ( ) Runs on every admin page load
load_first ( ) Ensure BackUpWordPress is loaded before add-ons, changes the order of the serialized values in the DB field.
load_intercom_script ( ) Load Intercom and send across user information and server info. Only loaded if the user has opted in.
maybe_self_deactivate ( ) : boolean Check plugin requirements.
plugins_loaded ( ) Initialize the plugin.
schedule_hook_run ( $schedule_id ) Function to run when the schedule cron fires.
scripts ( $hook ) Load the Javascript in the admin.
styles ( $hook ) Enqueue the plugin styles.
text_domain ( ) Loads the plugin text domain for translation.
upgrade ( ) Determine if we need to run an upgrade routine.

Protected Methods

Method Description
generate_key ( ) : string Generate a unique key.
includes ( ) Load all BackUpWordPress functions.

Private Methods

Method Description
__construct ( ) Instantiates a new Plugin object.

Method Details

constants() public method

Define all the constants.
public constants ( )

display_feature_message() public method

generate_key() protected method

Generate a unique key.
protected generate_key ( ) : string
return string

get_instance() public static method

Insures we always return the same object.
public static get_instance ( ) : Plugin
return Plugin

hooks() public method

Hook into WordPress page lifecycle and execute BackUpWordPress functions.
public hooks ( )

includes() protected method

Load all BackUpWordPress functions.
protected includes ( )

init() public method

Runs on every admin page load
public init ( )

load_first() public method

Ensure BackUpWordPress is loaded before add-ons, changes the order of the serialized values in the DB field.
public load_first ( )

load_intercom_script() public method

Load Intercom and send across user information and server info. Only loaded if the user has opted in.

maybe_self_deactivate() public method

Check plugin requirements.
public maybe_self_deactivate ( ) : boolean
return boolean True is fails requirements. False otherwise.

plugins_loaded() public method

Initialize the plugin.
public plugins_loaded ( )

schedule_hook_run() public method

Function to run when the schedule cron fires.
public schedule_hook_run ( $schedule_id )
$schedule_id

scripts() public method

Load the Javascript in the admin.
public scripts ( $hook )
$hook The name of the admin page hook.

styles() public method

Enqueue the plugin styles.
public styles ( $hook )
$hook

text_domain() public method

This setup allows a user to just drop his custom translation files into the WordPress language directory Files will need to be in a subdirectory with the name of the textdomain 'backupwordpress'
public text_domain ( )

upgrade() public method

Determine if we need to run an upgrade routine.
public upgrade ( )