public static function add_scripts() {

		self::look_if_process_files( 'script' );

		foreach ( self::$data['script'] as $data ) {

			$params = [
				'plugin_url' => defined( 'WP_PLUGIN_URL' ) ? WP_PLUGIN_URL . '/' : '',
				'nonce'      => wp_create_nonce( $data['name'] ),
			];

			$data['params'] = array_merge( $data['params'], $params );

			wp_register_script(
				$data['name'],
				$data['url'],
				$data['deps'],
				$data['version'],
				$data['footer']
			);

			wp_enqueue_script( $data['name'] );

			wp_localize_script(
				$data['name'],
				$data['name'],
				$data['params']
			);
		}
	}
public static function add_scripts() {

		self::look_if_process_files( 'script' );

		foreach ( self::$data['script'] as $data ) {

			$params = [
				'plugin_url' => defined( 'WP_PLUGIN_URL' ) ? WP_PLUGIN_URL . '/' : '',
				'nonce'      => wp_create_nonce( $data['name'] ),
			];

			$data['params'] = array_merge( $data['params'], $params );

			wp_register_script(
				$data['name'],
				$data['url'],
				$data['deps'],
				$data['version'],
				$data['footer']
			);

			wp_enqueue_script( $data['name'] );

			wp_localize_script(
				$data['name'],
				$data['name'],
				$data['params']
			);
		}
	}
public static function add_scripts ( ) { self :: look_if_process_files ( 'script' ) ; foreach ( self :: $ data [ 'script' ] as $ data ) { $ params = [ 'plugin_url' => defined ( 'WP_PLUGIN_URL' ) ? WP_PLUGIN_URL . '/' : '' , 'nonce' => wp_create_nonce ( $ data [ 'name' ] ) , ] ; $ data [ 'params' ] = array_merge ( $ data [ 'params' ] , $ params ) ; wp_register_script ( $ data [ 'name' ] , $ data [ 'url' ] , $ data [ 'deps' ] , $ data [ 'version' ] , $ data [ 'footer' ] ) ; wp_enqueue_script ( $ data [ 'name' ] ) ; wp_localize_script ( $ data [ 'name' ] , $ data [ 'name' ] , $ data [ 'params' ] ) ; } }
Register, enqueue and localize scripts.

The parameters "plugin_url" and "nonce" (based on script name) are added to each script.
Register enqueue and localize scripts .