@@ -153,6 +153,7 @@ discard block |
||
| 153 | 153 | /** |
| 154 | 154 | * Get attachment images for a specified post and return them. Also make sure |
| 155 | 155 | * their dimensions are at or above a required minimum. |
| 156 | + * @param integer $post_id |
|
| 156 | 157 | */ |
| 157 | 158 | static function from_attachment( $post_id, $width = 200, $height = 200 ) { |
| 158 | 159 | $images = array(); |
@@ -545,7 +546,6 @@ discard block |
||
| 545 | 546 | * resized and cropped image. |
| 546 | 547 | * |
| 547 | 548 | * @param string $src |
| 548 | - * @param int $dimension |
|
| 549 | 549 | * @return string Transformed image URL |
| 550 | 550 | */ |
| 551 | 551 | static function fit_image_url( $src, $width, $height ) { |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | * This is ported over from the manage module, which has been deprecated and baked in here. |
| 957 | 957 | * |
| 958 | 958 | * @param $domains |
| 959 | - * @return array |
|
| 959 | + * @return string[] |
|
| 960 | 960 | */ |
| 961 | 961 | function allow_wpcom_domain( $domains ) { |
| 962 | 962 | if ( empty( $domains ) ) { |
@@ -1324,7 +1324,7 @@ discard block |
||
| 1324 | 1324 | /** |
| 1325 | 1325 | * Does the network allow admins to add new users. |
| 1326 | 1326 | * |
| 1327 | - * @return boolian |
|
| 1327 | + * @return boolean |
|
| 1328 | 1328 | */ |
| 1329 | 1329 | static function network_add_new_users( $option = null ) { |
| 1330 | 1330 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1434,7 +1434,7 @@ discard block |
||
| 1434 | 1434 | * |
| 1435 | 1435 | * @param bool $option |
| 1436 | 1436 | * |
| 1437 | - * @return boolean |
|
| 1437 | + * @return string |
|
| 1438 | 1438 | */ |
| 1439 | 1439 | public function is_main_network_option( $option ) { |
| 1440 | 1440 | // return '1' or '' |
@@ -1445,7 +1445,7 @@ discard block |
||
| 1445 | 1445 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 1446 | 1446 | * |
| 1447 | 1447 | * @param string $option |
| 1448 | - * @return boolean |
|
| 1448 | + * @return string |
|
| 1449 | 1449 | */ |
| 1450 | 1450 | public function is_multisite( $option ) { |
| 1451 | 1451 | return (string) (bool) is_multisite(); |
@@ -1508,7 +1508,7 @@ discard block |
||
| 1508 | 1508 | /** |
| 1509 | 1509 | * Returns true if the site has file write access false otherwise. |
| 1510 | 1510 | * |
| 1511 | - * @return string ( '1' | '0' ) |
|
| 1511 | + * @return integer ( '1' | '0' ) |
|
| 1512 | 1512 | **/ |
| 1513 | 1513 | public static function file_system_write_access() { |
| 1514 | 1514 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2237,7 +2237,7 @@ discard block |
||
| 2237 | 2237 | * @param int $user_id The user id. |
| 2238 | 2238 | * @param string $token The user token. |
| 2239 | 2239 | * @param bool $is_master_user Whether the user is the master user. |
| 2240 | - * @return bool |
|
| 2240 | + * @return boolean|null |
|
| 2241 | 2241 | */ |
| 2242 | 2242 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 2243 | 2243 | _deprecated_function( __METHOD__, 'jetpack-8.0', 'Automattic\\Jetpack\\Connection\\Utils::update_user_token' ); |
@@ -2681,7 +2681,7 @@ discard block |
||
| 2681 | 2681 | * |
| 2682 | 2682 | * @param string $tag Tag as it appears in each module heading. |
| 2683 | 2683 | * |
| 2684 | - * @return mixed |
|
| 2684 | + * @return string |
|
| 2685 | 2685 | */ |
| 2686 | 2686 | public static function translate_module_tag( $tag ) { |
| 2687 | 2687 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2796,8 +2796,8 @@ discard block |
||
| 2796 | 2796 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
| 2797 | 2797 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
| 2798 | 2798 | * |
| 2799 | - * @param $string |
|
| 2800 | - * @return mixed |
|
| 2799 | + * @param string $string |
|
| 2800 | + * @return string|null |
|
| 2801 | 2801 | */ |
| 2802 | 2802 | public static function alias_directories( $string ) { |
| 2803 | 2803 | // ABSPATH has a trailing slash. |
@@ -2808,6 +2808,10 @@ discard block |
||
| 2808 | 2808 | return $string; |
| 2809 | 2809 | } |
| 2810 | 2810 | |
| 2811 | + /** |
|
| 2812 | + * @param boolean $redirect |
|
| 2813 | + * @param boolean $send_state_messages |
|
| 2814 | + */ |
|
| 2811 | 2815 | public static function activate_default_modules( |
| 2812 | 2816 | $min_version = false, |
| 2813 | 2817 | $max_version = false, |
@@ -3091,6 +3095,9 @@ discard block |
||
| 3091 | 3095 | return self::update_active_modules( $new ); |
| 3092 | 3096 | } |
| 3093 | 3097 | |
| 3098 | + /** |
|
| 3099 | + * @param string $module |
|
| 3100 | + */ |
|
| 3094 | 3101 | public static function enable_module_configurable( $module ) { |
| 3095 | 3102 | $module = self::get_module_slug( $module ); |
| 3096 | 3103 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3119,6 +3126,10 @@ discard block |
||
| 3119 | 3126 | } |
| 3120 | 3127 | |
| 3121 | 3128 | /* Installation */ |
| 3129 | + |
|
| 3130 | + /** |
|
| 3131 | + * @param string $message |
|
| 3132 | + */ |
|
| 3122 | 3133 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 3123 | 3134 | ?> |
| 3124 | 3135 | <!doctype html> |
@@ -3884,7 +3895,7 @@ discard block |
||
| 3884 | 3895 | * Add help to the Jetpack page |
| 3885 | 3896 | * |
| 3886 | 3897 | * @since Jetpack (1.2.3) |
| 3887 | - * @return false if not the Jetpack page |
|
| 3898 | + * @return false|null if not the Jetpack page |
|
| 3888 | 3899 | */ |
| 3889 | 3900 | function admin_help() { |
| 3890 | 3901 | $current_screen = get_current_screen(); |
@@ -4588,6 +4599,7 @@ discard block |
||
| 4588 | 4599 | |
| 4589 | 4600 | /** |
| 4590 | 4601 | * Record a stat for later output. This will only currently output in the admin_footer. |
| 4602 | + * @param string $group |
|
| 4591 | 4603 | */ |
| 4592 | 4604 | function stat( $group, $detail ) { |
| 4593 | 4605 | $this->initialize_stats(); |
@@ -5001,6 +5013,9 @@ discard block |
||
| 5001 | 5013 | return $url; |
| 5002 | 5014 | } |
| 5003 | 5015 | |
| 5016 | + /** |
|
| 5017 | + * @param string $actionurl |
|
| 5018 | + */ |
|
| 5004 | 5019 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
| 5005 | 5020 | $actionurl = str_replace( '&', '&', $actionurl ); |
| 5006 | 5021 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -5291,7 +5306,7 @@ discard block |
||
| 5291 | 5306 | * @param String $action The action name. |
| 5292 | 5307 | * @param Integer $user_id The user identifier. |
| 5293 | 5308 | * @param Integer $exp Expiration time in seconds. |
| 5294 | - * @return array |
|
| 5309 | + * @return boolean |
|
| 5295 | 5310 | */ |
| 5296 | 5311 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
| 5297 | 5312 | return self::connection()->generate_secrets( $action, $user_id, $exp ); |
@@ -5547,7 +5562,6 @@ discard block |
||
| 5547 | 5562 | * @deprecated since 8.9.0 |
| 5548 | 5563 | * @see Automattic\Jetpack\Connection\Rest_Authentication::wp_rest_authentication_errors() |
| 5549 | 5564 | * |
| 5550 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
| 5551 | 5565 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
| 5552 | 5566 | */ |
| 5553 | 5567 | public function wp_rest_authentication_errors( $value ) { |
@@ -5640,6 +5654,7 @@ discard block |
||
| 5640 | 5654 | * @param string $key |
| 5641 | 5655 | * @param string $value |
| 5642 | 5656 | * @param bool $restate private |
| 5657 | + * @return string |
|
| 5643 | 5658 | */ |
| 5644 | 5659 | public static function state( $key = null, $value = null, $restate = false ) { |
| 5645 | 5660 | static $state = array(); |
@@ -5721,6 +5736,9 @@ discard block |
||
| 5721 | 5736 | return true; |
| 5722 | 5737 | } |
| 5723 | 5738 | |
| 5739 | + /** |
|
| 5740 | + * @param string $file |
|
| 5741 | + */ |
|
| 5724 | 5742 | public static function check_privacy( $file ) { |
| 5725 | 5743 | static $is_site_publicly_accessible = null; |
| 5726 | 5744 | |
@@ -6293,9 +6311,7 @@ discard block |
||
| 6293 | 6311 | * |
| 6294 | 6312 | * Attached to `style_loader_src` filter. |
| 6295 | 6313 | * |
| 6296 | - * @param string $tag The tag that would link to the external asset. |
|
| 6297 | 6314 | * @param string $handle The registered handle of the script in question. |
| 6298 | - * @param string $href The url of the asset in question. |
|
| 6299 | 6315 | */ |
| 6300 | 6316 | public static function set_suffix_on_min( $src, $handle ) { |
| 6301 | 6317 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6671,8 +6687,8 @@ discard block |
||
| 6671 | 6687 | * - Absolute URLs `http://domain.com/feh.png` |
| 6672 | 6688 | * - Domain root relative URLs `/feh.png` |
| 6673 | 6689 | * |
| 6674 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 6675 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6690 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 6691 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6676 | 6692 | * |
| 6677 | 6693 | * @return mixed|string |
| 6678 | 6694 | */ |
@@ -6971,7 +6987,6 @@ discard block |
||
| 6971 | 6987 | } |
| 6972 | 6988 | |
| 6973 | 6989 | /** |
| 6974 | - * @param mixed $result Value for the user's option |
|
| 6975 | 6990 | * @return mixed |
| 6976 | 6991 | */ |
| 6977 | 6992 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -1540,6 +1540,7 @@ discard block |
||
| 1540 | 1540 | * timezone set in the options table for the blog or the GMT offset. |
| 1541 | 1541 | * |
| 1542 | 1542 | * @param datetime string $date_string Date to parse. |
| 1543 | + * @param string $date_string |
|
| 1543 | 1544 | * |
| 1544 | 1545 | * @return array( $local_time_string, $gmt_time_string ) |
| 1545 | 1546 | */ |
@@ -1649,6 +1650,10 @@ discard block |
||
| 1649 | 1650 | do_action( 'restapi_theme_init' ); |
| 1650 | 1651 | } |
| 1651 | 1652 | |
| 1653 | + /** |
|
| 1654 | + * @param string $from_hook |
|
| 1655 | + * @param string $to_hook |
|
| 1656 | + */ |
|
| 1652 | 1657 | function copy_hooks( $from_hook, $to_hook, $base_paths ) { |
| 1653 | 1658 | global $wp_filter; |
| 1654 | 1659 | foreach ( $wp_filter as $hook => $actions ) { |
@@ -2073,7 +2078,7 @@ discard block |
||
| 2073 | 2078 | * Get an array of all valid AMP origins for a blog's siteurl. |
| 2074 | 2079 | * |
| 2075 | 2080 | * @param string $siteurl Origin url of the API request. |
| 2076 | - * @return array |
|
| 2081 | + * @return string[] |
|
| 2077 | 2082 | */ |
| 2078 | 2083 | public function get_amp_cache_origins( $siteurl ) { |
| 2079 | 2084 | $host = parse_url( $siteurl, PHP_URL_HOST ); |
@@ -35,6 +35,9 @@ discard block |
||
| 35 | 35 | public $amp_source_origin = null; |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | + * @param string $method |
|
| 39 | + * @param string $url |
|
| 40 | + * @param string $post_body |
|
| 38 | 41 | * @return WPCOM_JSON_API instance |
| 39 | 42 | */ |
| 40 | 43 | static function init( $method = null, $url = null, $post_body = null ) { |
@@ -348,6 +351,9 @@ discard block |
||
| 348 | 351 | return call_user_func_array( array( $endpoint, 'callback' ), $path_pieces ); |
| 349 | 352 | } |
| 350 | 353 | |
| 354 | + /** |
|
| 355 | + * @param integer $status_code |
|
| 356 | + */ |
|
| 351 | 357 | function output_early( $status_code, $response = null, $content_type = 'application/json' ) { |
| 352 | 358 | $exit = $this->exit; |
| 353 | 359 | $this->exit = false; |
@@ -572,11 +578,18 @@ discard block |
||
| 572 | 578 | return wp_json_encode( $data ); |
| 573 | 579 | } |
| 574 | 580 | |
| 581 | + /** |
|
| 582 | + * @param string $needle |
|
| 583 | + */ |
|
| 575 | 584 | function ends_with( $haystack, $needle ) { |
| 576 | 585 | return $needle === substr( $haystack, -strlen( $needle ) ); |
| 577 | 586 | } |
| 578 | 587 | |
| 579 | 588 | // Returns the site's blog_id in the WP.com ecosystem |
| 589 | + |
|
| 590 | + /** |
|
| 591 | + * @return integer |
|
| 592 | + */ |
|
| 580 | 593 | function get_blog_id_for_output() { |
| 581 | 594 | return $this->token_details['blog_id']; |
| 582 | 595 | } |
@@ -599,6 +612,10 @@ discard block |
||
| 599 | 612 | } |
| 600 | 613 | |
| 601 | 614 | // Returns true if the specified blog ID is a restricted blog |
| 615 | + |
|
| 616 | + /** |
|
| 617 | + * @param integer $blog_id |
|
| 618 | + */ |
|
| 602 | 619 | function is_restricted_blog( $blog_id ) { |
| 603 | 620 | /** |
| 604 | 621 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |
@@ -648,7 +665,7 @@ discard block |
||
| 648 | 665 | /** |
| 649 | 666 | * Counts the number of comments on a site, excluding certain comment types. |
| 650 | 667 | * |
| 651 | - * @param $post_id int Post ID. |
|
| 668 | + * @param integer $post_id int Post ID. |
|
| 652 | 669 | * @return array Array of counts, matching the output of https://developer.wordpress.org/reference/functions/get_comment_count/. |
| 653 | 670 | */ |
| 654 | 671 | public function wp_count_comments( $post_id ) { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * Singleton implementation |
| 44 | 44 | * |
| 45 | - * @return object |
|
| 45 | + * @return Jetpack_Photon|null |
|
| 46 | 46 | */ |
| 47 | 47 | public static function instance() { |
| 48 | 48 | if ( ! is_a( self::$instance, 'Jetpack_Photon' ) ) { |
@@ -1382,7 +1382,7 @@ discard block |
||
| 1382 | 1382 | * after ourselves without breaking anyone else's filters. |
| 1383 | 1383 | * |
| 1384 | 1384 | * @internal |
| 1385 | - * @return true |
|
| 1385 | + * @return boolean |
|
| 1386 | 1386 | */ |
| 1387 | 1387 | public function override_image_downsize_in_rest_edit_context() { |
| 1388 | 1388 | return true; |
@@ -235,7 +235,7 @@ |
||
| 235 | 235 | * @param string $name Template name, available in `./templates` folder. |
| 236 | 236 | * @param array $template_props Template properties. Optional. |
| 237 | 237 | * @param bool $print Render template. True as default. |
| 238 | - * @return false|string HTML markup or false. |
|
| 238 | + * @return string|null HTML markup or false. |
|
| 239 | 239 | */ |
| 240 | 240 | function render( $name, $template_props = array(), $print = true ) { |
| 241 | 241 | if ( ! strpos( $name, '.php' ) ) { |
@@ -217,7 +217,7 @@ |
||
| 217 | 217 | * Render a slide |
| 218 | 218 | * |
| 219 | 219 | * @param array $media Media information. |
| 220 | - * @param array $index Index of the slide, first slide will be displayed by default, others hidden. |
|
| 220 | + * @param integer $index Index of the slide, first slide will be displayed by default, others hidden. |
|
| 221 | 221 | * |
| 222 | 222 | * @return string |
| 223 | 223 | */ |
@@ -326,7 +326,7 @@ |
||
| 326 | 326 | * |
| 327 | 327 | * @param string $url The URL to parse. |
| 328 | 328 | * @param integer $component Retrieve specific URL component. |
| 329 | - * @return mixed Result of parse_url |
|
| 329 | + * @return string|false Result of parse_url |
|
| 330 | 330 | */ |
| 331 | 331 | function jetpack_photon_parse_url( $url, $component = -1 ) { |
| 332 | 332 | _deprecated_function( 'jetpack_photon_parse_url', 'jetpack-7.8.0', 'wp_parse_url' ); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * Update the media post grabbing the post values from |
| 102 | 102 | * the `attrs` parameter |
| 103 | 103 | * |
| 104 | - * @param {Number} $media_id - post media ID |
|
| 104 | + * @param integer $media_id - post media ID |
|
| 105 | 105 | * @param {Object} $attrs - `attrs` parameter sent from the client in the request body |
| 106 | 106 | * @return |
| 107 | 107 | */ |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | * Save the given temporal file in a local folder. |
| 203 | 203 | * |
| 204 | 204 | * @param {Array} $file_array |
| 205 | - * @param {Number} $media_id |
|
| 205 | + * @param integer $media_id |
|
| 206 | 206 | * @return {Array|WP_Error} An array with information about the new file saved or a WP_Error is something went wrong. |
| 207 | 207 | */ |
| 208 | 208 | private function save_temporary_file( $file_array, $media_id ) { |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | /** |
| 278 | 278 | * Get the image from a remote url and then save it locally. |
| 279 | 279 | * |
| 280 | - * @param {Number} $media_id - media post ID |
|
| 280 | + * @param integer $media_id - media post ID |
|
| 281 | 281 | * @param {String} $url - image URL to save locally |
| 282 | 282 | * @return {Array|WP_Error} An array with information about the new file saved or a WP_Error is something went wrong. |
| 283 | 283 | */ |