diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
index fdbfdea250..feec2ea408 100644
--- a/src/wp-includes/pluggable.php
+++ b/src/wp-includes/pluggable.php
@@ -2537,17 +2537,27 @@ if ( ! function_exists( 'wp_rand' ) ) :
 	 *
 	 * @global string $rnd_value
 	 *
-	 * @param int $min Lower limit for the generated number
-	 * @param int $max Upper limit for the generated number
-	 * @return int A random number between min and max
+	 * @param int $min Optional. Lower limit for the generated number.
+	 *                 Accepts positive integers or zero. Defaults to 0.
+	 * @param int $max Optional. Upper limit for the generated number.
+	 *                 Accepts positive integers. Defaults to 4294967295.
+	 * @return int A random number between min and max.
 	 */
-	function wp_rand( $min = 0, $max = 0 ) {
+	function wp_rand( $min = null, $max = null ) {
 		global $rnd_value;

 		// Some misconfigured 32-bit environments (Entropy PHP, for example)
 		// truncate integers larger than PHP_INT_MAX to PHP_INT_MAX rather than overflowing them to floats.
 		$max_random_number = 3000000000 === 2147483647 ? (float) '4294967295' : 4294967295; // 4294967295 = 0xffffffff

+		if ( null === $min ) {
+			$min = 0;
+		}
+
+		if ( null === $max ) {
+			$max = $max_random_number;
+		}
+
 		// We only handle ints, floats are truncated to their integer value.
 		$min = (int) $min;
 		$max = (int) $max;
@@ -2556,10 +2566,9 @@ if ( ! function_exists( 'wp_rand' ) ) :
 		static $use_random_int_functionality = true;
 		if ( $use_random_int_functionality ) {
 			try {
-				$_max = ( 0 != $max ) ? $max : $max_random_number;
 				// wp_rand() can accept arguments in either order, PHP cannot.
-				$_max = max( $min, $_max );
-				$_min = min( $min, $_max );
+				$_max = max( $min, $max );
+				$_min = min( $min, $max );
 				$val  = random_int( $_min, $_max );
 				if ( false !== $val ) {
 					return absint( $val );
@@ -2599,9 +2608,7 @@ if ( ! function_exists( 'wp_rand' ) ) :
 		$value = abs( hexdec( $value ) );

 		// Reduce the value to be within the min - max range.
-		if ( 0 != $max ) {
-			$value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 );
-		}
+		$value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 );

 		return abs( (int) $value );
 	}
diff --git a/tests/phpunit/tests/pluggable.php b/tests/phpunit/tests/pluggable.php
index c7b0225987..c924229c2e 100644
--- a/tests/phpunit/tests/pluggable.php
+++ b/tests/phpunit/tests/pluggable.php
@@ -354,4 +354,33 @@ class Tests_Pluggable extends WP_UnitTestCase {

 		$this->assertSame( $current_user, $from_get_user_by );
 	}
+
+	/**
+	 * @ticket 55194
+	 * @covers ::wp_rand
+	 */
+	function test_wp_rand_range() {
+		// Range of 0, 0 must return 0
+		$this->assertEquals( 0, wp_rand( 0, 0 ) );
+
+		// Random between 1 and 99 must be between these numbers
+		$min = 1;
+		$max = 99;
+
+		$this->assertLessThan( 100, wp_rand( $min, $max ) );
+		$this->assertGreaterThan( 0, wp_rand( $min, $max ) );
+
+		// Range with minimum number must return a positive number
+		$min = -99;
+		$max = -1;
+
+		$this->assertLessThan( 100, wp_rand( $min, $max ) );
+		$this->assertGreaterThan( 0, wp_rand( $min, $max ) );
+
+		// Range with numbers greater than PHP_INT_MAX must not overflow
+		$min = PHP_INT_MAX + 1;
+		$max = PHP_INT_MAX + 1;
+
+		$this->assertEquals( PHP_INT_MAX, wp_rand( $min, $max ) );
+	}
 }
