@@ -1404,7 +1404,7 @@ |
||
| 1404 | 1404 | /** |
| 1405 | 1405 | * Migration routine for moving safecss from wp_options to wp_posts to support revisions |
| 1406 | 1406 | * |
| 1407 | - * @return void |
|
| 1407 | + * @return false|null |
|
| 1408 | 1408 | */ |
| 1409 | 1409 | static function upgrade() { |
| 1410 | 1410 | $css = get_option( 'safecss' ); |
@@ -107,6 +107,9 @@ |
||
| 107 | 107 | $this->enqueue_action( current_filter(), func_get_args(), $this->sync_queue ); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | + /** |
|
| 111 | + * @param Jetpack_Sync_Queue $queue |
|
| 112 | + */ |
|
| 110 | 113 | function enqueue_action( $current_filter, $args, $queue ) { |
| 111 | 114 | |
| 112 | 115 | /** |
@@ -227,6 +227,9 @@ discard block |
||
| 227 | 227 | $listener->get_full_sync_queue()->reset(); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | + /** |
|
| 231 | + * @param integer $default |
|
| 232 | + */ |
|
| 230 | 233 | private function get_status_option( $option, $default = null ) { |
| 231 | 234 | $prefix = self::STATUS_OPTION_PREFIX; |
| 232 | 235 | |
@@ -258,6 +261,9 @@ discard block |
||
| 258 | 261 | $this->queue_items_added( 1 ); |
| 259 | 262 | } |
| 260 | 263 | |
| 264 | + /** |
|
| 265 | + * @param integer $item_count |
|
| 266 | + */ |
|
| 261 | 267 | public function queue_items_added( $item_count ) { |
| 262 | 268 | $this->items_added_since_last_pause += $item_count; |
| 263 | 269 | |
@@ -1283,7 +1283,7 @@ |
||
| 1283 | 1283 | * Returns an array of stock and custom taxonomy query vars |
| 1284 | 1284 | * |
| 1285 | 1285 | * @global $wp_taxonomies |
| 1286 | - * @return array |
|
| 1286 | + * @return string[] |
|
| 1287 | 1287 | */ |
| 1288 | 1288 | function get_taxonomy_vars() { |
| 1289 | 1289 | global $wp_taxonomies; |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | * |
| 160 | 160 | * @since 4.3.0 |
| 161 | 161 | * |
| 162 | - * @return array Array of Jetpack modules. |
|
| 162 | + * @return string Array of Jetpack modules. |
|
| 163 | 163 | */ |
| 164 | 164 | public function get_modules() { |
| 165 | 165 | require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php' ); |
@@ -247,6 +247,11 @@ discard block |
||
| 247 | 247 | ) ); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | + /** |
|
| 251 | + * @param string $path |
|
| 252 | + * @param string $classname |
|
| 253 | + * @param Jetpack_IXR_Client $constructor_arguments |
|
| 254 | + */ |
|
| 250 | 255 | public static function route( $path, $classname, $method, |
| 251 | 256 | $constructor_arguments = NULL, |
| 252 | 257 | $endpoint_arguments = NULL |
@@ -876,7 +881,6 @@ discard block |
||
| 876 | 881 | * @since 4.3.0 |
| 877 | 882 | * |
| 878 | 883 | * @param string $module Module slug. If empty, it's assumed we're updating a module and we'll try to get its slug. |
| 879 | - * @param bool $cache Whether to cache the options or return always fresh. |
|
| 880 | 884 | * |
| 881 | 885 | * @return array |
| 882 | 886 | */ |
@@ -1753,7 +1757,7 @@ discard block |
||
| 1753 | 1757 | * |
| 1754 | 1758 | * @param string $route Regular expression for the endpoint with the module slug to return. |
| 1755 | 1759 | * |
| 1756 | - * @return array |
|
| 1760 | + * @return string |
|
| 1757 | 1761 | */ |
| 1758 | 1762 | public static function get_module_requested( $route = '/module/(?P<slug>[a-z\-]+)' ) { |
| 1759 | 1763 | |
@@ -1778,7 +1782,7 @@ discard block |
||
| 1778 | 1782 | * @param string $modules Can be a single module or a list of modules. |
| 1779 | 1783 | * @param null|string $slug Slug of the module in the first parameter. |
| 1780 | 1784 | * |
| 1781 | - * @return array |
|
| 1785 | + * @return string |
|
| 1782 | 1786 | */ |
| 1783 | 1787 | public static function prepare_modules_for_response( $modules = '', $slug = null ) { |
| 1784 | 1788 | if ( get_option( 'permalink_structure' ) ) { |
@@ -872,7 +872,7 @@ discard block |
||
| 872 | 872 | } |
| 873 | 873 | /** |
| 874 | 874 | * Does the network allow admins to add new users. |
| 875 | - * @return boolian |
|
| 875 | + * @return boolean |
|
| 876 | 876 | */ |
| 877 | 877 | static function network_add_new_users( $option = null ) { |
| 878 | 878 | return (bool) get_site_option( 'add_new_users' ); |
@@ -920,7 +920,7 @@ discard block |
||
| 920 | 920 | * database which could be set to anything as opposed to what this function returns. |
| 921 | 921 | * @param bool $option |
| 922 | 922 | * |
| 923 | - * @return boolean |
|
| 923 | + * @return string |
|
| 924 | 924 | */ |
| 925 | 925 | public function is_main_network_option( $option ) { |
| 926 | 926 | // return '1' or '' |
@@ -931,7 +931,7 @@ discard block |
||
| 931 | 931 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 932 | 932 | * |
| 933 | 933 | * @param string $option |
| 934 | - * @return boolean |
|
| 934 | + * @return string |
|
| 935 | 935 | */ |
| 936 | 936 | public function is_multisite( $option ) { |
| 937 | 937 | return (string) (bool) is_multisite(); |
@@ -989,7 +989,7 @@ discard block |
||
| 989 | 989 | |
| 990 | 990 | /** |
| 991 | 991 | * Returns true if the site has file write access false otherwise. |
| 992 | - * @return string ( '1' | '0' ) |
|
| 992 | + * @return integer ( '1' | '0' ) |
|
| 993 | 993 | **/ |
| 994 | 994 | public static function file_system_write_access() { |
| 995 | 995 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1563,7 +1563,7 @@ discard block |
||
| 1563 | 1563 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
| 1564 | 1564 | * |
| 1565 | 1565 | * @param string $name Option name |
| 1566 | - * @param mixed $default (optional) |
|
| 1566 | + * @param boolean $default (optional) |
|
| 1567 | 1567 | */ |
| 1568 | 1568 | public static function get_option( $name, $default = false ) { |
| 1569 | 1569 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1573,6 +1573,7 @@ discard block |
||
| 1573 | 1573 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
| 1574 | 1574 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
| 1575 | 1575 | * $name must be a registered option name. |
| 1576 | + * @param string $name |
|
| 1576 | 1577 | */ |
| 1577 | 1578 | public static function create_nonce( $name ) { |
| 1578 | 1579 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -1630,6 +1631,7 @@ discard block |
||
| 1630 | 1631 | * @param int $user_id |
| 1631 | 1632 | * @param string $token |
| 1632 | 1633 | * return bool |
| 1634 | + * @param boolean $is_master_user |
|
| 1633 | 1635 | */ |
| 1634 | 1636 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 1635 | 1637 | // not designed for concurrent updates |
@@ -2024,6 +2026,7 @@ discard block |
||
| 2024 | 2026 | |
| 2025 | 2027 | /** |
| 2026 | 2028 | * Like core's get_file_data implementation, but caches the result. |
| 2029 | + * @param string $file |
|
| 2027 | 2030 | */ |
| 2028 | 2031 | public static function get_file_data( $file, $headers ) { |
| 2029 | 2032 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2052,7 +2055,7 @@ discard block |
||
| 2052 | 2055 | * |
| 2053 | 2056 | * @param string $tag Tag as it appears in each module heading. |
| 2054 | 2057 | * |
| 2055 | - * @return mixed |
|
| 2058 | + * @return string |
|
| 2056 | 2059 | */ |
| 2057 | 2060 | public static function translate_module_tag( $tag ) { |
| 2058 | 2061 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2065,7 +2068,7 @@ discard block |
||
| 2065 | 2068 | * |
| 2066 | 2069 | * @param array $modules |
| 2067 | 2070 | * |
| 2068 | - * @return string|void |
|
| 2071 | + * @return string |
|
| 2069 | 2072 | */ |
| 2070 | 2073 | public static function get_translated_modules( $modules ) { |
| 2071 | 2074 | foreach ( $modules as $index => $module ) { |
@@ -2353,6 +2356,9 @@ discard block |
||
| 2353 | 2356 | _deprecated_function( __METHOD__, 'jeptack-4.2' ); |
| 2354 | 2357 | } |
| 2355 | 2358 | |
| 2359 | + /** |
|
| 2360 | + * @return string |
|
| 2361 | + */ |
|
| 2356 | 2362 | public static function deactivate_module( $module ) { |
| 2357 | 2363 | /** |
| 2358 | 2364 | * Fires when a module is deactivated. |
@@ -2381,6 +2387,9 @@ discard block |
||
| 2381 | 2387 | return self::update_active_modules( $new ); |
| 2382 | 2388 | } |
| 2383 | 2389 | |
| 2390 | + /** |
|
| 2391 | + * @param string $module |
|
| 2392 | + */ |
|
| 2384 | 2393 | public static function enable_module_configurable( $module ) { |
| 2385 | 2394 | $module = Jetpack::get_module_slug( $module ); |
| 2386 | 2395 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2391,21 +2400,33 @@ discard block |
||
| 2391 | 2400 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
| 2392 | 2401 | } |
| 2393 | 2402 | |
| 2403 | + /** |
|
| 2404 | + * @param string $module |
|
| 2405 | + */ |
|
| 2394 | 2406 | public static function module_configuration_load( $module, $method ) { |
| 2395 | 2407 | $module = Jetpack::get_module_slug( $module ); |
| 2396 | 2408 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
| 2397 | 2409 | } |
| 2398 | 2410 | |
| 2411 | + /** |
|
| 2412 | + * @param string $module |
|
| 2413 | + */ |
|
| 2399 | 2414 | public static function module_configuration_head( $module, $method ) { |
| 2400 | 2415 | $module = Jetpack::get_module_slug( $module ); |
| 2401 | 2416 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
| 2402 | 2417 | } |
| 2403 | 2418 | |
| 2419 | + /** |
|
| 2420 | + * @param string $module |
|
| 2421 | + */ |
|
| 2404 | 2422 | public static function module_configuration_screen( $module, $method ) { |
| 2405 | 2423 | $module = Jetpack::get_module_slug( $module ); |
| 2406 | 2424 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
| 2407 | 2425 | } |
| 2408 | 2426 | |
| 2427 | + /** |
|
| 2428 | + * @param string $module |
|
| 2429 | + */ |
|
| 2409 | 2430 | public static function module_configuration_activation_screen( $module, $method ) { |
| 2410 | 2431 | $module = Jetpack::get_module_slug( $module ); |
| 2411 | 2432 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2413,6 +2434,9 @@ discard block |
||
| 2413 | 2434 | |
| 2414 | 2435 | /* Installation */ |
| 2415 | 2436 | |
| 2437 | + /** |
|
| 2438 | + * @param string $message |
|
| 2439 | + */ |
|
| 2416 | 2440 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 2417 | 2441 | ?> |
| 2418 | 2442 | <!doctype html> |
@@ -3039,7 +3063,7 @@ discard block |
||
| 3039 | 3063 | * Add help to the Jetpack page |
| 3040 | 3064 | * |
| 3041 | 3065 | * @since Jetpack (1.2.3) |
| 3042 | - * @return false if not the Jetpack page |
|
| 3066 | + * @return false|null if not the Jetpack page |
|
| 3043 | 3067 | */ |
| 3044 | 3068 | function admin_help() { |
| 3045 | 3069 | $current_screen = get_current_screen(); |
@@ -4064,6 +4088,7 @@ discard block |
||
| 4064 | 4088 | /** |
| 4065 | 4089 | * Returns the requested Jetpack API URL |
| 4066 | 4090 | * |
| 4091 | + * @param string $relative_url |
|
| 4067 | 4092 | * @return string |
| 4068 | 4093 | */ |
| 4069 | 4094 | public static function api_url( $relative_url ) { |
@@ -4208,7 +4233,8 @@ discard block |
||
| 4208 | 4233 | * Note these tokens are unique per call, NOT static per site for connecting. |
| 4209 | 4234 | * |
| 4210 | 4235 | * @since 2.6 |
| 4211 | - * @return array |
|
| 4236 | + * @param string $action |
|
| 4237 | + * @return string |
|
| 4212 | 4238 | */ |
| 4213 | 4239 | public function generate_secrets( $action, $exp = 600 ) { |
| 4214 | 4240 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -4534,6 +4560,10 @@ discard block |
||
| 4534 | 4560 | return new WP_User( $token_details['user_id'] ); |
| 4535 | 4561 | } |
| 4536 | 4562 | |
| 4563 | + /** |
|
| 4564 | + * @param integer $timestamp |
|
| 4565 | + * @param string $nonce |
|
| 4566 | + */ |
|
| 4537 | 4567 | function add_nonce( $timestamp, $nonce ) { |
| 4538 | 4568 | global $wpdb; |
| 4539 | 4569 | static $nonces_used_this_request = array(); |
@@ -4683,6 +4713,7 @@ discard block |
||
| 4683 | 4713 | * @param string $key |
| 4684 | 4714 | * @param string $value |
| 4685 | 4715 | * @param bool $restate private |
| 4716 | + * @return string |
|
| 4686 | 4717 | */ |
| 4687 | 4718 | public static function state( $key = null, $value = null, $restate = false ) { |
| 4688 | 4719 | static $state = array(); |
@@ -4739,6 +4770,9 @@ discard block |
||
| 4739 | 4770 | Jetpack::state( null, null, true ); |
| 4740 | 4771 | } |
| 4741 | 4772 | |
| 4773 | + /** |
|
| 4774 | + * @param string $file |
|
| 4775 | + */ |
|
| 4742 | 4776 | public static function check_privacy( $file ) { |
| 4743 | 4777 | static $is_site_publicly_accessible = null; |
| 4744 | 4778 | |
@@ -5066,7 +5100,7 @@ discard block |
||
| 5066 | 5100 | /** |
| 5067 | 5101 | * Pings the WordPress.com Mirror Site for the specified options. |
| 5068 | 5102 | * |
| 5069 | - * @param string|array $option_names The option names to request from the WordPress.com Mirror Site |
|
| 5103 | + * @param string[] $option_names The option names to request from the WordPress.com Mirror Site |
|
| 5070 | 5104 | * |
| 5071 | 5105 | * @return array An associative array of the option values as stored in the WordPress.com Mirror Site |
| 5072 | 5106 | */ |
@@ -5090,7 +5124,7 @@ discard block |
||
| 5090 | 5124 | /** |
| 5091 | 5125 | * Fetch the filtered array of options that we should compare to determine an identity crisis. |
| 5092 | 5126 | * |
| 5093 | - * @return array An array of options to check. |
|
| 5127 | + * @return string[] An array of options to check. |
|
| 5094 | 5128 | */ |
| 5095 | 5129 | public static function identity_crisis_options_to_check() { |
| 5096 | 5130 | return array( |
@@ -5433,8 +5467,8 @@ discard block |
||
| 5433 | 5467 | * - Absolute URLs `http://domain.com/feh.png` |
| 5434 | 5468 | * - Domain root relative URLs `/feh.png` |
| 5435 | 5469 | * |
| 5436 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 5437 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5470 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 5471 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5438 | 5472 | * |
| 5439 | 5473 | * @return mixed|string |
| 5440 | 5474 | */ |
@@ -5743,7 +5777,7 @@ discard block |
||
| 5743 | 5777 | * |
| 5744 | 5778 | * @param string $option_name |
| 5745 | 5779 | * |
| 5746 | - * @return bool |
|
| 5780 | + * @return false|null |
|
| 5747 | 5781 | */ |
| 5748 | 5782 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
| 5749 | 5783 | // Bail if Jump Start has already been dismissed |
@@ -5834,7 +5868,6 @@ discard block |
||
| 5834 | 5868 | } |
| 5835 | 5869 | |
| 5836 | 5870 | /** |
| 5837 | - * @param mixed $result Value for the user's option |
|
| 5838 | 5871 | * @return mixed |
| 5839 | 5872 | */ |
| 5840 | 5873 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -107,6 +107,9 @@ |
||
| 107 | 107 | $this->enqueue_action( current_filter(), func_get_args(), $this->sync_queue ); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | + /** |
|
| 111 | + * @param Jetpack_Sync_Queue $queue |
|
| 112 | + */ |
|
| 110 | 113 | function enqueue_action( $current_filter, $args, $queue ) { |
| 111 | 114 | |
| 112 | 115 | /** |
@@ -250,6 +250,9 @@ discard block |
||
| 250 | 250 | return true; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | + /** |
|
| 254 | + * @param Jetpack_Sync_Queue_Buffer $buffer |
|
| 255 | + */ |
|
| 253 | 256 | function close( $buffer, $ids_to_remove = null ) { |
| 254 | 257 | $is_valid = $this->validate_checkout( $buffer ); |
| 255 | 258 | |
@@ -328,6 +331,9 @@ discard block |
||
| 328 | 331 | return get_transient( $this->get_checkout_transient_name() ); |
| 329 | 332 | } |
| 330 | 333 | |
| 334 | + /** |
|
| 335 | + * @param string $checkout_id |
|
| 336 | + */ |
|
| 331 | 337 | private function set_checkout_id( $checkout_id ) { |
| 332 | 338 | return set_transient( $this->get_checkout_transient_name(), $checkout_id, 5 * 60 ); // 5 minute timeout |
| 333 | 339 | } |