@@ -447,6 +447,10 @@ discard block |
||
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | // functions |
| 450 | + |
|
| 451 | + /** |
|
| 452 | + * @param string $name |
|
| 453 | + */ |
|
| 450 | 454 | public function get_callable( $name ) { |
| 451 | 455 | $value = get_option( 'jetpack_' . $name ); |
| 452 | 456 | |
@@ -738,6 +742,9 @@ discard block |
||
| 738 | 742 | return $histogram; |
| 739 | 743 | } |
| 740 | 744 | |
| 745 | + /** |
|
| 746 | + * @param string|null $id_column |
|
| 747 | + */ |
|
| 741 | 748 | private function table_checksum( $table, $columns, $id_column, $where_sql = '1=1', $min_id = null, $max_id = null, $strip_non_ascii = true, $salt = '' ) { |
| 742 | 749 | global $wpdb; |
| 743 | 750 | |
@@ -791,6 +798,9 @@ discard block |
||
| 791 | 798 | return 'sum'; |
| 792 | 799 | } |
| 793 | 800 | |
| 801 | + /** |
|
| 802 | + * @param string $where_sql |
|
| 803 | + */ |
|
| 794 | 804 | private function meta_count( $table, $where_sql, $min_id, $max_id ) { |
| 795 | 805 | global $wpdb; |
| 796 | 806 | |
@@ -65,7 +65,6 @@ |
||
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * @param string $file __FILE__ |
| 68 | - * @param string $option, Option name to sync |
|
| 69 | 68 | * @param string $option ... |
| 70 | 69 | */ |
| 71 | 70 | static function sync_options( $file, $option /*, $option, ... */ ) { |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | * This is ported over from the manage module, which has been deprecated and baked in here. |
| 717 | 717 | * |
| 718 | 718 | * @param $domains |
| 719 | - * @return array |
|
| 719 | + * @return string[] |
|
| 720 | 720 | */ |
| 721 | 721 | function allow_wpcom_domain( $domains ) { |
| 722 | 722 | if ( empty( $domains ) ) { |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | } |
| 1237 | 1237 | /** |
| 1238 | 1238 | * Does the network allow admins to add new users. |
| 1239 | - * @return boolian |
|
| 1239 | + * @return boolean |
|
| 1240 | 1240 | */ |
| 1241 | 1241 | static function network_add_new_users( $option = null ) { |
| 1242 | 1242 | return (bool) get_site_option( 'add_new_users' ); |
@@ -1341,7 +1341,7 @@ discard block |
||
| 1341 | 1341 | * database which could be set to anything as opposed to what this function returns. |
| 1342 | 1342 | * @param bool $option |
| 1343 | 1343 | * |
| 1344 | - * @return boolean |
|
| 1344 | + * @return string |
|
| 1345 | 1345 | */ |
| 1346 | 1346 | public function is_main_network_option( $option ) { |
| 1347 | 1347 | // return '1' or '' |
@@ -1352,7 +1352,7 @@ discard block |
||
| 1352 | 1352 | * Return true if we are with multi-site or multi-network false if we are dealing with single site. |
| 1353 | 1353 | * |
| 1354 | 1354 | * @param string $option |
| 1355 | - * @return boolean |
|
| 1355 | + * @return string |
|
| 1356 | 1356 | */ |
| 1357 | 1357 | public function is_multisite( $option ) { |
| 1358 | 1358 | return (string) (bool) is_multisite(); |
@@ -1414,7 +1414,7 @@ discard block |
||
| 1414 | 1414 | |
| 1415 | 1415 | /** |
| 1416 | 1416 | * Returns true if the site has file write access false otherwise. |
| 1417 | - * @return string ( '1' | '0' ) |
|
| 1417 | + * @return integer ( '1' | '0' ) |
|
| 1418 | 1418 | **/ |
| 1419 | 1419 | public static function file_system_write_access() { |
| 1420 | 1420 | if ( ! function_exists( 'get_filesystem_method' ) ) { |
@@ -1558,6 +1558,7 @@ discard block |
||
| 1558 | 1558 | * Determine whether the active plan supports a particular feature |
| 1559 | 1559 | * |
| 1560 | 1560 | * @deprecated 7.2.0 Use Jetpack_Plan::supports. |
| 1561 | + * @param string $feature |
|
| 1561 | 1562 | * @return bool True if plan supports feature, false if not. |
| 1562 | 1563 | */ |
| 1563 | 1564 | public static function active_plan_supports( $feature ) { |
@@ -2145,6 +2146,7 @@ discard block |
||
| 2145 | 2146 | * @param int $user_id |
| 2146 | 2147 | * @param string $token |
| 2147 | 2148 | * return bool |
| 2149 | + * @param boolean $is_master_user |
|
| 2148 | 2150 | */ |
| 2149 | 2151 | public static function update_user_token( $user_id, $token, $is_master_user ) { |
| 2150 | 2152 | // not designed for concurrent updates |
@@ -2547,6 +2549,7 @@ discard block |
||
| 2547 | 2549 | |
| 2548 | 2550 | /** |
| 2549 | 2551 | * Like core's get_file_data implementation, but caches the result. |
| 2552 | + * @param string $file |
|
| 2550 | 2553 | */ |
| 2551 | 2554 | public static function get_file_data( $file, $headers ) { |
| 2552 | 2555 | //Get just the filename from $file (i.e. exclude full path) so that a consistent hash is generated |
@@ -2583,7 +2586,7 @@ discard block |
||
| 2583 | 2586 | * |
| 2584 | 2587 | * @param string $tag Tag as it appears in each module heading. |
| 2585 | 2588 | * |
| 2586 | - * @return mixed |
|
| 2589 | + * @return string |
|
| 2587 | 2590 | */ |
| 2588 | 2591 | public static function translate_module_tag( $tag ) { |
| 2589 | 2592 | return jetpack_get_module_i18n_tag( $tag ); |
@@ -2755,8 +2758,8 @@ discard block |
||
| 2755 | 2758 | * Rewrites ABSPATH (eg `/home/jetpack/wordpress/`) to ABSPATH, and if WP_CONTENT_DIR |
| 2756 | 2759 | * is located outside of ABSPATH, rewrites that to WP_CONTENT_DIR. |
| 2757 | 2760 | * |
| 2758 | - * @param $string |
|
| 2759 | - * @return mixed |
|
| 2761 | + * @param string $string |
|
| 2762 | + * @return string|null |
|
| 2760 | 2763 | */ |
| 2761 | 2764 | public static function alias_directories( $string ) { |
| 2762 | 2765 | // ABSPATH has a trailing slash. |
@@ -3016,6 +3019,9 @@ discard block |
||
| 3016 | 3019 | return self::update_active_modules( $new ); |
| 3017 | 3020 | } |
| 3018 | 3021 | |
| 3022 | + /** |
|
| 3023 | + * @param string $module |
|
| 3024 | + */ |
|
| 3019 | 3025 | public static function enable_module_configurable( $module ) { |
| 3020 | 3026 | $module = Jetpack::get_module_slug( $module ); |
| 3021 | 3027 | add_filter( 'jetpack_module_configurable_' . $module, '__return_true' ); |
@@ -3044,6 +3050,9 @@ discard block |
||
| 3044 | 3050 | } |
| 3045 | 3051 | |
| 3046 | 3052 | /* Installation */ |
| 3053 | + /** |
|
| 3054 | + * @param string $message |
|
| 3055 | + */ |
|
| 3047 | 3056 | public static function bail_on_activation( $message, $deactivate = true ) { |
| 3048 | 3057 | ?> |
| 3049 | 3058 | <!doctype html> |
@@ -3778,7 +3787,7 @@ discard block |
||
| 3778 | 3787 | * Add help to the Jetpack page |
| 3779 | 3788 | * |
| 3780 | 3789 | * @since Jetpack (1.2.3) |
| 3781 | - * @return false if not the Jetpack page |
|
| 3790 | + * @return false|null if not the Jetpack page |
|
| 3782 | 3791 | */ |
| 3783 | 3792 | function admin_help() { |
| 3784 | 3793 | $current_screen = get_current_screen(); |
@@ -4597,6 +4606,9 @@ discard block |
||
| 4597 | 4606 | return $url; |
| 4598 | 4607 | } |
| 4599 | 4608 | |
| 4609 | + /** |
|
| 4610 | + * @return string |
|
| 4611 | + */ |
|
| 4600 | 4612 | public static function nonce_url_no_esc( $actionurl, $action = -1, $name = '_wpnonce' ) { |
| 4601 | 4613 | $actionurl = str_replace( '&', '&', $actionurl ); |
| 4602 | 4614 | return add_query_arg( $name, wp_create_nonce( $action ), $actionurl ); |
@@ -4656,6 +4668,7 @@ discard block |
||
| 4656 | 4668 | /** |
| 4657 | 4669 | * Returns the requested Jetpack API URL |
| 4658 | 4670 | * |
| 4671 | + * @param string $relative_url |
|
| 4659 | 4672 | * @return string |
| 4660 | 4673 | */ |
| 4661 | 4674 | public static function api_url( $relative_url ) { |
@@ -4847,6 +4860,7 @@ discard block |
||
| 4847 | 4860 | * Note these tokens are unique per call, NOT static per site for connecting. |
| 4848 | 4861 | * |
| 4849 | 4862 | * @since 2.6 |
| 4863 | + * @param string $action |
|
| 4850 | 4864 | * @return array |
| 4851 | 4865 | */ |
| 4852 | 4866 | public static function generate_secrets( $action, $user_id = false, $exp = 600 ) { |
@@ -5381,7 +5395,6 @@ discard block |
||
| 5381 | 5395 | /** |
| 5382 | 5396 | * Report authentication status to the WP REST API. |
| 5383 | 5397 | * |
| 5384 | - * @param WP_Error|mixed $result Error from another authentication handler, null if we should handle it, or another value if not |
|
| 5385 | 5398 | * @return WP_Error|boolean|null {@see WP_JSON_Server::check_authentication} |
| 5386 | 5399 | */ |
| 5387 | 5400 | public function wp_rest_authentication_errors( $value ) { |
@@ -5391,6 +5404,10 @@ discard block |
||
| 5391 | 5404 | return $this->rest_authentication_status; |
| 5392 | 5405 | } |
| 5393 | 5406 | |
| 5407 | + /** |
|
| 5408 | + * @param integer $timestamp |
|
| 5409 | + * @param string $nonce |
|
| 5410 | + */ |
|
| 5394 | 5411 | function add_nonce( $timestamp, $nonce ) { |
| 5395 | 5412 | global $wpdb; |
| 5396 | 5413 | static $nonces_used_this_request = array(); |
@@ -5536,6 +5553,7 @@ discard block |
||
| 5536 | 5553 | * @param string $key |
| 5537 | 5554 | * @param string $value |
| 5538 | 5555 | * @param bool $restate private |
| 5556 | + * @return string |
|
| 5539 | 5557 | */ |
| 5540 | 5558 | public static function state( $key = null, $value = null, $restate = false ) { |
| 5541 | 5559 | static $state = array(); |
@@ -5592,6 +5610,9 @@ discard block |
||
| 5592 | 5610 | Jetpack::state( null, null, true ); |
| 5593 | 5611 | } |
| 5594 | 5612 | |
| 5613 | + /** |
|
| 5614 | + * @param string $file |
|
| 5615 | + */ |
|
| 5595 | 5616 | public static function check_privacy( $file ) { |
| 5596 | 5617 | static $is_site_publicly_accessible = null; |
| 5597 | 5618 | |
@@ -5674,6 +5695,9 @@ discard block |
||
| 5674 | 5695 | } |
| 5675 | 5696 | } |
| 5676 | 5697 | |
| 5698 | + /** |
|
| 5699 | + * @param string $url |
|
| 5700 | + */ |
|
| 5677 | 5701 | public static function staticize_subdomain( $url ) { |
| 5678 | 5702 | |
| 5679 | 5703 | // Extract hostname from URL |
@@ -6224,9 +6248,7 @@ discard block |
||
| 6224 | 6248 | * |
| 6225 | 6249 | * Attached to `style_loader_src` filter. |
| 6226 | 6250 | * |
| 6227 | - * @param string $tag The tag that would link to the external asset. |
|
| 6228 | 6251 | * @param string $handle The registered handle of the script in question. |
| 6229 | - * @param string $href The url of the asset in question. |
|
| 6230 | 6252 | */ |
| 6231 | 6253 | public static function set_suffix_on_min( $src, $handle ) { |
| 6232 | 6254 | if ( false === strpos( $src, '.min.css' ) ) { |
@@ -6413,8 +6435,8 @@ discard block |
||
| 6413 | 6435 | * - Absolute URLs `http://domain.com/feh.png` |
| 6414 | 6436 | * - Domain root relative URLs `/feh.png` |
| 6415 | 6437 | * |
| 6416 | - * @param $css string: The raw CSS -- should be read in directly from the file. |
|
| 6417 | - * @param $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6438 | + * @param string $css string: The raw CSS -- should be read in directly from the file. |
|
| 6439 | + * @param string $css_file_url : The URL that the file can be accessed at, for calculating paths from. |
|
| 6418 | 6440 | * |
| 6419 | 6441 | * @return mixed|string |
| 6420 | 6442 | */ |
@@ -6657,7 +6679,7 @@ discard block |
||
| 6657 | 6679 | /** |
| 6658 | 6680 | * Stores and prints out domains to prefetch for page speed optimization. |
| 6659 | 6681 | * |
| 6660 | - * @param mixed $new_urls |
|
| 6682 | + * @param string[] $new_urls |
|
| 6661 | 6683 | */ |
| 6662 | 6684 | public static function dns_prefetch( $new_urls = null ) { |
| 6663 | 6685 | static $prefetch_urls = array(); |
@@ -6712,7 +6734,6 @@ discard block |
||
| 6712 | 6734 | } |
| 6713 | 6735 | |
| 6714 | 6736 | /** |
| 6715 | - * @param mixed $result Value for the user's option |
|
| 6716 | 6737 | * @return mixed |
| 6717 | 6738 | */ |
| 6718 | 6739 | function get_user_option_meta_box_order_dashboard( $sorted ) { |
@@ -684,6 +684,9 @@ |
||
| 684 | 684 | return self::get_module( $module_slug ); |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | + /** |
|
| 688 | + * @param string $module_slug |
|
| 689 | + */ |
|
| 687 | 690 | protected static function get_module( $module_slug ) { |
| 688 | 691 | if ( ! Jetpack::is_module( $module_slug ) ) |
| 689 | 692 | return new WP_Error( 'unknown_jetpack_module', sprintf( __( 'Module not found: `%s`.', 'jetpack' ), $module_slug ), 404 ); |
@@ -149,6 +149,9 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | /** |
| 151 | 151 | * Helper function for Jetpack_Color::fromHsl() |
| 152 | + * @param double $p |
|
| 153 | + * @param double $q |
|
| 154 | + * @param integer $t |
|
| 152 | 155 | */ |
| 153 | 156 | private function hue2rgb( $p, $q, $t ) { |
| 154 | 157 | if ( $t < 0 ) $t += 1; |
@@ -278,7 +281,7 @@ discard block |
||
| 278 | 281 | * Get HSV values for color |
| 279 | 282 | * (integer values from 0-255, fast but less accurate) |
| 280 | 283 | * |
| 281 | - * @return int |
|
| 284 | + * @return string |
|
| 282 | 285 | */ |
| 283 | 286 | public function toHsvInt() |
| 284 | 287 | { |
@@ -498,7 +501,7 @@ discard block |
||
| 498 | 501 | * |
| 499 | 502 | * @param Jetpack_Color $color |
| 500 | 503 | * |
| 501 | - * @return int |
|
| 504 | + * @return double |
|
| 502 | 505 | */ |
| 503 | 506 | public function getDistanceRgbFrom(Jetpack_Color $color) |
| 504 | 507 | { |
@@ -682,6 +685,9 @@ discard block |
||
| 682 | 685 | return $this->incrementLightness( $amount ); |
| 683 | 686 | } |
| 684 | 687 | |
| 688 | + /** |
|
| 689 | + * @param integer $amount |
|
| 690 | + */ |
|
| 685 | 691 | public function incrementLightness( $amount ) { |
| 686 | 692 | $hsl = $this->toHsl(); |
| 687 | 693 | extract( $hsl ); |
@@ -699,6 +705,9 @@ discard block |
||
| 699 | 705 | return $this->incrementSaturation( - $amount ); |
| 700 | 706 | } |
| 701 | 707 | |
| 708 | + /** |
|
| 709 | + * @param integer $amount |
|
| 710 | + */ |
|
| 702 | 711 | public function incrementSaturation( $amount ) { |
| 703 | 712 | $hsl = $this->toHsl(); |
| 704 | 713 | extract( $hsl ); |
@@ -739,6 +748,9 @@ discard block |
||
| 739 | 748 | return $this->incrementHue( $incr ); |
| 740 | 749 | } |
| 741 | 750 | |
| 751 | + /** |
|
| 752 | + * @param integer $amount |
|
| 753 | + */ |
|
| 742 | 754 | public function incrementHue( $amount ) { |
| 743 | 755 | $hsl = $this->toHsl(); |
| 744 | 756 | extract( $hsl ); |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | * Construct object from image. |
| 66 | 66 | * |
| 67 | 67 | * @param optional $type (hex, rgb, hsl) |
| 68 | - * @return color as a string formatted as $type |
|
| 68 | + * @return false|string as a string formatted as $type |
|
| 69 | 69 | * |
| 70 | 70 | */ |
| 71 | 71 | function color( $type = 'hex' ) { |
@@ -63,6 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * Similar to current_user_can, but internal to VideoPress. Returns |
| 65 | 65 | * true if the given VideoPress capability is allowed by the given user. |
| 66 | + * @param string $cap |
|
| 66 | 67 | */ |
| 67 | 68 | public function can( $cap, $user_id = false ) { |
| 68 | 69 | if ( ! $user_id ) { |
@@ -158,7 +159,7 @@ discard block |
||
| 158 | 159 | * @param string $url |
| 159 | 160 | * @param int $post_id |
| 160 | 161 | * |
| 161 | - * @return mixed |
|
| 162 | + * @return string |
|
| 162 | 163 | */ |
| 163 | 164 | public function update_attachment_url_for_videopress( $url, $post_id ) { |
| 164 | 165 | |
@@ -219,7 +220,7 @@ discard block |
||
| 219 | 220 | /** |
| 220 | 221 | * A work-around / hack to make it possible to go to the media library with the add new box open. |
| 221 | 222 | * |
| 222 | - * @return bool |
|
| 223 | + * @return false|null |
|
| 223 | 224 | */ |
| 224 | 225 | public function print_in_footer_open_media_add_new() { |
| 225 | 226 | global $pagenow; |
@@ -348,6 +348,7 @@ |
||
| 348 | 348 | * |
| 349 | 349 | * Similar to current_user_can, but internal to VideoPress. Returns |
| 350 | 350 | * true if the given VideoPress capability is allowed by the given user. |
| 351 | + * @param string $cap |
|
| 351 | 352 | */ |
| 352 | 353 | function can( $cap, $user_id = false ) { |
| 353 | 354 | if ( ! $user_id ) |
@@ -117,6 +117,11 @@ discard block |
||
| 117 | 117 | do_action( 'jetpack_bump_stats_extras', 'widget', 'twitter' ); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | + /** |
|
| 121 | + * @param boolean $hidepublicized |
|
| 122 | + * @param string $before_tweet |
|
| 123 | + * @param string $account |
|
| 124 | + */ |
|
| 120 | 125 | function display_tweets( $show, $tweets, $hidepublicized, $before_tweet, $before_timesince, $account ) { |
| 121 | 126 | $tweets_out = 0; |
| 122 | 127 | ?><ul class='tweets'><?php |
@@ -163,6 +168,9 @@ discard block |
||
| 163 | 168 | ?></ul><?php |
| 164 | 169 | } |
| 165 | 170 | |
| 171 | + /** |
|
| 172 | + * @param string $account |
|
| 173 | + */ |
|
| 166 | 174 | function display_follow_button( $account ) { |
| 167 | 175 | global $themecolors; |
| 168 | 176 | |
@@ -189,6 +197,11 @@ discard block |
||
| 189 | 197 | return $tweet; |
| 190 | 198 | } |
| 191 | 199 | |
| 200 | + /** |
|
| 201 | + * @param string $account |
|
| 202 | + * @param boolean $hidereplies |
|
| 203 | + * @param boolean $include_retweets |
|
| 204 | + */ |
|
| 192 | 205 | function fetch_twitter_user_stream( $account, $hidereplies, $show, $include_retweets ) { |
| 193 | 206 | $tweets = get_transient( 'widget-twitter-' . $this->number ); |
| 194 | 207 | $the_error = get_transient( 'widget-twitter-error-' . $this->number ); |
@@ -366,6 +379,9 @@ discard block |
||
| 366 | 379 | <?php |
| 367 | 380 | } |
| 368 | 381 | |
| 382 | + /** |
|
| 383 | + * @param integer $original |
|
| 384 | + */ |
|
| 369 | 385 | function time_since( $original, $do_more = 0 ) { |
| 370 | 386 | // array of time period chunks |
| 371 | 387 | $chunks = array( |