SLP_Admin_Activation
extends SLPlus_BaseClass_Object
in package
Handles activation processes for the SLP plugin, including role management, plugin deactivation checks, add-on updates, file copying, database table management, and extended data table setup.
Table of Contents
Properties
- $addon : object
- $myslp : MySLP
- $slplus : SLPlus
- $uses_myslp : bool
- $uses_slplus : bool
- $slug : mixed
Methods
- __construct() : mixed
- __get() : SLPlus_BaseClass_Object
- __isset() : bool
- being_deactivated() : bool
- Is this add-on being deactivated?
- copy_newer_files() : void
- Copy non-empty, readable files to destination if they are newer than the destination file.
- get_instance() : static
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- set_properties() : mixed
- Set our properties.
- update() : void
- Update the plugin.
- initialize() : mixed
- Do these things when this object is invoked. Override in your class.
- add_slplus_roles_and_caps() : void
- Add roles and cap.
- check_for_addon_updates() : void
- Check if there are any add on updates. Inactive plugins too.
- copyr() : void
- Recursively copy the source directory (or file) into the destination directory.
- dbupdater() : void
- Update the data structures on new db versions.
- install_ExtendedDataTables() : void
- Set up the extended data tables.
- install_main_table() : void
- Installs the main table for storing location data in the database.
- multisite_upgrade_options() : void
- Multisite upgrade.
- table_already_exists() : bool
Properties
$addon
public
object
$addon
$myslp
public
MySLP
$myslp
$slplus
public
SLPlus
$slplus
$uses_myslp
public
bool
$uses_myslp
Set to true to add a $myslp property pointing to global $myslp
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$slug
protected
mixed
$slug
Methods
__construct()
public
__construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
__get()
public
__get(string $property) : SLPlus_BaseClass_Object
Parameters
- $property : string
Return values
SLPlus_BaseClass_Object__isset()
public
__isset(string $property) : bool
Parameters
- $property : string
Return values
boolbeing_deactivated()
Is this add-on being deactivated?
public
being_deactivated() : bool
Return values
boolcopy_newer_files()
Copy non-empty, readable files to destination if they are newer than the destination file.
public
copy_newer_files(mixed $source_file, mixed $destination_file) : void
OR if the destination file does not exist.
Parameters
- $source_file : mixed
- $destination_file : mixed
get_instance()
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
public
static get_instance([bool $no_global = false ][, mixed $params = array() ]) : static
Parameters
- $no_global : bool = false
-
set to true to skip assigning object to SLP global as a property.
- $params : mixed = array()
-
object init params
Return values
staticset_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
update()
Update the plugin.
public
update() : void
initialize()
Do these things when this object is invoked. Override in your class.
protected
initialize() : mixed
add_slplus_roles_and_caps()
Add roles and cap.
private
add_slplus_roles_and_caps() : void
check_for_addon_updates()
Check if there are any add on updates. Inactive plugins too.
private
check_for_addon_updates() : void
copyr()
Recursively copy the source directory (or file) into the destination directory.
private
copyr(string $source, string $dest) : void
Parameters
- $source : string
-
can be a file or a directory
- $dest : string
-
can be a file or a directory
dbupdater()
Update the data structures on new db versions.
private
dbupdater(string $sql, string $table_name) : void
Parameters
- $sql : string
- $table_name : string
install_ExtendedDataTables()
Set up the extended data tables.
private
install_ExtendedDataTables() : void
Tags
install_main_table()
Installs the main table for storing location data in the database.
private
install_main_table() : void
This method creates a table named 'store_locator' with columns for storing various details about locations such as store name, address, latitude, longitude, and additional metadata. It also defines relevant keys, primary key, and ensures proper database collation.
Return values
void —Returns true if the table was created successfully, or an error message as a string if the creation fails.
multisite_upgrade_options()
Multisite upgrade.
private
multisite_upgrade_options() : void
table_already_exists()
private
table_already_exists(mixed $table_name) : bool
Parameters
- $table_name : mixed