@@ -201,7 +201,7 @@ |
||
| 201 | 201 | * should be notified, overriding the site setting. |
| 202 | 202 | * |
| 203 | 203 | * @param int $comment_id Comment ID. |
| 204 | - * @return true Always returns true. |
|
| 204 | + * @return boolean Always returns true. |
|
| 205 | 205 | */ |
| 206 | 206 | function wp_notify_moderator( $comment_id ) { |
| 207 | 207 | global $wpdb; |
@@ -147,6 +147,10 @@ |
||
| 147 | 147 | * Take a list of field prefixes and expand them for multi-lingual |
| 148 | 148 | * with the provided boostings. |
| 149 | 149 | */ |
| 150 | + |
|
| 151 | + /** |
|
| 152 | + * @param string[] $additional_fields |
|
| 153 | + */ |
|
| 150 | 154 | public function merge_ml_fields( $fields2boosts, $additional_fields ) { |
| 151 | 155 | $flds = array(); |
| 152 | 156 | foreach( $fields2boosts as $f => $b ) { |
@@ -58,6 +58,10 @@ |
||
| 58 | 58 | return $query->is_main_query() && $query->is_search(); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | + /** |
|
| 62 | + * @param double $duration |
|
| 63 | + * @param boolean $was_jetpack_search |
|
| 64 | + */ |
|
| 61 | 65 | private function record_query_time( $duration, $was_jetpack_search ) { |
| 62 | 66 | $this->stats[] = array( $was_jetpack_search, intval( $duration * 1000 ) ); |
| 63 | 67 | } |
@@ -76,7 +76,6 @@ |
||
| 76 | 76 | * @since 5.8.0 |
| 77 | 77 | * |
| 78 | 78 | * @param string|array $key Query key or keys to remove. |
| 79 | - * @param bool|string $query Optional. A URL to act upon. Defaults to the current search URL. |
|
| 80 | 79 | * |
| 81 | 80 | * @return string New URL query string (unescaped). |
| 82 | 81 | */ |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * |
| 70 | 70 | * @since 5.9 |
| 71 | 71 | * |
| 72 | - * @return string Length of the multibyte string |
|
| 72 | + * @return integer Length of the multibyte string |
|
| 73 | 73 | * |
| 74 | 74 | */ |
| 75 | 75 | function jetpack_utf8_strlen( $text ) { |
@@ -169,6 +169,9 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| 172 | + /** |
|
| 173 | + * @param string $text |
|
| 174 | + */ |
|
| 172 | 175 | function transform($text) { |
| 173 | 176 | # |
| 174 | 177 | # Main function. Performs some preprocessing on the input text |
@@ -903,6 +906,10 @@ discard block |
||
| 903 | 906 | |
| 904 | 907 | public $list_level = 0; |
| 905 | 908 | |
| 909 | + /** |
|
| 910 | + * @param string $list_str |
|
| 911 | + * @param string $marker_any_re |
|
| 912 | + */ |
|
| 906 | 913 | function processListItems($list_str, $marker_any_re) { |
| 907 | 914 | # |
| 908 | 915 | # Process the contents of a single ordered or unordered list, splitting it |
@@ -1006,6 +1013,9 @@ discard block |
||
| 1006 | 1013 | } |
| 1007 | 1014 | |
| 1008 | 1015 | |
| 1016 | + /** |
|
| 1017 | + * @param string $code |
|
| 1018 | + */ |
|
| 1009 | 1019 | function makeCodeSpan($code) { |
| 1010 | 1020 | # |
| 1011 | 1021 | # Create a code span markup for $code. Called from handleSpanToken. |
@@ -1498,6 +1508,9 @@ discard block |
||
| 1498 | 1508 | # hanlde UTF-8 if the default function does not exist. |
| 1499 | 1509 | public $utf8_strlen = 'mb_strlen'; |
| 1500 | 1510 | |
| 1511 | + /** |
|
| 1512 | + * @param string $text |
|
| 1513 | + */ |
|
| 1501 | 1514 | function detab($text) { |
| 1502 | 1515 | # |
| 1503 | 1516 | # Replace tabs with the appropriate amount of space. |
@@ -2042,6 +2055,12 @@ discard block |
||
| 2042 | 2055 | |
| 2043 | 2056 | return array($parsed, $text); |
| 2044 | 2057 | } |
| 2058 | + |
|
| 2059 | + /** |
|
| 2060 | + * @param string $text |
|
| 2061 | + * @param string $hash_method |
|
| 2062 | + * @param boolean $md_attr |
|
| 2063 | + */ |
|
| 2045 | 2064 | function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { |
| 2046 | 2065 | # |
| 2047 | 2066 | # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags. |
@@ -2706,6 +2725,9 @@ discard block |
||
| 2706 | 2725 | } |
| 2707 | 2726 | |
| 2708 | 2727 | |
| 2728 | + /** |
|
| 2729 | + * @return string |
|
| 2730 | + */ |
|
| 2709 | 2731 | function processDefListItems($list_str) { |
| 2710 | 2732 | # |
| 2711 | 2733 | # Process the contents of a single definition list, splitting it |
@@ -2817,6 +2839,10 @@ discard block |
||
| 2817 | 2839 | |
| 2818 | 2840 | return $text; |
| 2819 | 2841 | } |
| 2842 | + |
|
| 2843 | + /** |
|
| 2844 | + * @param string[] $matches |
|
| 2845 | + */ |
|
| 2820 | 2846 | function _doFencedCodeBlocks_callback($matches) { |
| 2821 | 2847 | $classname =& $matches[2]; |
| 2822 | 2848 | $attrs =& $matches[3]; |
@@ -40,6 +40,7 @@ |
||
| 40 | 40 | * l($arg1, $arg2) will call l($arg1) and l($arg2) and then return $arg1. |
| 41 | 41 | * |
| 42 | 42 | * A null argument will log the file and line number of the l() call. |
| 43 | + * @param string $stuff |
|
| 43 | 44 | */ |
| 44 | 45 | function l( $stuff = null ) { |
| 45 | 46 | // Do nothing when debugging is off |
@@ -1112,7 +1112,7 @@ discard block |
||
| 1112 | 1112 | } |
| 1113 | 1113 | /** |
| 1114 | 1114 | * Does the network allow admins to add new users. |
| 1115 | - * @return boolian |
|
| 1115 | + * @return boolean |
|
| 1116 | 1116 | */ |
| 1117 | 1117 | static function network_add_new_users( $option = null ) { |
| 1118 | 1118 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | * database which could be set to anything as opposed to what this function returns. |
| 1218 | 1218 | * @param bool $option |
| 1219 | 1219 | * |
| 1220 | - * @return boolean |
|
| 1220 | + * @return string |
|
| 1221 | 1221 | */ |
| 1222 | 1222 | public function is_main_network_option( $option ) { |
| 1223 | 1223 | // return '1' or '' |
@@ -1228,7 +1228,7 @@ discard block |
||
| 1228 | 1228 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 1229 | 1229 | * |
| 1230 | 1230 | * @param string $option |
| 1231 | - * @return boolean |
|
| 1231 | + * @return string |
|
| 1232 | 1232 | */ |
| 1233 | 1233 | public function is_multisite( $option ) { |
| 1234 | 1234 | return (string) (bool) is_multisite(); |
@@ -1290,7 +1290,7 @@ discard block |
||
| 1290 | 1290 | |
| 1291 | 1291 | /** |
| 1292 | 1292 | * Returns true if the site has file write access false otherwise. |
| 1293 | - * @return string ( '1' | '0' ) |
|
| 1293 | + * @return integer ( '1' | '0' ) |
|
| 1294 | 1294 | **/ |
| 1295 | 1295 | public static function file_system_write_access() { |
| 1296 | 1296 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2091,6 +2091,7 @@ discard block |
||
| 2091 | 2091 | * @param int $user_id |
| 2092 | 2092 | * @param string $token |
| 2093 | 2093 | * return bool |
| 2094 | + * @param boolean $is_master_user |
|
| 2094 | 2095 | */ |
| 2095 | 2096 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 2096 | 2097 | // not designed for concurrent updates |
@@ -2493,6 +2494,7 @@ discard block |
||
| 2493 | 2494 | |
| 2494 | 2495 | /** |
| 2495 | 2496 | * Like core's get_file_data implementation, but caches the result. |
| 2497 | + * @param string $file |
|
| 2496 | 2498 | */ |
| 2497 | 2499 | public static function get_file_data( $file, $headers ) { |
| 2498 | 2500 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2529,7 +2531,7 @@ discard block |
||
| 2529 | 2531 | * |
| 2530 | 2532 | * @param string $tag Tag as it appears in each module heading. |
| 2531 | 2533 | * |
| 2532 | - * @return mixed |
|
| 2534 | + * @return string |
|
| 2533 | 2535 | */ |
| 2534 | 2536 | public static function translate_module_tag( $tag ) { |
| 2535 | 2537 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2644,8 +2646,8 @@ discard block |
||
| 2644 | 2646 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
| 2645 | 2647 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
| 2646 | 2648 | * |
| 2647 | - * @param $string |
|
| 2648 | - * @return mixed |
|
| 2649 | + * @param string $string |
|
| 2650 | + * @return string|null |
|
| 2649 | 2651 | */ |
| 2650 | 2652 | public static function alias_directories( $string ) { |
| 2651 | 2653 | // ABSPATH has a trailing slash. |
@@ -2925,6 +2927,9 @@ discard block |
||
| 2925 | 2927 | return self::update_active_modules( $new ); |
| 2926 | 2928 | } |
| 2927 | 2929 | |
| 2930 | + /** |
|
| 2931 | + * @param string $module |
|
| 2932 | + */ |
|
| 2928 | 2933 | public static function enable_module_configurable( $module ) { |
| 2929 | 2934 | $module = Jetpack::get_module_slug( $module ); |
| 2930 | 2935 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2935,21 +2940,33 @@ discard block |
||
| 2935 | 2940 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
| 2936 | 2941 | } |
| 2937 | 2942 | |
| 2943 | + /** |
|
| 2944 | + * @param string $module |
|
| 2945 | + */ |
|
| 2938 | 2946 | public static function module_configuration_load( $module, $method ) { |
| 2939 | 2947 | $module = Jetpack::get_module_slug( $module ); |
| 2940 | 2948 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
| 2941 | 2949 | } |
| 2942 | 2950 | |
| 2951 | + /** |
|
| 2952 | + * @param string $module |
|
| 2953 | + */ |
|
| 2943 | 2954 | public static function module_configuration_head( $module, $method ) { |
| 2944 | 2955 | $module = Jetpack::get_module_slug( $module ); |
| 2945 | 2956 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
| 2946 | 2957 | } |
| 2947 | 2958 | |
| 2959 | + /** |
|
| 2960 | + * @param string $module |
|
| 2961 | + */ |
|
| 2948 | 2962 | public static function module_configuration_screen( $module, $method ) { |
| 2949 | 2963 | $module = Jetpack::get_module_slug( $module ); |
| 2950 | 2964 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
| 2951 | 2965 | } |
| 2952 | 2966 | |
| 2967 | + /** |
|
| 2968 | + * @param string $module |
|
| 2969 | + */ |
|
| 2953 | 2970 | public static function module_configuration_activation_screen( $module, $method ) { |
| 2954 | 2971 | $module = Jetpack::get_module_slug( $module ); |
| 2955 | 2972 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2957,6 +2974,9 @@ discard block |
||
| 2957 | 2974 | |
| 2958 | 2975 | /* Installation */ |
| 2959 | 2976 | |
| 2977 | + /** |
|
| 2978 | + * @param string $message |
|
| 2979 | + */ |
|
| 2960 | 2980 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 2961 | 2981 | ?> |
| 2962 | 2982 | <!doctype html> |
@@ -3713,7 +3733,7 @@ discard block |
||
| 3713 | 3733 | * Add help to the Jetpack page |
| 3714 | 3734 | * |
| 3715 | 3735 | * @since Jetpack (1.2.3) |
| 3716 | - * @return false if not the Jetpack page |
|
| 3736 | + * @return false|null if not the Jetpack page |
|
| 3717 | 3737 | */ |
| 3718 | 3738 | function admin_help() { |
| 3719 | 3739 | $current_screen = get_current_screen(); |
@@ -4815,6 +4835,7 @@ discard block |
||
| 4815 | 4835 | /** |
| 4816 | 4836 | * Returns the requested Jetpack API URL |
| 4817 | 4837 | * |
| 4838 | + * @param string $relative_url |
|
| 4818 | 4839 | * @return string |
| 4819 | 4840 | */ |
| 4820 | 4841 | public static function api_url( $relative_url ) { |
@@ -5006,7 +5027,8 @@ discard block |
||
| 5006 | 5027 | * Note these tokens are unique per call, NOT static per site for connecting. |
| 5007 | 5028 | * |
| 5008 | 5029 | * @since 2.6 |
| 5009 | - * @return array |
|
| 5030 | + * @param string $action |
|
| 5031 | + * @return boolean |
|
| 5010 | 5032 | */ |
| 5011 | 5033 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
| 5012 | 5034 | if ( ! $user_id ) { |
@@ -5558,7 +5580,6 @@ discard block |
||
| 5558 | 5580 | /** |
| 5559 | 5581 | * Report authentication status to the WP REST API. |
| 5560 | 5582 | * |
| 5561 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
| 5562 | 5583 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
| 5563 | 5584 | */ |
| 5564 | 5585 | public function wp_rest_authentication_errors( $value ) { |
@@ -5568,6 +5589,10 @@ discard block |
||
| 5568 | 5589 | return $this->rest_authentication_status; |
| 5569 | 5590 | } |
| 5570 | 5591 | |
| 5592 | + /** |
|
| 5593 | + * @param integer $timestamp |
|
| 5594 | + * @param string $nonce |
|
| 5595 | + */ |
|
| 5571 | 5596 | function add_nonce( $timestamp, $nonce ) { |
| 5572 | 5597 | global $wpdb; |
| 5573 | 5598 | static $nonces_used_this_request = array(); |
@@ -5713,6 +5738,7 @@ discard block |
||
| 5713 | 5738 | * @param string $key |
| 5714 | 5739 | * @param string $value |
| 5715 | 5740 | * @param bool $restate private |
| 5741 | + * @return string |
|
| 5716 | 5742 | */ |
| 5717 | 5743 | public static function state( $key = null, $value = null, $restate = false ) { |
| 5718 | 5744 | static $state = array(); |
@@ -5769,6 +5795,9 @@ discard block |
||
| 5769 | 5795 | Jetpack::state( null, null, true ); |
| 5770 | 5796 | } |
| 5771 | 5797 | |
| 5798 | + /** |
|
| 5799 | + * @param string $file |
|
| 5800 | + */ |
|
| 5772 | 5801 | public static function check_privacy( $file ) { |
| 5773 | 5802 | static $is_site_publicly_accessible = null; |
| 5774 | 5803 | |
@@ -6386,9 +6415,7 @@ discard block |
||
| 6386 | 6415 | * |
| 6387 | 6416 | * Attached to `style_loader_src` filter. |
| 6388 | 6417 | * |
| 6389 | - * @param string $tag The tag that would link to the external asset. |
|
| 6390 | 6418 | * @param string $handle The registered handle of the script in question. |
| 6391 | - * @param string $href The url of the asset in question. |
|
| 6392 | 6419 | */ |
| 6393 | 6420 | public static function set_suffix_on_min( $src, $handle ) { |
| 6394 | 6421 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6558,8 +6585,8 @@ discard block |
||
| 6558 | 6585 | * - Absolute URLs `http://domain.com/feh.png` |
| 6559 | 6586 | * - Domain root relative URLs `/feh.png` |
| 6560 | 6587 | * |
| 6561 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 6562 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6588 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 6589 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6563 | 6590 | * |
| 6564 | 6591 | * @return mixed|string |
| 6565 | 6592 | */ |
@@ -6788,7 +6815,7 @@ discard block |
||
| 6788 | 6815 | * |
| 6789 | 6816 | * @param string $option_name |
| 6790 | 6817 | * |
| 6791 | - * @return bool |
|
| 6818 | + * @return false|null |
|
| 6792 | 6819 | */ |
| 6793 | 6820 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
| 6794 | 6821 | // Bail if Jump Start has already been dismissed |
@@ -6829,7 +6856,7 @@ discard block |
||
| 6829 | 6856 | /** |
| 6830 | 6857 | * Stores and prints out domains to prefetch for page speed optimization. |
| 6831 | 6858 | * |
| 6832 | - * @param mixed $new_urls |
|
| 6859 | + * @param string[] $new_urls |
|
| 6833 | 6860 | */ |
| 6834 | 6861 | public static function dns_prefetch( $new_urls = null ) { |
| 6835 | 6862 | static $prefetch_urls = array(); |
@@ -6875,7 +6902,6 @@ discard block |
||
| 6875 | 6902 | } |
| 6876 | 6903 | |
| 6877 | 6904 | /** |
| 6878 | - * @param mixed $result Value for the user's option |
|
| 6879 | 6905 | * @return mixed |
| 6880 | 6906 | */ |
| 6881 | 6907 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | /** |
| 293 | 293 | * Get the current user id |
| 294 | 294 | * |
| 295 | - * @return int |
|
| 295 | + * @return string |
|
| 296 | 296 | */ |
| 297 | 297 | public function get_user_id() { |
| 298 | 298 | if ( is_user_logged_in() ) { |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | /** |
| 326 | 326 | * @param $product_id |
| 327 | 327 | * @param $quantity |
| 328 | - * @param $event |
|
| 328 | + * @param string $event |
|
| 329 | 329 | */ |
| 330 | 330 | public function capture_event_in_session_data( $product_id, $quantity, $event ) { |
| 331 | 331 | |
@@ -249,6 +249,9 @@ |
||
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | + /** |
|
| 253 | + * @param string $access_token |
|
| 254 | + */ |
|
| 252 | 255 | private static function verify_token( $access_token ) { |
| 253 | 256 | $request = array( |
| 254 | 257 | 'headers' => array( |