$prefix : string
Manages interaction between WordPress API and Buoy user settings.
$options : \WP_Buoy_User_Settings
The user's plugin settings.
register() : void
Registers user-related WordPress hooks.
This is the method called when WordPress loads the plugin file. It is responsible for "registering" the plugin's main functions with the WordPress Plugin API.
install_plugin_dependency(string $slug, string $version = '')
Automates installation of other plugins that we need.
We only use this for the WP REST API at the moment. It's the 1 and only dependency we have on other plugins. When that plugin gets added to WP Core, we can remove this code.
As a result, note that this code is SPECIFIC to the
plugin. It will not work as-is for other plugins.
renderWebAppHTML() : void
Prints meta tag indicators for native-like functionality.
The "activate alert" screen is intended to be the web app "install" screen for Buoy. We insert special mobile browser specific tags in order to create a native-like "installer" for the user. We only want to do this on this specific screen.
__construct(integer $user_id) : \WP_Buoy_User
if the provided
$user_id does not reference a valid
getByPhoneNumber(string $phone_number) : false|\WP_Buoy_User
Gets a Buoy User object from a given phone number.
has_responder() : boolean
Checks whether or not the user has at least one responder.
A "responder" in this context is a "confirmed" team member. At least one responder is needed before the "Activate Alert" screen will be of any use, obviously. This looks for confirmed members on any of the user's teams and returns as soon as it can find one.
warnIfNoResponder(\WP_Buoy_Team $team) : boolean
Sends a warning to a user if they no longer have responders.
The team that has been emptied.