Documentation for Developers

Get Started

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/woo-open-graph.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

 

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
});
Last updated: June 25, 2025