=' ) &&
version_compare( $wp_version, '5.5', '>=' ) &&
class_exists( 'GFForms' )
);
}
/**
* Display a notice if requirements are not met.
*
* @return void
*/
function notice_for_missing_requirements() {
printf(
'
',
esc_html__( 'The "Gravity Forms Sendinblue Add-on" plugin is inactive because the minimal requirements are not met.', 'addon-gravityforms-sendinblue-free' )
);
}
/**
* Trigger a custom action when activating the plugin.
*
* @param string $plugin
* @param boolean $network
* @return void
*/
function on_plugin_activation( $plugin, $network ) {
if ( $plugin !== DKGFSIB_FREE_BASENAME ) {
return;
}
init();
do_action( 'dk-gf-sib-free/plugin-activated', (bool) $network );
}
add_action( 'activate_plugin', __NAMESPACE__ . '\\on_plugin_activation', 10, 2 );
/**
* Trigger a custom action when de-activating the plugin.
*
* @return void
*/
function on_plugin_deactivation( $plugin, $network ) {
if ( $plugin !== DKGFSIB_FREE_BASENAME ) {
return;
}
init();
do_action( 'dk-gf-sib-free/plugin-deactivated', (bool) $network );
}
add_action( 'deactivate_plugin', __NAMESPACE__ . '\\on_plugin_deactivation', 10, 2 );
/**
* Register our add-on.
*
* @return void
*/
function register_addon() {
if ( ! method_exists( 'GFForms', 'include_addon_framework' ) ) {
return;
}
// Stop here if the pro version is enabled
if ( defined( 'DKGFSIB_VERSION' ) ) {
return;
}
init();
GFAddOn::register( 'DK_GF_SIB_FREE\GF_Addon' );
}
add_action( 'gform_loaded', __NAMESPACE__ . '\\register_addon', 5 );
/**
* Translations.
*
* @return void
*/
function load_translations() {
load_plugin_textdomain( 'addon-gravityforms-sendinblue-free', false, DKGFSIB_FREE_PLUGIN_DIRNAME . '/languages/' );
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\\load_translations' );