valid IP.
return false;
}
/**
* Convert bytes to readable format.
*
* @since 4.0.0
*
* @param integer $bytes The size of the file.
* @return string The size as a string.
*/
public function convertFileSize( $bytes ) {
if ( empty( $bytes ) ) {
return [
'original' => 0,
'readable' => '0 B'
];
}
$i = floor( log( $bytes ) / log( 1024 ) );
$sizes = [ 'B', 'KB', 'MB', 'GB', 'TB' ];
return [
'original' => $bytes,
'readable' => sprintf( '%.02F', $bytes / pow( 1024, $i ) ) * 1 . ' ' . $sizes[ $i ]
];
}
/**
* Sanitizes a given option value before we store it in the DB.
*
* Used by the migration and importer classes.
*
* @since 4.0.0
*
* @param mixed $value The value.
* @return mixed $value The sanitized value.
*/
public function sanitizeOption( $value ) {
switch ( gettype( $value ) ) {
case 'boolean':
return (bool) $value;
case 'string':
$value = aioseo()->helpers->decodeHtmlEntities( $value );
return aioseo()->helpers->encodeOutputHtml( wp_strip_all_tags( wp_check_invalid_utf8( trim( $value ) ) ) );
case 'integer':
return intval( $value );
case 'double':
return floatval( $value );
case 'array':
$sanitized = [];
foreach ( (array) $value as $child ) {
$sanitized[] = aioseo()->helpers->sanitizeOption( $child );
}
return $sanitized;
default:
return false;
}
}
/**
* Checks if the given string is serialized, and if so, unserializes it.
* If the serialized string contains an object, we abort to prevent PHP object injection.
*
* @since 4.1.0.2
*
* @param string $string The string.
* @param array|boolean $allowedClasses The allowed classes for unserialize.
* @return string|array The string or unserialized data.
*/
public function maybeUnserialize( $string, $allowedClasses = false ) {
if ( ! is_string( $string ) ) {
return $string;
}
$string = trim( $string );
if ( is_serialized( $string ) ) {
return @unserialize( $string, [ 'allowed_classes' => $allowedClasses ] ); // phpcs:disable PHPCompatibility.FunctionUse.NewFunctionParameters.unserialize_optionsFound
}
return $string;
}
/**
* Returns a deep clone of the given object.
* The built-in PHP clone KW provides a shallow clone. This method returns a deep clone that also clones nested object properties.
* You can use this method to sever the reference to nested objects.
*
* @since 4.4.7
*
* @return object The cloned object.
*/
public function deepClone( $object ) {
return unserialize( serialize( $object ) );
}
/**
* Sanitizes a given variable
*
* @since 4.5.6
*
* @param mixed $variable The variable.
* @param bool $preserveHtml Whether or not to preserve HTML for ALL fields.
* @param array $fieldsToPreserveHtml Specific fields to preserve HTML for.
* @param string $fieldName The name of the current field (when looping over a list).
* @return mixed The sanitized variable.
*/
public function sanitize( $variable, $preserveHtml = false, $fieldsToPreserveHtml = [], $fieldName = '' ) {
$type = gettype( $variable );
switch ( $type ) {
case 'boolean':
return (bool) $variable;
case 'string':
if ( $preserveHtml || in_array( $fieldName, $fieldsToPreserveHtml, true ) ) {
return aioseo()->helpers->decodeHtmlEntities( sanitize_text_field( htmlspecialchars( $variable, ENT_NOQUOTES, 'UTF-8' ) ) );
}
return sanitize_text_field( $variable );
case 'integer':
return intval( $variable );
case 'float':
case 'double':
return floatval( $variable );
case 'array':
$array = [];
foreach ( (array) $variable as $k => $v ) {
$array[ $k ] = $this->sanitize( $v, $preserveHtml, $fieldsToPreserveHtml, $k );
}
return $array;
default:
return false;
}
}
/**
* Return the version number with a filter to enable users to hide the version.
*
* @since 4.3.7
*
* @return string The current version or empty if the filter is active. Using ?aioseo-dev will override the filter.
*/
public function getAioseoVersion() {
$version = aioseo()->version;
if ( ! $this->isDev() && apply_filters( 'aioseo_hide_version_number', false ) ) {
$version = '';
}
return $version;
}
}
Fatal error: Uncaught Error: Class 'AIOSEO\Plugin\Common\Utils\Helpers' not found in /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/Lite/Utils/Helpers.php:16
Stack trace:
#0 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/vendor/composer/ClassLoader.php(576): include()
#1 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}('/home/kordian1/...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('AIOSEO\\Plugin\\L...')
#3 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(219): spl_autoload_call('AIOSEO\\Plugin\\L...')
#4 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(95): AIOSEO\Plugin\AIOSEO->preLoad()
#5 /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/AIOSEO.php(76): AIOSEO in /home/kordian1/domains/ostrabrama.pl/public_html/wp-content/plugins/all-in-one-seo-pack/app/Lite/Utils/Helpers.php on line 16