@@ -1404,7 +1404,7 @@ |
||
1404 | 1404 | /** |
1405 | 1405 | * Migration routine for moving safecss from wp_options to wp_posts to support revisions |
1406 | 1406 | * |
1407 | - * @return void |
|
1407 | + * @return false|null |
|
1408 | 1408 | */ |
1409 | 1409 | static function upgrade() { |
1410 | 1410 | $css = get_option( 'safecss' ); |
@@ -381,8 +381,8 @@ |
||
381 | 381 | * |
382 | 382 | * @param $width int Width of the image |
383 | 383 | * @param $height int Height of the image |
384 | -* @param $req_width int Required width to pass validation |
|
385 | -* @param $req_height int Required height to pass validation |
|
384 | +* @param integer $req_width int Required width to pass validation |
|
385 | +* @param integer $req_height int Required height to pass validation |
|
386 | 386 | * @return bool - True if the image passed the required size validation |
387 | 387 | */ |
388 | 388 | function _jetpack_og_get_image_validate_size($width, $height, $req_width, $req_height) { |
@@ -52,6 +52,9 @@ discard block |
||
52 | 52 | return (double) get_option( self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name, 0 ); |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param integer $time |
|
57 | + */ |
|
55 | 58 | public function set_next_sync_time( $time, $queue_name ) { |
56 | 59 | return update_option( self::NEXT_SYNC_TIME_OPTION_NAME . '_' . $queue_name, $time, true ); |
57 | 60 | } |
@@ -64,6 +67,9 @@ discard block |
||
64 | 67 | return $this->do_sync_and_set_delays( $this->sync_queue ); |
65 | 68 | } |
66 | 69 | |
70 | + /** |
|
71 | + * @param Jetpack_Sync_Queue $queue |
|
72 | + */ |
|
67 | 73 | public function do_sync_and_set_delays( $queue ) { |
68 | 74 | // don't sync if importing |
69 | 75 | if ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { |
@@ -293,6 +299,10 @@ discard block |
||
293 | 299 | } |
294 | 300 | |
295 | 301 | // in seconds |
302 | + |
|
303 | + /** |
|
304 | + * @param double $seconds |
|
305 | + */ |
|
296 | 306 | function set_max_dequeue_time( $seconds ) { |
297 | 307 | $this->max_dequeue_time = $seconds; |
298 | 308 | } |
@@ -107,6 +107,9 @@ discard block |
||
107 | 107 | self::set_is_sending( null ); |
108 | 108 | } |
109 | 109 | |
110 | + /** |
|
111 | + * @param boolean|null $is_importing |
|
112 | + */ |
|
110 | 113 | static function set_importing( $is_importing ) { |
111 | 114 | // set to NULL to revert to WP_IMPORTING, the standard behaviour |
112 | 115 | self::$is_importing = $is_importing; |
@@ -137,6 +140,9 @@ discard block |
||
137 | 140 | return (bool) self::$is_syncing; |
138 | 141 | } |
139 | 142 | |
143 | + /** |
|
144 | + * @param boolean|null $is_syncing |
|
145 | + */ |
|
140 | 146 | static function set_is_syncing( $is_syncing ) { |
141 | 147 | self::$is_syncing = $is_syncing; |
142 | 148 | } |
@@ -145,6 +151,9 @@ discard block |
||
145 | 151 | return (bool) self::$is_sending; |
146 | 152 | } |
147 | 153 | |
154 | + /** |
|
155 | + * @param boolean|null $is_sending |
|
156 | + */ |
|
148 | 157 | static function set_is_sending( $is_sending ) { |
149 | 158 | self::$is_sending = $is_sending; |
150 | 159 | } |
@@ -420,6 +420,10 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | // functions |
423 | + |
|
424 | + /** |
|
425 | + * @param string $name |
|
426 | + */ |
|
423 | 427 | public function get_callable( $name ) { |
424 | 428 | $value = get_option( 'jetpack_' . $name ); |
425 | 429 | |
@@ -688,6 +692,9 @@ discard block |
||
688 | 692 | return $histogram; |
689 | 693 | } |
690 | 694 | |
695 | + /** |
|
696 | + * @param string|null $id_column |
|
697 | + */ |
|
691 | 698 | private function table_checksum( $table, $columns, $id_column, $where_sql = '1=1', $min_id = null, $max_id = null, $strip_non_ascii = true ) { |
692 | 699 | global $wpdb; |
693 | 700 | |
@@ -725,6 +732,9 @@ discard block |
||
725 | 732 | |
726 | 733 | } |
727 | 734 | |
735 | + /** |
|
736 | + * @param string $where_sql |
|
737 | + */ |
|
728 | 738 | private function meta_count( $table, $where_sql, $min_id, $max_id ) { |
729 | 739 | global $wpdb; |
730 | 740 |
@@ -279,6 +279,9 @@ discard block |
||
279 | 279 | $listener->get_full_sync_queue()->reset(); |
280 | 280 | } |
281 | 281 | |
282 | + /** |
|
283 | + * @param integer $default |
|
284 | + */ |
|
282 | 285 | private function get_status_option( $name, $default = null ) { |
283 | 286 | $prefix = self::STATUS_OPTION_PREFIX; |
284 | 287 | |
@@ -313,6 +316,9 @@ discard block |
||
313 | 316 | return $this->read_option( 'jetpack_sync_full_config' ); |
314 | 317 | } |
315 | 318 | |
319 | + /** |
|
320 | + * @param string $name |
|
321 | + */ |
|
316 | 322 | private function write_option( $name, $value ) { |
317 | 323 | // we write our own option updating code to bypass filters/caching/etc on set_option/get_option |
318 | 324 | global $wpdb; |
@@ -340,6 +346,9 @@ discard block |
||
340 | 346 | return $updated_num; |
341 | 347 | } |
342 | 348 | |
349 | + /** |
|
350 | + * @param string $name |
|
351 | + */ |
|
343 | 352 | private function read_option( $name, $default = null ) { |
344 | 353 | global $wpdb; |
345 | 354 | $value = $wpdb->get_var( |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * |
177 | 177 | * @since 4.3.0 |
178 | 178 | * |
179 | - * @return array Array of Jetpack modules. |
|
179 | + * @return string Array of Jetpack modules. |
|
180 | 180 | */ |
181 | 181 | public function get_modules() { |
182 | 182 | require_once( JETPACK__PLUGIN_DIR . 'class.jetpack-admin.php' ); |
@@ -1104,7 +1104,6 @@ discard block |
||
1104 | 1104 | * |
1105 | 1105 | * @since 4.3.0 |
1106 | 1106 | * |
1107 | - * @param WP_REST_Request $request |
|
1108 | 1107 | * |
1109 | 1108 | * @return bool does a current user have enough privileges. |
1110 | 1109 | */ |
@@ -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' ); |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | * database which could be set to anything as opposed to what this function returns. |
988 | 988 | * @param bool $option |
989 | 989 | * |
990 | - * @return boolean |
|
990 | + * @return string |
|
991 | 991 | */ |
992 | 992 | public function is_main_network_option( $option ) { |
993 | 993 | // return '1' or '' |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
999 | 999 | * |
1000 | 1000 | * @param string $option |
1001 | - * @return boolean |
|
1001 | + * @return string |
|
1002 | 1002 | */ |
1003 | 1003 | public function is_multisite( $option ) { |
1004 | 1004 | return (string) (bool) is_multisite(); |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | |
1061 | 1061 | /** |
1062 | 1062 | * Returns true if the site has file write access false otherwise. |
1063 | - * @return string ( '1' | '0' ) |
|
1063 | + * @return integer ( '1' | '0' ) |
|
1064 | 1064 | **/ |
1065 | 1065 | public static function file_system_write_access() { |
1066 | 1066 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1247,6 +1247,7 @@ discard block |
||
1247 | 1247 | * @access public |
1248 | 1248 | * @static |
1249 | 1249 | * |
1250 | + * @param string $feature |
|
1250 | 1251 | * @return bool True if plan supports feature, false if not |
1251 | 1252 | */ |
1252 | 1253 | public static function active_plan_supports( $feature ) { |
@@ -1736,7 +1737,7 @@ discard block |
||
1736 | 1737 | * Returns the requested option. Looks in jetpack_options or jetpack_$name as appropriate. |
1737 | 1738 | * |
1738 | 1739 | * @param string $name Option name |
1739 | - * @param mixed $default (optional) |
|
1740 | + * @param boolean $default (optional) |
|
1740 | 1741 | */ |
1741 | 1742 | public static function get_option( $name, $default = false ) { |
1742 | 1743 | return Jetpack_Options::get_option( $name, $default ); |
@@ -1746,6 +1747,7 @@ discard block |
||
1746 | 1747 | * Stores two secrets and a timestamp so WordPress.com can make a request back and verify an action |
1747 | 1748 | * Does some extra verification so urls (such as those to public-api, register, etc) can't just be crafted |
1748 | 1749 | * $name must be a registered option name. |
1750 | + * @param string $name |
|
1749 | 1751 | */ |
1750 | 1752 | public static function create_nonce( $name ) { |
1751 | 1753 | $secret = wp_generate_password( 32, false ) . ':' . wp_generate_password( 32, false ) . ':' . ( time() + 600 ); |
@@ -1803,6 +1805,7 @@ discard block |
||
1803 | 1805 | * @param int $user_id |
1804 | 1806 | * @param string $token |
1805 | 1807 | * return bool |
1808 | + * @param boolean $is_master_user |
|
1806 | 1809 | */ |
1807 | 1810 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
1808 | 1811 | // not designed for concurrent updates |
@@ -2197,6 +2200,7 @@ discard block |
||
2197 | 2200 | |
2198 | 2201 | /** |
2199 | 2202 | * Like core's get_file_data implementation, but caches the result. |
2203 | + * @param string $file |
|
2200 | 2204 | */ |
2201 | 2205 | public static function get_file_data( $file, $headers ) { |
2202 | 2206 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2225,7 +2229,7 @@ discard block |
||
2225 | 2229 | * |
2226 | 2230 | * @param string $tag Tag as it appears in each module heading. |
2227 | 2231 | * |
2228 | - * @return mixed |
|
2232 | + * @return string |
|
2229 | 2233 | */ |
2230 | 2234 | public static function translate_module_tag( $tag ) { |
2231 | 2235 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2238,7 +2242,7 @@ discard block |
||
2238 | 2242 | * |
2239 | 2243 | * @param array $modules |
2240 | 2244 | * |
2241 | - * @return string|void |
|
2245 | + * @return string |
|
2242 | 2246 | */ |
2243 | 2247 | public static function get_translated_modules( $modules ) { |
2244 | 2248 | foreach ( $modules as $index => $module ) { |
@@ -2539,6 +2543,9 @@ discard block |
||
2539 | 2543 | _deprecated_function( __METHOD__, 'jeptack-4.2' ); |
2540 | 2544 | } |
2541 | 2545 | |
2546 | + /** |
|
2547 | + * @return string |
|
2548 | + */ |
|
2542 | 2549 | public static function deactivate_module( $module ) { |
2543 | 2550 | /** |
2544 | 2551 | * Fires when a module is deactivated. |
@@ -2567,6 +2574,9 @@ discard block |
||
2567 | 2574 | return self::update_active_modules( $new ); |
2568 | 2575 | } |
2569 | 2576 | |
2577 | + /** |
|
2578 | + * @param string $module |
|
2579 | + */ |
|
2570 | 2580 | public static function enable_module_configurable( $module ) { |
2571 | 2581 | $module = Jetpack::get_module_slug( $module ); |
2572 | 2582 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -2577,21 +2587,33 @@ discard block |
||
2577 | 2587 | return Jetpack::admin_url( array( 'page' => 'jetpack', 'configure' => $module ) ); |
2578 | 2588 | } |
2579 | 2589 | |
2590 | + /** |
|
2591 | + * @param string $module |
|
2592 | + */ |
|
2580 | 2593 | public static function module_configuration_load( $module, $method ) { |
2581 | 2594 | $module = Jetpack::get_module_slug( $module ); |
2582 | 2595 | add_action( 'jetpack_module_configuration_load_' . $module, $method ); |
2583 | 2596 | } |
2584 | 2597 | |
2598 | + /** |
|
2599 | + * @param string $module |
|
2600 | + */ |
|
2585 | 2601 | public static function module_configuration_head( $module, $method ) { |
2586 | 2602 | $module = Jetpack::get_module_slug( $module ); |
2587 | 2603 | add_action( 'jetpack_module_configuration_head_' . $module, $method ); |
2588 | 2604 | } |
2589 | 2605 | |
2606 | + /** |
|
2607 | + * @param string $module |
|
2608 | + */ |
|
2590 | 2609 | public static function module_configuration_screen( $module, $method ) { |
2591 | 2610 | $module = Jetpack::get_module_slug( $module ); |
2592 | 2611 | add_action( 'jetpack_module_configuration_screen_' . $module, $method ); |
2593 | 2612 | } |
2594 | 2613 | |
2614 | + /** |
|
2615 | + * @param string $module |
|
2616 | + */ |
|
2595 | 2617 | public static function module_configuration_activation_screen( $module, $method ) { |
2596 | 2618 | $module = Jetpack::get_module_slug( $module ); |
2597 | 2619 | add_action( 'display_activate_module_setting_' . $module, $method ); |
@@ -2599,6 +2621,9 @@ discard block |
||
2599 | 2621 | |
2600 | 2622 | /* Installation */ |
2601 | 2623 | |
2624 | + /** |
|
2625 | + * @param string $message |
|
2626 | + */ |
|
2602 | 2627 | public static function bail_on_activation( $message, $deactivate = true ) { |
2603 | 2628 | ?> |
2604 | 2629 | <!doctype html> |
@@ -3245,7 +3270,7 @@ discard block |
||
3245 | 3270 | * Add help to the Jetpack page |
3246 | 3271 | * |
3247 | 3272 | * @since Jetpack (1.2.3) |
3248 | - * @return false if not the Jetpack page |
|
3273 | + * @return false|null if not the Jetpack page |
|
3249 | 3274 | */ |
3250 | 3275 | function admin_help() { |
3251 | 3276 | $current_screen = get_current_screen(); |
@@ -4243,6 +4268,7 @@ discard block |
||
4243 | 4268 | /** |
4244 | 4269 | * Returns the requested Jetpack API URL |
4245 | 4270 | * |
4271 | + * @param string $relative_url |
|
4246 | 4272 | * @return string |
4247 | 4273 | */ |
4248 | 4274 | public static function api_url( $relative_url ) { |
@@ -4387,7 +4413,8 @@ discard block |
||
4387 | 4413 | * Note these tokens are unique per call, NOT static per site for connecting. |
4388 | 4414 | * |
4389 | 4415 | * @since 2.6 |
4390 | - * @return array |
|
4416 | + * @param string $action |
|
4417 | + * @return string |
|
4391 | 4418 | */ |
4392 | 4419 | public function generate_secrets( $action, $exp = 600 ) { |
4393 | 4420 | $secret = wp_generate_password( 32, false ) // secret_1 |
@@ -4713,6 +4740,10 @@ discard block |
||
4713 | 4740 | return new WP_User( $token_details['user_id'] ); |
4714 | 4741 | } |
4715 | 4742 | |
4743 | + /** |
|
4744 | + * @param integer $timestamp |
|
4745 | + * @param string $nonce |
|
4746 | + */ |
|
4716 | 4747 | function add_nonce( $timestamp, $nonce ) { |
4717 | 4748 | global $wpdb; |
4718 | 4749 | static $nonces_used_this_request = array(); |
@@ -4858,6 +4889,7 @@ discard block |
||
4858 | 4889 | * @param string $key |
4859 | 4890 | * @param string $value |
4860 | 4891 | * @param bool $restate private |
4892 | + * @return string |
|
4861 | 4893 | */ |
4862 | 4894 | public static function state( $key = null, $value = null, $restate = false ) { |
4863 | 4895 | static $state = array(); |
@@ -4914,6 +4946,9 @@ discard block |
||
4914 | 4946 | Jetpack::state( null, null, true ); |
4915 | 4947 | } |
4916 | 4948 | |
4949 | + /** |
|
4950 | + * @param string $file |
|
4951 | + */ |
|
4917 | 4952 | public static function check_privacy( $file ) { |
4918 | 4953 | static $is_site_publicly_accessible = null; |
4919 | 4954 | |
@@ -5658,8 +5693,8 @@ discard block |
||
5658 | 5693 | * - Absolute URLs `http://domain.com/feh.png` |
5659 | 5694 | * - Domain root relative URLs `/feh.png` |
5660 | 5695 | * |
5661 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
5662 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
5696 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
5697 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
5663 | 5698 | * |
5664 | 5699 | * @return mixed|string |
5665 | 5700 | */ |
@@ -5950,7 +5985,7 @@ discard block |
||
5950 | 5985 | * |
5951 | 5986 | * @param string $option_name |
5952 | 5987 | * |
5953 | - * @return bool |
|
5988 | + * @return false|null |
|
5954 | 5989 | */ |
5955 | 5990 | public static function jumpstart_has_updated_module_option( $option_name = '' ) { |
5956 | 5991 | // Bail if Jump Start has already been dismissed |
@@ -6041,7 +6076,6 @@ discard block |
||
6041 | 6076 | } |
6042 | 6077 | |
6043 | 6078 | /** |
6044 | - * @param mixed $result Value for the user's option |
|
6045 | 6079 | * @return mixed |
6046 | 6080 | */ |
6047 | 6081 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -283,6 +283,11 @@ discard block |
||
283 | 283 | ) ); |
284 | 284 | } |
285 | 285 | |
286 | + /** |
|
287 | + * @param string $path |
|
288 | + * @param string $classname |
|
289 | + * @param Jetpack_IXR_Client $constructor_arguments |
|
290 | + */ |
|
286 | 291 | public static function route( $path, $classname, $method, |
287 | 292 | $constructor_arguments = NULL, |
288 | 293 | $endpoint_arguments = NULL |
@@ -1980,7 +1985,7 @@ discard block |
||
1980 | 1985 | * |
1981 | 1986 | * @param string $route Regular expression for the endpoint with the module slug to return. |
1982 | 1987 | * |
1983 | - * @return array |
|
1988 | + * @return string |
|
1984 | 1989 | */ |
1985 | 1990 | public static function get_module_requested( $route = '/module/(?P<slug>[a-z\-]+)' ) { |
1986 | 1991 | |
@@ -2005,7 +2010,7 @@ discard block |
||
2005 | 2010 | * @param string $modules Can be a single module or a list of modules. |
2006 | 2011 | * @param null|string $slug Slug of the module in the first parameter. |
2007 | 2012 | * |
2008 | - * @return array |
|
2013 | + * @return string |
|
2009 | 2014 | */ |
2010 | 2015 | public static function prepare_modules_for_response( $modules = '', $slug = null ) { |
2011 | 2016 | if ( get_option( 'permalink_structure' ) ) { |