WP Manifestindependent plugin directory
manifest / users / 4climbers-wordpress-express-integration

4Climbers Wordpress-Express Integration

Wordpress plugin to login via firebase in a woocommerce/wordpress app

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/rollercoders/4climbers-wordpress-express-integration/archive/refs/heads/develop.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Firebase-WooCommerce Integration

✨ Plugin per sincronizzazione utenti tra WooCommerce e Firebase.


🔁 Flusso

Caso A – Registrazione via app (Firebase)

  • L'utente si registra nell'app (tramite Firebase Auth)

  • Il backend Express chiama:

    POST /wp-json/firebase/v1/create-user
  • WordPress crea l'utente WooCommerce corrispondente, con ruolo customer

Caso B – Registrazione via WooCommerce

  • L’utente si registra tramite /my-account o in fase di checkout
  • WooCommerce intercetta la password da $_POST
  • Alla creazione dell’utente (user_register), WordPress chiama il backend Express per creare l’utente su Firebase

Caso C – Eliminazione utente da Firebase

  • Se l’utente viene eliminato in Firebase (es. da pannello admin), il backend Express chiama:

    DELETE /wp-json/firebase/v1/delete-user/:email
  • WordPress cerca l’utente tramite email ed esegue wp_delete_user()


🔐 Sicurezza

  • Tutte le chiamate server-to-server sono protette via header:

    X-WP-Secret: <shared secret>
  • Nel file wp-config.php, aggiungi:

    define('FIREBASE_SYNC_SECRET', 'la-tua-chiave-super-segreta');
    define('FIREBASE_SYNC_ENDPOINT', 'https://tuo-backend.it/api/firebase-sync');

⚙️ Setup

  1. Installa il plugin all’interno di WordPress (come plugin ZIP oppure via FTP)

  2. Aggiungi le costanti nel wp-config.php come indicato sopra

  3. Il tuo backend Express deve:

    • Esporre /api/firebase-sync (protetto da X-WP-Secret)
    • Chiamare /wp-json/firebase/v1/create-user ogni volta che registra un nuovo utente Firebase
    • Chiamare /wp-json/firebase/v1/delete-user/:email quando elimina un utente

🧪 Debug

  • Il plugin logga tutto solo se WP_DEBUG === true
  • Tutti i error_log() sono condizionati, quindi in produzione non scrive nulla

✅ Stato attuale

  • [x] Registrazione Woo → Firebase
  • [x] Registrazione Firebase → Woo
  • [x] Cancellazione Firebase → Woo (DELETE /delete-user/:email)
  • [x] Sicurezza server-to-server
  • [x] Logging controllato da WP_DEBUG
  • [x] Pulizia automatica dei dati sensibili (password via transient TTL)