SLPĀ® phpDocs

MySLP_User
in package

Class MySLP_User a modified WP_User

A MySLP User.

Tags
@property-read

string last_name

Table of Contents

Constants

DEFAULT_MAX_LOCATIONS  : mixed = 125
DEFAULT_MAX_VIEWS  : mixed = 1000
DEFAULT_PERIOD  : mixed = 'month'
DEFAULT_PLAN_NAME  : mixed = 'Advanced'
STATUS_ACTIVE  : mixed = 'active'
STATUS_EXPIRED  : mixed = 'expired'
VIEW_OVERAGE_BLOCKSIZE  : mixed = 1000
VIEW_OVERAGE_PRICE  : mixed = 500

Properties

$blog_id  : mixed
$primary_user  : mixed
$account_status  : mixed
$api_key  : mixed
$blog_details  : mixed
$blogname  : mixed
$coupon  : mixed
$coupon_code  : mixed
$coupon_details  : mixed
$customer_details  : mixed
$discount  : mixed
$email  : mixed
$expiration_date  : mixed
$first_name  : mixed
$home  : mixed
$ID  : mixed
$last_name  : mixed
$last_payment  : mixed
$location_count  : mixed
$location_limit  : int
$mapview_count  : int
$mapview_limit  : int
$meta_amount  : mixed
$myslp_subscription_plan  : mixed
$payment_customer_id  : mixed
$payment_mode  : mixed
$payment_processor  : mixed
$payment_profileid  : mixed
$payment_status  : mixed
$paypal_data  : mixed
$plan  : mixed
$plan_base_price  : mixed
$post_count  : mixed
$recurring_payments  : mixed
$referer_blacklist_urls  : mixed
$referer_urls  : mixed
$siteurl  : mixed
$status  : mixed
$subscription_details  : mixed
$subscription_is_cancelled  : mixed
$subscription_is_pending  : mixed
$subscription_period  : mixed
$subscription_status  : mixed
$user_email  : mixed
$user_login  : mixed
$user_meta  : mixed
$user_registered  : mixed
$wp_user  : mixed

Methods

__get()  : null
Special interface for private properties.
__isset()  : bool
Allow isset to be called on private properties.
__set()  : null
Set our private properties.
__unset()  : mixed
Allow unset to be called on private properties.
activate()  : bool
Activate the current user account.
do_wp_init()  : void
We do this during WP's init hook.
expire()  : bool
Expire the current user account.
format_map_view_stats()  : array<string|int, mixed>
Share renewal-history billing text with the administrator overages drawer.
get_current_subscription()  : WP_Error|array<string|int, mixed>
Get the current subscription details for this user.
get_location_limit()  : mixed
Needed for the WP filter.
get_map_view_stats()  : array<string|int, mixed>
Get map view stats for the user.
is_valid()  : bool
Return true if this user has a valid blog and user ID.
load()  : WP_Error|WP_User|null
Load up a specific user (by ID)
load_for_blog()  : WP_User|null
Load user for specified blog
load_for_blog_with_user()  : void
Load user for a blog when the WP_User object is already available.
load_for_current_blog()  : void
Set this user object to the user that owns the current blog.
log_referer()  : void
Track all referers for this users.
might_have_subscription()  : bool
Return true if the user has (or had) an active subscription.
reload()  : mixed
Reload the current user.
set_account_status()  : bool
Set the user account state ( 'active' | 'expired' )
get_primary_user()  : WP_User|null
Retrieves the primary user associated with the specified blog ID.
property_fallback()  : mixed
Set fallback properties.
reset()  : mixed
Reset base properties except blog_id.
set_recurring_payment_properties()  : void
Set our local properties when updating the recurring payments array.

Constants

DEFAULT_MAX_LOCATIONS

public mixed DEFAULT_MAX_LOCATIONS = 125

DEFAULT_MAX_VIEWS

public mixed DEFAULT_MAX_VIEWS = 1000

DEFAULT_PERIOD

public mixed DEFAULT_PERIOD = 'month'

DEFAULT_PLAN_NAME

public mixed DEFAULT_PLAN_NAME = 'Advanced'

STATUS_ACTIVE

public mixed STATUS_ACTIVE = 'active'

STATUS_EXPIRED

public mixed STATUS_EXPIRED = 'expired'

VIEW_OVERAGE_BLOCKSIZE

public mixed VIEW_OVERAGE_BLOCKSIZE = 1000

VIEW_OVERAGE_PRICE

public mixed VIEW_OVERAGE_PRICE = 500

Properties

$primary_user

public mixed $primary_user = \null

$customer_details

private mixed $customer_details

$expiration_date

private mixed $expiration_date

$myslp_subscription_plan

private mixed $myslp_subscription_plan

$payment_customer_id

private mixed $payment_customer_id

$payment_processor

private mixed $payment_processor

$payment_profileid

private mixed $payment_profileid

$plan_base_price

private mixed $plan_base_price

$recurring_payments

private mixed $recurring_payments

$referer_blacklist_urls

private mixed $referer_blacklist_urls = array()

$referer_urls

private mixed $referer_urls = array()

$subscription_details

private mixed $subscription_details

$subscription_is_cancelled

private mixed $subscription_is_cancelled

$subscription_is_pending

private mixed $subscription_is_pending

$subscription_period

private mixed $subscription_period

$subscription_status

private mixed $subscription_status

$user_registered

private mixed $user_registered

Methods

__get()

Special interface for private properties.

public __get(mixed $property) : null
Parameters
$property : mixed
Return values
null

__isset()

Allow isset to be called on private properties.

public __isset(mixed $property) : bool
Parameters
$property : mixed
Return values
bool

__set()

Set our private properties.

public __set(mixed $property, mixed $value) : null
Parameters
$property : mixed
$value : mixed
Return values
null

__unset()

Allow unset to be called on private properties.

public __unset(mixed $property) : mixed
Parameters
$property : mixed

activate()

Activate the current user account.

public activate() : bool
Return values
bool —

true if the user was activated

do_wp_init()

We do this during WP's init hook.

public do_wp_init() : void

expire()

Expire the current user account.

public expire() : bool
Return values
bool —

true if the user was expired

format_map_view_stats()

Share renewal-history billing text with the administrator overages drawer.

public static format_map_view_stats(int $map_views, int $map_views_limit[, bool $is_estimate = false ]) : array<string|int, mixed>

Historical callers supply the plan limit recorded at renewal.

Parameters
$map_views : int
$map_views_limit : int
$is_estimate : bool = false
Return values
array<string|int, mixed>

get_current_subscription()

Get the current subscription details for this user.

public get_current_subscription() : WP_Error|array<string|int, mixed>
Return values
WP_Error|array<string|int, mixed>

get_location_limit()

Needed for the WP filter.

public get_location_limit() : mixed

get_map_view_stats()

Get map view stats for the user.

public get_map_view_stats([bool $is_estimate = false ]) : array<string|int, mixed>
Parameters
$is_estimate : bool = false
Return values
array<string|int, mixed>

is_valid()

Return true if this user has a valid blog and user ID.

public is_valid() : bool
Return values
bool

load()

Load up a specific user (by ID)

public load(int $user_id) : WP_Error|WP_User|null

Figures out the blog ID associated with the user, to make sure the user has a blog.

Parameters
$user_id : int

ID for the user.

Tags
uses
MySLP_Dashboard_Controller::get_blog_id_by_user
Return values
WP_Error|WP_User|null

load_for_blog()

Load user for specified blog

public load_for_blog(int $blog_id) : WP_User|null
Parameters
$blog_id : int

ID for the blog to load the user from.

Tags
uses
MySLP_User::get_primary_user

via __get('wp_user')

Return values
WP_User|null

load_for_blog_with_user()

Load user for a blog when the WP_User object is already available.

public load_for_blog_with_user(int $blog_id, WP_User $wp_user) : void

Bypasses get_blog_id_by_user() and get_primary_user()'s get_users() call by pre-seeding primary_user with the caller-supplied object. Use this in list-building loops where the WP_User comes from a prior WP_User_Query.

Parameters
$blog_id : int

Blog ID for this user's site.

$wp_user : WP_User

Already-fetched WP_User object.

load_for_current_blog()

Set this user object to the user that owns the current blog.

public load_for_current_blog() : void

log_referer()

Track all referers for this users.

public log_referer() : void

Incoming URL requests for geocoding (and eventually map views)

might_have_subscription()

Return true if the user has (or had) an active subscription.

public might_have_subscription() : bool
Return values
bool

reload()

Reload the current user.

public reload() : mixed

set_account_status()

Set the user account state ( 'active' | 'expired' )

public set_account_status(mixed $state) : bool
Parameters
$state : mixed
Return values
bool

get_primary_user()

Retrieves the primary user associated with the specified blog ID.

private get_primary_user(int $blog_id) : WP_User|null

If the primary user is not already set, this method fetches the list of users for the provided blog ID. When a main-site administrator is signed in and multiple administrators are returned, that administrator is the primary user.

note: get_users() returns an array of WP_User objects

Parameters
$blog_id : int

The ID of the blog for which to retrieve the primary user.

Tags
used-by

MySLP_User::__get

Return values
WP_User|null —

The primary user object associated with the blog.

property_fallback()

Set fallback properties.

private property_fallback(mixed $property) : mixed
Parameters
$property : mixed

reset()

Reset base properties except blog_id.

private reset() : mixed

set_recurring_payment_properties()

Set our local properties when updating the recurring payments array.

private set_recurring_payment_properties(array<string|int, mixed> $value) : void
Parameters
$value : array<string|int, mixed>
On this page

Search results