ADA TRAY

Your Plugin is successfully installed/registered.

Please fill below details to activate your Plugin.

Error:

'text', 'id' => 'email', 'label_for' => 'email' ); add_settings_field( 'ada_email_field', 'Email', 'ada_tray_settings', $true_page, 'true_section_1', $true_field_params ); $true_field_params = array( 'type' => 'text', 'id' => 'first_name', 'label_for' => 'first_name' ); add_settings_field( 'ada_first_name_field', 'First name', 'ada_tray_settings', $true_page, 'true_section_1', $true_field_params ); $true_field_params = array( 'type' => 'text', 'id' => 'last_name', 'label_for' => 'last_name' ); add_settings_field( 'ada_last_name_field', 'Last name', 'ada_tray_settings', $true_page, 'true_section_1', $true_field_params ); $true_field_params = array( 'type' => 'text', 'id' => 'url', 'label_for' => 'url' ); add_settings_field( 'ada_url_field', 'URL', 'ada_tray_settings', $true_page, 'true_section_1', $true_field_params ); } add_action( 'admin_init', 'ada_tray_form_settings' ); function ada_tray_settings($args) { extract( $args ); $option_name = 'adatray_settings'; $o = get_option( $option_name ); $all_options = get_option('adatray_settings'); switch ( $type ) { case 'text': $o[$id] = esc_attr( stripslashes($o[$id]) ); echo ""; break; } } function ada_tray_validate($input) { $errors = []; if (empty($input['email'])) { $errors[] = 'Please enter your email Id'; } if (!filter_var($input['email'], FILTER_VALIDATE_EMAIL)) { $errors[] = 'Please enter valid email format'; } if (empty($input['first_name'])) { $errors[] = 'Please enter your first name'; } if (empty($input['last_name'])) { $errors[] = 'Please enter your last name'; } if (!filter_var($input['url'], FILTER_VALIDATE_URL)) { $errors[] = 'Please enter valid URL format along with http/https'; } if (count($errors) > 0) { $input['errors'] = $errors; $input['status'] = 'error'; } $input['widget'] = '1'; if (empty($input['errors'])) { $data_string = $input; $args = array( 'body' => $data_string, 'timeout' => '5', 'redirection' => '5', 'httpversion' => '1.0', 'blocking' => true, 'headers' => array(), 'cookies' => array(), ); $response = wp_remote_post( 'https://www.ada-tray.com/index.php/widget-registration', $args ); $result = $response['body']; if ($result != "") { $input['code'] = $result; $input['status'] = 'success'; } else { $input['status'] = 'error'; $input['errors'][] = 'All fields are required'; foreach($input as $k => $v) { $valid_input[$k] = trim($v); if(($input[$k]) == '') { $input['errors'][$k] = '_error'; } } } } return $input; }