@@ -188,6 +188,9 @@ discard block |
||
188 | 188 | ); |
189 | 189 | } |
190 | 190 | |
191 | + /** |
|
192 | + * @param string $meta_type |
|
193 | + */ |
|
191 | 194 | private function get_metadata( $ids, $meta_type ) { |
192 | 195 | global $wpdb; |
193 | 196 | $table = _get_meta_table( $meta_type ); |
@@ -214,6 +217,10 @@ discard block |
||
214 | 217 | $this->set_status("updates", 100); |
215 | 218 | } |
216 | 219 | |
220 | + /** |
|
221 | + * @param string $name |
|
222 | + * @param integer $percent |
|
223 | + */ |
|
217 | 224 | private function set_status( $name, $percent, $count = 1, $total =1 ) { |
218 | 225 | set_transient( self::$status_transient_name.'_'.$name, |
219 | 226 | array( |
@@ -7,6 +7,9 @@ discard block |
||
7 | 7 | public $id; |
8 | 8 | public $items_with_ids; |
9 | 9 | |
10 | + /** |
|
11 | + * @param string $id |
|
12 | + */ |
|
10 | 13 | public function __construct( $id, $items_with_ids ) { |
11 | 14 | $this->id = $id; |
12 | 15 | $this->items_with_ids = $items_with_ids; |
@@ -31,6 +34,9 @@ discard block |
||
31 | 34 | public $id; |
32 | 35 | private $row_iterator; |
33 | 36 | |
37 | + /** |
|
38 | + * @param string $id |
|
39 | + */ |
|
34 | 40 | function __construct( $id ) { |
35 | 41 | $this->id = str_replace( '-', '_', $id ); // necessary to ensure we don't have ID collisions in the SQL |
36 | 42 | $this->row_iterator = 0; |
@@ -303,6 +309,9 @@ discard block |
||
303 | 309 | return get_transient( $this->get_checkout_transient_name() ); |
304 | 310 | } |
305 | 311 | |
312 | + /** |
|
313 | + * @param string $checkout_id |
|
314 | + */ |
|
306 | 315 | private function set_checkout_id( $checkout_id ) { |
307 | 316 | return set_transient( $this->get_checkout_transient_name(), $checkout_id, 5*60 ); // 5 minute timeout |
308 | 317 | } |
@@ -195,21 +195,36 @@ discard block |
||
195 | 195 | $this->network_options_whitelist = $options; |
196 | 196 | } |
197 | 197 | |
198 | + /** |
|
199 | + * @param integer $size |
|
200 | + */ |
|
198 | 201 | function set_send_buffer_memory_size( $size ) { |
199 | 202 | $this->checkout_memory_size = $size; |
200 | 203 | } |
201 | 204 | |
202 | 205 | // in bytes |
206 | + |
|
207 | + /** |
|
208 | + * @param integer $max_bytes |
|
209 | + */ |
|
203 | 210 | function set_upload_max_bytes( $max_bytes ) { |
204 | 211 | $this->upload_max_bytes = $max_bytes; |
205 | 212 | } |
206 | 213 | |
207 | 214 | // in rows |
215 | + |
|
216 | + /** |
|
217 | + * @param integer $max_rows |
|
218 | + */ |
|
208 | 219 | function set_upload_max_rows( $max_rows ) { |
209 | 220 | $this->upload_max_rows = $max_rows; |
210 | 221 | } |
211 | 222 | |
212 | 223 | // in seconds |
224 | + |
|
225 | + /** |
|
226 | + * @param integer $seconds |
|
227 | + */ |
|
213 | 228 | function set_min_sync_wait_time( $seconds ) { |
214 | 229 | update_option( self::SYNC_THROTTLE_OPTION_NAME, $seconds, true ); |
215 | 230 | } |
@@ -476,6 +491,9 @@ discard block |
||
476 | 491 | } |
477 | 492 | } |
478 | 493 | |
494 | + /** |
|
495 | + * @param string $action_name |
|
496 | + */ |
|
479 | 497 | private function buffer_includes_action( $buffer, $action_name ) { |
480 | 498 | foreach ( $buffer->get_items() as $item ) { |
481 | 499 | if ( $item[0] === $action_name ) { |
@@ -505,6 +523,9 @@ discard block |
||
505 | 523 | return $post; |
506 | 524 | } |
507 | 525 | |
526 | + /** |
|
527 | + * @param string $when |
|
528 | + */ |
|
508 | 529 | private function schedule_sync( $when ) { |
509 | 530 | wp_schedule_single_event( strtotime( $when ), 'jetpack_sync_actions' ); |
510 | 531 | } |
@@ -338,6 +338,10 @@ |
||
338 | 338 | } |
339 | 339 | |
340 | 340 | // functions |
341 | + |
|
342 | + /** |
|
343 | + * @param string $name |
|
344 | + */ |
|
341 | 345 | public function get_callable( $name ) { |
342 | 346 | $value = get_option( 'jetpack_' . $name ); |
343 | 347 |
@@ -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> |
@@ -3475,7 +3499,7 @@ discard block |
||
3475 | 3499 | * Add help to the Jetpack page |
3476 | 3500 | * |
3477 | 3501 | * @since Jetpack (1.2.3) |
3478 | - * @return false if not the Jetpack page |
|
3502 | + * @return false|null if not the Jetpack page |
|
3479 | 3503 | */ |
3480 | 3504 | function admin_help() { |
3481 | 3505 | $current_screen = get_current_screen(); |
@@ -4791,6 +4815,7 @@ discard block |
||
4791 | 4815 | /** |
4792 | 4816 | * Returns the requested Jetpack API URL |
4793 | 4817 | * |
4818 | + * @param string $relative_url |
|
4794 | 4819 | * @return string |
4795 | 4820 | */ |
4796 | 4821 | public static function api_url( $relative_url ) { |
@@ -4932,7 +4957,8 @@ discard block |
||
4932 | 4957 | * Note these tokens are unique per call, NOT static per site for connecting. |
4933 | 4958 | * |
4934 | 4959 | * @since 2.6 |
4935 | - * @return array |
|
4960 | + * @param string $action |
|
4961 | + * @return string |
|
4936 | 4962 | */ |
4937 | 4963 | public function generate_secrets( $action ) { |
4938 | 4964 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -5253,6 +5279,10 @@ discard block |
||
5253 | 5279 | return new WP_User( $token_details['user_id'] ); |
5254 | 5280 | } |
5255 | 5281 | |
5282 | + /** |
|
5283 | + * @param integer $timestamp |
|
5284 | + * @param string $nonce |
|
5285 | + */ |
|
5256 | 5286 | function add_nonce( $timestamp, $nonce ) { |
5257 | 5287 | global $wpdb; |
5258 | 5288 | static $nonces_used_this_request = array(); |
@@ -5458,6 +5488,9 @@ discard block |
||
5458 | 5488 | Jetpack::state( null, null, true ); |
5459 | 5489 | } |
5460 | 5490 | |
5491 | + /** |
|
5492 | + * @param string $file |
|
5493 | + */ |
|
5461 | 5494 | public static function check_privacy( $file ) { |
5462 | 5495 | static $is_site_publicly_accessible = null; |
5463 | 5496 | |
@@ -5785,7 +5818,7 @@ discard block |
||
5785 | 5818 | /** |
5786 | 5819 | * Pings the WordPress.com Mirror Site for the specified options. |
5787 | 5820 | * |
5788 | - * @param string|array $option_names The option names to request from the WordPress.com Mirror Site |
|
5821 | + * @param string[] $option_names The option names to request from the WordPress.com Mirror Site |
|
5789 | 5822 | * |
5790 | 5823 | * @return array An associative array of the option values as stored in the WordPress.com Mirror Site |
5791 | 5824 | */ |
@@ -5809,7 +5842,7 @@ discard block |
||
5809 | 5842 | /** |
5810 | 5843 | * Fetch the filtered array of options that we should compare to determine an identity crisis. |
5811 | 5844 | * |
5812 | - * @return array An array of options to check. |
|
5845 | + * @return string[] An array of options to check. |
|
5813 | 5846 | */ |
5814 | 5847 | public static function identity_crisis_options_to_check() { |
5815 | 5848 | return array( |
@@ -6481,8 +6514,8 @@ discard block |
||
6481 | 6514 | * - Absolute URLs `http://domain.com/feh.png` |
6482 | 6515 | * - Domain root relative URLs `/feh.png` |
6483 | 6516 | * |
6484 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6485 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6517 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6518 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6486 | 6519 | * |
6487 | 6520 | * @return mixed|string |
6488 | 6521 | */ |
@@ -6790,7 +6823,7 @@ discard block |
||
6790 | 6823 | * |
6791 | 6824 | * @param string $option_name |
6792 | 6825 | * |
6793 | - * @return bool |
|
6826 | + * @return false|null |
|
6794 | 6827 | */ |
6795 | 6828 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6796 | 6829 | // Bail if Jump Start has already been dismissed |
@@ -6881,7 +6914,6 @@ discard block |
||
6881 | 6914 | } |
6882 | 6915 | |
6883 | 6916 | /** |
6884 | - * @param mixed $result Value for the user's option |
|
6885 | 6917 | * @return mixed |
6886 | 6918 | */ |
6887 | 6919 | function get_user_option_meta_box_order_dashboard( $sorted ) { |