'; return 'data:image/svg+xml;base64,' . base64_encode( $svg ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode } /** * Register menu. */ public static function menu() { $brand = fillnova_brand_name(); $cap = self::cap(); add_menu_page( $brand, $brand, $cap, 'fillnova', array( __CLASS__, 'page_forms' ), self::icon(), 26 ); add_submenu_page( 'fillnova', __( 'All Forms', 'fillnova' ), __( 'All Forms', 'fillnova' ), $cap, 'fillnova', array( __CLASS__, 'page_forms' ) ); add_submenu_page( 'fillnova', __( 'Add New', 'fillnova' ), __( 'Add New', 'fillnova' ), $cap, 'fillnova-new', array( __CLASS__, 'page_new' ) ); add_submenu_page( 'fillnova', __( 'Entries', 'fillnova' ), __( 'Entries', 'fillnova' ), $cap, 'fillnova-entries', array( __CLASS__, 'page_entries' ) ); // Hidden page (no menu item): the form builder. $builder = add_submenu_page( '', __( 'Form Builder', 'fillnova' ), '', $cap, 'fillnova-builder', array( __CLASS__, 'page_builder' ) ); add_action( 'load-' . $builder, function () { global $title; $title = __( 'Form Builder', 'fillnova' ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited } ); do_action( 'fillnova_admin_menu', $cap ); add_submenu_page( 'fillnova', __( 'Settings', 'fillnova' ), __( 'Settings', 'fillnova' ), $cap, 'fillnova-settings', array( 'Fillnova_Settings', 'page' ) ); if ( ! fillnova_is_pro() ) { add_submenu_page( 'fillnova', __( 'Upgrade to Pro', 'fillnova' ), '' . esc_html__( 'Upgrade to Pro', 'fillnova' ) . '', $cap, 'fillnova-pro', array( __CLASS__, 'page_pro' ) ); } } /** * Keep the Fillnova menu open on the hidden builder page. * * @param string $parent Parent file. * @return string */ public static function parent_file( $parent ) { global $plugin_page, $submenu_file; if ( 'fillnova-builder' === $plugin_page ) { $submenu_file = 'fillnova'; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited return 'fillnova'; } return $parent; } /** * Body class for full-screen builder. * * @param string $classes Classes. * @return string */ public static function body_class( $classes ) { // Admin-screen detection for enqueueing only; the admin menu cannot carry a nonce. Read-only, no state change. $page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( 0 === strpos( $page, 'fillnova' ) ) { $classes .= ' fillnova-admin'; } if ( 'fillnova-builder' === $page ) { $classes .= ' fillnova-builder-screen folded'; } return $classes; } /** * Redirect to "Add new" after activation. */ public static function activation_redirect() { if ( get_transient( 'fillnova_activation_redirect' ) ) { delete_transient( 'fillnova_activation_redirect' ); if ( ! isset( $_GET['activate-multi'] ) && ! wp_doing_ajax() ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended wp_safe_redirect( admin_url( 'admin.php?page=fillnova-new&welcome=1' ) ); exit; } } } /** * Plugin action links. * * @param array $links Links. * @return array */ public static function action_links( $links ) { array_unshift( $links, '' . esc_html__( 'Settings', 'fillnova' ) . '' ); array_unshift( $links, '' . esc_html__( 'Create form', 'fillnova' ) . '' ); if ( ! fillnova_is_pro() ) { $links[] = '' . esc_html__( 'Go Pro', 'fillnova' ) . ''; } return $links; } /** * Pro URL. * * @return string */ public static function pro_url() { return apply_filters( 'fillnova_pro_url', 'https://fillnova.com/pricing/' ); } /** * Enqueue admin assets. * * @param string $hook Hook. */ public static function assets( $hook ) { // Admin-screen detection for enqueueing only; the admin menu cannot carry a nonce. Read-only, no state change. $page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( 0 !== strpos( $page, 'fillnova' ) ) { return; } wp_enqueue_style( 'fillnova-admin', FILLNOVA_URL . 'assets/css/admin.css', array( 'dashicons' ), fillnova_asset_ver( 'assets/css/admin.css' ) ); $common = array( 'rest' => esc_url_raw( rest_url( Fillnova_REST::NS ) ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'adminUrl' => admin_url( 'admin.php' ), 'isPro' => fillnova_is_pro(), 'proUrl' => self::pro_url(), 'imgUrl' => FILLNOVA_URL . 'assets/img/', 'ai' => array( 'configured' => Fillnova_AI::has_provider(), 'remaining' => Fillnova_AI::remaining(), 'status' => Fillnova_AI::status(), 'settings' => admin_url( 'admin.php?page=fillnova-settings&tab=ai' ), ), 'templates' => Fillnova_Templates::catalog(), ); if ( 'fillnova-builder' === $page ) { // Read-only: loads the chosen form into the editor for display (like core's post.php?post=). Saving goes through the nonce-protected REST API. $form_id = isset( $_GET['id'] ) ? absint( $_GET['id'] ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $form = Fillnova_Forms::get( $form_id ); if ( ! $form ) { return; } wp_enqueue_script( 'jquery-ui-sortable' ); wp_enqueue_script( 'jquery-ui-draggable' ); wp_enqueue_script( 'fillnova-builder', FILLNOVA_URL . 'assets/js/builder.js', array( 'jquery', 'jquery-ui-sortable', 'jquery-ui-draggable', 'wp-i18n' ), fillnova_asset_ver( 'assets/js/builder.js' ), true ); wp_enqueue_style( 'fillnova-front', FILLNOVA_URL . 'assets/css/fillnova.css', array(), fillnova_asset_ver( 'assets/css/fillnova.css' ) ); $types = array(); foreach ( Fillnova_Fields::types() as $key => $t ) { $types[ $key ] = array( 'label' => $t['label'], 'icon' => $t['icon'], 'group' => $t['group'], 'input' => ! empty( $t['input'] ), 'locked' => ! empty( $t['locked'] ), 'pro' => ! empty( $t['pro'] ), 'defaults' => isset( $t['defaults'] ) ? $t['defaults'] : array(), ); } wp_localize_script( 'fillnova-builder', 'FillnovaBuilderData', array_merge( $common, array( 'form' => $form, 'types' => $types, 'groups' => Fillnova_Fields::groups(), 'operators' => Fillnova_Logic::operators(), 'defaults' => Fillnova_Forms::default_settings(), 'shareUrl' => Fillnova_Share::url( $form['id'] ), 'iframe' => Fillnova_Share::iframe_code( $form['id'] ), 'entries' => admin_url( 'admin.php?page=fillnova-entries&form_id=' . $form['id'] ), 'back' => admin_url( 'admin.php?page=fillnova' ), 'captcha' => array( 'recaptcha' => Fillnova_Captcha::ready( 'recaptcha' ), 'hcaptcha' => Fillnova_Captcha::ready( 'hcaptcha' ), 'turnstile' => Fillnova_Captcha::ready( 'turnstile' ), ), 'brand' => fillnova_brand_name(), ) ) ); do_action( 'fillnova_builder_enqueue', $form ); return; } wp_enqueue_script( 'fillnova-admin', FILLNOVA_URL . 'assets/js/admin.js', array( 'jquery' ), fillnova_asset_ver( 'assets/js/admin.js' ), true ); wp_localize_script( 'fillnova-admin', 'FillnovaAdminData', $common ); } /** * App bar (logo, sections, AI allowance, upgrade) + page heading. * * @param string $title Title (empty = no heading row). * @param string $actions Right side HTML for the heading row. */ public static function header( $title, $actions = '' ) { $page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : 'fillnova'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $items = array( 'fillnova' => __( 'All Forms', 'fillnova' ), 'fillnova-entries' => __( 'Entries', 'fillnova' ), ); if ( class_exists( 'Fillnova_Analytics' ) ) { $items['fillnova-analytics'] = __( 'Analytics', 'fillnova' ); } $items['fillnova-settings'] = __( 'Settings', 'fillnova' ); $items = apply_filters( 'fillnova_appbar_items', $items ); $active = 'fillnova-new' === $page ? 'fillnova' : $page; ?>
PRO

'', 'search' => '', 'upload' => '', 'copy' => '', 'dots' => '', 'pencil' => '', 'dup' => '', 'code' => '', 'download' => '', 'trash' => '', 'doc' => '', 'eye' => '', 'arrow' => '', 'layers' => '', 'wand' => '', 'filter' => '', ); return ''; } /** * Forms list page. */ public static function page_forms() { $forms = Fillnova_Forms::all(); // Read-only list filter for display only (like core's ?post_status=). No state change here; every form action (duplicate/delete/export/bulk) is nonce- and capability-checked in form_action()/bulk_forms(). $search = isset( $_GET['s'] ) ? sanitize_text_field( wp_unslash( $_GET['s'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $filter = isset( $_GET['status'] ) ? sanitize_key( $_GET['status'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended $total = count( $forms ); $forms = array_filter( $forms, function ( $p ) use ( $search, $filter ) { if ( $search && false === stripos( $p->post_title, $search ) && (string) $p->ID !== $search ) { return false; } return ! $filter || $p->post_status === $filter; } ); $new_url = admin_url( 'admin.php?page=fillnova-new' ); ?>

ID ); $count = Fillnova_Entries::count( $p->ID ); $unread = Fillnova_Entries::count( $p->ID, 'unread' ); $author = get_userdata( $p->post_author ); $updated = strtotime( $p->post_modified_gmt . ' UTC' ); $created = strtotime( $p->post_date_gmt . ' UTC' ); $live = 'publish' === $p->post_status; $action = function ( $do ) use ( $p ) { return wp_nonce_url( admin_url( 'admin-post.php?action=fillnova_form_action&do=' . $do . '&id=' . $p->ID ), 'fillnova_form_' . $p->ID ); }; $short = '[fillnova id="' . $p->ID . '"]'; ?>
post_title ); ?> ID, wp_date( get_option( 'date_format' ), $created ) ) ); ?> display_name : '—' ); ?>
__( 'Deleted.', 'fillnova' ), 'duplicated' => __( 'Form duplicated.', 'fillnova' ), 'updated' => __( 'Updated.', 'fillnova' ), 'saved' => __( 'Settings saved.', 'fillnova' ), 'imported' => __( 'Form imported.', 'fillnova' ), 'badimport' => __( 'That file is not a Fillnova form export.', 'fillnova' ), ); if ( isset( $map[ $msg ] ) ) { $bad = 'badimport' === $msg; echo '
' . esc_html( $map[ $msg ] ) . '
'; } } /** * New form page: choose Blank / Template / AI, then the template library or the AI prompt. */ public static function page_new() { $welcome = ! empty( $_GET['welcome'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended $catalog = Fillnova_Templates::catalog(); $counts = array(); foreach ( $catalog as $t ) { $counts[ $t['category'] ] = isset( $counts[ $t['category'] ] ) ? $counts[ $t['category'] ] + 1 : 1; } $cat_icons = array( 'business' => 'building', 'marketing' => 'megaphone', 'feedback' => 'chart-bar', 'registration' => 'id', 'events' => 'calendar-alt', 'hr' => 'portfolio', 'education' => 'welcome-learn-more', 'health' => 'heart', 'nonprofit' => 'groups', 'support' => 'sos', 'quiz' => 'awards', 'payment' => 'cart', 'calculator' => 'calculator', ); ?>

' . esc_html__( 'Form not found.', 'fillnova' ) . ' ' . esc_html__( 'Create a new form', 'fillnova' ) . '

'; return; } echo '
'; } /** * Entries page (list or single). */ public static function page_entries() { // Read-only routing: which entry to display. The only state change (marking it // read) is nonce-verified in page_entry(); all entry actions use entry_action(). $entry_id = isset( $_GET['entry'] ) ? absint( $_GET['entry'] ) : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( $entry_id ) { self::page_entry( $entry_id ); return; } $table = new Fillnova_Entries_Table(); $table->prepare_items(); $form_id = $table->form_id; $export = $form_id ? '' . esc_html__( 'Export CSV', 'fillnova' ) . '' : ''; ?>
views(); ?> search_box( __( 'Search entries', 'fillnova' ), 'fillnova-entries' ); ?>
display(); ?>

' . esc_html__( 'Entry not found.', 'fillnova' ) . '

'; return; } // Marking an entry read is a state change, so it only happens on an explicit, // nonce-verified view (the "View" link), never on a forgeable bare request. $view_nonce = isset( $_GET['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ) : ''; if ( 'unread' === $entry['status'] && current_user_can( self::cap() ) && wp_verify_nonce( $view_nonce, 'fillnova_view_entry_' . $entry_id ) ) { Fillnova_Entries::update( $entry_id, array( 'status' => 'read' ) ); } $form = Fillnova_Forms::get( $entry['form_id'] ); $fields = $form ? $form['fields'] : array(); $back = admin_url( 'admin.php?page=fillnova-entries&form_id=' . $entry['form_id'] ); $act = function ( $do ) use ( $entry_id ) { return wp_nonce_url( admin_url( 'admin-post.php?action=fillnova_entry_action&do=' . $do . '&entry=' . $entry_id ), 'fillnova_entry_' . $entry_id ); }; /* translators: %d: entry id */ $title = sprintf( __( 'Entry #%d', 'fillnova' ), $entry_id ); ?>
' . esc_html__( 'Back to entries', 'fillnova' ) . '' ); ?>

' . esc_html( isset( $f['label'] ) ? $f['label'] : $f['id'] ) . '
'; echo self::entry_value_html( $f, $value ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '
'; } foreach ( $entry['data'] as $k => $v ) { if ( in_array( $k, $shown, true ) ) { continue; } echo '
' . esc_html( $k ) . '
' . esc_html( fillnova_value_to_string( $v ) ) . '
'; } ?>
'; foreach ( $value as $url ) { $is_img = preg_match( '/\.(jpe?g|png|gif|webp)$/i', $url ); $out .= '
  • ' . ( $is_img ? '' : '' ) . esc_html( basename( $url ) ) . '
  • '; } return $out . ''; } if ( 'rating' === $f['type'] && '' !== (string) $value ) { $stars = ! empty( $f['stars'] ) ? (int) $f['stars'] : 5; return '' . str_repeat( '★', (int) $value ) . '' . str_repeat( '★', max( 0, $stars - (int) $value ) ) . ''; } $text = Fillnova_Notifications::format_value( $f, $value ); if ( '' === $text ) { return '—'; } if ( 'email' === $f['type'] ) { return '' . esc_html( $text ) . ''; } if ( 'url' === $f['type'] ) { return '' . esc_html( $text ) . ''; } return nl2br( esc_html( $text ) ); } /** * Upgrade page. */ public static function page_pro() { $img = FILLNOVA_URL . 'assets/img/cards/'; $groups = array( array( 'calendar-alt', __( 'Bookings & appointments', 'fillnova' ), array( __( 'Live calendar with only free dates and times', 'fillnova' ), __( 'Approve or decline with one click', 'fillnova' ), __( 'Customer emails with a link to view or cancel', 'fillnova' ), __( 'Calendar sync with Airbnb, Booking.com & Google', 'fillnova' ), ), ), array( 'smartphone', __( 'Instant alerts', 'fillnova' ), array( __( 'Every entry to WhatsApp and Telegram', 'fillnova' ), __( 'SMS alerts to you and your team', 'fillnova' ), __( 'Your own message with smart tags', 'fillnova' ), __( 'Booking date and status in the first line', 'fillnova' ), ), ), array( 'money-alt', __( 'Payments & prices', 'fillnova' ), array( __( 'Stripe & PayPal, Apple Pay and Google Pay', 'fillnova' ), __( 'Price cards with fees and a live total', 'fillnova' ), __( 'Calculations, quotes and order forms', 'fillnova' ), __( 'Discounts for longer stays and spin-to-win coupons', 'fillnova' ), ), ), array( 'megaphone', __( 'Grow your leads', 'fillnova' ), array( __( 'Popups, banners and spin to win', 'fillnova' ), __( 'Save & continue and partial entries', 'fillnova' ), __( 'Quizzes with scores and results', 'fillnova' ), __( 'Analytics: views, starts and conversion', 'fillnova' ), ), ), array( 'shield', __( 'Know your visitors', 'fillnova' ), array( __( 'Country, city, device and browser for every entry', 'fillnova' ), __( 'Block spam IPs and limit entries per visitor', 'fillnova' ), __( 'Digital signatures and repeater fields', 'fillnova' ), __( 'Priority support from the Fillnova team', 'fillnova' ), ), ), array( 'superhero-alt', __( 'AI, design & connections', 'fillnova' ), array( __( '5 AI forms every day + “edit my form with AI”', 'fillnova' ), __( 'Design Studio: colours, fonts, presets, CSS', 'fillnova' ), __( 'Webhooks, Zapier, Google Sheets, Mailchimp', 'fillnova' ), __( 'Turn entries into posts', 'fillnova' ), ), ), ); $shots = array( 'dental' => __( 'Dental clinic', 'fillnova' ), 'restaurant' => __( 'Restaurant', 'fillnova' ), 'salon' => __( 'Beauty salon', 'fillnova' ), 'rental' => __( 'Holiday rental', 'fillnova' ), ); ?>
    PRO

    →

    FILLNOVA_VERSION, 'title' => $form['title'], 'fields' => $form['fields'], 'settings' => $form['settings'], ), JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ); exit; } } wp_safe_redirect( admin_url( 'admin.php?page=fillnova&fy_msg=' . $msg ) ); exit; } /** * Import a form from a JSON export. */ public static function import_form() { if ( ! current_user_can( self::cap() ) || ! check_admin_referer( 'fillnova_import' ) ) { wp_die( esc_html__( 'Not allowed.', 'fillnova' ) ); } $msg = 'badimport'; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- the file is only read and decoded; everything is sanitized by Fillnova_Forms::save(). $file = isset( $_FILES['file']['tmp_name'] ) ? $_FILES['file']['tmp_name'] : ''; if ( $file && is_uploaded_file( $file ) && filesize( $file ) < 2 * MB_IN_BYTES ) { $data = json_decode( (string) file_get_contents( $file ), true ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents if ( is_array( $data ) && isset( $data['fields'] ) && is_array( $data['fields'] ) ) { $id = Fillnova_Forms::save( array( 'title' => isset( $data['title'] ) ? (string) $data['title'] : '', 'fields' => $data['fields'], 'settings' => isset( $data['settings'] ) && is_array( $data['settings'] ) ? $data['settings'] : array(), 'status' => 'draft', ) ); $msg = is_wp_error( $id ) ? 'badimport' : 'imported'; } } wp_safe_redirect( admin_url( 'admin.php?page=fillnova&fy_msg=' . $msg ) ); exit; } /** * Bulk publish / draft / delete. */ public static function bulk_forms() { if ( ! current_user_can( self::cap() ) || ! check_admin_referer( 'fillnova_bulk' ) ) { wp_die( esc_html__( 'Not allowed.', 'fillnova' ) ); } $do = isset( $_POST['do'] ) ? sanitize_key( $_POST['do'] ) : ''; $ids = isset( $_POST['ids'] ) ? array_map( 'absint', (array) $_POST['ids'] ) : array(); foreach ( $ids as $id ) { $post = get_post( $id ); if ( ! $post || Fillnova_Forms::POST_TYPE !== $post->post_type ) { continue; } if ( 'delete' === $do ) { Fillnova_Forms::delete( $id ); } elseif ( in_array( $do, array( 'publish', 'draft' ), true ) ) { wp_update_post( array( 'ID' => $id, 'post_status' => $do, ) ); } } wp_safe_redirect( admin_url( 'admin.php?page=fillnova&fy_msg=' . ( 'delete' === $do ? 'deleted' : 'updated' ) ) ); exit; } /** * Entry actions. */ public static function entry_action() { $id = isset( $_GET['entry'] ) ? absint( $_GET['entry'] ) : 0; $do = isset( $_GET['do'] ) ? sanitize_key( $_GET['do'] ) : ''; if ( ! current_user_can( self::cap() ) || ! check_admin_referer( 'fillnova_entry_' . $id ) ) { wp_die( esc_html__( 'Not allowed.', 'fillnova' ) ); } $entry = Fillnova_Entries::get( $id ); if ( ! $entry ) { wp_safe_redirect( admin_url( 'admin.php?page=fillnova-entries' ) ); exit; } switch ( $do ) { case 'star': Fillnova_Entries::update( $id, array( 'starred' => 1 ) ); break; case 'unstar': Fillnova_Entries::update( $id, array( 'starred' => 0 ) ); break; case 'unread': Fillnova_Entries::update( $id, array( 'status' => 'unread' ) ); wp_safe_redirect( admin_url( 'admin.php?page=fillnova-entries&form_id=' . $entry['form_id'] . '&fy_msg=updated' ) ); exit; case 'delete': Fillnova_Entries::delete( $id ); wp_safe_redirect( admin_url( 'admin.php?page=fillnova-entries&form_id=' . $entry['form_id'] . '&fy_msg=deleted' ) ); exit; } wp_safe_redirect( wp_nonce_url( admin_url( 'admin.php?page=fillnova-entries&entry=' . $id ), 'fillnova_view_entry_' . $id ) ); exit; } /** * CSV export. */ public static function export_csv() { if ( ! current_user_can( self::cap() ) || ! check_admin_referer( 'fillnova_export' ) ) { wp_die( esc_html__( 'Not allowed.', 'fillnova' ) ); } $form_id = isset( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0; $form = Fillnova_Forms::get( $form_id ); if ( ! $form ) { wp_die( esc_html__( 'Form not found.', 'fillnova' ) ); } $fields = array_values( array_filter( $form['fields'], function ( $f ) { return Fillnova_Fields::is_input( $f ); } ) ); $result = Fillnova_Entries::query( array( 'form_id' => $form_id, 'per_page' => 100000, ) ); nocache_headers(); header( 'Content-Type: text/csv; charset=utf-8' ); header( 'Content-Disposition: attachment; filename=' . sanitize_file_name( $form['title'] ) . '-entries-' . gmdate( 'Y-m-d' ) . '.csv' ); $out = fopen( 'php://output', 'w' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen fwrite( $out, "\xEF\xBB\xBF" ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fwrite -- UTF-8 BOM for Excel. $head = array( 'ID', __( 'Date', 'fillnova' ) ); foreach ( $fields as $f ) { $head[] = isset( $f['label'] ) ? $f['label'] : $f['id']; } $head = apply_filters( 'fillnova_csv_headers', $head, $form ); fputcsv( $out, $head ); foreach ( $result['items'] as $e ) { $row = array( $e['id'], $e['created_at'] ); foreach ( $fields as $f ) { $v = isset( $e['data'][ $f['id'] ] ) ? Fillnova_Notifications::format_value( $f, $e['data'][ $f['id'] ] ) : ''; $v = preg_match( '/^[=+\-@\t\r]/', $v ) ? "'" . $v : $v; // CSV injection guard. $row[] = $v; } fputcsv( $out, apply_filters( 'fillnova_csv_row', $row, $e, $form ) ); } fclose( $out ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose exit; } }