', 'wpforms-lite' ), ! empty( $this->form_data['settings']['form_title'] ) ? sanitize_text_field( $this->form_data['settings']['form_title'] ) : esc_html__( 'Form Template', 'wpforms-lite' ) ); } return sprintf( /* translators: %s - form name. */ esc_html__( '%s Preview', 'wpforms-lite' ), ! empty( $this->form_data['settings']['form_title'] ) ? sanitize_text_field( $this->form_data['settings']['form_title'] ) : esc_html__( 'Form', 'wpforms-lite' ) ); } /** * Customize form preview page content. * * @since 1.5.1 * * @return string */ public function the_content() { if ( ! isset( $this->form_data['id'] ) ) { return ''; } if ( ! wpforms_current_user_can( 'view_form_single', $this->form_data['id'] ) ) { return ''; } $admin_url = admin_url( 'admin.php' ); $links = []; if ( wpforms_current_user_can( 'edit_form_single', $this->form_data['id'] ) ) { $links[] = [ 'url' => esc_url( add_query_arg( [ 'page' => 'wpforms-builder', 'view' => 'fields', 'form_id' => absint( $this->form_data['id'] ), ], $admin_url ) ), 'text' => $this->is_form_template ? esc_html__( 'Edit Form Template', 'wpforms-lite' ) : esc_html__( 'Edit Form', 'wpforms-lite' ), ]; } if ( wpforms()->is_pro() && wpforms_current_user_can( 'view_entries_form_single', $this->form_data['id'] ) ) { $links[] = [ 'url' => esc_url( add_query_arg( [ 'page' => 'wpforms-entries', 'view' => 'list', 'form_id' => absint( $this->form_data['id'] ), ], $admin_url ) ), 'text' => esc_html__( 'View Entries', 'wpforms-lite' ), ]; } if ( ! $this->is_form_template && wpforms_current_user_can( wpforms_get_capability_manage_options(), $this->form_data['id'] ) && wpforms()->obj( 'payment' )->get_by( 'form_id', $this->form_data['id'] ) ) { $links[] = [ 'url' => esc_url( add_query_arg( [ 'page' => 'wpforms-payments', 'form_id' => absint( $this->form_data['id'] ), ], $admin_url ) ), 'text' => esc_html__( 'View Payments', 'wpforms-lite' ), ]; } if ( ! empty( $_GET['new_window'] ) ) { // phpcs:ignore $links[] = [ 'url' => 'javascript:window.close();', 'text' => esc_html__( 'Close this window', 'wpforms-lite' ), ]; } $content = ''; $content .= $this->add_preview_notice(); $content .= '

'; $content .= $this->is_form_template ? esc_html__( 'This is a preview of the latest saved revision of your form template. If this preview does not match your template, save your changes and then refresh this page. This template preview is not publicly accessible.', 'wpforms-lite' ) : esc_html__( 'This is a preview of the latest saved revision of your form. If this preview does not match your form, save your changes and then refresh this page. This form preview is not publicly accessible.', 'wpforms-lite' ); if ( ! empty( $links ) ) { $content .= '
'; $content .= ''; foreach ( $links as $key => $link ) { $content .= '' . $link['text'] . ''; $l = array_keys( $links ); if ( end( $l ) !== $key ) { $content .= ' | '; } } $content .= ''; } $content .= '

'; $content .= '

'; $content .= sprintf( wp_kses( /* translators: %s - WPForms doc link. */ __( 'For form testing tips, check out our complete guide!', 'wpforms-lite' ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ), esc_url( wpforms_utm_link( 'https://wpforms.com/docs/how-to-properly-test-your-wordpress-forms-before-launching-checklist/', $this->is_form_template ? 'Form Template Preview' : 'Form Preview', 'Form Testing Tips Documentation' ) ) ); $content .= '

'; $content .= do_shortcode( '[wpforms id="' . absint( $this->form_data['id'] ) . '"]' ); return $content; } /** * Add preview notice. * * @since 1.8.8 * * @return string HTML content. */ private function add_preview_notice(): string { if ( ! $this->is_form_template ) { return ''; } $content = '
'; $content .= sprintf( '%s %s', esc_html__( 'Heads up!', 'wpforms-lite' ), esc_html__( 'You\'re viewing a preview of a form template.', 'wpforms-lite' ) ); if ( wpforms()->is_pro() ) { /** This filter is documented in wpforms/src/Pro/Tasks/Actions/PurgeTemplateEntryTask.php */ $delay = (int) apply_filters( 'wpforms_pro_tasks_actions_purge_template_entry_task_delay', DAY_IN_SECONDS ); // phpcs:ignore WPForms.PHP.ValidateHooks.InvalidHookName $message = sprintf( /* translators: %s - time period, e.g. 24 hours. */ __( 'Entries are automatically deleted after %s.', 'wpforms-lite' ), // The `- 1` hack is to avoid the "1 day" message in favor of "24 hours". human_time_diff( time(), time() + $delay - 1 ) ); $content .= sprintf( '

%s

', esc_html( $message ) ); } $content .= '
'; return wp_kses_post( $content ); } /** * Force page template types. * * @since 1.7.2 * * @param array $templates A list of template candidates, in descending order of priority. * * @return array */ public function force_page_template_hierarchy( $templates ) { return [ 'page.php', 'single.php', 'index.php' ]; } /** * Adjust value of the {page_title} smart tag. * * @since 1.7.7 * * @param string $content Content. * @param array $form_data Form data. * @param array $fields List of fields. * @param string $entry_id Entry ID. * @param object $smart_tag_object The smart tag object or the Generic object for those cases when class unregistered. * * @return string */ public function smart_tags_process_page_title_value( $content, $form_data, $fields, $entry_id, $smart_tag_object ) { return sprintf( /* translators: %s - form name. */ esc_html__( '%s Preview', 'wpforms-lite' ), ! empty( $form_data['settings']['form_title'] ) ? sanitize_text_field( $form_data['settings']['form_title'] ) : esc_html__( 'Form', 'wpforms-lite' ) ); } /** * Force page template types. * * @since 1.5.1 * @deprecated 1.7.2 * * @return string */ public function template_include() { _deprecated_function( __METHOD__, '1.7.2 of the WPForms plugin' ); return locate_template( [ 'page.php', 'single.php', 'index.php' ] ); } }
Warning: Cannot modify header information - headers already sent by (output started at /htdocs/wp-content/plugins/wpforms-lite/src/Forms/Preview.php:1) in /htdocs/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1563

Fatal error: Uncaught Error: Class "AmpProject\AmpWP\Infrastructure\Injector\FallbackInstantiator" not found in /htdocs/wp-content/plugins/amp/src/Infrastructure/Injector/SimpleInjector.php:57 Stack trace: #0 /htdocs/wp-content/plugins/amp/src/Infrastructure/ServiceBasedPlugin.php(87): AmpProject\AmpWP\Infrastructure\Injector\SimpleInjector->__construct() #1 /htdocs/wp-content/plugins/amp/src/AmpWpPluginFactory.php(38): AmpProject\AmpWP\Infrastructure\ServiceBasedPlugin->__construct() #2 /htdocs/wp-content/plugins/amp/includes/amp-helper-functions.php(78): AmpProject\AmpWP\AmpWpPluginFactory::create() #3 /htdocs/wp-includes/class-wp-hook.php(324): amp_bootstrap_plugin('') #4 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #5 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #7 /htdocs/wp-config.php(100): require_once('/htdocs/wp-sett...') #8 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #9 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #10 /htdocs/index.php(17): require('/htdocs/wp-blog...') #11 {main} thrown in /htdocs/wp-content/plugins/amp/src/Infrastructure/Injector/SimpleInjector.php on line 57