<?php if ( ! defined( 'ABSPATH' ) ) exit;
* Register our step processing admin page.
function nf_register_step_processing_page() {
// Register our admin page
$admin_page = add_submenu_page( NULL, esc_html__( 'Ninja Forms Processing', 'ninja-forms' ), esc_html__( 'Processing', 'ninja-forms' ), apply_filters( 'ninja_forms_admin_menu_capabilities', 'manage_options' ), 'nf-processing', 'nf_output_step_processing_page' );
add_action( 'admin_print_styles-' . $admin_page, 'nf_step_processing_css' );
add_action( 'admin_print_styles-' . $admin_page, 'nf_step_processing_js' );
add_action( 'admin_menu', 'nf_register_step_processing_page' );
* Enqueue our step processing CSS.
function nf_step_processing_css() {
wp_enqueue_style( 'jquery-smoothness', Ninja_Forms::$url .'deprecated/css/smoothness/jquery-smoothness.css');
* Enqueue our step processing JS.
function nf_step_processing_js() {
wp_enqueue_script( 'nf-processing',
Ninja_Forms::$url . 'deprecated/assets/js/dev/step-processing.js',
array( 'jquery', 'jquery-ui-core', 'jquery-ui-sortable', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-progressbar' ) );
$step_labels = apply_filters( 'nf_step_processing_labels', array(
wp_localize_script( 'nf-processing', 'nf_processing', array( 'step_labels' => $step_labels ) );
* Output our step processing admin page.
function nf_output_step_processing_page() {
$page_title = isset ( $_REQUEST['title'] ) ? urldecode( esc_html ( $_REQUEST['title'] ) ) : esc_html__( 'Ninja Forms - Processing', 'ninja-forms' );
text-shadow: 1px 1px 0 #fff;
/*background-size: 100% auto;*/
background-repeat: repeat;
background-image: url(<?php echo NF_PLUGIN_URL . 'assets/img/pbar-ani.gif'; ?>);
<script type="text/javascript">
if ( isset ( $_REQUEST['action'] ) && ! empty ( $_REQUEST['action'] ) ) {
$action = esc_html__( 'Loading...', 'ninja-forms' );
var nfProcessingAction = 'nf_<?php echo esc_html( $_REQUEST['action'] ); ?>';
$action = esc_html__( 'No Action Specified...', 'ninja-forms' );
var nfProcessingAction = 'none';
$url_params = parse_url( esc_url_raw( add_query_arg( array() ) ) );
$query = $url_params['query'];
$query = parse_str( $query, $tmp_array );
unset ( $tmp_array['action'] );
unset ( $tmp_array['page'] );
var nfProcessingArgs = <?php echo json_encode( $tmp_array ); ?>
<h2><?php echo $page_title ?></h2>
<div id="nf-upgrade-status">
<p><?php esc_html_e( 'The process has started, please be patient. This could take several minutes. You will be automatically redirected when the process is finished.', 'ninja-forms' ); ?></p>
<div class="progress-label">
<div id="nf-upgrade-errors" class="hidden nf-upgrade-errors">
<h3 class="nf-upgrade-errors-header">Error Log</h3>
<ul class="nf-upgrade-errors-list"></ul>