@@ -162,7 +162,7 @@ |
||
162 | 162 | * |
163 | 163 | * @access public |
164 | 164 | * |
165 | - * @return array Full sync actions of this module. |
|
165 | + * @return string[] Full sync actions of this module. |
|
166 | 166 | */ |
167 | 167 | public function get_full_sync_actions() { |
168 | 168 | return array( 'jetpack_full_sync_terms' ); |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | * @access public |
503 | 503 | * |
504 | 504 | * @param array $config Full sync configuration for this sync module. |
505 | - * @return array Number of items yet to be enqueued. |
|
505 | + * @return integer Number of items yet to be enqueued. |
|
506 | 506 | */ |
507 | 507 | public function estimate_full_sync_actions( $config ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
508 | 508 | return 1; |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | * |
523 | 523 | * @access public |
524 | 524 | * |
525 | - * @return array Full sync actions of this module. |
|
525 | + * @return string[] Full sync actions of this module. |
|
526 | 526 | */ |
527 | 527 | public function get_full_sync_actions() { |
528 | 528 | return array( 'jetpack_full_sync_theme_data' ); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @access public |
185 | 185 | * |
186 | - * @param \WP_User $user User object. |
|
186 | + * @param \WP_User|null $user User object. |
|
187 | 187 | * @return \WP_User Expanded user object. |
188 | 188 | */ |
189 | 189 | public function expand_user( $user ) { |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | * @todo Refactor to prepare the SQL query before executing it. |
615 | 615 | * |
616 | 616 | * @param array $config Full sync configuration for this sync module. |
617 | - * @return array Number of items yet to be enqueued. |
|
617 | + * @return integer Number of items yet to be enqueued. |
|
618 | 618 | */ |
619 | 619 | public function estimate_full_sync_actions( $config ) { |
620 | 620 | global $wpdb; |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | * |
659 | 659 | * @access public |
660 | 660 | * |
661 | - * @return array Full sync actions of this module. |
|
661 | + * @return string[] Full sync actions of this module. |
|
662 | 662 | */ |
663 | 663 | public function get_full_sync_actions() { |
664 | 664 | return array( 'jetpack_full_sync_users' ); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @access public |
152 | 152 | * |
153 | - * @return array Full sync actions of this module. |
|
153 | + * @return string[] Full sync actions of this module. |
|
154 | 154 | */ |
155 | 155 | public function get_full_sync_actions() { |
156 | 156 | return array( 'jetpack_full_sync_woocommerce_order_items' ); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * @todo Refactor the SQL query to use $wpdb->prepare(). |
247 | 247 | * |
248 | 248 | * @param array $config Full sync configuration for this sync module. |
249 | - * @return array Number of items yet to be enqueued. |
|
249 | + * @return integer Number of items yet to be enqueued. |
|
250 | 250 | */ |
251 | 251 | public function estimate_full_sync_actions( $config ) { |
252 | 252 | global $wpdb; |
@@ -77,7 +77,7 @@ |
||
77 | 77 | * |
78 | 78 | * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html |
79 | 79 | * |
80 | - * @param $function string name of the function |
|
80 | + * @param string $function string name of the function |
|
81 | 81 | * @param $params array functions parameters |
82 | 82 | * |
83 | 83 | * @return void |
@@ -95,10 +95,16 @@ |
||
95 | 95 | return (array) $upgrader->skin->get_upgrade_messages(); |
96 | 96 | } |
97 | 97 | |
98 | + /** |
|
99 | + * @param string $plugin_slug |
|
100 | + */ |
|
98 | 101 | protected static function generate_wordpress_org_plugin_download_link( $plugin_slug ) { |
99 | 102 | return "https://downloads.wordpress.org/plugin/$plugin_slug.latest-stable.zip"; |
100 | 103 | } |
101 | 104 | |
105 | + /** |
|
106 | + * @param string $slug |
|
107 | + */ |
|
102 | 108 | public static function get_plugin_id_by_slug( $slug ) { |
103 | 109 | // Check if get_plugins() function exists. This is required on the front end of the |
104 | 110 | // site, since it is in a file that is normally only loaded in the admin. |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | * This is ported over from the manage module, which has been deprecated and baked in here. |
768 | 768 | * |
769 | 769 | * @param $domains |
770 | - * @return array |
|
770 | + * @return string[] |
|
771 | 771 | */ |
772 | 772 | function allow_wpcom_domain( $domains ) { |
773 | 773 | if ( empty( $domains ) ) { |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | } |
1264 | 1264 | /** |
1265 | 1265 | * Does the network allow admins to add new users. |
1266 | - * @return boolian |
|
1266 | + * @return boolean |
|
1267 | 1267 | */ |
1268 | 1268 | static function network_add_new_users( $option = null ) { |
1269 | 1269 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1368,7 +1368,7 @@ discard block |
||
1368 | 1368 | * database which could be set to anything as opposed to what this function returns. |
1369 | 1369 | * @param bool $option |
1370 | 1370 | * |
1371 | - * @return boolean |
|
1371 | + * @return string |
|
1372 | 1372 | */ |
1373 | 1373 | public function is_main_network_option( $option ) { |
1374 | 1374 | // return '1' or '' |
@@ -1379,7 +1379,7 @@ discard block |
||
1379 | 1379 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
1380 | 1380 | * |
1381 | 1381 | * @param string $option |
1382 | - * @return boolean |
|
1382 | + * @return string |
|
1383 | 1383 | */ |
1384 | 1384 | public function is_multisite( $option ) { |
1385 | 1385 | return (string) (bool) is_multisite(); |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | |
1442 | 1442 | /** |
1443 | 1443 | * Returns true if the site has file write access false otherwise. |
1444 | - * @return string ( '1' | '0' ) |
|
1444 | + * @return integer ( '1' | '0' ) |
|
1445 | 1445 | **/ |
1446 | 1446 | public static function file_system_write_access() { |
1447 | 1447 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -2168,6 +2168,7 @@ discard block |
||
2168 | 2168 | * @param int $user_id |
2169 | 2169 | * @param string $token |
2170 | 2170 | * return bool |
2171 | + * @param boolean $is_master_user |
|
2171 | 2172 | */ |
2172 | 2173 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
2173 | 2174 | // not designed for concurrent updates |
@@ -2612,7 +2613,7 @@ discard block |
||
2612 | 2613 | * |
2613 | 2614 | * @param string $tag Tag as it appears in each module heading. |
2614 | 2615 | * |
2615 | - * @return mixed |
|
2616 | + * @return string |
|
2616 | 2617 | */ |
2617 | 2618 | public static function translate_module_tag( $tag ) { |
2618 | 2619 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2784,8 +2785,8 @@ discard block |
||
2784 | 2785 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
2785 | 2786 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
2786 | 2787 | * |
2787 | - * @param $string |
|
2788 | - * @return mixed |
|
2788 | + * @param string $string |
|
2789 | + * @return string|null |
|
2789 | 2790 | */ |
2790 | 2791 | public static function alias_directories( $string ) { |
2791 | 2792 | // ABSPATH has a trailing slash. |
@@ -3045,6 +3046,9 @@ discard block |
||
3045 | 3046 | return self::update_active_modules( $new ); |
3046 | 3047 | } |
3047 | 3048 | |
3049 | + /** |
|
3050 | + * @param string $module |
|
3051 | + */ |
|
3048 | 3052 | public static function enable_module_configurable( $module ) { |
3049 | 3053 | $module = Jetpack::get_module_slug( $module ); |
3050 | 3054 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3073,6 +3077,9 @@ discard block |
||
3073 | 3077 | } |
3074 | 3078 | |
3075 | 3079 | /* Installation */ |
3080 | + /** |
|
3081 | + * @param string $message |
|
3082 | + */ |
|
3076 | 3083 | public static function bail_on_activation( $message, $deactivate = true ) { |
3077 | 3084 | ?> |
3078 | 3085 | <!doctype html> |
@@ -3807,7 +3814,7 @@ discard block |
||
3807 | 3814 | * Add help to the Jetpack page |
3808 | 3815 | * |
3809 | 3816 | * @since Jetpack (1.2.3) |
3810 | - * @return false if not the Jetpack page |
|
3817 | + * @return false|null if not the Jetpack page |
|
3811 | 3818 | */ |
3812 | 3819 | function admin_help() { |
3813 | 3820 | $current_screen = get_current_screen(); |
@@ -4643,6 +4650,9 @@ discard block |
||
4643 | 4650 | return $url; |
4644 | 4651 | } |
4645 | 4652 | |
4653 | + /** |
|
4654 | + * @return string |
|
4655 | + */ |
|
4646 | 4656 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
4647 | 4657 | $actionurl = str_replace( '&', '&', $actionurl ); |
4648 | 4658 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -4702,6 +4712,7 @@ discard block |
||
4702 | 4712 | /** |
4703 | 4713 | * Returns the requested Jetpack API URL |
4704 | 4714 | * |
4715 | + * @param string $relative_url |
|
4705 | 4716 | * @return string |
4706 | 4717 | */ |
4707 | 4718 | public static function api_url( $relative_url ) { |
@@ -4897,6 +4908,7 @@ discard block |
||
4897 | 4908 | * Note these tokens are unique per call, NOT static per site for connecting. |
4898 | 4909 | * |
4899 | 4910 | * @since 2.6 |
4911 | + * @param string $action |
|
4900 | 4912 | * @return array |
4901 | 4913 | */ |
4902 | 4914 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
@@ -5452,7 +5464,6 @@ discard block |
||
5452 | 5464 | /** |
5453 | 5465 | * Report authentication status to the WP REST API. |
5454 | 5466 | * |
5455 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
5456 | 5467 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
5457 | 5468 | */ |
5458 | 5469 | public function wp_rest_authentication_errors( $value ) { |
@@ -5462,6 +5473,10 @@ discard block |
||
5462 | 5473 | return $this->rest_authentication_status; |
5463 | 5474 | } |
5464 | 5475 | |
5476 | + /** |
|
5477 | + * @param integer $timestamp |
|
5478 | + * @param string $nonce |
|
5479 | + */ |
|
5465 | 5480 | function add_nonce( $timestamp, $nonce ) { |
5466 | 5481 | global $wpdb; |
5467 | 5482 | static $nonces_used_this_request = array(); |
@@ -5607,6 +5622,7 @@ discard block |
||
5607 | 5622 | * @param string $key |
5608 | 5623 | * @param string $value |
5609 | 5624 | * @param bool $restate private |
5625 | + * @return string |
|
5610 | 5626 | */ |
5611 | 5627 | public static function state( $key = null, $value = null, $restate = false ) { |
5612 | 5628 | static $state = array(); |
@@ -5745,6 +5761,9 @@ discard block |
||
5745 | 5761 | } |
5746 | 5762 | } |
5747 | 5763 | |
5764 | + /** |
|
5765 | + * @param string $url |
|
5766 | + */ |
|
5748 | 5767 | public static function staticize_subdomain( $url ) { |
5749 | 5768 | |
5750 | 5769 | // Extract hostname from URL |
@@ -6300,9 +6319,7 @@ discard block |
||
6300 | 6319 | * |
6301 | 6320 | * Attached to `style_loader_src` filter. |
6302 | 6321 | * |
6303 | - * @param string $tag The tag that would link to the external asset. |
|
6304 | 6322 | * @param string $handle The registered handle of the script in question. |
6305 | - * @param string $href The url of the asset in question. |
|
6306 | 6323 | */ |
6307 | 6324 | public static function set_suffix_on_min( $src, $handle ) { |
6308 | 6325 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6489,8 +6506,8 @@ discard block |
||
6489 | 6506 | * - Absolute URLs `http://domain.com/feh.png` |
6490 | 6507 | * - Domain root relative URLs `/feh.png` |
6491 | 6508 | * |
6492 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
6493 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6509 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
6510 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
6494 | 6511 | * |
6495 | 6512 | * @return mixed|string |
6496 | 6513 | */ |
@@ -6789,7 +6806,6 @@ discard block |
||
6789 | 6806 | } |
6790 | 6807 | |
6791 | 6808 | /** |
6792 | - * @param mixed $result Value for the user's option |
|
6793 | 6809 | * @return mixed |
6794 | 6810 | */ |
6795 | 6811 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -33,6 +33,9 @@ discard block |
||
33 | 33 | public $extra_headers = array(); |
34 | 34 | |
35 | 35 | /** |
36 | + * @param string $method |
|
37 | + * @param string $url |
|
38 | + * @param string $post_body |
|
36 | 39 | * @return WPCOM_JSON_API instance |
37 | 40 | */ |
38 | 41 | static function init( $method = null, $url = null, $post_body = null ) { |
@@ -572,6 +575,10 @@ discard block |
||
572 | 575 | } |
573 | 576 | |
574 | 577 | // Returns true if the specified blog ID is a restricted blog |
578 | + |
|
579 | + /** |
|
580 | + * @param integer $blog_id |
|
581 | + */ |
|
575 | 582 | function is_restricted_blog( $blog_id ) { |
576 | 583 | /** |
577 | 584 | * Filters all REST API access and return a 403 unauthorized response for all Restricted blog IDs. |
@@ -346,6 +346,9 @@ |
||
346 | 346 | return false; |
347 | 347 | } |
348 | 348 | |
349 | + /** |
|
350 | + * @param string $checkout_id |
|
351 | + */ |
|
349 | 352 | private function set_checkout_id( $checkout_id ) { |
350 | 353 | global $wpdb; |
351 | 354 |