MySLP_User
in package
Class MySLP_User a modified WP_User
A MySLP User.
Table of Contents
Constants
- DEFAULT_MAX_LOCATIONS = 125
- DEFAULT_MAX_VIEWS = 1000
- DEFAULT_PERIOD = 'month'
- DEFAULT_PLAN_NAME = 'Advanced'
- VIEW_OVERAGE_BLOCKSIZE = 1000
- VIEW_OVERAGE_PRICE = 500
Properties
- $account_status : string
- $api_key : string
- $blog_details : array<string|int, mixed>
- $blog_id : mixed
- $blogname : string
- $coupon : string
- $coupon_code : string
- $coupon_details : string
- $customer_details : string
- $email : string
- $expiration_date : string
- $home : string
- $ID : int
- $last_payment : string
- $location_count : int
- $location_limit : int
- $mapview_count : int
- $mapview_limit : int
- $meta_amount : string
- $myslp_subscription_plan : string
- $payment_customer_id : string
- $payment_mode : string
- $payment_processor : string
- $payment_profileid : string
- $payment_status : string
- $paypal_data : string
- $plan : string
- $plan_base_price : string
- $post_count : int
- $recurring_payments : array<string|int, mixed>
- $referer_blacklist_urls : array<string|int, mixed>
- $referer_urls : array<string|int, mixed>
- $siteurl : string
- $status : string
- $subscription_details : string
- $subscription_is_cancelled : string
- $subscription_is_pending : string
- $subscription_period : string
- $user_meta : array<string|int, mixed>
- $user_registered : string
- $wp_user : WP_User
- $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 : mixed
- $mapview_count : mixed
- $mapview_limit : mixed
- $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_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() : mixed
- We do this during WP's init hook.
- expire() : bool
- Expire the current user account.
- get_location_limit() : null
- Needed for the WP filter.
- is_valid() : bool
- Return true if this user has a valid blog and user ID.
- load() : WP_Error
- Load up a specific user (by ID)
- load_by_email() : WP_Error
- Load up a specific user (by ID)
- load_for_blog() : WP_User
- Load user for specified blog
- load_for_current_blog() : mixed
- Set this user object to the user that owns the current blog.
- log_referer() : mixed
- 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' )
- property_fallback() : mixed
- Set fallback properties.
- reset() : mixed
- Reset base properties except blog_id.
- set_recurring_payment_properties() : mixed
- 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'
VIEW_OVERAGE_BLOCKSIZE
public
mixed
VIEW_OVERAGE_BLOCKSIZE
= 1000
VIEW_OVERAGE_PRICE
public
mixed
VIEW_OVERAGE_PRICE
= 500
Properties
$account_status
public
string
$account_status
Use ->status instead (that is the payment status), this is from user_meta.
$api_key read-only
public
string
$api_key
Map deployment API key
$blog_details read-only
public
array<string|int, mixed>
$blog_details
$blog_id
public
mixed
$blog_id
$blogname read-only
public
string
$blogname
$coupon read-only
public
string
$coupon
$coupon_code read-only
public
string
$coupon_code
Processor-side coupon codes (Stripe-based coupons for example).
$coupon_details read-only
public
string
$coupon_details
Processor-side coupon details (Stripe-based coupons for example). * @property-read string email Email
$customer_details read-only
public
string
$customer_details
Payment processor customer details
$email read-only
public
string
$email
$expiration_date
public
string
$expiration_date
Current subscription expiration
$home read-only
public
string
$home
$ID read-only
public
int
$ID
User ID
$last_payment read-only
public
string
$last_payment
The last payment from the user stored in user_meta so our customer list report can sort/filter on it.
$location_count
public
int
$location_count
The location count for the user stored in user_meta so our customer list report can sort/filter on it.
$location_limit read-only
public
int
$location_limit
The ACTIVE location limit (when purchased) NOT the current plan limit (which can change if marketing decides new limits are warranted)
$mapview_count
public
int
$mapview_count
Map views in current billing period.
$mapview_limit read-only
public
int
$mapview_limit
How many map views the user is allowed with their plan.
$meta_amount read-only
public
string
$meta_amount
User meta "payment_amount" which is still referenced in some places in the code, should probably be looking in recurring_payments keys
$myslp_subscription_plan
public
string
$myslp_subscription_plan
Which plan - from DSRA during sign up, and dashboard controller level update. Update with $this->plan =
$payment_customer_id read-only
public
string
$payment_customer_id
Payment Processor Customer ID
$payment_mode read-only
public
string
$payment_mode
live or test mode for payments
$payment_processor
public
string
$payment_processor
Which payment processor was used? paypal || stripe (default)
$payment_profileid read-only
public
string
$payment_profileid
The profile (subscription ID) assigned by the payment processor.
$payment_status read-only
public
string
$payment_status
The PayPal payment status
$paypal_data read-only
public
string
$paypal_data
User meta "paypal_data"
$plan
public
string
$plan
Which plan - currently from blog_option 'user_subscription_status' which is likely NOT the definitive source: from dashboard controller update blog settings, and dashboard helper myslp_user_settings
$plan_base_price read-only
public
string
$plan_base_price
Price for the selected plan. Update with $this->plan =
$post_count read-only
public
int
$post_count
$recurring_payments
public
array<string|int, mixed>
$recurring_payments
Unserialized recurring payments data
$referer_blacklist_urls
public
array<string|int, mixed>
$referer_blacklist_urls
URLs blacklisted from using user key
$referer_urls
public
array<string|int, mixed>
$referer_urls
URLs that sent map requests for the user
$siteurl read-only
public
string
$siteurl
Site URL
$status
public
string
$status
Current account status*
$subscription_details read-only
public
string
$subscription_details
Payment processor subscription details
$subscription_is_cancelled read-only
public
string
$subscription_is_cancelled
Is the subscription cancelled?
$subscription_is_pending read-only
public
string
$subscription_is_pending
Is the subscription pending? More PayPal crap, approved payments may or may not be active right away.
$subscription_period read-only
public
string
$subscription_period
Subscription period
$user_meta read-only
public
array<string|int, mixed>
$user_meta
The WordPress user meta
$user_registered read-only
public
string
$user_registered
$wp_user read-only
public
WP_User
$wp_user
The WordPress user object
status -- known issues
Status is stored in the blog option 'user_subscription_status' serialized as well as in the user meta 'account_status'. user_meta makes it easy to find/filter accounts on the customer list management UX -- extra storage space but is friendlier with WP_User_Query
ONE of these options should become the defacto standard -- the "Master Copy" of account status. ALWAYS user $myslp->User->set_account_status() to change the status -- it updates both locations.
$myslp->User->status pulls from the blog option $myslp->User->account_status pulls from the meta <== let's always use this and make it the master
There is also an 'account_status' blog option that is a single string entry that appears to be defunct.
subscription_status -- stored in blog option user_subscription_status
-
only set via myslp_user_settings()
-
account_name User->blogname expiration_date Current Account Expiration Date location_limit Max locations allowed for user mapview_limit Max map views before charging plan the english text name for the plan selected referer_urls URLs that loaded the user map referer_blacklist_urls blacklisted URLs the user asked to stop loading their map
-
registered_date Date account was started status Current account status subscription_period
-
url User->home
$account_status
private
mixed
$account_status
$api_key
private
mixed
$api_key
$blog_details
private
mixed
$blog_details
$blogname
private
mixed
$blogname
$coupon
private
mixed
$coupon
$coupon_code
private
mixed
$coupon_code
$coupon_details
private
mixed
$coupon_details
$customer_details
private
mixed
$customer_details
$discount
private
mixed
$discount
private
mixed
$email
$expiration_date
private
mixed
$expiration_date
$first_name
private
mixed
$first_name
$home
private
mixed
$home
$ID
private
mixed
$ID
$last_name
private
mixed
$last_name
$last_payment
private
mixed
$last_payment
$location_count
private
mixed
$location_count
$location_limit
private
mixed
$location_limit
$mapview_count
private
mixed
$mapview_count
$mapview_limit
private
mixed
$mapview_limit
$meta_amount
private
mixed
$meta_amount
$myslp_subscription_plan
private
mixed
$myslp_subscription_plan
$payment_customer_id
private
mixed
$payment_customer_id
$payment_mode
private
mixed
$payment_mode
$payment_processor
private
mixed
$payment_processor
$payment_profileid
private
mixed
$payment_profileid
$payment_status
private
mixed
$payment_status
$paypal_data
private
mixed
$paypal_data
$plan
private
mixed
$plan
$plan_base_price
private
mixed
$plan_base_price
$post_count
private
mixed
$post_count
$recurring_payments
private
mixed
$recurring_payments
$referer_blacklist_urls
private
mixed
$referer_blacklist_urls
= array()
$referer_urls
private
mixed
$referer_urls
= array()
$siteurl
private
mixed
$siteurl
$status
private
mixed
$status
$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_meta
private
mixed
$user_meta
$user_registered
private
mixed
$user_registered
$wp_user
private
mixed
$wp_user
Methods
__get()
Special interface for private properties.
public
__get( $property) : null
Parameters
Return values
null__isset()
Allow isset to be called on private properties.
public
__isset( $property) : bool
Parameters
Return values
bool__set()
Set our private properties.
public
__set( $property, $value) : null
Parameters
Return values
null__unset()
Allow unset to be called on private properties.
public
__unset( $property) : mixed
Parameters
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() : mixed
expire()
Expire the current user account.
public
expire() : bool
Return values
bool —true if the user was expired
get_location_limit()
Needed for the WP filter.
public
get_location_limit() : null
Return values
nullis_valid()
Return true if this user has a valid blog and user ID.
public
is_valid() : bool
Return values
boolload()
Load up a specific user (by ID)
public
load(int $user_id) : WP_Error
Parameters
- $user_id : int
-
ID for the user.
Return values
WP_Error —| WP_User | false
load_by_email()
Load up a specific user (by ID)
public
load_by_email(string $email) : WP_Error
Parameters
- $email : string
-
user email
Return values
WP_Error —| false
load_for_blog()
Load user for specified blog
public
load_for_blog(int $blog_id[, int $user_id = null ]) : WP_User
Parameters
- $blog_id : int
-
ID for the blog to load the user from.
- $user_id : int = null
-
ID for the user (optional)
Return values
WP_User —| false
load_for_current_blog()
Set this user object to the user that owns the current blog.
public
load_for_current_blog() : mixed
log_referer()
Track all referers for this users.
public
log_referer() : mixed
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
boolreload()
Reload the current user.
public
reload() : mixed
set_account_status()
Set the user account state ( 'active' | 'expired' )
public
set_account_status( $state) : bool
Parameters
Return values
boolproperty_fallback()
Set fallback properties.
private
property_fallback( $property) : mixed
Parameters
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) : mixed
Parameters
- $value : array<string|int, mixed>