Posted by Igor Benic

Web Developer who mainly uses WordPress for projects. Working on various project through Codeable & Toptal. Author of several ebooks at


  1. This has been extremely helpful in getting my headless WP backend up and running using the facebook login SDK!! Its very rare to find help on headless wp builds/setups & process, site bookmarked! Great job of explaining and code sharing. Thank you so much for all the help!


    1. Hey Igor and Spencer,

      I was looking also for Facebook login implementation.

      Would you like to share yours?


  2. How can I setup autoload help me please


    1. Once you install the packages using composer, the autoload.php provided by composer will be enough to autoload classes.

      If you have not yet been introduced to composer, you can check their site:

      If you would like create your own custom autoloaders, you can then here is an article from Tom McFarlin about creating autoloaders for WordPress projects:


  3. protected $googleClient = ‘YOUR_GOOGLE_CLIENT_ID’;

    should i replace ‘YOUR_GOOGLE_CLIENT_ID’ with id i get from google console ?


    1. Yes, that’s the long google client id. You can see for example in their own code example: how they use the client ID.

      But in this code you use the whole part ( included).


      1. thank you very much , implemented with React-native / wp backend
        and it work like a charm


  4. Wisnu Eka Saputra February 5, 2020 at 7:56 am

    Hey. Thanks for your tutorial dude. It works on localhost but when on live site it returns 404 route not found. Can you help me?


    1. Hi Wisnu, if I understood correctly, the route is 404? Not page 404?

      In case the route is 404 (not found) it might be that the URL to the route is incorrect or some other plugin is maybe blocking that?

      Or try updating permalinks (Settings > Permalinks > Save Changes). It should not be related to permalinks but you never know 🙂


      1. Wisnu Eka Saputra February 11, 2020 at 8:18 am

        Nice man, thanks. but i get invalid-token code when i try to post on post man. i get the id_token from i check on it contain the userdata from google. but still return invalid-token. how can i resolve that? thanks


  5. In the class-login-2.php file, I do not see the Client.php in the mentioned path ‘/vendor/google/apiclient/src/Google/Client.php’.
    Also this path ‘\Firebase\JWT\JWT;’

    I have downloaded the google client api from the below links, I checked in both of the zip files.

    can anyone tell how I have to setup Google Client API without composer.


Leave a reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.