Method |
Description |
|
__destruct ( ) |
If there are any stats that need to be pushed, but haven't been, push them now. |
|
absolutize_css_urls ( $css, $css_file_url ) : mixed | string |
Converts any url in a stylesheet, to the correct absolute url. |
|
activate_default_modules ( $min_version = false, $max_version = false, $other_modules = [], $redirect = true ) |
|
|
activate_manage ( ) |
|
|
activate_module ( $module, $exit = true, $redirect = true ) |
|
|
activate_module_actions ( $module ) |
|
|
activate_new_modules ( $redirect = false ) |
|
|
active_plan_supports ( $feature ) : boolean |
Determine whether the active plan supports a particular feature |
|
add_jetpack_pagestyles ( $admin_body_class = '' ) |
|
|
add_nonce ( $timestamp, $nonce ) |
|
|
add_remote_request_handlers ( ) |
|
|
add_token_to_login_redirect_json_api_authorization ( $redirect_to, $original_redirect_to, $user ) |
Add the Access Code details to the public-api.wordpress.com redirect |
|
admin_banner_styles ( ) |
|
|
admin_body_class ( $admin_body_class = '' ) |
|
|
admin_head ( ) |
|
|
admin_help ( ) : false |
Add help to the Jetpack page |
|
admin_init ( ) |
* Admin Pages |
|
admin_jetpack_manage_notice ( ) : null |
This is the first banner
It should be visible only to user that can update the option
Are not connected |
|
admin_menu_css ( ) |
|
|
admin_menu_order ( ) |
|
|
admin_notices ( ) |
|
|
admin_page_load ( ) |
Handles the page load events for the Jetpack admin page |
|
admin_screen_configure_module ( $module_id ) |
|
|
admin_url ( $args = null ) |
|
|
ajax_recheck_ssl ( ) |
|
|
alert_auto_ssl_fail ( ) |
*
Displays an admin_notice, alerting the user to their JETPACK_CLIENT__HTTPS constant being 'AUTO' but SSL isn't working. |
|
allow_wpcom_public_api_domain ( $domains ) |
Add public-api.wordpress.com to the safe redirect whitelist - only added when someone allows API access |
|
api_url ( $relative_url ) : string |
Returns the requested Jetpack API URL |
|
authenticate_jetpack ( $user, $username, $password ) |
Authenticates XML-RPC and other requests from the Jetpack Server |
|
bail_on_activation ( $message, $deactivate = true ) |
* Installation |
|
build_connect_url ( boolean $raw = false, boolean | string $redirect = false, boolean | string $from = false ) : string |
Builds a URL to the Jetpack connection auth page |
|
build_raw_urls ( $url ) |
*
Strip http:// or https:// from a url, replaces forward slash with ::,
so we can bring them directly to their site in calypso. |
|
build_reconnect_url ( $raw = false ) |
|
|
build_stats_url ( $args ) : string |
Builds the stats url. |
|
can_display_jetpack_manage_notice ( ) : (bool) |
Determines whether to show the notice of not true = display notice |
|
catch_errors ( boolean $catch ) |
Catches PHP errors. Must be used in conjunction with output buffering. |
|
catch_errors_on_shutdown ( ) |
Saves any generated PHP errors in ::state( 'php_errors', {errors} ) |
|
check_identity_crisis ( ) : array | boolean |
Checks if the site is currently in an identity crisis. |
|
check_open_graph ( ) : null |
Check if Jetpack's Open Graph tags should be used. |
|
check_privacy ( $file ) |
|
|
check_rest_api_compat ( ) : null |
Check if Jetpack's REST API compat file should be included |
|
check_twitter_tags ( ) : null |
Check if Jetpack's Twitter tags should be used. |
|
clean_nonces ( $all = false ) |
|
|
concat_remove_style_loader_tag ( $tag, $handle ) |
|
|
create_nonce ( $name ) |
Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action
Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted
$name must be a registered option name. |
|
current_user_is_connection_owner ( ) |
|
|
dashboard_widget ( ) |
|
|
dashboard_widget_connect_to_wpcom ( ) |
|
|
dashboard_widget_footer ( ) |
|
|
deactivate_module ( $module ) |
|
|
debugger_page ( ) |
|
|
delete_active_modules ( ) |
|
|
delete_option ( string | array $names ) |
Deletes the given option. May be passed multiple option names as an array. |
|
deprecated_hooks ( ) |
Throws warnings for deprecated hooks to be removed from Jetpack |
|
devicepx ( ) |
Device Pixels support
This improves the resolution of gravatars and wordpress.com uploads on hi-res and zoomed browsers. |
|
disconnect ( $update_activated_state = true ) |
Disconnects from the Jetpack servers. |
|
dismiss_jetpack_notice ( ) |
|
|
display_activate_module_link ( string $module_id ) : null |
Display link to activate the module to see the settings screen. |
|
dns_prefetch ( mixed $new_urls = null ) |
Stores and prints out domains to prefetch for page speed optimization. |
|
do_server_side_stat ( $args ) : boolean |
Runs stats code for a one-off, server-side. |
|
do_stats ( $method = '' ) |
Load stats pixels. $group is auto-prefixed with "x_jetpack-" |
|
do_version_bump ( (string) $version, (string) $old_version ) : null |
Runs before bumping version numbers up to a new version |
|
enable_module_configurable ( $module ) |
|
|
extra_oembed_providers ( ) |
Add any extra oEmbed providers that we know about and use on wpcom for feature parity. |
|
featured_images_enabled ( ) : string |
Determines whether the current theme supports featured images or not. |
|
file_system_write_access ( ) : string |
Returns true if the site has file write access false otherwise. |
|
filter_default_modules ( array $modules ) : array |
Checks activated plugins during auto-activation to determine
if any of those plugins are in the list with a corresponding module
that is not compatible with the plugin. The module will not be allowed
to auto-activate. |
|
fix_url_for_bad_hosts ( $url ) |
Some hosts disable the OpenSSL extension and so cannot make outgoing HTTPS requsets |
|
generate_secrets ( $action, $exp = 600 ) : array |
Creates two secret tokens and the end of life timestamp for them. |
|
get_active_modules ( ) |
Get a list of activated modules as an array of module slugs. |
|
get_active_plan ( ) : array |
Get the plan that this Jetpack site is currently using |
|
get_active_plugins ( ) |
Gets all plugins currently active in values, regardless of whether they're
traditionally activated or network activated. |
|
get_additional_stat_data ( $prefix = '' ) |
Get additional stat data to sync to WPCOM |
|
get_available_modules ( $min_version = false, $max_version = false ) |
List available Jetpack modules. Simply lists .php files in /modules/. |
|
get_avatar_url ( integer | string | object $id_or_email, integer $size = 96, string $default = '', boolean $force_display = false ) : array |
Centralize the function here until it gets added to core. |
|
get_cloud_site_options ( string | array $option_names ) : array |
Pings the WordPress.com Mirror Site for the specified options. |
|
get_connected_user_data ( $user_id = null ) |
Get the wpcom user data of the current|specified connected user. |
|
get_connected_user_email ( $user_id = null ) |
Get the wpcom email of the current|specified connected user. |
|
get_content_width ( ) |
Get $content_width, but with a twist filter. |
|
get_default_modules ( $min_version = false, $max_version = false ) |
Default modules loaded on activation. |
|
get_file_data ( $file, $headers ) |
Like core's get_file_data implementation, but caches the result. |
|
get_jetpack_options_for_reset ( ) |
*
This method is used to organize all options that can be reset
without disconnecting Jetpack. |
|
get_jp_emblem ( ) : string |
Return string containing the Jetpack logo. |
|
get_locale ( ) : string | boolean |
Get the locale. |
|
get_log ( $event = false, $num = false ) : array |
Get the internal event log. |
|
get_master_user_email ( ) |
Get the wpcom email of the master user. |
|
get_module ( $module ) |
Load module data from module file. Headers differ from WordPress
plugin headers to avoid them being identified as standalone
plugins on the WordPress plugins page. |
|
get_module_path ( $slug ) |
Generate a module's path from its slug. |
|
get_module_slug ( $file ) |
Extract a module's slug from its full path. |
|
get_option ( string $name, mixed $default = false ) |
Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
|
get_option_names ( $type = 'compact' ) |
* Jetpack Options API |
|
get_other_linked_admins ( ) : mixed |
Checks to see if there are any other users available to become primary
Users must both:
- Be linked to wpcom
- Be an admin |
|
get_parsed_plugin_data ( ) : array |
Gets and parses additional plugin data to send with the heartbeat data |
|
get_parsed_theme_data ( ) : array |
Gets and parses theme data to send with the heartbeat data |
|
get_remote_query_timeout_limit ( ) : integer |
Builds the timeout limit for queries talking with the wpcom servers. |
|
get_stat_data ( $encode = true, $extended = true ) |
Return stat data for WPCOM sync |
|
get_sync_error_idc_option ( array $response = [] ) : array |
Gets the value that is to be saved in the jetpack_sync_error_idc option. |
|
get_translated_modules ( array $modules ) : string | void |
Return module name translation. Uses matching string created in modules/module-headings.php. |
|
get_update_details ( ) |
|
|
get_updates ( ) : array |
jetpack_updates is saved in the following schema: |
|
get_user_option_meta_box_order_dashboard ( $sorted ) : mixed |
|
|
glob_php ( string $absolute_path ) : array |
Returns an array of all PHP files in the specified absolute path. |
|
guess_locale_from_lang ( string $lang ) : string | boolean |
Guess locale from language code. |
|
handle_deprecated_modules ( array $modules ) : array |
Checks activated modules during auto-activation to determine
if any of those modules are being deprecated. If so, close
them out, and add any replacement modules. |
|
implode_frontend_css ( $travis_test = false ) |
This methods removes all of the registered css files on the front end
from Jetpack in favor of using a single file. In effect "imploding"
all the files into one file. |
|
init ( ) |
Singleton |
|
intercept_plugin_error_scrape ( $action, $result ) |
|
|
intercept_plugin_error_scrape_init ( ) |
|
|
is_active ( ) |
Is Jetpack active? |
|
is_development_mode ( ) |
Is Jetpack in development (offline) mode? |
|
is_development_version ( ) |
Whether Jetpack's version maps to a public release, or a development version. |
|
is_main_network_option ( boolean $option ) : boolean |
Return whether we are dealing with a multi network setup or not. |
|
is_module ( $module ) |
|
|
is_module_active ( string $module ) : boolean |
Check whether or not a Jetpack module is active. |
|
is_multi_network ( ) : boolean |
Implemented since there is no core is multi network function
Right now there is no way to tell if we which network is the dominant network on the system |
|
is_multisite ( string $option ) : boolean |
Return true if we are with multi-site or multi-network false if we are dealing with single site. |
|
is_plugin_active ( $plugin = 'jetpack/jetpack.php' ) |
Checks whether a specific plugin is active. |
|
is_single_user_site ( ) : boolean |
Get back if the current site is single user site. |
|
is_staging_site ( ) : boolean |
Checks whether the home and siteurl specifically are whitelisted
Written so that we don't have re-check $key and $value params every time
we want to check if this site is whitelisted, for example in footer.php |
|
is_user_connected ( $user_id = false ) |
Is a given user (or the current user if none is specified) linked to a WordPress.com user? |
|
is_version_controlled ( ) : string |
Finds out if a site is using a version control system. |
|
jetpack_admin_ajax_tracks_callback ( ) |
|
|
jetpack_check_heartbeat_data ( ) |
*
Check the heartbeat data |
|
jetpack_custom_caps ( $caps, $cap, $user_id, $args ) |
|
|
jetpack_getOptions ( $args ) |
|
|
jetpack_icon_user_connected ( $columns ) |
*
Adds a "blank" column in the user admin table to display indication of user connection. |
|
jetpack_jitm_ajax_callback ( ) |
The callback for the JITM ajax requests. |
|
jetpack_main_network_site_option ( boolean $option ) : string |
Return the network_site_url so that .com knows what network this site is a part of. |
|
jetpack_menu_order ( $menu_order ) |
|
|
jetpack_show_user_connected_icon ( $val, $col, $user_id ) |
*
Show Jetpack icon if the user is linked. |
|
jetpack_user_col_style ( ) |
*
Style the Jetpack user column |
|
jumpstart_has_updated_module_option ( string $option_name = '' ) : boolean |
Check if an option of a Jetpack module has been updated. |
|
load_modules ( ) |
Loads the currently active modules. |
|
load_view ( string $template, array $data = [] ) : boolean |
Loads a view file from the views |
|
load_xml_rpc_client ( ) |
Loads the Jetpack XML-RPC client |
|
log ( $code, $data = null ) |
Tracking an internal event log. Try not to put too much chaff in here. |
|
log_settings_change ( $option, $old_value, $value ) |
Log modification of important settings. |
|
login_form_json_api_authorization ( ) |
Handles the login action for Authorizing the JSON API |
|
login_message_json_api_authorization ( $message ) |
|
|
manage_activate_screen ( ) |
|
|
maybe_clear_other_linked_admins_transient ( integer $user_id, string $role, array $old_roles = null ) |
If a user has been promoted to or demoted from admin, we need to clear the
jetpack_other_linked_admins transient. |
|
maybe_inline_style ( string $tag, string $handle ) : string |
Maybe inlines a stylesheet. |
|
maybe_min_asset ( $url, $path, $plugin ) |
Maybe Use a .min.css stylesheet, maybe not. |
|
maybe_set_version_option ( ) : bool: |
If the db version is showing something other that what we've got now, bump it to current. |
|
module_configuration_activation_screen ( $module, $method ) |
|
|
module_configuration_head ( $module, $method ) |
|
|
module_configuration_load ( $module, $method ) |
|
|
module_configuration_screen ( $module, $method ) |
|
|
module_configuration_url ( $module ) |
|
|
network_add_new_users ( $option = null ) : boolian |
Does the network allow admins to add new users. |
|
network_allow_new_registrations ( $option = null ) : string |
Does the network allow new user and site registrations. |
|
network_enable_administration_menus ( $option = null ) : array |
Lets us know if a site allows admins to manage the network. |
|
network_max_upload_file_size ( $option = null ) : number |
Maximum file upload size set by the network. |
|
network_name ( $option = null ) |
Network Name. |
|
network_site_upload_space ( $option = null ) : number |
File upload psace left per site in MB. |
|
network_upload_file_types ( $option = null ) : string |
Network allowed file types. |
|
nonce_url_no_esc ( $actionurl, $action, $name = '_wpnonce' ) |
|
|
normalize_url_protocol_agnostic ( string $url ) : WP_Error | string |
Normalizes a url by doing three things:
- Strips protocol
- Strips www
- Adds a trailing slash |
|
opt_in_jetpack_manage_notice ( ) |
|
|
opt_in_jetpack_manage_url ( ) : (string) |
Returns the url that the user clicks to opt in to Jetpack Manage |
|
opt_out_jetpack_manage_url ( ) : (string) |
Returns the url that the user clicks to remove the notice for the big banner |
|
permit_ssl ( $force_recheck = false ) : boolean |
Checks to see if the URL is using SSL to connect with Jetpack |
|
plugin_action_links ( $actions ) |
|
|
plugin_activation ( $network_wide ) |
Attached to activate_{ plugin_basename( __FILES__ ) } by register_activation_hook() |
|
plugin_deactivation ( ) |
Removes all connection options |
|
plugin_initialize ( ) |
Sets the internal version number and activation state. |
|
plugin_textdomain ( ) |
Load language files |
|
plugin_upgrade ( ) |
Must never be called statically |
|
post_login_form_to_signed_url ( $url, $path, $scheme ) |
Make sure the login form is POSTed to the signed URL so we can reverify the request |
|
prepare_manage_jetpack_notice ( ) : null |
Call this function if you want the Big Jetpack Manage Notice to show up. |
|
preserve_action_in_login_form_for_json_api_authorization ( ) |
Make sure the POSTed request is handled by the same action |
|
public_xmlrpc_methods ( $methods ) |
|
|
refresh_active_plan_from_wpcom ( ) : boolean |
Make an API call to WordPress.com for plan status |
|
refresh_theme_data ( ) |
|
|
refresh_update_data ( ) |
|
|
register ( ) : boolean | WP_Error |
|
|
register_assets ( ) : null |
Register assets for use in various modules and the Jetpack admin page. |
|
remote_request_handlers ( ) |
|
|
require_jetpack_authentication ( ) |
|
|
restate ( ) |
|
|
show_development_mode_notice ( ) |
Get Jetpack development mode notice text and notice class. |
|
sign_role ( $role ) |
|
|
sort_modules ( $a, $b ) |
|
|
stat ( $group, $detail ) |
Record a stat for later output. This will only currently output in the admin_footer. |
|
state ( string $key = null, string $value = null, boolean $restate = false ) |
State is passed via cookies from one request to the next, but never to subsequent requests. |
|
staticize_subdomain ( $url ) |
|
|
store_json_api_authorization_token ( $user_login, $user ) |
If someone logs in to approve API access, store the Access Code in usermeta |
|
submit_security_report ( string $type = '', string $plugin_file = '', array $args = [] ) |
Allows plugins to submit security reports. |
|
sync_idc_optin ( ) : boolean |
Returns the value of the jetpack_sync_idc_optin filter, or constant. |
|
throw_error_on_activate_plugin ( string $plugin ) |
Sometimes a plugin can activate without causing errors, but it will cause errors on the next page load. |
|
translate_current_user_to_role ( ) |
|
|
translate_module_tag ( string $tag ) : mixed |
Return translated module tag. |
|
translate_role_to_cap ( $role ) |
|
|
try_registration ( ) |
Attempts Jetpack registration. If it fail, a state flag is set: @see ::admin_page_load() |
|
unlink_user ( $user_id = null ) |
Unlinks the current user from the linked WordPress.com user |
|
update_active_modules ( $modules ) |
|
|
update_jetpack_main_network_site_option ( ) : null |
Trigger an update to the main_network_site when we update the siteurl of a site. |
|
update_jetpack_network_settings ( ) |
Triggered after a user updates the network settings via Network Settings Admin Page |
|
update_option ( string $name, mixed $value ) |
Updates the single given option. Updates jetpack_options or jetpack_$name as appropriate. |
|
update_options ( array $array ) |
Updates the multiple given options. Updates jetpack_options and/or jetpack_$name as appropriate. |
|
update_user_token ( integer $user_id, string $token, $is_master_user ) |
Enters a user token into the user_tokens option |
|
upload_handler ( ) |
|
|
user_role_change ( $user_id ) |
Synchronize connected user role changes |
|
validate_remote_register_response ( $response ) : true |
Takes the response from the Jetpack register new site endpoint and
verifies it worked properly. |
|
validate_sync_error_idc_option ( ) : boolean |
Checks whether the sync_error_idc option is valid or not, and if not, will do cleanup. |
|
verify_json_api_authorization_request ( ) |
Verifies the request by checking the signature |
|
verify_xml_rpc_signature ( ) |
|
|
wp_dashboard_setup ( ) |
|
|
xmlrpc_api_url ( ) : string |
Returns the Jetpack XML-RPC API |
|
xmlrpc_async_call ( ) |
Helper method for multicall XMLRPC. |
|
xmlrpc_methods ( $methods ) |
In some setups, $HTTP_RAW_POST_DATA can be emptied during some IXR_Server paths since it is passed by reference to various methods. |
|
xmlrpc_options ( $options ) |
|
|