Skip to content

wbcomdesigns/WooCommerce-Open-Graph

Repository files navigation

Open Graph for WooCommerce

Advanced Open Graph meta tags and social sharing for WooCommerce Boost social media engagement with automatic Schema.org markup and beautiful share buttons.

๐Ÿš€ Overview

Open Graph for WooCommerce is a comprehensive WordPress plugin that helps your WooCommerce products look perfect when shared on social media. It automatically generates optimized Open Graph meta tags, Twitter Cards, and Schema.org structured data to boost your social media presence and SEO.

โœจ What Makes It Special

  • ๐ŸŽฏ WooCommerce-Focused: Built specifically for e-commerce with product pricing, availability, and inventory data
  • โšก Performance Optimized: 70% smaller asset size, conditional loading, optimized queries
  • ๐ŸŽจ Beautiful UI: Modern WordPress-native admin interface with 3 share button styles
  • ๐Ÿ“ฑ Mobile First: Responsive design with touch-optimized social sharing
  • โ™ฟ Accessible: WCAG 2.1 compliant with full keyboard navigation and screen reader support
  • ๐Ÿ”ง Developer Friendly: 20+ hooks, extensive customization options, and comprehensive API

๐Ÿ”ฅ Key Features

๐Ÿ“ฑ Complete Social Media Support

  • Facebook - Complete Open Graph with App ID integration
  • Twitter - Optimized Cards with product data
  • LinkedIn - Professional network optimization
  • Pinterest - Rich Pins with product information
  • WhatsApp - Mobile-optimized sharing
  • Email - Traditional sharing with formatting
  • Copy Link - Modern clipboard API integration

๐Ÿ—๏ธ Advanced Schema.org Markup

  • Product schema with offers, reviews, and ratings
  • Organization and brand information
  • Breadcrumb navigation markup
  • Rich snippets for search engines

๐ŸŽจ Beautiful Social Share Buttons

  • 3 Stunning Styles: Modern, Classic, Minimal
  • Flexible Positioning: 4 built-in positions + shortcode
  • Smart Image Handling: Multiple sizes with fallbacks
  • Copy Functionality: Working clipboard integration

โšก Performance Features

  • Conditional loading (only when needed)
  • Optimized database queries
  • Smart caching system
  • Minimal page load impact (< 0.1s)

๐Ÿš€ Installation

WordPress.org (Recommended)

# From WordPress admin
Plugins โ†’ Add New โ†’ Search "Open Graph for WooCommerce" โ†’ Install โ†’ Activate

Manual Installation

# Download and extract
wp plugin install open-graph-for-woocommerce.zip
wp plugin activate open-graph-for-woocommerce

Composer

composer require wbcomdesigns/open-graph-for-woocommerce

โš™๏ธ Quick Setup

  1. Install & Activate the plugin
  2. Navigate to WooCommerce โ†’ Social Media
  3. Enable Platforms you want to support
  4. Choose Style for share buttons
  5. Configure Settings as needed
  6. Test with social platform validators

๐ŸŽฏ Usage Examples

Basic Setup

// Plugin automatically generates meta tags for all products
// No code required - just configure in admin

Shortcode Usage

// Display share buttons anywhere
[wog_social_share]

// In templates
echo do_shortcode('[wog_social_share]');

Hook Examples

// Modify product meta data
add_filter('wog_product_meta_data', function($meta_data, $product) {
    $meta_data['custom_field'] = 'custom_value';
    return $meta_data;
}, 10, 2);

// Add custom platform
add_filter('wog_social_platforms', function($platforms) {
    $platforms['custom'] = array(
        'name' => 'Custom Platform',
        'url' => 'https://custom.com/share?url={{url}}'
    );
    return $platforms;
});

// Track share events
add_action('wog_social_share_tracked', function($platform, $product_id, $url) {
    // Your tracking logic here
});

๐Ÿ› ๏ธ Development

Requirements

  • WordPress: 5.0+
  • WooCommerce: 4.0+
  • PHP: 7.4+ (8.0+ recommended)
  • Node.js: 14+ (for development)

Local Development Setup

# Clone repository
git clone https://github.com/wbcomdesigns/open-graph-for-woocommerce.git
cd woo-open-graph

# Install dependencies
npm install
composer install

# Start development
npm run dev

# Build for production
npm run build

File Structure

woo-open-graph/
โ”œโ”€โ”€ ๐Ÿ“„ woo-open-graph.php             # Main plugin file
โ”œโ”€โ”€ ๐Ÿ“ includes/                     # Core functionality
โ”‚   โ”œโ”€โ”€ class-wog-settings.php      # Settings management
โ”‚   โ”œโ”€โ”€ class-wog-meta-tags.php     # Meta tags generation
โ”‚   โ”œโ”€โ”€ class-wog-schema.php        # Schema.org markup
โ”‚   โ”œโ”€โ”€ class-wog-sitemap.php       # XML sitemaps
โ”‚   โ”œโ”€โ”€ class-wog-social-share.php  # Social sharing
โ”‚   โ””โ”€โ”€ class-wog-meta-boxes.php    # Admin meta boxes
โ”œโ”€โ”€ ๐Ÿ“ admin/                        # Admin interface
โ”‚   โ””โ”€โ”€ class-wog-admin.php         # Admin panel
โ”œโ”€โ”€ ๐Ÿ“ assets/                       # Frontend assets
โ”‚   โ”œโ”€โ”€ css/                         # Stylesheets
โ”‚   โ””โ”€โ”€ js/                          # JavaScript
โ””โ”€โ”€ ๐Ÿ“ languages/                    # Translation files

๐Ÿ“Š Performance Metrics

Metric Before v2.0 After v2.0 Improvement
Asset Size ~105KB ~28KB 73% smaller
DB Queries +8 avg +3 avg 62% reduction
Load Time +0.3s +0.1s 67% faster
Memory Usage ~5MB ~2MB 60% less

๐Ÿงช Testing

Automated Testing

# Run PHP tests
composer test

# Run JavaScript tests  
npm test

# Run linting
npm run lint

Manual Testing Tools

Testing Checklist

  • Meta tags generate correctly on product pages
  • Share buttons appear in configured position
  • Copy link functionality works
  • Schema markup validates
  • Mobile responsiveness
  • Performance impact < 0.1s

๐ŸŒ Browser Support

Browser Version Status
Chrome 70+ โœ… Fully Supported
Firefox 65+ โœ… Fully Supported
Safari 12+ โœ… Fully Supported
Edge 79+ โœ… Fully Supported
iOS Safari 12+ โœ… Fully Supported
Chrome Mobile 70+ โœ… Fully Supported

๐ŸŽจ Customization

CSS Customization

/* Override share button styles */
.wog-social-share .wog-share-btn {
    /* Your custom styles */
}

/* Style specific platforms */
.wog-share-facebook {
    background: #1877f2;
}

JavaScript Events

// Listen for share events
document.addEventListener('wog_social_share', function(event) {
    console.log('Shared on:', event.detail.platform);
});

// Custom copy functionality
window.EWOGSocialShare.copyLink(url);

๐Ÿ› Troubleshooting

Common Issues

Meta tags not showing?

  • Verify WooCommerce is active
  • Check on product pages only
  • Clear caching plugins

Share buttons not appearing?

  • Enable social sharing in settings
  • Check theme compatibility
  • Verify position setting

Copy button not working?

  • Requires HTTPS for modern browsers
  • Fallback provided for HTTP

Debug Mode

// Enable debug logging
define('WOG_DEBUG', true);

// Or via admin
WooCommerce โ†’ Social Media โ†’ Advanced โ†’ Debug Mode

๐Ÿ“ Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Coding Standards

๐Ÿ“– Documentation

๐Ÿ†˜ Support

Free Support

Premium Support

๐Ÿ“„ License

This project is licensed under the GPL-2.0+ License - see the LICENSE file for details.

๐Ÿ† Credits

Team

Special Thanks

  • WordPress & WooCommerce communities
  • Beta testers and feedback providers
  • Translation contributors
  • Simple Icons for social media icons

๐Ÿ”ฎ Roadmap

Version 2.1 (Q1 2025)

  • Instagram sharing support
  • TikTok integration
  • Advanced analytics dashboard
  • Bulk product optimization
  • Custom meta box fields

Version 2.2 (Q2 2025)

  • AI-powered content optimization
  • A/B testing for share buttons
  • Advanced image optimization
  • Multi-site network support
  • REST API endpoints

Long Term

  • Shopify integration
  • Mobile app
  • Enterprise features
  • White-label options

๐Ÿ“Š Stats

GitHub stars GitHub forks WordPress.org downloads WordPress.org rating


Website โ€ข Documentation โ€ข Support โ€ข Donate

Made with โค๏ธ by Wbcom Designs

About

This Plugin will add Open Graph Meta tags and dynamic values to your site.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •