Class Reference

Check if Recomendo is active

Recommendations will only work if the Recomendo plugin is already active. You can wrap your code in a check to see if Recomendo is installed:

/**
 * Check if Recomendo is active
 **/
 
if ( in_array( 'recomendo/recomendo.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    // Put your code here
}

Main Class

The main class ‘recomendo’ is available globally via the $recomendo global variable. This class handles all the functions of Recomendo.

/**
 * Check if Recomendo is active and configured 
 **/
 
if ( in_array( 'recomendo/recomendo.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    global $recomendo;
    if ( isset( $recomendo) ) {
        // Put your code here
    }
}