Extending VIP Features with Init User Engine

The Init User Engine plugin includes a powerful VIP system, allowing you to offer exclusive experiences to premium users. This guide shows how to use built-in functions to check VIP status, disable ads, grant special features, and create custom UI behavior.

Extending VIP Features with Init User Engine

1. Check if a user is VIP

You can check whether the current user or any specific user has an active VIP status:

// Check current user
if ( init_plugin_suite_user_engine_is_vip() ) {
    // The current user is VIP
}

// Check specific user
if ( init_plugin_suite_user_engine_is_vip( $user_id ) ) {
    // User with ID is VIP
}

2. Example: Disable Google Site Kit ads for VIP users

function disable_adsense_sitekit_for_vip() {
    if ( init_plugin_suite_user_engine_is_vip() ) {
        add_filter( 'googlesitekit_adsense_tag_blocked', '__return_true' );
    }
}
add_action( 'init', 'disable_adsense_sitekit_for_vip' );

3. Get VIP expiration timestamp

$expiry = init_plugin_suite_user_engine_get_vip_expiry();
echo wp_date( 'Y-m-d H:i', $expiry );

This is useful for showing the remaining VIP time to users.

4. Unlock features or interface for VIP users

if ( init_plugin_suite_user_engine_is_vip() ) {
    // Show premium UI, tools, downloads, etc.
}

5. Grant VIP days manually

Useful for gifts, bonuses, or admin tools:

init_plugin_suite_user_engine_add_vip_days( $user_id, 30 ); // Add 30 VIP days

6. Get VIP purchase history

$log = init_plugin_suite_user_engine_get_vip_log( $user_id );

foreach ( $log as $entry ) {
    echo 'Package: ' . $entry['package'] . ' days – Cost: ' . $entry['coin'] . ' coins – Date: ' . wp_date( 'Y-m-d', $entry['time'] ) . '<br>';
}

7. Purchase VIP via REST API

Endpoint: /wp-json/inituser/v1/vip/purchase (method: POST)

Example JSON body:

{
  "package_id": 2
}

Default package options:

  • 1 – 7 days
  • 2 – 30 days
  • 3 – 90 days
  • 4 – 180 days
  • 5 – 360 days
  • 6 – Lifetime (9999 days)

8. Hook: After VIP purchase

Use this hook to send emails, show effects, or run any logic after purchase:

add_action( 'init_plugin_suite_user_engine_vip_purchased', function( $user_id, $package_id, $data ) {
    // $data['days'], $data['coin'], $data['new_expiry']
});

9. Display VIP-only UI using HTML/CSS

The plugin automatically adds the iue-vip class to the <body> element when the user has an active VIP status.
This allows you to control VIP-only UI purely with CSS, without relying on PHP or JavaScript.

body.iue-vip .vip-only {
    display: block;
}

body:not(.iue-vip) .vip-only {
    display: none;
}

This approach is especially useful when you can only inject static HTML/CSS (page builders, block editors, or landing pages).

10. Show renewal reminders when VIP is close to expiration

When a user’s VIP is close to expiring (default: ≤ 1 day), the plugin adds the iue-expire-soon class to the <body> element. You can use this class to display renewal reminders or limited-time offers.

body.iue-expire-soon .vip-renew-notice {
    display: block;
}

body:not(.iue-expire-soon) .vip-renew-notice {
    display: none;
}

The “expire soon” threshold can be customized via a developer filter.

11. Upsell to users with expired VIP status

If a user has previously purchased VIP but their VIP has expired, the plugin adds the iue-vip-expired class to the <body> element. This is an ideal signal for displaying upsell content or re-engagement messages.

body.iue-vip-expired .vip-upsell {
    display: block;
}

This method is highly effective for marketing because:

  • No PHP logic is required.
  • No performance impact.
  • Works perfectly with static HTML and pure CSS.

Conclusion

The VIP system in Init User Engine is more than just a premium feature—it’s a framework to personalize and enhance the user experience. By using the built-in functions and hooks, you can integrate VIP logic into your theme or plugin with ease and full control.

Comments


  • No comments yet.

Init Toolbox

Press Ctrl + \ on desktop, or swipe left anywhere on mobile.

Login