@@ -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; |
@@ -35,6 +38,9 @@ discard block |
||
35 | 38 | public $id; |
36 | 39 | private $row_iterator; |
37 | 40 | |
41 | + /** |
|
42 | + * @param string $id |
|
43 | + */ |
|
38 | 44 | function __construct( $id ) { |
39 | 45 | $this->id = str_replace( '-', '_', $id ); // necessary to ensure we don't have ID collisions in the SQL |
40 | 46 | $this->row_iterator = 0; |
@@ -312,6 +318,9 @@ discard block |
||
312 | 318 | return get_transient( $this->get_checkout_transient_name() ); |
313 | 319 | } |
314 | 320 | |
321 | + /** |
|
322 | + * @param string $checkout_id |
|
323 | + */ |
|
315 | 324 | private function set_checkout_id( $checkout_id ) { |
316 | 325 | return set_transient( $this->get_checkout_transient_name(), $checkout_id, 5 * 60 ); // 5 minute timeout |
317 | 326 | } |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | } |
883 | 883 | /** |
884 | 884 | * Does the network allow admins to add new users. |
885 | - * @return boolian |
|
885 | + * @return boolean |
|
886 | 886 | */ |
887 | 887 | static function network_add_new_users( $option = null ) { |
888 | 888 | return (bool) get_site_option( 'add_new_users' ); |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | * database which could be set to anything as opposed to what this function returns. |
931 | 931 | * @param bool $option |
932 | 932 | * |
933 | - * @return boolean |
|
933 | + * @return string |
|
934 | 934 | */ |
935 | 935 | public function is_main_network_option( $option ) { |
936 | 936 | // return '1' or '' |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
942 | 942 | * |
943 | 943 | * @param string $option |
944 | - * @return boolean |
|
944 | + * @return string |
|
945 | 945 | */ |
946 | 946 | public function is_multisite( $option ) { |
947 | 947 | return (string) (bool) is_multisite(); |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | |
1040 | 1040 | /** |
1041 | 1041 | * Returns true if the site has file write access false otherwise. |
1042 | - * @return string ( '1' | '0' ) |
|
1042 | + * @return integer ( '1' | '0' ) |
|
1043 | 1043 | **/ |
1044 | 1044 | public static function file_system_write_access() { |
1045 | 1045 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1803,7 +1803,7 @@ discard block |
||
1803 | 1803 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
1804 | 1804 | * |
1805 | 1805 | * @param string $name Option name |
1806 | - * @param mixed $default (optional) |
|
1806 | + * @param boolean $default (optional) |
|
1807 | 1807 | */ |
1808 | 1808 | public static function get_option( $name, $default = false ) { |
1809 | 1809 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1813,6 +1813,7 @@ discard block |
||
1813 | 1813 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
1814 | 1814 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
1815 | 1815 | * $name must be a registered option name. |
1816 | + * @param string $name |
|
1816 | 1817 | */ |
1817 | 1818 | public static function create_nonce( $name ) { |
1818 | 1819 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -1870,6 +1871,7 @@ discard block |
||
1870 | 1871 | * @param int $user_id |
1871 | 1872 | * @param string $token |
1872 | 1873 | * return bool |
1874 | + * @param boolean $is_master_user |
|
1873 | 1875 | */ |
1874 | 1876 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
1875 | 1877 | // not designed for concurrent updates |
@@ -2264,6 +2266,7 @@ discard block |
||
2264 | 2266 | |
2265 | 2267 | /** |
2266 | 2268 | * Like core's get_file_data implementation, but caches the result. |
2269 | + * @param string $file |
|
2267 | 2270 | */ |
2268 | 2271 | public static function get_file_data( $file, $headers ) { |
2269 | 2272 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2292,7 +2295,7 @@ discard block |
||
2292 | 2295 | * |
2293 | 2296 | * @param string $tag Tag as it appears in each module heading. |
2294 | 2297 | * |
2295 | - * @return mixed |
|
2298 | + * @return string |
|
2296 | 2299 | */ |
2297 | 2300 | public static function translate_module_tag( $tag ) { |
2298 | 2301 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2608,6 +2611,9 @@ discard block |
||
2608 | 2611 | do_action( "jetpack_activate_module_$module", $module ); |
2609 | 2612 | } |
2610 | 2613 | |
2614 | + /** |
|
2615 | + * @return string |
|
2616 | + */ |
|
2611 | 2617 | public static function deactivate_module( $module ) { |
2612 | 2618 | /** |
2613 | 2619 | * Fires when a module is deactivated. |
@@ -2657,6 +2663,9 @@ discard block |
||
2657 | 2663 | return $success; |
2658 | 2664 | } |
2659 | 2665 | |
2666 | + /** |
|
2667 | + * @param string $module |
|
2668 | + */ |
|
2660 | 2669 | public static function enable_module_configurable( $module ) { |
2661 | 2670 | $module = Jetpack::get_module_slug( $module ); |
2662 | 2671 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2667,21 +2676,33 @@ discard block |
||
2667 | 2676 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2668 | 2677 | } |
2669 | 2678 | |
2679 | + /** |
|
2680 | + * @param string $module |
|
2681 | + */ |
|
2670 | 2682 | public static function module_configuration_load( $module, $method ) { |
2671 | 2683 | $module = Jetpack::get_module_slug( $module ); |
2672 | 2684 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2673 | 2685 | } |
2674 | 2686 | |
2687 | + /** |
|
2688 | + * @param string $module |
|
2689 | + */ |
|
2675 | 2690 | public static function module_configuration_head( $module, $method ) { |
2676 | 2691 | $module = Jetpack::get_module_slug( $module ); |
2677 | 2692 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2678 | 2693 | } |
2679 | 2694 | |
2695 | + /** |
|
2696 | + * @param string $module |
|
2697 | + */ |
|
2680 | 2698 | public static function module_configuration_screen( $module, $method ) { |
2681 | 2699 | $module = Jetpack::get_module_slug( $module ); |
2682 | 2700 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2683 | 2701 | } |
2684 | 2702 | |
2703 | + /** |
|
2704 | + * @param string $module |
|
2705 | + */ |
|
2685 | 2706 | public static function module_configuration_activation_screen( $module, $method ) { |
2686 | 2707 | $module = Jetpack::get_module_slug( $module ); |
2687 | 2708 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2689,6 +2710,9 @@ discard block |
||
2689 | 2710 | |
2690 | 2711 | /* Installation */ |
2691 | 2712 | |
2713 | + /** |
|
2714 | + * @param string $message |
|
2715 | + */ |
|
2692 | 2716 | public static function bail_on_activation( $message, $deactivate = true ) { |
2693 | 2717 | ?> |
2694 | 2718 | <!doctype html> |
@@ -3306,7 +3330,7 @@ discard block |
||
3306 | 3330 | * Add help to the Jetpack page |
3307 | 3331 | * |
3308 | 3332 | * @since Jetpack (1.2.3) |
3309 | - * @return false if not the Jetpack page |
|
3333 | + * @return false|null if not the Jetpack page |
|
3310 | 3334 | */ |
3311 | 3335 | function admin_help() { |
3312 | 3336 | $current_screen = get_current_screen(); |
@@ -4348,6 +4372,7 @@ discard block |
||
4348 | 4372 | /** |
4349 | 4373 | * Returns the requested Jetpack API URL |
4350 | 4374 | * |
4375 | + * @param string $relative_url |
|
4351 | 4376 | * @return string |
4352 | 4377 | */ |
4353 | 4378 | public static function api_url( $relative_url ) { |
@@ -4489,7 +4514,8 @@ discard block |
||
4489 | 4514 | * Note these tokens are unique per call, NOT static per site for connecting. |
4490 | 4515 | * |
4491 | 4516 | * @since 2.6 |
4492 | - * @return array |
|
4517 | + * @param string $action |
|
4518 | + * @return string |
|
4493 | 4519 | */ |
4494 | 4520 | public function generate_secrets( $action, $exp = 600 ) { |
4495 | 4521 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -4809,6 +4835,10 @@ discard block |
||
4809 | 4835 | return new WP_User( $token_details['user_id'] ); |
4810 | 4836 | } |
4811 | 4837 | |
4838 | + /** |
|
4839 | + * @param integer $timestamp |
|
4840 | + * @param string $nonce |
|
4841 | + */ |
|
4812 | 4842 | function add_nonce( $timestamp, $nonce ) { |
4813 | 4843 | global $wpdb; |
4814 | 4844 | static $nonces_used_this_request = array(); |
@@ -5014,6 +5044,9 @@ discard block |
||
5014 | 5044 | Jetpack::state( null, null, true ); |
5015 | 5045 | } |
5016 | 5046 | |
5047 | + /** |
|
5048 | + * @param string $file |
|
5049 | + */ |
|
5017 | 5050 | public static function check_privacy( $file ) { |
5018 | 5051 | static $is_site_publicly_accessible = null; |
5019 | 5052 | |
@@ -5341,7 +5374,7 @@ discard block |
||
5341 | 5374 | /** |
5342 | 5375 | * Pings the WordPress.com Mirror Site for the specified options. |
5343 | 5376 | * |
5344 | - * @param string|array $option_names The option names to request from the WordPress.com Mirror Site |
|
5377 | + * @param string[] $option_names The option names to request from the WordPress.com Mirror Site |
|
5345 | 5378 | * |
5346 | 5379 | * @return array An associative array of the option values as stored in the WordPress.com Mirror Site |
5347 | 5380 | */ |
@@ -5365,7 +5398,7 @@ discard block |
||
5365 | 5398 | /** |
5366 | 5399 | * Fetch the filtered array of options that we should compare to determine an identity crisis. |
5367 | 5400 | * |
5368 | - * @return array An array of options to check. |
|
5401 | + * @return string[] An array of options to check. |
|
5369 | 5402 | */ |
5370 | 5403 | public static function identity_crisis_options_to_check() { |
5371 | 5404 | return array( |
@@ -6021,8 +6054,8 @@ discard block |
||
6021 | 6054 | * - Absolute URLs `http://domain.com/feh.png` |
6022 | 6055 | * - Domain root relative URLs `/feh.png` |
6023 | 6056 | * |
6024 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6025 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6057 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6058 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6026 | 6059 | * |
6027 | 6060 | * @return mixed|string |
6028 | 6061 | */ |
@@ -6331,7 +6364,7 @@ discard block |
||
6331 | 6364 | * |
6332 | 6365 | * @param string $option_name |
6333 | 6366 | * |
6334 | - * @return bool |
|
6367 | + * @return false|null |
|
6335 | 6368 | */ |
6336 | 6369 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
6337 | 6370 | // Bail if Jump Start has already been dismissed |
@@ -6422,7 +6455,6 @@ discard block |
||
6422 | 6455 | } |
6423 | 6456 | |
6424 | 6457 | /** |
6425 | - * @param mixed $result Value for the user's option |
|
6426 | 6458 | * @return mixed |
6427 | 6459 | */ |
6428 | 6460 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -565,6 +565,9 @@ discard block |
||
565 | 565 | } |
566 | 566 | } |
567 | 567 | |
568 | + /** |
|
569 | + * @param string $action_name |
|
570 | + */ |
|
568 | 571 | private function buffer_includes_action( $buffer, $action_name ) { |
569 | 572 | foreach ( $buffer->get_items() as $item ) { |
570 | 573 | if ( $item[0] === $action_name ) { |
@@ -622,6 +625,9 @@ discard block |
||
622 | 625 | return $comment; |
623 | 626 | } |
624 | 627 | |
628 | + /** |
|
629 | + * @param string $when |
|
630 | + */ |
|
625 | 631 | private function schedule_sync( $when ) { |
626 | 632 | wp_schedule_single_event( strtotime( $when ), 'jetpack_sync_actions' ); |
627 | 633 | } |