WebHS — lp.webhs.pt deploy package
=====================================

ESTRUTURA
---------
lp.webhs.pt/
  wordpress/
    index.html          ← Landing page
  api/
    config.php          ← PREENCHER credenciais antes de subir
    diagnostico.php     ← Endpoint do formulário
    worker.php          ← Worker de processamento (cron ou manual)
    save-report.php     ← Endpoint chamado pelo n8n para gravar reports
    schema.sql          ← Correr uma vez no MySQL
    .htaccess           ← Protege config.php de acesso direto
  reports/
    .htaccess           ← Options -Indexes (sem listagem)
n8n/
  workflow.json         ← Importar em n8n (alternativa ao cron PHP)

SETUP
-----
1. Criar subdomínio lp.webhs.pt no cPanel
2. Fazer upload desta estrutura para o document root
3. cPanel → MySQL Databases → criar DB + user → correr schema.sql
4. Preencher api/config.php com credenciais reais
5. cd api && composer require phpmailer/phpmailer
6. Testar: curl -X POST https://lp.webhs.pt/api/diagnostico.php \
     -d "name=Teste&email=tu@webhs.pt&url=https://webhs.pt&source=wordpress"
7. Processar manualmente: php api/worker.php
8. Cron (cPanel → Cron Jobs):
   */5 * * * * /usr/local/bin/php /home/USER/lp.webhs.pt/api/worker.php >> /home/USER/logs/worker.log 2>&1

PSI API KEY
-----------
console.cloud.google.com → APIs & Services → Enable "PageSpeed Insights API"
→ Credentials → Create API Key → meter em config.php (PSI_API_KEY)

WORKER SECRET (n8n)
-------------------
php -r "echo bin2hex(random_bytes(24));"
→ meter em config.php (WORKER_SECRET) e no workflow n8n
