@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * Validate the require two step checkbox in Settings > General |
263 | 263 | * |
264 | 264 | * @since 2.7 |
265 | - * @return boolean |
|
265 | + * @return integer |
|
266 | 266 | **/ |
267 | 267 | public function validate_jetpack_sso_require_two_step( $input ) { |
268 | 268 | return ( ! empty( $input ) ) ? 1 : 0; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | * Validate the match by email check in Settings > General |
288 | 288 | * |
289 | 289 | * @since 2.9 |
290 | - * @return boolean |
|
290 | + * @return integer |
|
291 | 291 | **/ |
292 | 292 | public function validate_jetpack_sso_match_by_email( $input ) { |
293 | 293 | return ( ! empty( $input ) ) ? 1 : 0; |
@@ -1018,7 +1018,7 @@ discard block |
||
1018 | 1018 | } |
1019 | 1019 | /** |
1020 | 1020 | * Does the network allow admins to add new users. |
1021 | - * @return boolian |
|
1021 | + * @return boolean |
|
1022 | 1022 | */ |
1023 | 1023 | static function network_add_new_users( $option = null ) { |
1024 | 1024 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1066,7 +1066,7 @@ discard block |
||
1066 | 1066 | * database which could be set to anything as opposed to what this function returns. |
1067 | 1067 | * @param bool $option |
1068 | 1068 | * |
1069 | - * @return boolean |
|
1069 | + * @return string |
|
1070 | 1070 | */ |
1071 | 1071 | public function is_main_network_option( $option ) { |
1072 | 1072 | // return '1' or '' |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1078 | 1078 | * |
1079 | 1079 | * @param string $option |
1080 | - * @return boolean |
|
1080 | + * @return string |
|
1081 | 1081 | */ |
1082 | 1082 | public function is_multisite( $option ) { |
1083 | 1083 | return (string) (bool) is_multisite(); |
@@ -1175,7 +1175,7 @@ discard block |
||
1175 | 1175 | |
1176 | 1176 | /** |
1177 | 1177 | * Returns true if the site has file write access false otherwise. |
1178 | - * @return string ( '1' | '0' ) |
|
1178 | + * @return integer ( '1' | '0' ) |
|
1179 | 1179 | **/ |
1180 | 1180 | public static function file_system_write_access() { |
1181 | 1181 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1985,7 +1985,7 @@ discard block |
||
1985 | 1985 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
1986 | 1986 | * |
1987 | 1987 | * @param string $name Option name |
1988 | - * @param mixed $default (optional) |
|
1988 | + * @param boolean $default (optional) |
|
1989 | 1989 | */ |
1990 | 1990 | public static function get_option( $name, $default = false ) { |
1991 | 1991 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1995,6 +1995,7 @@ discard block |
||
1995 | 1995 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
1996 | 1996 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
1997 | 1997 | * $name must be a registered option name. |
1998 | + * @param string $name |
|
1998 | 1999 | */ |
1999 | 2000 | public static function create_nonce( $name ) { |
2000 | 2001 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -2052,6 +2053,7 @@ discard block |
||
2052 | 2053 | * @param int $user_id |
2053 | 2054 | * @param string $token |
2054 | 2055 | * return bool |
2056 | + * @param boolean $is_master_user |
|
2055 | 2057 | */ |
2056 | 2058 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2057 | 2059 | // not designed for concurrent updates |
@@ -2446,6 +2448,7 @@ discard block |
||
2446 | 2448 | |
2447 | 2449 | /** |
2448 | 2450 | * Like core's get_file_data implementation, but caches the result. |
2451 | + * @param string $file |
|
2449 | 2452 | */ |
2450 | 2453 | public static function get_file_data( $file, $headers ) { |
2451 | 2454 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2474,7 +2477,7 @@ discard block |
||
2474 | 2477 | * |
2475 | 2478 | * @param string $tag Tag as it appears in each module heading. |
2476 | 2479 | * |
2477 | - * @return mixed |
|
2480 | + * @return string |
|
2478 | 2481 | */ |
2479 | 2482 | public static function translate_module_tag( $tag ) { |
2480 | 2483 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2792,6 +2795,9 @@ discard block |
||
2792 | 2795 | $this->sync->sync_all_module_options( $module ); |
2793 | 2796 | } |
2794 | 2797 | |
2798 | + /** |
|
2799 | + * @return string |
|
2800 | + */ |
|
2795 | 2801 | public static function deactivate_module( $module ) { |
2796 | 2802 | /** |
2797 | 2803 | * Fires when a module is deactivated. |
@@ -2830,6 +2836,9 @@ discard block |
||
2830 | 2836 | return Jetpack_Options::update_option( 'active_modules', array_unique( $new ) ); |
2831 | 2837 | } |
2832 | 2838 | |
2839 | + /** |
|
2840 | + * @param string $module |
|
2841 | + */ |
|
2833 | 2842 | public static function enable_module_configurable( $module ) { |
2834 | 2843 | $module = Jetpack::get_module_slug( $module ); |
2835 | 2844 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2840,21 +2849,33 @@ discard block |
||
2840 | 2849 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2841 | 2850 | } |
2842 | 2851 | |
2852 | + /** |
|
2853 | + * @param string $module |
|
2854 | + */ |
|
2843 | 2855 | public static function module_configuration_load( $module, $method ) { |
2844 | 2856 | $module = Jetpack::get_module_slug( $module ); |
2845 | 2857 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2846 | 2858 | } |
2847 | 2859 | |
2860 | + /** |
|
2861 | + * @param string $module |
|
2862 | + */ |
|
2848 | 2863 | public static function module_configuration_head( $module, $method ) { |
2849 | 2864 | $module = Jetpack::get_module_slug( $module ); |
2850 | 2865 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2851 | 2866 | } |
2852 | 2867 | |
2868 | + /** |
|
2869 | + * @param string $module |
|
2870 | + */ |
|
2853 | 2871 | public static function module_configuration_screen( $module, $method ) { |
2854 | 2872 | $module = Jetpack::get_module_slug( $module ); |
2855 | 2873 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2856 | 2874 | } |
2857 | 2875 | |
2876 | + /** |
|
2877 | + * @param string $module |
|
2878 | + */ |
|
2858 | 2879 | public static function module_configuration_activation_screen( $module, $method ) { |
2859 | 2880 | $module = Jetpack::get_module_slug( $module ); |
2860 | 2881 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2862,6 +2883,9 @@ discard block |
||
2862 | 2883 | |
2863 | 2884 | /* Installation */ |
2864 | 2885 | |
2886 | + /** |
|
2887 | + * @param string $message |
|
2888 | + */ |
|
2865 | 2889 | public static function bail_on_activation( $message, $deactivate = true ) { |
2866 | 2890 | ?> |
2867 | 2891 | <!doctype html> |
@@ -3484,7 +3508,7 @@ discard block |
||
3484 | 3508 | * Add help to the Jetpack page |
3485 | 3509 | * |
3486 | 3510 | * @since Jetpack (1.2.3) |
3487 | - * @return false if not the Jetpack page |
|
3511 | + * @return false|null if not the Jetpack page |
|
3488 | 3512 | */ |
3489 | 3513 | function admin_help() { |
3490 | 3514 | $current_screen = get_current_screen(); |
@@ -4805,6 +4829,7 @@ discard block |
||
4805 | 4829 | /** |
4806 | 4830 | * Returns the requested Jetpack API URL |
4807 | 4831 | * |
4832 | + * @param string $relative_url |
|
4808 | 4833 | * @return string |
4809 | 4834 | */ |
4810 | 4835 | public static function api_url( $relative_url ) { |
@@ -4946,7 +4971,7 @@ discard block |
||
4946 | 4971 | * Note these tokens are unique per call, NOT static per site for connecting. |
4947 | 4972 | * |
4948 | 4973 | * @since 2.6 |
4949 | - * @return array |
|
4974 | + * @return string |
|
4950 | 4975 | */ |
4951 | 4976 | public function generate_secrets( $action, $exp = 600 ) { |
4952 | 4977 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -5266,6 +5291,10 @@ discard block |
||
5266 | 5291 | return new WP_User( $token_details['user_id'] ); |
5267 | 5292 | } |
5268 | 5293 | |
5294 | + /** |
|
5295 | + * @param integer $timestamp |
|
5296 | + * @param string $nonce |
|
5297 | + */ |
|
5269 | 5298 | function add_nonce( $timestamp, $nonce ) { |
5270 | 5299 | global $wpdb; |
5271 | 5300 | static $nonces_used_this_request = array(); |
@@ -5471,6 +5500,9 @@ discard block |
||
5471 | 5500 | Jetpack::state( null, null, true ); |
5472 | 5501 | } |
5473 | 5502 | |
5503 | + /** |
|
5504 | + * @param string $file |
|
5505 | + */ |
|
5474 | 5506 | public static function check_privacy( $file ) { |
5475 | 5507 | static $is_site_publicly_accessible = null; |
5476 | 5508 | |
@@ -5798,7 +5830,7 @@ discard block |
||
5798 | 5830 | /** |
5799 | 5831 | * Pings the WordPress.com Mirror Site for the specified options. |
5800 | 5832 | * |
5801 | - * @param string|array $option_names The option names to request from the WordPress.com Mirror Site |
|
5833 | + * @param string[] $option_names The option names to request from the WordPress.com Mirror Site |
|
5802 | 5834 | * |
5803 | 5835 | * @return array An associative array of the option values as stored in the WordPress.com Mirror Site |
5804 | 5836 | */ |
@@ -5822,7 +5854,7 @@ discard block |
||
5822 | 5854 | /** |
5823 | 5855 | * Fetch the filtered array of options that we should compare to determine an identity crisis. |
5824 | 5856 | * |
5825 | - * @return array An array of options to check. |
|
5857 | + * @return string[] An array of options to check. |
|
5826 | 5858 | */ |
5827 | 5859 | public static function identity_crisis_options_to_check() { |
5828 | 5860 | return array( |
@@ -6494,8 +6526,8 @@ discard block |
||
6494 | 6526 | * - Absolute URLs `http://domain.com/feh.png` |
6495 | 6527 | * - Domain root relative URLs `/feh.png` |
6496 | 6528 | * |
6497 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6498 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6529 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6530 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6499 | 6531 | * |
6500 | 6532 | * @return mixed|string |
6501 | 6533 | */ |
@@ -6803,7 +6835,7 @@ discard block |
||
6803 | 6835 | * |
6804 | 6836 | * @param string $option_name |
6805 | 6837 | * |
6806 | - * @return bool |
|
6838 | + * @return false|null |
|
6807 | 6839 | */ |
6808 | 6840 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6809 | 6841 | // Bail if Jump Start has already been dismissed |
@@ -6894,7 +6926,6 @@ discard block |
||
6894 | 6926 | } |
6895 | 6927 | |
6896 | 6928 | /** |
6897 | - * @param mixed $result Value for the user's option |
|
6898 | 6929 | * @return mixed |
6899 | 6930 | */ |
6900 | 6931 | function get_user_option_meta_box_order_dashboard( $sorted ) { |