1. Home
  2. Docs
  3. KeyGator
  4. 2. Integrate KeyGator Client in the WordPress Project

2. Integrate KeyGator Client in the WordPress Project

See How to integrate the DevenceGate (Client) plugin into your WordPress project using TGM Plugin Activation to force your buyers to verify their licenses to receive the Sendback Content array and use the Premium features for buyers only.

We extremely recommended to use our modified version of TGMPA inside your plugins or themes you develop, The new TGMPA modified to work simultaneously to avoid conflict with other TGMPA included (In case a plugin and theme use TGMPA simultaneously).

For Plugins (If you use Namespaces in your project):
https://github.com/Oxibug/tgmpa-ns

For Themes:
https://github.com/Oxibug/tgmpa-unique-cls

  • Include TGM Plugin Activation into your WordPress project
  • Include your DevenceGate (Client) Plugin generated from the latest step using TGMPA.
  • Add the following lines into your project’s main file like functions.php.
if( ! defined('CONST_{ITEM_SLUG}_{ITEM_ID}_ID') ) { define('CONST_{ITEM_SLUG}_{ITEM_ID}_ID', '{ITEM_ID}'); }

if( ! defined('CONST_{ITEM_SLUG}_{ITEM_ID}_VERSION') ) { define('CONST_{ITEM_SLUG}_{ITEM_ID}_VERSION', 'CURRENT_SENDBACK_VERSION'); }
  • Define the item 7156494 with Slug MAG4U
  • Use DevenceGate (Client) Plugin functions to check whether your project’s licenses have been verified by a verified buyer or not, Using the following code.

    The element inside the Sendback content called tgmpa_plugins, If you have added you own Sendback content, you should use your elements IDs.
  • Helper Functions provided by DevenceGate Client Plugin and you can use ’em in your project using your plugin’s namespace
    \DevenceGate{AUTHOR_NAME}\DevFactory::{FUNCTION_NAME}