@@ -119,6 +119,9 @@ discard block |
||
| 119 | 119 | return $default; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | + /** |
|
| 123 | + * @param string $name |
|
| 124 | + */ |
|
| 122 | 125 | private static function update_grouped_option( $group, $name, $value ) { |
| 123 | 126 | $options = get_option( self::$grouped_options[ $group ] ); |
| 124 | 127 | if ( ! is_array( $options ) ) { |
@@ -217,6 +220,9 @@ discard block |
||
| 217 | 220 | return $result; |
| 218 | 221 | } |
| 219 | 222 | |
| 223 | + /** |
|
| 224 | + * @param string $name |
|
| 225 | + */ |
|
| 220 | 226 | private static function get_grouped_option( $group, $name, $default ) { |
| 221 | 227 | $options = get_option( self::$grouped_options[ $group ] ); |
| 222 | 228 | if ( is_array( $options ) && isset( $options[ $name ] ) ) { |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | * |
| 99 | 99 | * @param string $content |
| 100 | 100 | * |
| 101 | - * @return mixed |
|
| 101 | + * @return string |
|
| 102 | 102 | */ |
| 103 | 103 | function jetpack_archiveorg_embed_to_shortcode( $content ) { |
| 104 | 104 | if ( false === stripos( $content, 'archive.org/embed/' ) ) |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Returns status of WordAds approval. |
| 48 | - * @return boolean true if site is WordAds approved |
|
| 48 | + * @return string true if site is WordAds approved |
|
| 49 | 49 | * |
| 50 | 50 | * @since 4.5.0 |
| 51 | 51 | */ |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Returns status of WordAds active. |
| 62 | - * @return boolean true if ads are active on site |
|
| 62 | + * @return string true if ads are active on site |
|
| 63 | 63 | * |
| 64 | 64 | * @since 4.5.0 |
| 65 | 65 | */ |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * Returns status of WordAds house ads. |
| 76 | - * @return boolean true if WP.com house ads should be shown |
|
| 76 | + * @return string true if WP.com house ads should be shown |
|
| 77 | 77 | * |
| 78 | 78 | * @since 4.5.0 |
| 79 | 79 | */ |
@@ -90,6 +90,9 @@ discard block |
||
| 90 | 90 | return $html; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | + /** |
|
| 94 | + * @param string $regexp |
|
| 95 | + */ |
|
| 93 | 96 | static public function regexp_entities( $regexp ) { |
| 94 | 97 | return preg_replace( |
| 95 | 98 | '/\[\^&([^\]]+)\]\*\+/', |
@@ -128,6 +131,9 @@ discard block |
||
| 128 | 131 | return self::dispatch( $matches ); |
| 129 | 132 | } |
| 130 | 133 | |
| 134 | + /** |
|
| 135 | + * @param string[] $matches |
|
| 136 | + */ |
|
| 131 | 137 | static function dispatch( $matches ) { |
| 132 | 138 | $html = preg_replace( '%�*58;//%', '://', $matches[0] ); |
| 133 | 139 | $attrs = self::get_attrs( $html ); |
@@ -138,6 +138,7 @@ |
||
| 138 | 138 | /** |
| 139 | 139 | * Returns a class value, `output-the-content` by default. |
| 140 | 140 | * Used for themes with a 'Mixed' Blog Display so we can tell which output is by default. |
| 141 | + * @param string $new_class |
|
| 141 | 142 | */ |
| 142 | 143 | function jetpack_the_content_customizer_class( $new_class = null ) { |
| 143 | 144 | static $class; |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | * |
| 99 | 99 | * @param string $content |
| 100 | 100 | * |
| 101 | - * @return mixed |
|
| 101 | + * @return string |
|
| 102 | 102 | */ |
| 103 | 103 | function jetpack_archiveorg_embed_to_shortcode( $content ) { |
| 104 | 104 | if ( false === stripos( $content, 'archive.org/embed/' ) ) |
@@ -298,6 +298,9 @@ discard block |
||
| 298 | 298 | return $sync_modules; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | + /** |
|
| 302 | + * @return string |
|
| 303 | + */ |
|
| 301 | 304 | static function sanitize_filtered_sync_cron_schedule( $schedule ) { |
| 302 | 305 | $schedule = sanitize_key( $schedule ); |
| 303 | 306 | $schedules = wp_get_schedules(); |
@@ -333,6 +336,9 @@ discard block |
||
| 333 | 336 | ) ); |
| 334 | 337 | } |
| 335 | 338 | |
| 339 | + /** |
|
| 340 | + * @param string $hook |
|
| 341 | + */ |
|
| 336 | 342 | static function maybe_schedule_sync_cron( $schedule, $hook ) { |
| 337 | 343 | if ( ! $hook ) { |
| 338 | 344 | return; |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | } |
| 894 | 894 | /** |
| 895 | 895 | * Does the network allow admins to add new users. |
| 896 | - * @return boolian |
|
| 896 | + * @return boolean |
|
| 897 | 897 | */ |
| 898 | 898 | static function network_add_new_users( $option = null ) { |
| 899 | 899 | return (bool) get_site_option( 'add_new_users' ); |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | * database which could be set to anything as opposed to what this function returns. |
| 999 | 999 | * @param bool $option |
| 1000 | 1000 | * |
| 1001 | - * @return boolean |
|
| 1001 | + * @return string |
|
| 1002 | 1002 | */ |
| 1003 | 1003 | public function is_main_network_option( $option ) { |
| 1004 | 1004 | // return '1' or '' |
@@ -1009,7 +1009,7 @@ discard block |
||
| 1009 | 1009 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 1010 | 1010 | * |
| 1011 | 1011 | * @param string $option |
| 1012 | - * @return boolean |
|
| 1012 | + * @return string |
|
| 1013 | 1013 | */ |
| 1014 | 1014 | public function is_multisite( $option ) { |
| 1015 | 1015 | return (string) (bool) is_multisite(); |
@@ -1071,7 +1071,7 @@ discard block |
||
| 1071 | 1071 | |
| 1072 | 1072 | /** |
| 1073 | 1073 | * Returns true if the site has file write access false otherwise. |
| 1074 | - * @return string ( '1' | '0' ) |
|
| 1074 | + * @return integer ( '1' | '0' ) |
|
| 1075 | 1075 | **/ |
| 1076 | 1076 | public static function file_system_write_access() { |
| 1077 | 1077 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1280,6 +1280,7 @@ discard block |
||
| 1280 | 1280 | * @access public |
| 1281 | 1281 | * @static |
| 1282 | 1282 | * |
| 1283 | + * @param string $feature |
|
| 1283 | 1284 | * @return bool True if plan supports feature, false if not |
| 1284 | 1285 | */ |
| 1285 | 1286 | public static function active_plan_supports( $feature ) { |
@@ -1836,6 +1837,7 @@ discard block |
||
| 1836 | 1837 | * @param int $user_id |
| 1837 | 1838 | * @param string $token |
| 1838 | 1839 | * return bool |
| 1840 | + * @param boolean $is_master_user |
|
| 1839 | 1841 | */ |
| 1840 | 1842 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 1841 | 1843 | // not designed for concurrent updates |
@@ -2230,6 +2232,7 @@ discard block |
||
| 2230 | 2232 | |
| 2231 | 2233 | /** |
| 2232 | 2234 | * Like core's get_file_data implementation, but caches the result. |
| 2235 | + * @param string $file |
|
| 2233 | 2236 | */ |
| 2234 | 2237 | public static function get_file_data( $file, $headers ) { |
| 2235 | 2238 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2258,7 +2261,7 @@ discard block |
||
| 2258 | 2261 | * |
| 2259 | 2262 | * @param string $tag Tag as it appears in each module heading. |
| 2260 | 2263 | * |
| 2261 | - * @return mixed |
|
| 2264 | + * @return string |
|
| 2262 | 2265 | */ |
| 2263 | 2266 | public static function translate_module_tag( $tag ) { |
| 2264 | 2267 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2271,7 +2274,7 @@ discard block |
||
| 2271 | 2274 | * |
| 2272 | 2275 | * @param array $modules |
| 2273 | 2276 | * |
| 2274 | - * @return string|void |
|
| 2277 | + * @return string |
|
| 2275 | 2278 | */ |
| 2276 | 2279 | public static function get_translated_modules( $modules ) { |
| 2277 | 2280 | foreach ( $modules as $index => $module ) { |
@@ -2600,6 +2603,9 @@ discard block |
||
| 2600 | 2603 | return self::update_active_modules( $new ); |
| 2601 | 2604 | } |
| 2602 | 2605 | |
| 2606 | + /** |
|
| 2607 | + * @param string $module |
|
| 2608 | + */ |
|
| 2603 | 2609 | public static function enable_module_configurable( $module ) { |
| 2604 | 2610 | $module = Jetpack::get_module_slug( $module ); |
| 2605 | 2611 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2610,21 +2616,33 @@ discard block |
||
| 2610 | 2616 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
| 2611 | 2617 | } |
| 2612 | 2618 | |
| 2619 | + /** |
|
| 2620 | + * @param string $module |
|
| 2621 | + */ |
|
| 2613 | 2622 | public static function module_configuration_load( $module, $method ) { |
| 2614 | 2623 | $module = Jetpack::get_module_slug( $module ); |
| 2615 | 2624 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
| 2616 | 2625 | } |
| 2617 | 2626 | |
| 2627 | + /** |
|
| 2628 | + * @param string $module |
|
| 2629 | + */ |
|
| 2618 | 2630 | public static function module_configuration_head( $module, $method ) { |
| 2619 | 2631 | $module = Jetpack::get_module_slug( $module ); |
| 2620 | 2632 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
| 2621 | 2633 | } |
| 2622 | 2634 | |
| 2635 | + /** |
|
| 2636 | + * @param string $module |
|
| 2637 | + */ |
|
| 2623 | 2638 | public static function module_configuration_screen( $module, $method ) { |
| 2624 | 2639 | $module = Jetpack::get_module_slug( $module ); |
| 2625 | 2640 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
| 2626 | 2641 | } |
| 2627 | 2642 | |
| 2643 | + /** |
|
| 2644 | + * @param string $module |
|
| 2645 | + */ |
|
| 2628 | 2646 | public static function module_configuration_activation_screen( $module, $method ) { |
| 2629 | 2647 | $module = Jetpack::get_module_slug( $module ); |
| 2630 | 2648 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2632,6 +2650,9 @@ discard block |
||
| 2632 | 2650 | |
| 2633 | 2651 | /* Installation */ |
| 2634 | 2652 | |
| 2653 | + /** |
|
| 2654 | + * @param string $message |
|
| 2655 | + */ |
|
| 2635 | 2656 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 2636 | 2657 | ?> |
| 2637 | 2658 | <!doctype html> |
@@ -3280,7 +3301,7 @@ discard block |
||
| 3280 | 3301 | * Add help to the Jetpack page |
| 3281 | 3302 | * |
| 3282 | 3303 | * @since Jetpack (1.2.3) |
| 3283 | - * @return false if not the Jetpack page |
|
| 3304 | + * @return false|null if not the Jetpack page |
|
| 3284 | 3305 | */ |
| 3285 | 3306 | function admin_help() { |
| 3286 | 3307 | $current_screen = get_current_screen(); |
@@ -4278,6 +4299,7 @@ discard block |
||
| 4278 | 4299 | /** |
| 4279 | 4300 | * Returns the requested Jetpack API URL |
| 4280 | 4301 | * |
| 4302 | + * @param string $relative_url |
|
| 4281 | 4303 | * @return string |
| 4282 | 4304 | */ |
| 4283 | 4305 | public static function api_url( $relative_url ) { |
@@ -4422,7 +4444,8 @@ discard block |
||
| 4422 | 4444 | * Note these tokens are unique per call, NOT static per site for connecting. |
| 4423 | 4445 | * |
| 4424 | 4446 | * @since 2.6 |
| 4425 | - * @return array |
|
| 4447 | + * @param string $action |
|
| 4448 | + * @return string |
|
| 4426 | 4449 | */ |
| 4427 | 4450 | public function generate_secrets( $action, $exp = 600 ) { |
| 4428 | 4451 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -4861,7 +4884,6 @@ discard block |
||
| 4861 | 4884 | /** |
| 4862 | 4885 | * Report authentication status to the WP REST API. |
| 4863 | 4886 | * |
| 4864 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
| 4865 | 4887 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
| 4866 | 4888 | */ |
| 4867 | 4889 | public function wp_rest_authentication_errors( $value ) { |
@@ -4871,6 +4893,10 @@ discard block |
||
| 4871 | 4893 | return $this->rest_authentication_status; |
| 4872 | 4894 | } |
| 4873 | 4895 | |
| 4896 | + /** |
|
| 4897 | + * @param integer $timestamp |
|
| 4898 | + * @param string $nonce |
|
| 4899 | + */ |
|
| 4874 | 4900 | function add_nonce( $timestamp, $nonce ) { |
| 4875 | 4901 | global $wpdb; |
| 4876 | 4902 | static $nonces_used_this_request = array(); |
@@ -5016,6 +5042,7 @@ discard block |
||
| 5016 | 5042 | * @param string $key |
| 5017 | 5043 | * @param string $value |
| 5018 | 5044 | * @param bool $restate private |
| 5045 | + * @return string |
|
| 5019 | 5046 | */ |
| 5020 | 5047 | public static function state( $key = null, $value = null, $restate = false ) { |
| 5021 | 5048 | static $state = array(); |
@@ -5072,6 +5099,9 @@ discard block |
||
| 5072 | 5099 | Jetpack::state( null, null, true ); |
| 5073 | 5100 | } |
| 5074 | 5101 | |
| 5102 | + /** |
|
| 5103 | + * @param string $file |
|
| 5104 | + */ |
|
| 5075 | 5105 | public static function check_privacy( $file ) { |
| 5076 | 5106 | static $is_site_publicly_accessible = null; |
| 5077 | 5107 | |
@@ -5821,8 +5851,8 @@ discard block |
||
| 5821 | 5851 | * - Absolute URLs `http://domain.com/feh.png` |
| 5822 | 5852 | * - Domain root relative URLs `/feh.png` |
| 5823 | 5853 | * |
| 5824 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 5825 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5854 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 5855 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 5826 | 5856 | * |
| 5827 | 5857 | * @return mixed|string |
| 5828 | 5858 | */ |
@@ -6113,7 +6143,7 @@ discard block |
||
| 6113 | 6143 | * |
| 6114 | 6144 | * @param string $option_name |
| 6115 | 6145 | * |
| 6116 | - * @return bool |
|
| 6146 | + * @return false|null |
|
| 6117 | 6147 | */ |
| 6118 | 6148 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
| 6119 | 6149 | // Bail if Jump Start has already been dismissed |
@@ -6204,7 +6234,6 @@ discard block |
||
| 6204 | 6234 | } |
| 6205 | 6235 | |
| 6206 | 6236 | /** |
| 6207 | - * @param mixed $result Value for the user's option |
|
| 6208 | 6237 | * @return mixed |
| 6209 | 6238 | */ |
| 6210 | 6239 | function get_user_option_meta_box_order_dashboard( $sorted ) { |