{"id":18289936,"url":"https://github.com/mehrshaddarzi/wp-login-gmail","last_synced_at":"2026-05-18T17:01:30.999Z","repository":{"id":85428044,"uuid":"382296074","full_name":"mehrshaddarzi/wp-login-gmail","owner":"mehrshaddarzi","description":"Easy Login in Wordpress with Gmail","archived":false,"fork":false,"pushed_at":"2021-07-02T10:35:05.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T07:25:07.536Z","etag":null,"topics":["api","gmail","google","wordpress","wordpress-plugin","wordpressdevelopment"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mehrshaddarzi.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-02T09:25:36.000Z","updated_at":"2024-04-16T14:51:00.000Z","dependencies_parsed_at":"2023-03-03T09:45:43.788Z","dependency_job_id":null,"html_url":"https://github.com/mehrshaddarzi/wp-login-gmail","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mehrshaddarzi/wp-login-gmail","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrshaddarzi%2Fwp-login-gmail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrshaddarzi%2Fwp-login-gmail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrshaddarzi%2Fwp-login-gmail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrshaddarzi%2Fwp-login-gmail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehrshaddarzi","download_url":"https://codeload.github.com/mehrshaddarzi/wp-login-gmail/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrshaddarzi%2Fwp-login-gmail/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265586013,"owners_count":23792833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","gmail","google","wordpress","wordpress-plugin","wordpressdevelopment"],"created_at":"2024-11-05T14:08:53.210Z","updated_at":"2026-05-18T17:01:25.949Z","avatar_url":"https://github.com/mehrshaddarzi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## WordPress Login With Gmail\n\n#### How To install Plugin?\n\n1. run `composer update` in dir\n2. install plugin in wordpress.\n3. Create Google Client ID and Client Secret by this article:\n````\n https://code.tutsplus.com/tutorials/create-a-google-login-page-in-php--cms-33214\n````\n\n4.Set `Authorised redirect URIs` in Google Developer:\n````\nhttps://site.com/?gmail_login_redirect=yes\n````\n\n5. add define in your wp-config.php\n````php\ndefine('WP_GMAIL_CLIENT_ID', 'xxx');\ndefine('WP_GMAIL_CLIENT_SECRET', 'xxx');\ndefine('WP_GMAIL_REDIRECT_PARAM', 'gmail_login_redirect');\n````\n\n6. use `wp_gmail_login_success` WordPress action for handle user register or login\n````php\ndo_action('wp_gmail_login_success', $accessToken, $email, $name, $familyName, $gender, $locale, $avatar, $google_account_info);\n````\n\n\n#### Example\n\n1.Create Button for Login Url\n````php\n\u003ca href=\"\u003c?php echo WP_Gmail_Login::getAuthUrl(); ?\u003e\"\u003eLogin With Gmail\u003c/a\u003e\n````\n\n2. Handle Return User Success Login With Gmail\n````php\nadd_action('wp_gmail_login_success', 'login_with_gmail', 10, 4);\nfunction login_with_gmail($accessToken, $email, $name, $familyName)\n{\n    $user_id = email_exists($email);\n    if ($user_id === false) {\n\n        $data = array(\n            'user_email' =\u003e $email,\n            'first_name' =\u003e $name,\n            'show_admin_bar_front' =\u003e false\n        );\n        $user_id = wp_insert_user( $data );\n    }\n\n    // Automatic SignIn\n    wp_set_current_user($user_id);\n    wp_set_auth_cookie($user_id, true);\n\n    // Redirect To Home Page Again\n    wp_redirect(home_url());\n    exit;\n}\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehrshaddarzi%2Fwp-login-gmail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehrshaddarzi%2Fwp-login-gmail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehrshaddarzi%2Fwp-login-gmail/lists"}