$data) { if (0 === strpos($data['Name'], 'WP fail2ban')) { $wp_f2b_ver = substr(WP_FAIL2BAN_VER, 0, strrpos(WP_FAIL2BAN_VER, '.')); $error_msg = '

'.__('Cannot activate WP fail2ban', 'wp-fail2ban').'

'; $mu_file = WPMU_PLUGIN_DIR.'/'.$plugin; if (is_link($mu_file)) { if (false === ($link = readlink($mu_file)) || false === ($path = realpath($mu_file))) { $h3 = __('A broken symbolic link was found in mu-plugins:'); $error_msg .= <<< HTML

{$h3}

{$mu_file}

HTML; } elseif (WP_FAIL2BAN_FILE == $path) { // OK, we're linking to ourself break; } else { $mu_file = str_replace('/', '/', $mu_file); $mu_file = substr($mu_file, strlen(WPMU_PLUGIN_DIR)-1); $h3 = __('A conflicting symbolic link was found in mu-plugins:'); $error_msg .= <<< HTML

{$h3}

{$mu_file} {$link}
{$path}
HTML; } } else { $mu_file = str_replace('/', '/', $mu_file); $mu_file = substr($mu_file, strlen(WPMU_PLUGIN_DIR)-1); $h3 = __('A conflicting file was found in mu-plugins:'); $error_msg .= <<< HTML

{$h3}

{$mu_file}

HTML; } $error_msg .= sprintf( '

%s

', sprintf( /* translators: 1: internals */ __('Please see the documentation for how to configure WP fail2ban for mu-plugins.', 'wp-fail2ban'), sprintf( 'href="%s" target="_blank"', "https://docs.wp-fail2ban.com/en/{$wp_f2b_ver}/configuration.html#mu-plugins-support" ) ) ); $error_msg .= sprintf( '

%s

', sprintf( /* translators: %s: internals */ __('Click here to return to the plugins page.'), sprintf( 'href="%s"', admin_url('plugins.php') ) ) ); deactivate_plugins(plugin_basename(WP_FAIL2BAN_FILE)); wp_die($error_msg); } } @include_once WP_FAIL2BAN_DIR.'/premium/activation.php'; });