| Server IP : 194.30.32.123 / Your IP : 216.73.216.95 Web Server : Apache System : Linux eab357717bca 5.10.0-44-amd64 #1 SMP Debian 5.10.257-1 (2026-05-27) x86_64 User : ftpbegirale ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /expert/htwebs/www.begirale.com/public/wp-content/plugins/ninja-forms/lib/ |
Upload File : |
<?php
final class NF_AddonChecker
{
public function __construct()
{
add_action( 'plugins_loaded', array( $this, 'check_plugins' ) );
add_action( 'admin_notices', array( $this, 'deactivation_notice' ) );
}
public function check_plugins()
{
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$plugins = get_plugins();
foreach( $plugins as $plugin => $data ){
if( 'ninja-forms/ninja-forms.php' != $plugin && 0 === strncmp( $plugin, 'ninja-forms-', 12 ) && version_compare( $data[ 'Version' ], '3', '<' ) ){
if( ! is_plugin_active( $plugin ) ) continue;
deactivate_plugins($plugin);
wp_redirect( admin_url( 'plugins.php?nf-deactivated=' . $plugin ) ); exit;
}
}
}
public function deactivation_notice()
{
if( ! isset( $_GET[ 'nf-deactivated' ] ) ) return;
$plugin = sanitize_text_field( $_GET[ 'nf-deactivated' ] );
?>
<div class="notice notice-error is-dismissible">
<p><?php echo sprintf( __( 'Oops! That addon is not yet compatible with Ninja Forms THREE. %sLearn More%s.', 'ninja-forms' ), '<a target="_blank" href="https://ninjaforms.com/ninja-forms-three-extension-development-master-list/">', '</a>' ); ?></p>
<p><?php echo sprintf( __( '%s was deactivated.', 'ninja-forms' ), '<code>' . $plugin . '</code>'); ?></p>
</div>
<?php
}
}
new NF_AddonChecker();