\DevOwl\RealProductManagerWpClientUtils

Utils functionality.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
setupConstants()
startsWith()
isRedirected()
getIpAddress()
getUserFullName()
getOptionRaw()
getCurrentHostname()
mapBlogsToHosts()
getActivePluginsMap()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this package so we can utils package natively.

Returns

string

setupConstants()

setupConstants()

Make sure the RPM_WP_CLIENT constants are available.

startsWith()

startsWith(string  $haystack,string  $needle)

Check if a string starts with a given needle.

Parameters

string $haystack

The string to search in

string $needle

The starting string

isRedirected()

isRedirected()

Check if the current page request gets redirected.

getIpAddress()

getIpAddress()

Get the IP address of the current request.

getUserFullName()

getUserFullName(\WP_User  $user = null)

Get the full name for the currently logged in user.

Parameters

\WP_User $user

Fall back to current user

getOptionRaw()

getOptionRaw(string  $optionName,mixed  $default = false)

Get the raw value of a `wp_options` value by respecting the object cache. It is not modified through option-filters.

Parameters

string $optionName
mixed $default

getCurrentHostname()

getCurrentHostname(): string

Get current home url, normalized without schema, `www` subdomain and path.

This avoids general conflicts for situations, when customers move their HTTP site to HTTPS.

Returns

string —

Can be empty, e.g. for WP CLI and WP Cronjob when Object Cache is active

mapBlogsToHosts()

mapBlogsToHosts(array<mixed,integer>  $blogIds)

To avoid issues with multisites without own domains, we need to map blog ids to their `site_url`'s host so we can determine the used license for a given blog.

Parameters

array<mixed,integer> $blogIds

getActivePluginsMap()

getActivePluginsMap(boolean  $includeSlugs = true)

Get the list of active plugins in a map: File => Name. This is needed for the config and the notice for `skip-if-active` attribute in cookie opt-in codes.

Parameters

boolean $includeSlugs