Skip to content

A lightweight, performance-focused WordPress plugin using the native Web Share API

License

mkhuda/native-social-share-wp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧩 Native Social Share | Wordpress Plugin

Native Social Share WP Image

A lightweight, performance-focused WordPress plugin using the native Web Share API with graceful fallbacks for Twitter, Facebook, and LinkedIn.

WordPress Tested License GPLv2 Version


🚀 Features

  • 🧠 Uses native Web Share API (if supported)
  • 🌗 Auto Dark Mode support (via prefers-color-scheme)
  • 💨 No dependencies (zero jQuery)
  • ⚙️ Configurable from WordPress Dashboard:
    • Button position (above, below, both content)
    • Enable/disable specific social platforms (Twitter, Facebook, LinkedIn)
  • 🧱 Lightweight: ~10KB including CSS + JS

🛠️ Installation

  1. Download the latest release from Releases.
  2. Upload the folder to your WordPress site at:
    /wp-content/plugins/native-social-share-wp/
  3. Activate the plugin from Plugins → Installed Plugins.
  4. Go to Settings → Native Social Share to configure:
    • Position: Above or below or both post content
    • Which social buttons to show

🧩 Plugin Structure

/native-social-share-wp/
├── assets/
│ ├── css/
│ │ └── style.css
│ └── js/
│ └── share.js
├── native-social-share.php
└── readme.txt

⚙️ Configuration Options

Option Description Default
Position Where to show buttons (Above / Below / Both content) Below
Enabled Buttons Choose which social buttons appear All enabled
Auto Dark Mode Adapts to system theme automatically Enabled

🧪 Browser Support

Feature Supported Browsers
Native Share (navigator.share) Chrome, Edge, Safari, Android WebView
Fallback Links All browsers

Native Social Share WP Image


📦 Changelog

v1.1.0 (2025-10-27)

  • 🔧 Updated prefix from nssnatssh (WordPress.org compliance)
  • 🧩 Added PHP namespace Mkhuda\NativeSocialShare
  • ⚙️ Improved option migration for smoother upgrades
  • 🧾 Fixed license mismatch between files (GPL-2.0-or-later)
  • 🧼 Minor code cleanup and PHPCS/WPCS compliance
  • 📦 Updated readme + assets for submission to WP Plugin Directory
  • Added “Both (Above & Below)” position option for more flexibility

v1.0 (2025-10-15)

  • Initial public release with native share + fallback buttons
  • ✨ Added Auto Dark Mode support
  • 🧰 Added configurable social buttons
  • 🪶 Simplified CSS for cleaner look

💡 Developer Notes

  • Written in pure PHP + Vanilla JS
  • Safe to use with caching/CDN
  • 100% compliant with WordPress coding standards
  • License: GPLv3 or later

🧑‍💻 Author

M Khoirul Huda
https://mkhuda.com


⭐ Show support

If you like this plugin, give it a ⭐ on GitHub or mention it on your blog!

About

A lightweight, performance-focused WordPress plugin using the native Web Share API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published