Mozilla/5.0 (BlackBerry; U; BlackBerry 9670; en) AppleWebKit/534.3+ (KHTML, like Gecko) Version/6.0.0.286 Mobile Safari/534.3+.
// Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+.
// Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0 Mobile Safari/534.11+.
$pos_webkit = stripos( $agent, 'webkit' );
if ( false !== $pos_webkit ) {
// Detected blackberry webkit browser.
$pos_torch = stripos( $agent, 'BlackBerry 9800' );
if ( false !== $pos_torch ) {
return 'blackberry-torch'; // Match the torch first edition. the 2nd edition should use the OS7 and doesn't need any special rule.
} elseif ( preg_match( '#Version\/([\d\.]+)#i', $agent, $matches ) ) { // Detecting the BB OS version for devices running OS 6.0 or higher.
$version = $matches[1];
$version_num = explode( '.', $version );
if ( false === is_array( $version_num ) || count( $version_num ) <= 1 ) {
return 'blackberry-6'; // not a BB device that match our rule.
} else {
return 'blackberry-' . $version_num[0];
}
} else {
// if doesn't match returns the minimun version with a webkit browser. we should never fall here.
return 'blackberry-6'; // not a BB device that match our rule.
}
}
// Blackberry devices <= 5.XX.
// BlackBerry9000/5.0.0.93 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/179.
if ( preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) {
$version = $matches[1];
} else {
return false; // not a BB device that match our rule.
}
$version_num = explode( '.', $version );
if ( is_array( $version_num ) === false || count( $version_num ) <= 1 ) {
return false;
}
$version_num_major = (int) $version_num[0];
$version_num_minor = (int) $version_num[1];
if ( 5 === $version_num_major ) {
return 'blackberry-5';
} elseif ( 4 === $version_num_major && 7 === $version_num_minor ) {
return 'blackberry-4.7';
} elseif ( 4 === $version_num_major && 6 === $version_num_minor ) {
return 'blackberry-4.6';
} elseif ( 4 === $version_num_major && 5 === $version_num_minor ) {
return 'blackberry-4.5';
} else {
return false;
}
}
/**
* Retrieve the blackberry browser version.
*
* Return string are from the following list:
* - blackberry-10
* - blackberry-webkit
* - blackberry-5
* - blackberry-4.7
* - blackberry-4.6
*
* @return string Type of the BB browser.
* If browser's version is not found, detect_blackbeberry_browser_version will return boolean false.
*/
public static function detect_blackberry_browser_version() {
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
return false;
}
$agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.
if ( self::is_blackberry_10() ) {
return 'blackberry-10';
}
$pos_blackberry = strpos( $agent, 'blackberry' );
if ( false === $pos_blackberry ) {
// Not a blackberry device.
return false;
}
$pos_webkit = strpos( $agent, 'webkit' );
if ( ! ( false === $pos_webkit ) ) {
return 'blackberry-webkit';
} else {
if ( ! preg_match( '#BlackBerry\w+\/([\d\.]+)#i', $agent, $matches ) ) {
return false; // not a BB device that match our rule.
}
$version_num = explode( '.', $matches[1] );
if ( false === is_array( $version_num ) || count( $version_num ) <= 1 ) {
return false;
}
$version_num_major = (int) $version_num[0];
$version_num_minor = (int) $version_num[1];
if ( 5 === $version_num_major ) {
return 'blackberry-5';
} elseif ( 4 === $version_num_major && 7 === $version_num_minor ) {
return 'blackberry-4.7';
} elseif ( 4 === $version_num_major && 6 === $version_num_minor ) {
return 'blackberry-4.6';
} else {
// A very old BB device is found or this is a BB device that doesn't match our rules.
return false;
}
}
}
/**
* Checks if a visitor is coming from one of the WordPress mobile apps.
*
* @return bool
*/
public static function is_mobile_app() {
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
return false;
}
$agent = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.
if ( isset( $_SERVER['X_USER_AGENT'] ) && preg_match( '|wp-webos|', $_SERVER['X_USER_AGENT'] ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput -- This is validating.
return true; // Wp4webos 1.1 or higher.
}
$app_agents = array( 'wp-android', 'wp-blackberry', 'wp-iphone', 'wp-nokia', 'wp-webos', 'wp-windowsphone' );
// the mobile reader on iOS has an incorrect UA when loading the reader
// currently it is the default one provided by the iOS framework which
// causes problems with 2-step-auth
// User-Agent WordPress/3.1.4 CFNetwork/609 Darwin/13.0.0.
$app_agents[] = 'wordpress/3.1';
foreach ( $app_agents as $app_agent ) {
if ( false !== strpos( $agent, $app_agent ) ) {
return true;
}
}
return false;
}
/**
* Detects if the current browser is Nintendo 3DS handheld.
*
* Example: Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7498.US
* can differ in language, version and region
*/
public static function is_Nintendo_3DS() {
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
return false;
}
$ua = strtolower( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.
if ( strpos( $ua, 'nintendo 3ds' ) !== false ) {
return true;
}
return false;
}
/**
* Was the current request made by a known bot?
*
* @return boolean
*/
public static function is_bot() {
static $is_bot = null;
if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
return false;
}
if ( $is_bot === null ) {
$is_bot = self::is_bot_user_agent( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- This is validating.
}
return $is_bot;
}
/**
* Is the given user-agent a known bot?
* If you want an is_bot check for the current request's UA, use is_bot() instead of passing a user-agent to this method.
*
* @param string $ua A user-agent string.
*
* @return boolean
*/
public static function is_bot_user_agent( $ua = null ) {
if ( empty( $ua ) ) {
return false;
}
$bot_agents = array(
'alexa',
'altavista',
'ask jeeves',
'attentio',
'baiduspider',
'bingbot',
'chtml generic',
'crawler',
'fastmobilecrawl',
'feedfetcher-google',
'firefly',
'froogle',
'gigabot',
'googlebot',
'googlebot-mobile',
'heritrix',
'httrack',
'ia_archiver',
'irlbot',
'iescholar',
'infoseek',
'jumpbot',
'linkcheck',
'lycos',
'mediapartners',
'mediobot',
'motionbot',
'msnbot',
'mshots',
'openbot',
'pss-webkit-request',
'pythumbnail',
'scooter',
'slurp',
'snapbot',
'spider',
'taptubot',
'technoratisnoop',
'teoma',
'twiceler',
'yahooseeker',
'yahooysmcm',
'yammybot',
'ahrefsbot',
'pingdom.com_bot',
'kraken',
'yandexbot',
'twitterbot',
'tweetmemebot',
'openhosebot',
'queryseekerspider',
'linkdexbot',
'grokkit-crawler',
'livelapbot',
'germcrawler',
'domaintunocrawler',
'grapeshotcrawler',
'cloudflare-alwaysonline',
'cookieinformationscanner', // p1699315886066389-slack-C0438NHCLSY
'facebookexternalhit', // https://www.facebook.com/externalhit_uatext.php
'feedburner',
'yacybot', // http://yacy.net/bot.html
'trendictionbot', // http://www.trendiction.de/bot;
'elisabot',
'linkfluence', // http://linkfluence.com/
'semrushbot', // https://www.semrush.com/bot/
'archive.org_bot', // http://archive.org/details/archive.org_bot
'ezlynxbot', // https://www.ezoic.com/bot
'siteauditbot', // https://www.semrush.com/bot/
'snapchat', // https://developers.snap.com/robots
'applebot', // https://support.apple.com/en-ca/HT204683
'bne.es_bot', // https://www.bne.es/es/colecciones/archivo-web-espanola/aviso-webmasters
'google-safety;', // https://www.google.com/bot.html
'mojeekbot', // https://www.mojeek.com/bot.html
'linkwalker', // https://www.linkwalker.com/
);
foreach ( $bot_agents as $bot_agent ) {
if ( false !== stripos( $ua, $bot_agent ) ) {
return true;
}
}
return false;
}
}
Fatal error: Uncaught Error: Class 'Automattic\Jetpack\Device_Detection\User_Agent_Info' not found in /var/www/html/dportilho.com.br/web/wp-content/plugins/jetpack/class.jetpack.php:680
Stack trace:
#0 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(324): Jetpack->{closure}('')
#1 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#2 /var/www/html/dportilho.com.br/web/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /var/www/html/dportilho.com.br/web/wp-settings.php(559): do_action('plugins_loaded')
#4 /var/www/html/dportilho.com.br/web/wp-config.php(126): require_once('/var/www/html/d...')
#5 /var/www/html/dportilho.com.br/web/wp-load.php(50): require_once('/var/www/html/d...')
#6 /var/www/html/dportilho.com.br/web/wp-blog-header.php(13): require_once('/var/www/html/d...')
#7 /var/www/html/dportilho.com.br/web/index.php(17): require('/var/www/html/d...')
#8 {main}
thrown in /var/www/html/dportilho.com.br/web/wp-content/plugins/jetpack/class.jetpack.php on line 680