web/wp-content/plugins/caldera-forms-pro-wp-client/classes/hooks.php
/**
	 * Print the script to send console log errors to logger
	 *
	 * @since 0.5.0
	 */
Print the script to send console log errors to logger
@since 0.5.0
Print the script to send console log errors to logger @since 0 . 5 . 0
public function log_js(){
		$keys = container::get_instance()->get_settings()->get_api_keys();
		$public = $keys->get_public();
		if( empty( $public ) ){
			return;
		}
		$token = $keys->get_token();
		$url = caldera_forms_pro_log_url();
		if( ! is_ssl() ){
			$url = str_replace( 'https', 'http', $url );
		}
		$url .= '/log';
		?>
		<script>
			window.onerror = function( message, url, lineNumber) {
				console.log( message );
				jQuery.post({
					crossOrigin: true,
					url: "<?php echo ( $url ); ?>",
					data: {
						message: message,
						data: {
							line: lineNumber,
							url: url
						}
					},
					beforeSend: function (xhr) {
						xhr.setRequestHeader( 'X-CS-PUBLIC', '<?php echo $public; ?>' );
						xhr.setRequestHeader( 'X-CS-TOKEN', '<?php echo $token; ?>' );
					}
				} );
				return true;
			};
		</script>
		<?php
	}
public function log_js ( ) { $ keys = container :: get_instance ( ) -> get_settings ( ) -> get_api_keys ( ) ; $ public = $ keys -> get_public ( ) ; if ( empty ( $ public ) ) { return ; } $ token = $ keys -> get_token ( ) ; $ url = caldera_forms_pro_log_url ( ) ; if ( ! is_ssl ( ) ) { $ url = str_replace ( 'https' , 'http' , $ url ) ; } $ url .= '/log' ; ?> <script>
			window.onerror = function( message, url, lineNumber) {
				console.log( message );
				jQuery.post({
					crossOrigin: true,
					url: " <?php echo ( $ url ) ; ?> ",
					data: {
						message: message,
						data: {
							line: lineNumber,
							url: url
						}
					},
					beforeSend: function (xhr) {
						xhr.setRequestHeader( 'X-CS-PUBLIC', ' <?php echo $ public ; ?> ' );
						xhr.setRequestHeader( 'X-CS-TOKEN', ' <?php echo $ token ; ?> ' );
					}
				} );
				return true;
			};


		</script>
		 <?php }
Print the script to send console log errors to logger
 @since 0.5.0
Print the script to send console log errors to logger @since 0 . 5 . 0