@@ -256,7 +256,7 @@ |
||
| 256 | 256 | |
| 257 | 257 | /** |
| 258 | 258 | * Check the reasons to bail before we attempt to insert ads. |
| 259 | - * @return true if we should bail (don't insert ads) |
|
| 259 | + * @return boolean if we should bail (don't insert ads) |
|
| 260 | 260 | * |
| 261 | 261 | * @since 0.1 |
| 262 | 262 | */ |
@@ -877,7 +877,7 @@ discard block |
||
| 877 | 877 | } |
| 878 | 878 | /** |
| 879 | 879 | * Does the network allow admins to add new users. |
| 880 | - * @return boolian |
|
| 880 | + * @return boolean |
|
| 881 | 881 | */ |
| 882 | 882 | static function network_add_new_users( $option = null ) { |
| 883 | 883 | return (bool) get_site_option( 'add_new_users' ); |
@@ -977,7 +977,7 @@ discard block |
||
| 977 | 977 | * database which could be set to anything as opposed to what this function returns. |
| 978 | 978 | * @param bool $option |
| 979 | 979 | * |
| 980 | - * @return boolean |
|
| 980 | + * @return string |
|
| 981 | 981 | */ |
| 982 | 982 | public function is_main_network_option( $option ) { |
| 983 | 983 | // return '1' or '' |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 989 | 989 | * |
| 990 | 990 | * @param string $option |
| 991 | - * @return boolean |
|
| 991 | + * @return string |
|
| 992 | 992 | */ |
| 993 | 993 | public function is_multisite( $option ) { |
| 994 | 994 | return (string) (bool) is_multisite(); |
@@ -1046,7 +1046,7 @@ discard block |
||
| 1046 | 1046 | |
| 1047 | 1047 | /** |
| 1048 | 1048 | * Returns true if the site has file write access false otherwise. |
| 1049 | - * @return string ( '1' | '0' ) |
|
| 1049 | + * @return integer ( '1' | '0' ) |
|
| 1050 | 1050 | **/ |
| 1051 | 1051 | public static function file_system_write_access() { |
| 1052 | 1052 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1630,6 +1630,7 @@ discard block |
||
| 1630 | 1630 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
| 1631 | 1631 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
| 1632 | 1632 | * $name must be a registered option name. |
| 1633 | + * @param string $name |
|
| 1633 | 1634 | */ |
| 1634 | 1635 | public static function create_nonce( $name ) { |
| 1635 | 1636 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -1687,6 +1688,7 @@ discard block |
||
| 1687 | 1688 | * @param int $user_id |
| 1688 | 1689 | * @param string $token |
| 1689 | 1690 | * return bool |
| 1691 | + * @param boolean $is_master_user |
|
| 1690 | 1692 | */ |
| 1691 | 1693 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 1692 | 1694 | // not designed for concurrent updates |
@@ -2081,6 +2083,7 @@ discard block |
||
| 2081 | 2083 | |
| 2082 | 2084 | /** |
| 2083 | 2085 | * Like core's get_file_data implementation, but caches the result. |
| 2086 | + * @param string $file |
|
| 2084 | 2087 | */ |
| 2085 | 2088 | public static function get_file_data( $file, $headers ) { |
| 2086 | 2089 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2109,7 +2112,7 @@ discard block |
||
| 2109 | 2112 | * |
| 2110 | 2113 | * @param string $tag Tag as it appears in each module heading. |
| 2111 | 2114 | * |
| 2112 | - * @return mixed |
|
| 2115 | + * @return string |
|
| 2113 | 2116 | */ |
| 2114 | 2117 | public static function translate_module_tag( $tag ) { |
| 2115 | 2118 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2122,7 +2125,7 @@ discard block |
||
| 2122 | 2125 | * |
| 2123 | 2126 | * @param array $modules |
| 2124 | 2127 | * |
| 2125 | - * @return string|void |
|
| 2128 | + * @return string |
|
| 2126 | 2129 | */ |
| 2127 | 2130 | public static function get_translated_modules( $modules ) { |
| 2128 | 2131 | foreach ( $modules as $index => $module ) { |
@@ -2410,6 +2413,9 @@ discard block |
||
| 2410 | 2413 | _deprecated_function( __METHOD__, 'jeptack-4.2' ); |
| 2411 | 2414 | } |
| 2412 | 2415 | |
| 2416 | + /** |
|
| 2417 | + * @return string |
|
| 2418 | + */ |
|
| 2413 | 2419 | public static function deactivate_module( $module ) { |
| 2414 | 2420 | /** |
| 2415 | 2421 | * Fires when a module is deactivated. |
@@ -2438,6 +2444,9 @@ discard block |
||
| 2438 | 2444 | return self::update_active_modules( $new ); |
| 2439 | 2445 | } |
| 2440 | 2446 | |
| 2447 | + /** |
|
| 2448 | + * @param string $module |
|
| 2449 | + */ |
|
| 2441 | 2450 | public static function enable_module_configurable( $module ) { |
| 2442 | 2451 | $module = Jetpack::get_module_slug( $module ); |
| 2443 | 2452 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2448,21 +2457,33 @@ discard block |
||
| 2448 | 2457 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
| 2449 | 2458 | } |
| 2450 | 2459 | |
| 2460 | + /** |
|
| 2461 | + * @param string $module |
|
| 2462 | + */ |
|
| 2451 | 2463 | public static function module_configuration_load( $module, $method ) { |
| 2452 | 2464 | $module = Jetpack::get_module_slug( $module ); |
| 2453 | 2465 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
| 2454 | 2466 | } |
| 2455 | 2467 | |
| 2468 | + /** |
|
| 2469 | + * @param string $module |
|
| 2470 | + */ |
|
| 2456 | 2471 | public static function module_configuration_head( $module, $method ) { |
| 2457 | 2472 | $module = Jetpack::get_module_slug( $module ); |
| 2458 | 2473 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
| 2459 | 2474 | } |
| 2460 | 2475 | |
| 2476 | + /** |
|
| 2477 | + * @param string $module |
|
| 2478 | + */ |
|
| 2461 | 2479 | public static function module_configuration_screen( $module, $method ) { |
| 2462 | 2480 | $module = Jetpack::get_module_slug( $module ); |
| 2463 | 2481 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
| 2464 | 2482 | } |
| 2465 | 2483 | |
| 2484 | + /** |
|
| 2485 | + * @param string $module |
|
| 2486 | + */ |
|
| 2466 | 2487 | public static function module_configuration_activation_screen( $module, $method ) { |
| 2467 | 2488 | $module = Jetpack::get_module_slug( $module ); |
| 2468 | 2489 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2470,6 +2491,9 @@ discard block |
||
| 2470 | 2491 | |
| 2471 | 2492 | /* Installation */ |
| 2472 | 2493 | |
| 2494 | + /** |
|
| 2495 | + * @param string $message |
|
| 2496 | + */ |
|
| 2473 | 2497 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 2474 | 2498 | ?> |
| 2475 | 2499 | <!doctype html> |
@@ -3103,7 +3127,7 @@ discard block |
||
| 3103 | 3127 | * Add help to the Jetpack page |
| 3104 | 3128 | * |
| 3105 | 3129 | * @since Jetpack (1.2.3) |
| 3106 | - * @return false if not the Jetpack page |
|
| 3130 | + * @return false|null if not the Jetpack page |
|
| 3107 | 3131 | */ |
| 3108 | 3132 | function admin_help() { |
| 3109 | 3133 | $current_screen = get_current_screen(); |
@@ -4138,6 +4162,7 @@ discard block |
||
| 4138 | 4162 | /** |
| 4139 | 4163 | * Returns the requested Jetpack API URL |
| 4140 | 4164 | * |
| 4165 | + * @param string $relative_url |
|
| 4141 | 4166 | * @return string |
| 4142 | 4167 | */ |
| 4143 | 4168 | public static function api_url( $relative_url ) { |
@@ -4282,7 +4307,8 @@ discard block |
||
| 4282 | 4307 | * Note these tokens are unique per call, NOT static per site for connecting. |
| 4283 | 4308 | * |
| 4284 | 4309 | * @since 2.6 |
| 4285 | - * @return array |
|
| 4310 | + * @param string $action |
|
| 4311 | + * @return string |
|
| 4286 | 4312 | */ |
| 4287 | 4313 | public function generate_secrets( $action, $exp = 600 ) { |
| 4288 | 4314 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -4608,6 +4634,10 @@ discard block |
||
| 4608 | 4634 | return new WP_User( $token_details['user_id'] ); |
| 4609 | 4635 | } |
| 4610 | 4636 | |
| 4637 | + /** |
|
| 4638 | + * @param integer $timestamp |
|
| 4639 | + * @param string $nonce |
|
| 4640 | + */ |
|
| 4611 | 4641 | function add_nonce( $timestamp, $nonce ) { |
| 4612 | 4642 | global $wpdb; |
| 4613 | 4643 | static $nonces_used_this_request = array(); |
@@ -4753,6 +4783,7 @@ discard block |
||
| 4753 | 4783 | * @param string $key |
| 4754 | 4784 | * @param string $value |
| 4755 | 4785 | * @param bool $restate private |
| 4786 | + * @return string |
|
| 4756 | 4787 | */ |
| 4757 | 4788 | public static function state( $key = null, $value = null, $restate = false ) { |
| 4758 | 4789 | static $state = array(); |
@@ -4809,6 +4840,9 @@ discard block |
||
| 4809 | 4840 | Jetpack::state( null, null, true ); |
| 4810 | 4841 | } |
| 4811 | 4842 | |
| 4843 | + /** |
|
| 4844 | + * @param string $file |
|
| 4845 | + */ |
|
| 4812 | 4846 | public static function check_privacy( $file ) { |
| 4813 | 4847 | static $is_site_publicly_accessible = null; |
| 4814 | 4848 | |
@@ -5536,8 +5570,8 @@ discard block |
||
| 5536 | 5570 | * - Absolute URLs `http://domain.com/feh.png` |
| 5537 | 5571 | * - Domain root relative URLs `/feh.png` |
| 5538 | 5572 | * |
| 5539 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 5540 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5573 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 5574 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5541 | 5575 | * |
| 5542 | 5576 | * @return mixed|string |
| 5543 | 5577 | */ |
@@ -5828,7 +5862,7 @@ discard block |
||
| 5828 | 5862 | * |
| 5829 | 5863 | * @param string $option_name |
| 5830 | 5864 | * |
| 5831 | - * @return bool |
|
| 5865 | + * @return false|null |
|
| 5832 | 5866 | */ |
| 5833 | 5867 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
| 5834 | 5868 | // Bail if Jump Start has already been dismissed |
@@ -5919,7 +5953,6 @@ discard block |
||
| 5919 | 5953 | } |
| 5920 | 5954 | |
| 5921 | 5955 | /** |
| 5922 | - * @param mixed $result Value for the user's option |
|
| 5923 | 5956 | * @return mixed |
| 5924 | 5957 | */ |
| 5925 | 5958 | function get_user_option_meta_box_order_dashboard( $sorted ) { |