Home / Disable / myceluya_imei_checker
Duplicate Snippet

Embed Snippet on Your Site

myceluya_imei_checker

Code Preview
php
<?php
// 1. Algoritmo de Luhn para validar que el IMEI sea real (15 dígitos)
function myceluya_validar_imei($imei) {
    $imei = preg_replace('/[^0-9]/', '', $imei);
    if (strlen($imei) !== 15) return false;
    $sum = 0;
    for ($i = 0; $i < 15; $i++) {
        $n = (int)$imei[$i];
        if ($i % 2 !== 0) {
            $n *= 2;
            if ($n > 9) $n -= 9;
        }
        $sum += $n;
    }
    return ($sum % 10 === 0);
}
// 2. Interfaz Visual del Consultor Rápido de IMEI (Shortcode: [myceluya_imei_checker])
add_shortcode('myceluya_imei_checker', function() {
    $resultado_html = '';
    if (isset($_POST['myceluya_consultar'])) {
        $imei = sanitize_text_field($_POST['myceluya_imei']);
        $service = intval($_POST['myceluya_service_id']);
        if (!myceluya_validar_imei($imei)) {
            $resultado_html = '<div style="margin-top:20px; padding:15px; background:#7f1d1d; color:#fecaca; border-radius:8px;">❌ <strong>IMEI Inválido:</strong> Verifica los 15 dígitos. El número ingresado no supera la validación matemática oficial.</div>';
        } else {
            // CONFIGURA AQUÍ TU API KEY DE SICKW.COM
            $api_key = 'PEGA_AQUI_TU_API_KEY';
            if ($api_key === 'PEGA_AQUI_TU_API_KEY') {
                $resultado_html = '<div style="margin-top:20px; padding:15px; background:#065f46; color:#d1fae5; border-radius:8px;">✅ <strong>IMEI Válido (' . esc_html($imei) . ')</strong><br>El motor de Myceluya Server está funcionando correctamente. Solo falta pegar tu API Key de Sickw en el código para mostrar el reporte en vivo.</div>';
            } else {
                $url = "https://sickw.com/api.php?format=html&key={$api_key}&imei={$imei}&service={$service}";
                $response = wp_remote_get($url, ['timeout' => 30]);
                if (is_wp_error($response)) {
                    $resultado_html = '<div style="margin-top:20px; padding:15px; background:#7f1d1d; color:#fecaca; border-radius:8px;">⚠️ Error de conexión con el servidor central.</div>';
                } else {
                    $body = wp_remote_retrieve_body($response);
                    $resultado_html = '<div style="margin-top:20px; padding:20px; background:#1e293b; border-left:4px solid #38bdf8; border-radius:8px; line-height:1.6;"><h4 style="margin-top:0; color:#38bdf8;">📋 Resultado Oficial Myceluya Server:</h4>' . wp_kses_post($body) . '</div>';
                }
            }
        }
    }
    return '
    <div style="max-width:650px; margin:30px auto; padding:25px; background:#0f172a; color:#fff; border-radius:12px; box-shadow:0 10px 25px rgba(0,0,0,0.3); font-family:sans-serif;">
        <h2 style="margin-top:0; color:#38bdf8; text-align:center;">⚡ MYCELUYA SERVER - Consulta Instantánea IMEI</h2>
        <p style="text-align:center; color:#94a3b8; font-size:14px;">Ingresa el número IMEI de 15 dígitos (marca *#06# en el equipo) y selecciona el servicio.</p>
        
        <form method="post" style="margin-top:20px;">
            <label style="display:block; margin-bottom:6px; font-weight:bold;">Servicio de Consulta:</label>
            <select name="myceluya_service_id" required style="width:100%; padding:12px; border-radius:8px; border:1px solid #334155; background:#1e293b; color:#fff; margin-bottom:15px;">
                <option value="1">🍎 Apple iPhone - Check Básico + Find My iPhone (FMI)</option>
                <option value="30">🍎 Apple iPhone - Operador de Origen + SimLock Status</option>
                <option value="61">🔒 Check Mundial de Lista Negra (Blacklist / Reporte Pro)</option>
                <option value="12">📱 Samsung - Info Completa + País + Garantía</option>
            </select>
            <label style="display:block; margin-bottom:6px; font-weight:bold;">Número IMEI (15 dígitos):</label>
            <input type="text" name="myceluya_imei" maxlength="15" placeholder="Ej: 353915104829104" required style="width:100%; padding:12px; border-radius:8px; border:1px solid #334155; background:#1e293b; color:#fff; font-size:16px; letter-spacing:1px; margin-bottom:15px;">
            <button type="submit" name="myceluya_consultar" style="width:100%; padding:14px; background:#0284c7; color:#fff; border:none; border-radius:8px; font-size:16px; font-weight:bold; cursor:pointer;">
                🔍 Consultar IMEI Ahora
            </button>
        </form>
        ' . $resultado_html . '
    </div>';
});

Comments

Add a Comment