SDKs & Integrations

WordPress Integration

Official WordPress plugin. Adds follower counters, growth widgets, and analytics to your site through shortcodes, Gutenberg blocks, or PHP functions. WooCommerce support included for product page social proof.

FeatureDetails
Pluginoutfame-instagram-growth
Version1.4.2
WordPress≥ 6.0
PHP≥ 8.0
WooCommerceOptional (≥ 8.0)
LicenseGPLv2
Sourcegithub.com/outfame/outfame-wordpress

Installation

From WordPress admin

Fastest way to get started:

  1. Navigate to Plugins → Add New in your WordPress admin
  2. Search for “Outfame Instagram Growth”
  3. Click Install Now, then Activate
  4. Go to Settings → Outfame and enter your API key

Via WP-CLI

# Install and activate in one command
wp plugin install outfame-instagram-growth --activate

# Verify installation
wp plugin status outfame-instagram-growth

Manual upload

# Download the latest release
curl -L -o outfame.zip https://downloads.outfame.com/wordpress/latest.zip

# Extract to your plugins directory
unzip outfame.zip -d /path/to/wp-content/plugins/

# Activate via WP-CLI
wp plugin activate outfame-instagram-growth

Configuration

Head to Settings → Outfame after activation.

SettingDescriptionRequired
API KeyYour Outfame API key (sk_live_...)Yes
Account IDDefault Instagram account to display (acc_...)Yes
Cache DurationHow long to cache growth data (default: 5 minutes)No
Webhook URLAuto-generated endpoint for real-time updatesNo
WooCommerce IntegrationEnable social proof widgets on product pagesNo

You can also configure the plugin programmatically via wp-config.php:

// wp-config.php
define('OUTFAME_API_KEY', 'sk_live_your_api_key');
define('OUTFAME_ACCOUNT_ID', 'acc_7Gx2kLm9Qr');
define('OUTFAME_CACHE_TTL', 300); // seconds
define('OUTFAME_ENABLE_WOOCOMMERCE', true);

Shortcodes

Embed follower data anywhere in posts, pages, or widgets.

[outfame_growth_widget]

Growth overview card with follower count, net change, engagement rate, and optional chart.

[outfame_growth_widget]

[outfame_growth_widget
  account_id="acc_7Gx2kLm9Qr"
  period="30d"
  show_chart="true"
  show_engagement="true"
  theme="light"
]

[outfame_growth_widget
  period="7d"
  show_chart="false"
  theme="dark"
  class="my-custom-class"
]
AttributeDefaultDescription
account_idSettings defaultOverride the account to display
period30dTime range: 7d, 30d, 90d, 1y
show_charttrueDisplay the mini growth chart
show_engagementtrueShow engagement rate metric
themelightlight or dark
classAdditional CSS classes

[outfame_follower_count]

Inline number you can drop into any sentence. Good for social proof in blog posts or product descriptions.

<!-- Simple inline count -->
We've grown to [outfame_follower_count] Instagram followers!

<!-- Formatted with prefix -->
[outfame_follower_count format="short" prefix="+" suffix=" followers this month" metric="net_growth" period="30d"]

<!-- As part of a sentence -->
Join [outfame_follower_count format="comma"] others who trust our brand.
AttributeDefaultDescription
metricfollowersfollowers, net_growth, engagement_rate
formatcommacomma (12,450), short (12.4K), raw (12450)
periodRequired for net_growth metric
prefixText before the number
suffixText after the number

[outfame_analytics]

Full dashboard with charts, engagement breakdowns, and audience data. Best on a dedicated page.

[outfame_analytics]

[outfame_analytics
  account_id="acc_7Gx2kLm9Qr"
  period="90d"
  sections="growth,engagement,audience,targeting"
  chart_height="400"
  show_export="true"
  theme="light"
]
AttributeDefaultDescription
sectionsAll sectionsComma-separated: growth, engagement, audience, targeting
chart_height320Chart height in pixels
show_exportfalseShow CSV/PDF export buttons
interactivetrueEnable hover tooltips and date range selection

Gutenberg blocks

Five custom blocks with live preview in the editor:

BlockCategoryDescription
Outfame / Growth WidgetWidgetsFull growth overview card with chart and metrics
Outfame / Follower CounterInlineAnimated follower count with optional formatting
Outfame / Analytics DashboardWidgetsFull-page analytics with growth, engagement, and audience data
Outfame / Social Proof BarLayoutHorizontal bar showing follower count, growth rate, and rating
Outfame / Growth CTALayoutCall-to-action block with live growth stats and signup button

All blocks support the following panel controls in the block inspector:

  • Account selector — Choose which Instagram account to display
  • Time period — 7d, 30d, 90d, or 1 year
  • Theme — Light, dark, or auto (inherits from theme)
  • Alignment — Full-width, wide, or default

WooCommerce integration

Show follower counts and engagement on product pages. Enable in settings or via wp-config.php.

Setup

// wp-config.php or via Settings > Outfame > WooCommerce
define('OUTFAME_ENABLE_WOOCOMMERCE', true);

Product page widget

The plugin automatically adds an Instagram social proof widget below the product description. It shows your follower count, recent growth, and engagement rate.

// Customize the widget position via hook
add_action('init', function() {
    // Move widget from after description to after price
    remove_action(
        'woocommerce_single_product_summary',
        'outfame_product_social_proof',
        25
    );
    add_action(
        'woocommerce_single_product_summary',
        'outfame_product_social_proof',
        15 // After price (priority 10)
    );
});

// Customize the widget output
add_filter('outfame_product_social_proof_html', function($html, $data) {
    return sprintf(
        '<div class="my-social-proof">
            <p>Trusted by %s Instagram followers</p>
            <p>+%s new followers this month</p>
        </div>',
        number_format($data['followers_count']),
        number_format($data['net_growth'])
    );
}, 10, 2);

Cart social proof

// Add follower count to cart page
add_action('woocommerce_before_cart', function() {
    $analytics = outfame_get_analytics('30d');
    if ($analytics) {
        printf(
            '<div class="outfame-cart-proof">
                Join %s others who follow us on Instagram
            </div>',
            number_format($analytics['followers_count'])
        );
    }
});

PHP functions

For theme developers. All functions cache results based on the configured TTL.

outfame_get_analytics()

/**
 * Get analytics overview for the configured account.
 *
 * @param string $period   Time period: '7d', '30d', '90d', '1y', or 'custom'
 * @param array  $options  Optional: ['account_id' => '...', 'start_date' => '...', 'end_date' => '...']
 * @return array|null      Analytics data or null on error
 */
$analytics = outfame_get_analytics('30d');

// Returns:
// [
//   'followers_count'   => 45230,
//   'followers_gained'  => 1847,
//   'followers_lost'    => 312,
//   'net_growth'        => 1535,
//   'engagement_rate'   => 4.7,
//   'growth_trend'      => 'up',
//   'audience_quality'  => [
//       'real_percentage' => 94.2,
//       'bot_percentage'  => 5.8,
//       'score'           => 87,
//   ],
//   'data_points' => [
//       ['date' => '2026-01-10', 'followers' => 43695, 'net' => 52],
//       ['date' => '2026-01-11', 'followers' => 43741, 'net' => 46],
//       // ...
//   ],
// ]

// Custom date range
$analytics = outfame_get_analytics('custom', [
    'start_date' => '2026-01-01',
    'end_date'   => '2026-01-31',
]);

// Different account
$analytics = outfame_get_analytics('30d', [
    'account_id' => 'acc_DifferentAccount',
]);

outfame_get_followers()

/**
 * Get the current follower count.
 *
 * @param string|null $account_id  Account ID (uses default if null)
 * @param string      $format      'raw' (int), 'comma' (string), 'short' (string)
 * @return int|string              Follower count in requested format
 */

// Raw integer
$count = outfame_get_followers();
// 45230

// Formatted with commas
$formatted = outfame_get_followers(null, 'comma');
// "45,230"

// Short format
$short = outfame_get_followers(null, 'short');
// "45.2K"

// Specific account
$count = outfame_get_followers('acc_DifferentAccount');

outfame_get_account()

/**
 * Get full account details including targeting configuration.
 *
 * @param string|null $account_id  Account ID (uses default if null)
 * @return array|null              Account data or null on error
 */
$account = outfame_get_account();

// Returns:
// [
//   'id'                  => 'acc_7Gx2kLm9Qr',
//   'instagram_username'  => 'yourbrand',
//   'followers_count'     => 45230,
//   'status'              => 'active',
//   'platform'            => 'instagram',
//   'targeting_config'    => [
//       'competitor_accounts' => ['competitor1', 'competitor2'],
//       'hashtags'            => ['fitness', 'wellness'],
//       'ai_optimization'     => ['enabled' => true, 'mode' => 'balanced'],
//   ],
//   'created_at'          => '2025-06-15T10:30:00Z',
// ]

outfame_get_engagement()

/**
 * Get today's engagement stats.
 *
 * @param string|null $account_id  Account ID (uses default if null)
 * @return array|null              Engagement data or null on error
 */
$engagement = outfame_get_engagement();

// Returns:
// [
//   'is_active' => true,
//   'actions'   => [
//       'likes'    => ['performed' => 142, 'limit' => 200],
//       'follows'  => ['performed' => 38, 'limit' => 60],
//       'comments' => ['performed' => 12, 'limit' => 20],
//   ],
//   'conversion_rates' => [
//       'follow_to_follow_back' => 0.34,
//       'like_to_follow'        => 0.08,
//   ],
// ]

Theme template usage

<!-- In your theme's header.php or any template -->
<?php if (function_exists('outfame_get_followers')): ?>
    <div class="site-social-proof">
        <span class="follower-count">
            <?php echo outfame_get_followers(null, 'short'); ?> Instagram followers
        </span>
        <?php
        $analytics = outfame_get_analytics('30d');
        if ($analytics && $analytics['net_growth'] > 0):
        ?>
            <span class="growth-badge">
                +<?php echo number_format($analytics['net_growth']); ?> this month
            </span>
        <?php endif; ?>
    </div>
<?php endif; ?>

WordPress hooks

Actions and filters for milestone notifications, data transforms, and custom workflows.

Actions

// Fired when a growth milestone is reached (1K, 5K, 10K, etc.)
add_action('outfame_growth_milestone', function($data) {
    $milestone = $data['milestone'];    // e.g., 10000
    $account   = $data['account_id'];

    // Send custom notification
    wp_mail(
        get_option('admin_email'),
        "Instagram milestone reached: {$milestone} followers!",
        "Your account {$account} just hit {$milestone} followers."
    );
}, 10, 1);

// Fired when daily engagement summary is received
add_action('outfame_daily_summary', function($data) {
    $net_growth      = $data['net_growth'];
    $engagement_rate = $data['engagement_rate'];

    // Log to custom table for historical tracking
    global $wpdb;
    $wpdb->insert(
        $wpdb->prefix . 'outfame_history',
        [
            'date'            => current_time('mysql'),
            'net_growth'      => $net_growth,
            'engagement_rate' => $engagement_rate,
        ]
    );
}, 10, 1);

// Fired when campaign status changes (active, paused, completed)
add_action('outfame_campaign_status_changed', function($data) {
    if ($data['status'] === 'paused') {
        // Alert admin that growth campaign was paused
        do_action('admin_notices', function() {
            echo '<div class="notice notice-warning"><p>Outfame growth campaign paused.</p></div>';
        });
    }
}, 10, 1);

// Fired when targeting suggestions are available from the AI
add_action('outfame_targeting_suggestions', function($suggestions) {
    // Auto-log suggestions for review
    error_log('Outfame AI suggestions: ' . wp_json_encode($suggestions));
}, 10, 1);

Filters

// Customize the cache TTL for analytics data
add_filter('outfame_cache_ttl', function($ttl) {
    return 120; // Cache for 2 minutes instead of default 5
});

// Modify analytics data before rendering in shortcodes
add_filter('outfame_analytics_data', function($data, $account_id) {
    // Add custom computed metrics
    $data['growth_per_day'] = round($data['net_growth'] / 30, 1);
    return $data;
}, 10, 2);

// Customize widget HTML output
add_filter('outfame_widget_html', function($html, $widget_type, $data) {
    if ($widget_type === 'growth_widget') {
        // Wrap in your theme's card component
        return '<div class="theme-card">' . $html . '</div>';
    }
    return $html;
}, 10, 3);

// Add custom CSS classes to Gutenberg blocks
add_filter('outfame_block_classes', function($classes, $block_name) {
    $classes[] = 'my-theme-outfame-block';
    return $classes;
}, 10, 2);

REST API endpoints

Registered under /wp-json/outfame/v1/. Useful for AJAX interfaces or headless setups.

// GET /wp-json/outfame/v1/analytics?period=30d
// GET /wp-json/outfame/v1/account
// GET /wp-json/outfame/v1/engagement
// GET /wp-json/outfame/v1/followers?format=short

// JavaScript example (from your theme)
const response = await fetch('/wp-json/outfame/v1/analytics?period=30d', {
    headers: { 'X-WP-Nonce': wpApiSettings.nonce },
});
const analytics = await response.json();
console.log(`Growth: +${analytics.net_growth} followers`);

Caching

All API responses are cached via WordPress transients. Compatible with Redis Object Cache, Memcached, and WP Super Cache.

Data TypeDefault TTLFilterable
Account data10 minutesoutfame_cache_ttl_account
Analytics overview5 minutesoutfame_cache_ttl_analytics
Follower count5 minutesoutfame_cache_ttl_followers
Engagement stats2 minutesoutfame_cache_ttl_engagement
// Clear all Outfame caches manually
outfame_clear_cache();

// Clear cache for a specific account
outfame_clear_cache('acc_7Gx2kLm9Qr');

// WP-CLI cache management
wp outfame cache clear
wp outfame cache status

The plugin is compatible with popular object cache plugins including Redis Object Cache, Memcached, and WP Super Cache. When an object cache is active, transients are stored in memory for faster retrieval.


Troubleshooting

IssueSolution
Widget shows “No data”Verify API key and Account ID in Settings → Outfame
Stale follower countRun wp outfame cache clear or reduce cache TTL
Blocks not appearing in editorEnsure WordPress ≥ 6.0 and Gutenberg is enabled
WooCommerce widget missingEnable WooCommerce integration in Settings and verify WooCommerce ≥ 8.0
REST API returns 401Check that the X-WP-Nonce header is included in requests
Slow page loadsIncrease cache TTL or enable an object cache plugin

Debug mode

// Enable verbose logging in wp-config.php
define('OUTFAME_DEBUG', true);

// Logs are written to: wp-content/debug.log
// Includes: API requests, cache hits/misses, webhook events

// WP-CLI diagnostics
wp outfame status        # Connection check
wp outfame test-api      # Verify API key
wp outfame cache status  # Cache hit rates

Next stepsWebhooks reference | Growth guide