@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | /** |
| 187 | 187 | * Return a hosting provider using a set of known constants. |
| 188 | 188 | * |
| 189 | - * @return mixed A host identifier string or false. |
|
| 189 | + * @return string|false A host identifier string or false. |
|
| 190 | 190 | */ |
| 191 | 191 | public function get_hosting_provider_by_known_constant() { |
| 192 | 192 | $hosting_provider_constants = array( |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | /** |
| 215 | 215 | * Return a hosting provider using a set of known classes. |
| 216 | 216 | * |
| 217 | - * @return mixed A host identifier string or false. |
|
| 217 | + * @return string|false A host identifier string or false. |
|
| 218 | 218 | */ |
| 219 | 219 | public function get_hosting_provider_by_known_class() { |
| 220 | 220 | $hosting_provider = false; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | /** |
| 232 | 232 | * Return a hosting provider using a set of known functions. |
| 233 | 233 | * |
| 234 | - * @return mixed A host identifier string or false. |
|
| 234 | + * @return string|false A host identifier string or false. |
|
| 235 | 235 | */ |
| 236 | 236 | public function get_hosting_provider_by_known_function() { |
| 237 | 237 | $hosting_provider = false; |
@@ -380,7 +380,7 @@ |
||
| 380 | 380 | * |
| 381 | 381 | * @param string $option Option value from the site. |
| 382 | 382 | * @param callable $url_function Function retrieving the URL to normalize. |
| 383 | - * @return mixed|string URL. |
|
| 383 | + * @return callable URL. |
|
| 384 | 384 | */ |
| 385 | 385 | public static function normalize_www_in_url( $option, $url_function ) { |
| 386 | 386 | $url = wp_parse_url( call_user_func( $url_function ) ); |
@@ -766,7 +766,7 @@ |
||
| 766 | 766 | * |
| 767 | 767 | * @param string $item Sync item identifier. |
| 768 | 768 | * |
| 769 | - * @return string|string[]|null |
|
| 769 | + * @return null|string |
|
| 770 | 770 | */ |
| 771 | 771 | protected static function sanitize_item_ids( $item ) { |
| 772 | 772 | // lets not delete any options that don't start with jpsq_sync- . |
@@ -10,6 +10,9 @@ |
||
| 10 | 10 | function __construct() { |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | + /** |
|
| 14 | + * @param string $table |
|
| 15 | + */ |
|
| 13 | 16 | function attach( $table, $parse_create_table = false ) { |
| 14 | 17 | $this->table=$table; |
| 15 | 18 | if ( $parse_create_table ) { |
@@ -42,6 +42,9 @@ discard block |
||
| 42 | 42 | die( 'naughty naughty' ); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + /** |
|
| 46 | + * @param string $file |
|
| 47 | + */ |
|
| 45 | 48 | function fdump( $file ) { |
| 46 | 49 | header("Content-Type: application/octet-stream;"); |
| 47 | 50 | header("Content-Transfer-Encoding: binary"); |
@@ -88,6 +91,9 @@ discard block |
||
| 88 | 91 | return false; |
| 89 | 92 | } |
| 90 | 93 | |
| 94 | + /** |
|
| 95 | + * @param string $method |
|
| 96 | + */ |
|
| 91 | 97 | function checksum_file( $file, $method ) { |
| 92 | 98 | $use_exec = false; |
| 93 | 99 | if ( filesize( $file ) >= 104857600 ) |
@@ -394,6 +394,9 @@ discard block |
||
| 394 | 394 | return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>" . $suffix; |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | + /** |
|
| 398 | + * @param integer $goal |
|
| 399 | + */ |
|
| 397 | 400 | function r20493_split_str_by_whitespace( $string, $goal ) { |
| 398 | 401 | $chunks = array(); |
| 399 | 402 | |
@@ -904,6 +907,10 @@ discard block |
||
| 904 | 907 | return VaultPress_kses::wp_kses_attr( $elem, $attrlist, $allowed_html, $allowed_protocols ); |
| 905 | 908 | } |
| 906 | 909 | |
| 910 | + /** |
|
| 911 | + * @param string $element |
|
| 912 | + * @param string $attr |
|
| 913 | + */ |
|
| 907 | 914 | static function wp_kses_attr($element, $attr, $allowed_html, $allowed_protocols) { |
| 908 | 915 | # Is there a closing XHTML slash at the end of the attributes? |
| 909 | 916 | |
@@ -50,6 +50,7 @@ |
||
| 50 | 50 | * Perform the IXR request. |
| 51 | 51 | * |
| 52 | 52 | * @param string[] ...$args IXR args. |
| 53 | + * @param string $args |
|
| 53 | 54 | * |
| 54 | 55 | * @return bool True if request succeeded, false otherwise. |
| 55 | 56 | */ |
@@ -6,6 +6,9 @@ |
||
| 6 | 6 | |
| 7 | 7 | if ( !function_exists( 'apply_filters_ref_array' ) ) : |
| 8 | 8 | |
| 9 | +/** |
|
| 10 | + * @param string $tag |
|
| 11 | + */ |
|
| 9 | 12 | function apply_filters_ref_array($tag, $args) { |
| 10 | 13 | global $wp_filter, $merged_filters, $wp_current_filter; |
| 11 | 14 | |
@@ -262,6 +262,9 @@ discard block |
||
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | + /** |
|
| 266 | + * @param string $key |
|
| 267 | + */ |
|
| 265 | 268 | function get_option( $key ) { |
| 266 | 269 | if ( 'hostname' == $key ) { |
| 267 | 270 | if ( defined( 'VAULTPRESS_HOSTNAME' ) ) |
@@ -306,6 +309,9 @@ discard block |
||
| 306 | 309 | return false; |
| 307 | 310 | } |
| 308 | 311 | |
| 312 | + /** |
|
| 313 | + * @param string $key |
|
| 314 | + */ |
|
| 309 | 315 | function update_option( $key, $value ) { |
| 310 | 316 | if ( 'allow_forwarded_for' === $key ) { |
| 311 | 317 | update_option( 'vaultpress_allow_forwarded_for', $value ); |
@@ -321,6 +327,9 @@ discard block |
||
| 321 | 327 | $this->update_options(); |
| 322 | 328 | } |
| 323 | 329 | |
| 330 | + /** |
|
| 331 | + * @param string $key |
|
| 332 | + */ |
|
| 324 | 333 | function delete_option( $key ) { |
| 325 | 334 | if ( 'allow_forwarded_for' === $key ) { |
| 326 | 335 | delete_option( 'vaultpress_allow_forwarded_for' ); |
@@ -1046,6 +1055,9 @@ discard block |
||
| 1046 | 1055 | return $jetpack_logo->output(); |
| 1047 | 1056 | } |
| 1048 | 1057 | |
| 1058 | + /** |
|
| 1059 | + * @param string $key |
|
| 1060 | + */ |
|
| 1049 | 1061 | function get_config( $key ) { |
| 1050 | 1062 | $val = get_option( $key ); |
| 1051 | 1063 | if ( $val ) |
@@ -1291,10 +1303,16 @@ discard block |
||
| 1291 | 1303 | function woocommerce_order_item_meta_handler( $id ) { $this->generic_change_handler( 'woocommerce_order_itemmeta', array( 'meta_id' => $id ) ); } |
| 1292 | 1304 | function woocommerce_attribute_handler( $id ) { $this->generic_change_handler( 'woocommerce_attribute_taxonomies', array( 'attribute_id' => $id ) ); } |
| 1293 | 1305 | |
| 1306 | + /** |
|
| 1307 | + * @param string $table |
|
| 1308 | + */ |
|
| 1294 | 1309 | function generic_change_handler( $table, $key ) { |
| 1295 | 1310 | $this->add_ping( 'db', array( $table => $key ) ); |
| 1296 | 1311 | } |
| 1297 | 1312 | |
| 1313 | + /** |
|
| 1314 | + * @param string $table |
|
| 1315 | + */ |
|
| 1298 | 1316 | function block_change_handler( $table, $query ) { |
| 1299 | 1317 | $this->add_ping( 'db', array( "bulk~{$table}" => $query ) ); |
| 1300 | 1318 | } |
@@ -1310,6 +1328,10 @@ discard block |
||
| 1310 | 1328 | } |
| 1311 | 1329 | |
| 1312 | 1330 | // Emulate $wpdb->last_table |
| 1331 | + |
|
| 1332 | + /** |
|
| 1333 | + * @param string $table |
|
| 1334 | + */ |
|
| 1313 | 1335 | function record_table( $table ) { |
| 1314 | 1336 | global $vaultpress_last_table; |
| 1315 | 1337 | $vaultpress_last_table = $table; |
@@ -1438,6 +1460,9 @@ discard block |
||
| 1438 | 1460 | return $wpdb->insert_id; |
| 1439 | 1461 | } |
| 1440 | 1462 | |
| 1463 | + /** |
|
| 1464 | + * @param string $value |
|
| 1465 | + */ |
|
| 1441 | 1466 | function ai_ping_insert( $value ) { |
| 1442 | 1467 | if ( ! $this->allow_ai_pings() ) { |
| 1443 | 1468 | return false; |
@@ -2236,6 +2261,9 @@ discard block |
||
| 2236 | 2261 | return false; |
| 2237 | 2262 | } |
| 2238 | 2263 | |
| 2264 | + /** |
|
| 2265 | + * @param string $action |
|
| 2266 | + */ |
|
| 2239 | 2267 | function contact_service( $action, $args = array() ) { |
| 2240 | 2268 | if ( 'test' != $action && 'register' != $action && !$this->check_connection() ) |
| 2241 | 2269 | return false; |
@@ -2518,6 +2546,9 @@ discard block |
||
| 2518 | 2546 | return false; |
| 2519 | 2547 | } |
| 2520 | 2548 | |
| 2549 | + /** |
|
| 2550 | + * @param string $string |
|
| 2551 | + */ |
|
| 2521 | 2552 | function sign_string( $string, $secret, $salt ) { |
| 2522 | 2553 | return hash_hmac( 'sha1', "$string:$salt", $secret ); |
| 2523 | 2554 | } |
@@ -2589,6 +2620,10 @@ discard block |
||
| 2589 | 2620 | ); |
| 2590 | 2621 | } |
| 2591 | 2622 | |
| 2623 | + /** |
|
| 2624 | + * @param string $type |
|
| 2625 | + * @param string $hook |
|
| 2626 | + */ |
|
| 2592 | 2627 | function add_ping( $type, $data, $hook=null ) { |
| 2593 | 2628 | global $vaultpress_pings; |
| 2594 | 2629 | if ( defined( 'WP_IMPORTING' ) && constant( 'WP_IMPORTING' ) ) |
@@ -2752,6 +2787,9 @@ discard block |
||
| 2752 | 2787 | $this->delete_option( 'connection_test' ); |
| 2753 | 2788 | } |
| 2754 | 2789 | |
| 2790 | + /** |
|
| 2791 | + * @return string |
|
| 2792 | + */ |
|
| 2755 | 2793 | function site_url() { |
| 2756 | 2794 | $site_url = ''; |
| 2757 | 2795 | |
@@ -2789,7 +2827,7 @@ discard block |
||
| 2789 | 2827 | * |
| 2790 | 2828 | * @param array $options The list of whitelisted option names. |
| 2791 | 2829 | * |
| 2792 | - * @return array The updated whitelist |
|
| 2830 | + * @return string[] The updated whitelist |
|
| 2793 | 2831 | */ |
| 2794 | 2832 | function add_to_jetpack_options_whitelist( $options ) { |
| 2795 | 2833 | $options[] = $this->option_name; |