Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/leadin/public/utils
File: class-versions.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace Leadin\utils;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* Static class containing all the utility functions related to versioning.
[5] Fix | Delete
*/
[6] Fix | Delete
class Versions {
[7] Fix | Delete
/**
[8] Fix | Delete
* Return the given version until the patch version
[9] Fix | Delete
* eg: 6.4.2.1-beta => 6.4.2
[10] Fix | Delete
*
[11] Fix | Delete
* @param String $version version.
[12] Fix | Delete
*/
[13] Fix | Delete
private static function parse_version( $version ) {
[14] Fix | Delete
preg_match( '/^\d+(\.\d+){0,2}/', $version, $match );
[15] Fix | Delete
if ( empty( $match ) ) {
[16] Fix | Delete
return '';
[17] Fix | Delete
}
[18] Fix | Delete
return $match[0];
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Return the current WordPress version.
[23] Fix | Delete
*/
[24] Fix | Delete
public static function get_wp_version() {
[25] Fix | Delete
global $wp_version;
[26] Fix | Delete
return self::parse_version( $wp_version );
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* Return the current PHP version.
[31] Fix | Delete
*/
[32] Fix | Delete
public static function get_php_version() {
[33] Fix | Delete
return self::parse_version( phpversion() );
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Return true if the current PHP version is not supported.
[38] Fix | Delete
*/
[39] Fix | Delete
public static function is_php_version_not_supported() {
[40] Fix | Delete
return version_compare( phpversion(), LEADIN_REQUIRED_PHP_VERSION, '<' );
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* Return true if the current WordPress version is not supported.
[45] Fix | Delete
*/
[46] Fix | Delete
public static function is_wp_version_not_supported() {
[47] Fix | Delete
global $wp_version;
[48] Fix | Delete
return version_compare( $wp_version, LEADIN_REQUIRED_WP_VERSION, '<' );
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Return true if a given version is less than the supported version
[53] Fix | Delete
*
[54] Fix | Delete
* @param String $version Given version to check.
[55] Fix | Delete
* @param String $version_to_compare The version number to test the given version against.
[56] Fix | Delete
*/
[57] Fix | Delete
public static function is_version_less_than( $version, $version_to_compare ) {
[58] Fix | Delete
return version_compare( $version, $version_to_compare, '<' );
[59] Fix | Delete
}
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function