Freesoul Deactivate Plugins, for Developers
Adding a custom ajax action to the FDP settings.
If you want to add the ajax actions of your plugin or theme, use the filter ‘eos_dp_integration_action_plugins’ as in the following example:
add_filter( 'eos_dp_integration_action_plugins','my_plugin_add_fdp_integration' ); // Add custom ajax actions to the FDP Actions Settings Pages. function my_plugin_add_fdp_integration( $args ){ $args['my-plugin'] = array( 'is_active' => defined( 'MY_CUSTOM_PLUGIN_VERSION' ), 'ajax_actions' => array( 'my_action_example_name' => array( 'description' => __( 'Example of action description','my-textdomain' ) ), 'my_action_other_example_name' => array( 'description' => __( 'Other example of action descriptionn','my-textdomain' ) ), ) ); return $args; }
The key is_active
should return true
when your plugin or theme is active. In the example above, we used defined( 'MY_CUSTOM_PLUGIN_VERSION' )
because we assume that the constant MY_CUSTOM_PLUGIN_VERSION
is defined within the custom plugin.
Alternatively, you can use function_exists()
, class_exists()
, or any other method that confirms your plugin or theme is active.
In the example, 'my_action_example_name'
represents the action hook used to add your AJAX function. For more details on implementing AJAX in plugins and themes, refer to [this guide].
If you’re following the example, your AJAX function should be added as shown in the following snippet:
add_action( 'wp_ajax_my_action_example_name','my_action_example_name' ); function my_action_example_name(){ //Your code... }
You will see your actions in the FDP settings as shown in the following picture.

If you’re a plugin author and include the previously mentioned code in your plugin, you can troubleshoot AJAX issues more effectively. If users experience problems with your plugin’s AJAX actions due to conflicts with other plugins, you can recommend deactivating all other plugins while testing AJAX functionality.
How to programmatically check if a plugin is globally active.
In your code, you can check if a plugin is globally active using the function fdp_is_plugin_globally_active( $plugin ).
Example:
$plugin = ‘woocommerce/woocommerce.php’;
if( function_exists( 'fdp_is_plugin_globally_active' ) && fdp_is_plugin_globally_active( $plugin ) ){ // Your code here. }
$plugin is the path to the plugin main file relative to the plugins directory.