Repository navigation
feat(theme): replace Super Socializer with Log in with Google - #78
Merged
Merged
Conversation
Super Socializer (7.14.5) was closed on WordPress.org on 2026-06-18 for a security issue and has unpatched CVEs (CVE-2026-65542 broken auth, CVE-2026-65544 / CVE-2026-11798 XSS). The site only uses it for Google sign-in, so move to rtCamp's single-purpose "Log in with Google" plugin. - includes/functions/google-login.php: render the theme's Google button with the plugin's authorization URL (post-login redirect validated, mirrors custom_login_page()); suppress the activation email for Google sign-ups (rtcamp.google_register_user @5, before wp_insert_user fires user_register) and mark Google-authenticated accounts verified; send failed Google sign-ins to the existing /?login_type=social error and log them. Everything no-ops if the plugin is inactive (button hidden). - assets/js/google-login.js: set the plugin's CSRF state cookie on click, as its own login.js does (that script errors next to the theme's #loginform modal, so it isn't loaded). - includes/functions/login.php: let the OAuth callback (wp-login.php?code=&state=) through instead of redirecting it to /login. - login/register templates use the helper; drop dead Facebook/X buttons and the old the_champ_* hooks; button styles cover the link. - Bump ACADEMY_AFRICA_VERSION to 1.7.22.
Point the Log in with Google redirect_uri at the theme's /login page and complete the sign-in there (wp_signon on init), so users never see wp-login.php. Drop the wp-login.php callback exception in custom_login_page(), and fall back to /learning-pathways instead of wp-admin when the state's redirect_to is rejected. The Google OAuth client must list https://academy.africa/login (and http://localhost:8080/login for local testing) as authorised redirect URIs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Super Socializer is closed on WordPress.org (since 18 Jun 2026, "Security Issue") and won't get fixes. Production runs 7.14.5, which is affected by:
The site only actually uses it for Google sign-in: about 3,278 users are Google-linked, and the theme only shows a Google button. The share bars and Facebook comments are enabled but never render, though Facebook/X login still accepts requests. This PR moves Google sign-in to rtCamp's single-purpose Log in with Google (v1.4.5, updated 6 Nov 2026). Its code is reviewed below.
Plugin review (1.4.5)
email_verifiedrequired), so current Google users keep their accounts with no duplicates. On first login it binds the account to the Google ID (google_oauth_sub), and after that a different Google account with the same email is rejected.__Host-prefixed on HTTPS);wp_safe_redirectfor the post-login redirect.WP_GOOGLE_LOGIN_CLIENT_ID,WP_GOOGLE_LOGIN_SECRET,WP_GOOGLE_LOGIN_USER_REGISTRATION), so the secret can stay out of the DB.Theme changes
includes/functions/google-login.php(new)/loginhonours?redirect_url=(falling back to/learning-pathways). Off-site targets are rejected.rtcamp.google_register_userat priority 5, becausewp_insert_user()firesuser_register(and sosend_activation_link) beforertcamp.google_user_created.is_verified. This covers new sign-ups and existing unverified accounts, since Google has verified the email.verify_user_on_login()still runs after the plugin onauthenticate./?login_type=socialerror, not WP's unstyled login screen, and are logged.assets/js/google-login.js(new): sets the plugin's CSRF state cookie on click and writes the token intostate, mirroring the plugin's ownlogin.js. The plugin's script throws on pages containing the theme's#loginformmodal, so it isn't loaded./login, not/wp-login.php: the plugin'sredirect_uriis filtered tohome_url('/login'), andacademyafrica_google_login_callback()completes the sign-in there oninitviawp_signon()(sameauthenticatechain, soverify_user_on_login()still applies). Users never seewp-login.php;custom_login_page()is unchanged apart from that.the_champ_*hooks; the button styles cover the new link.ACADEMY_AFRICA_VERSION→1.7.22.Testing (local Docker, plugin installed)
google_oauth_subbound; a different Google ID for the same email is rejectedis_verified=1, no emails sent (pre_wp_mailcaptured none)/?login_type=social(friendly error shown, reason logged)/wp-login.php/login/login(mocked Google over HTTP)google_oauth_subbound; returns to course page; bad code / missing cookie →/?login_type=social; off-siteredirect_to→/learning-pathways; token exchange sendsredirect_uri=…/login?redirect_url=path/URL honoured,https://evil…and//evil…→/learning-pathwaysstate, redirect and nonce preserved, cookie reused on second clickNot tested: a real Google sign-in end to end. That needs the OAuth client to allow the environment's redirect URI. Please test it on staging before prod.
Deploy checklist (plugins aren't in Git, so this is done in wp-admin)
https://academy.africa/login(and the staging equivalent, plushttp://localhost:8080/loginfor local testing; exact match, no trailing slash) as an authorised redirect URI on the OAuth client.wp-config.phpconstants), enable user registration (WP'susers_can_registeris off), leave One Tap off.the_champ_*/heateor_*options, which hold the Google, Facebook and X keys, and revoke the Facebook and X app credentials.Known follow-ups
thechamp_avatarmeta. After removal they fall back to Gravatar/default unless we add a fallback./?login_type=social(the homepage). It now returns users to the page they signed in from.