HEX
Server: Apache
System: Linux server1.panigaletech.com 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/dev.captainschairit.com/wp-content/plugins/cf7-calendly-integration/public/public-form.php
<?php


function calendlycf7_forms_enabled() {
	$enabled = array();
	$args = array(
		'posts_per_page'   => -1,
		'post_type'        => 'wpcf7_contact_form',
	);
	$posts_array = get_posts($args);
	foreach($posts_array as $post) {
		$post_id = $post->ID;
		$enable = get_post_meta( $post_id, "_ccf7_active", true);
			
			if ($enable == "active") {	
			$meetingurls = get_post_meta( $post_id, "cf7rl_urls", true);
			$selecttype = get_post_meta( $post_id, "cf7rl_type", true);
			$sendemail = get_post_meta( $post_id, "cf7rl_sendemail", true);
			$ccf7_name = get_post_meta( $post_id, "cf7rl_name", true);
			$ccf7_email = get_post_meta( $post_id, "cf7rl_emai", true);
			$redirectmethod = get_post_meta( $post_id, "cf7rl_redirectmethod", true);
			

			$enabled[] = '|'.$post_id.'|'.$meetingurls.'|'.$selecttype.'|'.$sendemail.'|'.$ccf7_name.'|'.$ccf7_email.'|'.$redirectmethod.'|';
			}
	}
	return json_encode($enabled,JSON_UNESCAPED_SLASHES);
}


function calendlycf7_public_enqueue() {

	// redirect method js
	wp_enqueue_script('cf7rl-redirect_method',plugins_url('./redirect_method.js',__FILE__),array('jquery'),null);
	wp_localize_script('cf7rl-redirect_method', 'cf7rl_ajax_object',
		array (
			'cf7rl_ajax_url' 		=> admin_url('admin-ajax.php'),
			'cf7rl_forms' 			=> calendlycf7_forms_enabled(),
		)
	);

}
add_action('wp_enqueue_scripts','calendlycf7_public_enqueue',10);