Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/ninja-fo.../includes/Admin/Menus
File: Dashboard.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
final class NF_Admin_Menus_Dashboard extends NF_Abstracts_Submenu
[2] Fix | Delete
{
[3] Fix | Delete
public $parent_slug = 'ninja-forms';
[4] Fix | Delete
[5] Fix | Delete
public $page_title = 'Dashboard';
[6] Fix | Delete
[7] Fix | Delete
public $menu_slug = 'ninja-forms';
[8] Fix | Delete
[9] Fix | Delete
public $position = 1;
[10] Fix | Delete
[11] Fix | Delete
public function __construct()
[12] Fix | Delete
{
[13] Fix | Delete
parent::__construct();
[14] Fix | Delete
[15] Fix | Delete
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_dashboard_script' ) );
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
public function get_page_title()
[19] Fix | Delete
{
[20] Fix | Delete
if( isset( $_GET[ 'form_id' ] ) ) {
[21] Fix | Delete
return esc_html__( 'Form Builder', 'ninja-forms' );
[22] Fix | Delete
}
[23] Fix | Delete
return esc_html__( 'Dashboard', 'ninja-forms' );
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
public function get_capability()
[27] Fix | Delete
{
[28] Fix | Delete
return apply_filters( 'ninja_forms_admin_all_forms_capabilities', $this->capability );
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
public function display()
[32] Fix | Delete
{
[33] Fix | Delete
// This section intentionally left blank.
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
/**
[37] Fix | Delete
* Enqueue dashboard page elements
[38] Fix | Delete
*/
[39] Fix | Delete
public function enqueue_dashboard_script($page) {
[40] Fix | Delete
// let's check and make sure we're on the dashboard page.
[41] Fix | Delete
if( isset( $page ) && $page === "toplevel_page_ninja-forms" && ! isset( $_REQUEST['form_id'] ) ) {
[42] Fix | Delete
global $wp_version;
[43] Fix | Delete
//Enqueue Dashboard element for dashboard
[44] Fix | Delete
if( $wp_version >= "5.4" ){
[45] Fix | Delete
//Get Dependencies and Version from build asset.php generated by wp-scripts
[46] Fix | Delete
$dashboard_asset_php = [
[47] Fix | Delete
"dependencies" => ['jquery'],
[48] Fix | Delete
"version" => false
[49] Fix | Delete
];
[50] Fix | Delete
if( file_exists( Ninja_Forms::$dir . "build/dashboard.asset.php" ) ){
[51] Fix | Delete
$asset_php = include( Ninja_Forms::$dir . "build/dashboard.asset.php" );
[52] Fix | Delete
$dashboard_asset_php["dependencies"] = array_merge( $dashboard_asset_php["dependencies"], $asset_php["dependencies"]);
[53] Fix | Delete
$dashboard_asset_php["version"] = $asset_php["version"];
[54] Fix | Delete
}
[55] Fix | Delete
//Get JS dashboard assets details
[56] Fix | Delete
if( file_exists( Ninja_Forms::$dir . "build/dashboard.scss.asset.php" ) ){
[57] Fix | Delete
$asset_scss = include( Ninja_Forms::$dir . "build/dashboard.scss.asset.php" );
[58] Fix | Delete
}
[59] Fix | Delete
$dashboard_asset_scss_version = isset($asset_scss) ? $asset_scss["version"] : Ninja_Forms::VERSION;
[60] Fix | Delete
//Register Dashboard script
[61] Fix | Delete
wp_register_script( 'ninja_forms_admin_dashboard', Ninja_Forms::$url . 'build/dashboard.js', $dashboard_asset_php["dependencies"], $dashboard_asset_php["version"], false );
[62] Fix | Delete
wp_enqueue_script( 'ninja_forms_admin_dashboard' );
[63] Fix | Delete
wp_set_script_translations( "ninja_forms_admin_dashboard", "ninja-forms", Ninja_Forms::$dir . 'lang' );
[64] Fix | Delete
//Enqueue dashboard style
[65] Fix | Delete
wp_enqueue_style( 'ninja_forms_admin_dashboard_style', Ninja_Forms::$url . 'build/dashboard.scss.css', [], $dashboard_asset_scss_version );
[66] Fix | Delete
[67] Fix | Delete
//Provide server side and saved data
[68] Fix | Delete
$addons_instance = new NF_Admin_Menus_Addons;
[69] Fix | Delete
$addons_data = $addons_instance->display();
[70] Fix | Delete
$services_data = Ninja_Forms()->config( 'DashboardServices' );
[71] Fix | Delete
wp_localize_script('ninja_forms_admin_dashboard', 'ninja_forms_admin_dashboard_data', [
[72] Fix | Delete
'addonsData' => $addons_data,
[73] Fix | Delete
'servicesData' => $services_data,
[74] Fix | Delete
'siteUrl' => esc_url_raw( site_url() ),
[75] Fix | Delete
'adminUrl' => esc_url_raw( admin_url() ),
[76] Fix | Delete
'restUrl' => esc_url_raw( get_rest_url() ),
[77] Fix | Delete
'ajaxUrl' => esc_url_raw( admin_url( 'admin-ajax.php' ) ),
[78] Fix | Delete
'pluginDir' => plugin_dir_url('ninja-forms.php'),
[79] Fix | Delete
'pluginURL' => NF_PLUGIN_URL,
[80] Fix | Delete
'token' => wp_create_nonce( 'wp_rest' ),
[81] Fix | Delete
'load_user_management' => !in_array('ninja-forms-user-management/ninja-forms-user-management.php', get_option('active_plugins'))
[82] Fix | Delete
]);
[83] Fix | Delete
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
}
[87] Fix | Delete
}
[88] Fix | Delete
} // End Class NF_Admin_Dashboard
[89] Fix | Delete
[90] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function