Editorial status: This tutorial is retired as current development advice. It showed how to build a WordPress plugin around Google +1 / Google+ behavior, but those APIs and integrations no longer function for modern websites.
Why this tutorial is no longer safe to follow
Legacy Google+ APIs were shut down in March 2019. Google+ web integrations, including +1 buttons and sharing widgets, also stopped functioning. A WordPress plugin built around those endpoints would not provide useful functionality today.
The broader lesson still matters: WordPress plugins should be small, focused, secure, and easy to remove. The specific Google +1 implementation does not belong in a current codebase.
For source context, Google documented the legacy Google+ API shutdown and advised developers to remove dependencies on Google+ APIs.
How to build a modern WordPress plugin instead
- Start with the official WordPress Plugin Handbook.
- Use hooks, shortcodes, blocks, or REST endpoints only when the feature genuinely needs them.
- Escape output, sanitize input, use nonces for state-changing actions, and avoid loading scripts globally.
- Use
wp_enqueue_script()andwp_enqueue_style()instead of hard-coding scripts into post content. - Prefer maintained platform APIs and remove abandoned integrations quickly.
If you inherited this code
- Remove Google +1 scripts, widgets, and API calls.
- Check for old shortcodes that output empty social buttons.
- Replace the feature only if there is a current reader or business need.
- Test the site for PHP warnings, JavaScript console errors, and layout gaps after removal.












Responses (0 )