Error in aurifox plugn, please check Settings > Requirements for details.';
add_action( "admin_notices", array( $this, $message ) );
}
}
public function aurifox_process_page_request() {
if (is_front_page()) {
if ($this->aurifox_get_home()) {
status_header(200);
$this->aurifox_show_post( $this->aurifox_get_home() );
exit();
} else {
return;
}
}
$full_request_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$request_url_parts = explode( "?", $full_request_url );
$request_url = $request_url_parts[0];
$base_url = get_home_url()."/";
$slug = str_replace( $base_url, "", $request_url );
$slug = rtrim( $slug, '/' );
if ($slug != '') {
$query_args = array(
'meta_key' => 'sd_slug',
'meta_value' => $slug,
'post_type' => 'aurifox',
'compare' => '='
);
$the_posts = get_posts($query_args);
$sd_page = current($the_posts);
if ($sd_page) {
status_header(200);
$this->aurifox_show_post( $sd_page->ID );
exit();
}
}
if (is_404()) {
if ($this->aurifox_get_404()) {
$this->aurifox_show_post( $this->aurifox_get_404() );
exit();
} else {
return;
}
}
return;
}
public function aurifox_show_post( $post_id ) {
$url = get_post_meta( $post_id, "sd_step_url", true );
$method = get_option('aurifox_display_method');
if ($method == 'download') {
echo $this->aurifox_get_page_content($url);
} else if ($method == 'iframe') {
echo $this->aurifox_get_page_iframe($url);
} else if ($method == 'redirect') {
wp_redirect($url, 301);
}
exit();
}
public function aurifox_get_page_content( $url )
{
$response11 = wp_remote_post($url);
$body = $response11['body'];
return $body;
}
public function aurifox_get_page_iframe( $sd_step_url ) {
if (has_site_icon() && (get_option('aurifox_favicon_method') == 'wordpress')) {
$favicon = '';
}
else
{
$url = AURIFOX_API_URL.'getsiteicon';
$args = array(
'step_url' => $sd_step_url,
);
$response = wp_remote_post($url, $args);
$favicon = '';
}
$additional_snippet = html_entity_decode(stripslashes(get_option('aurifox_additional_snippet')));
return '
'.esc_html($favicon).'
'.esc_html($additional_snippet).'