/home/altere25/public_html/wp-content/plugins/formidable/classes/models
NameSizeModeActions
fields/-0755rm
FrmAddon.php256190644editdlrm
FrmAntiSpam.php88810644editdlrm
FrmApplicationApi.php6750644editdlrm
FrmApplicationTemplate.php53170644editdlrm
FrmCreateFile.php70840644editdlrm
FrmDb.php199790644editdlrm
FrmEmail.php205890644editdlrm
FrmEmailMonthly.php7880644editdlrm
FrmEmailStats.php70660644editdlrm
FrmEmailSummary.php42940644editdlrm
FrmEmailYearly.php7470644editdlrm
FrmEntry.php299420644editdlrm
FrmEntryFormatter.php215150644editdlrm
FrmEntryMeta.php161040644editdlrm
FrmEntryShortcodeFormatter.php62600644editdlrm
FrmEntryValidate.php256760644editdlrm
FrmEntryValues.php74760644editdlrm
FrmField.php446210644editdlrm
FrmFieldCaptchaSettings.php52080644editdlrm
FrmFieldFormHtml.php146790644editdlrm
FrmFieldOption.php17160644editdlrm
FrmFieldSelectionData.php6350644editdlrm
FrmFieldTypeOptionData.php5780644editdlrm
FrmFieldValue.php59460644editdlrm
FrmFieldValueSelector.php48020644editdlrm
FrmForm.php357810644editdlrm
FrmFormAction.php270940644editdlrm
FrmFormApi.php86490644editdlrm
FrmFormMigrator.php155180644editdlrm
FrmFormState.php63240644editdlrm
FrmFormTemplateApi.php43630644editdlrm
FrmHcaptchaSettings.php12760644editdlrm
FrmHoneypot.php39850644editdlrm
FrmInbox.php116570644editdlrm
FrmInstallerSkin.php21310644editdlrm
FrmInstallPlugin.php36520644editdlrm
FrmMigrate.php196280644editdlrm
FrmNotification.php16740644editdlrm
FrmOnSubmitAction.php26870644editdlrm
FrmPersonalData.php43120644editdlrm
FrmPluginSearch.php110130644editdlrm
FrmRecaptchaSettings.php25730644editdlrm
FrmReviews.php63530644editdlrm
FrmSettings.php131230644editdlrm
FrmSolution.php216210644editdlrm
FrmStyle.php256100644editdlrm
FrmStyleApi.php12190644editdlrm
FrmTableHTMLGenerator.php76230644editdlrm
FrmTurnstileSettings.php15730644editdlrm
FrmUsage.php86730644editdlrm
FrmValidate.php9410644editdlrm
FrmYoutubeFeedApi.php10030644editdlrm
Edit: /home/altere25/public_html/wp-content/plugins/formidable/classes/models/FrmSolution.php (21621B)
plugin_slug ) ) { return; } add_action( 'plugins_loaded', array( $this, 'load_hooks' ), 50 ); add_action( 'admin_init', array( $this, 'redirect' ), 9999 ); if ( empty( $this->plugin_file ) ) { $this->plugin_file = $this->plugin_slug . '.php'; } } /** * Register all WP hooks. * * @since 4.06.02 * * @return void */ public function load_hooks() { // If user is in admin ajax or doing cron, return. if ( wp_doing_cron() ) { return; } add_filter( 'frm_add_settings_section', array( $this, 'add_settings' ) ); if ( wp_doing_ajax() ) { return; } // If user cannot manage_options, return. if ( ! current_user_can( 'frm_change_settings' ) && ! FrmAppHelper::is_formidable_admin() ) { return; } add_filter( 'plugin_action_links_' . $this->plugin_slug . '/' . $this->plugin_file, array( $this, 'plugin_links' ) ); add_action( 'admin_menu', array( $this, 'register' ) ); add_action( 'admin_head', array( $this, 'hide_menu' ) ); } public function plugin_links( $links ) { if ( ! $this->is_complete() ) { $settings = '' . __( 'Setup', 'formidable' ) . ''; array_unshift( $links, $settings ); } return $links; } /** * Register the pages to be used for the Welcome screen (and tabs). * * These pages will be removed from the Dashboard menu, so they will * not actually show. Sneaky, sneaky. * * @since 4.06.02 * * @return void */ public function register() { // Getting started - shows after installation. add_dashboard_page( esc_html( $this->page_title() ), esc_html( $this->page_title() ), 'frm_change_settings', $this->page, array( $this, 'output' ) ); } /** * Removed the dashboard pages from the admin menu. * * This means the pages are still available to us, but hidden. * * @since 4.06.02 * * @return void */ public function hide_menu() { remove_submenu_page( 'index.php', $this->page ); } /** * @return string * * @psalm-return '' */ protected function plugin_name() { return ''; } /** * @return string */ protected function page_title() { return __( 'Welcome to Formidable Forms', 'formidable' ); } /** * @return string */ protected function page_description() { return __( 'Follow the steps below to get started.', 'formidable' ); } /** * Welcome screen redirect. * * This function checks if a new install or update has just occurred. If so, * then we redirect the user to the appropriate page. * * @since 4.06.02 * * @return void */ public function redirect() { $current_page = FrmAppHelper::simple_get( 'page', 'sanitize_title' ); if ( $current_page === $this->page ) { // Prevent endless loop. return; } // Only do this for single site installs. if ( isset( $_GET['activate-multi'] ) || is_network_admin() ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing return; } // Check if we should consider redirection. if ( ! $this->is_current_plugin() ) { return; } delete_transient( FrmOnboardingWizardController::TRANSIENT_NAME ); // Initial install. wp_safe_redirect( $this->settings_link() ); exit; } /** * @return string */ protected function settings_link() { return admin_url( 'index.php?page=' . $this->page ); } /** * Add page to global settings. */ public function add_settings( $sections ) { wp_enqueue_style( 'formidable-pro-fields' ); $sections[ $this->plugin_slug ] = array( 'class' => $this, 'function' => 'settings_page', 'name' => $this->plugin_name(), 'icon' => $this->icon, 'ajax' => true, ); return $sections; } /* * Output for global settings. */ /** * @return void */ public function settings_page() { $steps = $this->get_steps_data(); if ( ! $steps['license']['complete'] || ( isset( $steps['plugin'] ) && ! $steps['plugin']['complete'] ) ) { // Redirect to the welcome page if install hasn't been done. $url = $this->settings_link(); echo ''; return; } $all_imported = $this->is_complete( 'all' ); $step = $steps['import']; $step['label'] = ''; $step['nested'] = true; if ( $steps['complete']['current'] ) { // Always show this step in settings. $step['current'] = true; $new_class = $all_imported ? ' button frm_hidden' : ''; $step['button_class'] = str_replace( 'frm_grey disabled', $new_class, $step['button_class'] ); } if ( $all_imported ) { $step['description'] = __( 'The following form(s) have been created.', 'formidable' ); } $this->show_app_install( $step ); if ( ! $all_imported ) { $step = $steps['complete']; $step['current'] = false; $step['button_class'] .= ' frm_grey disabled'; $this->show_page_links( $step ); } } /** * Getting Started screen. Shows after first install. * * @return void */ public function output() { FrmAppHelper::include_svg(); $this->css(); $class = FrmAppHelper::pro_is_installed() ? 'pro' : 'lite'; echo '
'; $this->header(); $this->main_content(); echo '
'; } /** * Heading section. * * @return void */ protected function header() { $size = array( 'height' => 90, 'width' => 90, ); ?>
'Install', 'style' => 'width:30px;height:30px;margin:0 35px;', ) ); FrmAppHelper::icon_by_class( 'frmfont frm_wordpress_icon', array( 'aria-label' => 'WordPress', 'style' => 'width:90px;height:90px;', ) ); ?>

page_title() ); ?>

page_description() ); ?>

get_steps_data(); $this->license_box( $steps['license'] ); if ( isset( $steps['plugin'] ) ) { $this->show_plugin_install( $steps['plugin'] ); } $this->show_app_install( $steps['import'] ); $this->show_page_links( $steps['complete'] ); } protected function get_steps_data() { $pro_installed = FrmAppHelper::pro_is_connected(); $steps = array( 'license' => array( 'label' => __( 'Connect to FormidableForms.com', 'formidable' ), 'description' => __( 'Create a connection to get plugin downloads.', 'formidable' ), 'button_label' => __( 'Connect an Account', 'formidable' ), 'current' => empty( $pro_installed ), 'complete' => $pro_installed, 'num' => 1, ), 'plugin' => array( 'label' => __( 'Install and Activate Add-Ons', 'formidable' ), 'description' => __( 'Install any required add-ons from FormidableForms.com.', 'formidable' ), 'button_label' => __( 'Install & Activate', 'formidable' ), 'current' => false, 'complete' => false, 'num' => 2, ), 'import' => array( 'label' => __( 'Setup Forms, Views, and Pages', 'formidable' ), 'description' => __( 'Build the forms, views, and pages automatically.', 'formidable' ), 'button_label' => __( 'Create Now', 'formidable' ), 'complete' => $this->is_complete(), 'num' => 3, ), 'complete' => array( 'label' => __( 'Customize Your New Pages', 'formidable' ), 'description' => __( 'Make any required changes and publish the page.', 'formidable' ), 'button_label' => __( 'View Page', 'formidable' ), 'complete' => false, 'num' => 4, ), ); $this->adjust_plugin_install_step( $steps ); $has_current = false; foreach ( $steps as $k => $step ) { // Set the current step. if ( ! isset( $step['current'] ) ) { if ( $step['complete'] ) { $steps[ $k ]['current'] = false; } else { $steps[ $k ]['current'] = ! $has_current; $has_current = true; } } elseif ( $step['current'] ) { $has_current = true; } // Set disabled buttons. $class = isset( $step['button_class'] ) ? $step['button_class'] : ''; $class .= ' button-primary frm-button-primary'; if ( ! $steps[ $k ]['current'] ) { $class .= ' frm_grey disabled'; } $steps[ $k ]['button_class'] = $class; }//end foreach return $steps; } /** * @param array $steps * * @return void */ protected function adjust_plugin_install_step( &$steps ) { $plugins = $this->required_plugins(); if ( empty( $plugins ) ) { unset( $steps['plugin'] ); $steps['import']['num'] = 2; $steps['complete']['num'] = 3; return; } $missing = array(); $rel = array(); foreach ( $plugins as $plugin_key ) { $plugin = FrmAddonsController::install_link( $plugin_key ); if ( $plugin['status'] === 'active' ) { continue; } if ( isset( $plugin['url'] ) ) { $rel[] = $plugin['url']; } else { // Add-on is required but not allowed. $missing[] = $plugin_key; } } if ( empty( $rel ) && empty( $missing ) ) { $steps['plugin']['complete'] = true; } elseif ( ! empty( $missing ) ) { $steps['plugin']['error'] = sprintf( /* translators: %1$s: Plugin name */ esc_html__( 'You need permission to download the Formidable %1$s plugin', 'formidable' ), implode( ', ', $missing ) ); } else { $steps['plugin']['links'] = $rel; $steps['plugin']['button_class'] = 'frm-solution-multiple '; } if ( $steps['license']['complete'] && ! $steps['plugin']['complete'] ) { $steps['plugin']['current'] = true; } } /** * @return void */ protected function step_top( $step ) { $section_class = empty( $step['current'] ) ? 'frm_grey' : ''; ?>

step_top( $step ); if ( $step['complete'] ) { ?> step_bottom( $step ); } /** * @return void */ protected function show_plugin_install( $step ) { $this->step_top( $step ); if ( ! isset( $step['error'] ) ) { $rel = isset( $step['links'] ) ? $step['links'] : array(); ?> step_bottom( $step ); } /** * @return void */ protected function show_app_install( $step ) { $is_complete = $step['complete']; if ( ! empty( $this->form_options() ) && ! $is_complete ) { $step['description'] = __( 'Select the form or view you would like to create.', 'formidable' ); } $this->step_top( $step ); $api = new FrmFormApi(); $addons = $api->get_api_info(); $id = $this->download_id(); $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] ); if ( ! $step['current'] ) { ?> step_bottom( $step ); return; } if ( ! $has_file ) { echo '

' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '

'; } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) { echo '

' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '

'; } else { $xml = $addons[ $id ]['beta']['package']; if ( is_array( $xml ) ) { $xml = reset( $xml ); } if ( isset( $step['nested'] ) ) { echo '
'; } else { echo '
'; } ?> show_form_options( $xml ); $this->show_view_options(); if ( ! $this->is_complete( 'all' ) ) { // Don't show on the settings page when complete. $this->show_page_options(); } ?>

'; } else { echo '
'; } }//end if $this->step_bottom( $step ); } /** * @return void */ protected function show_form_options( $xml ) { $this->show_import_options( $this->form_options(), 'form', $xml ); } /** * @return void */ protected function show_view_options() { $this->show_import_options( $this->view_options(), 'view' ); } /** * @param array $options * @param string $importing * @param string $xml * * @psalm-param 'form'|'view' $importing * * @return void */ protected function show_import_options( $options, $importing, $xml = '' ) { if ( empty( $options ) ) { return; } $imported = $this->previously_imported_forms(); $count = count( $options ); foreach ( $options as $info ) { // Count the number of options displayed for css. if ( $count > 1 && ! isset( $info['img'] ) ) { --$count; } } $width = floor( ( 533 - ( ( $count - 1 ) * 20 ) ) / $count ); unset( $count ); $selected = false; include FrmAppHelper::plugin_path() . '/classes/views/solutions/_import.php'; } /** * @return void */ protected function show_page_options() { $pages = $this->needed_pages(); if ( empty( $pages ) ) { return; } echo '

Choose New Page Title

'; foreach ( $pages as $page ) { ?>

step_top( $step ); ?> step_bottom( $step ); } /** * Only show the content for the correct plugin. * * @return bool */ protected function is_current_plugin() { $to_redirect = get_transient( FrmOnboardingWizardController::TRANSIENT_NAME ); return $to_redirect === $this->plugin_slug && empty( $this->is_complete() ); } /** * Override this function to indicate when install is complete. * * @param int|string $count * * @psalm-param 'all'|1 $count * * @return bool */ protected function is_complete( $count = 1 ) { $imported = $this->previously_imported_forms(); if ( $count === 'all' ) { return count( $imported ) >= count( $this->form_options() ); } return ! empty( $imported ); } /** * Get an array of all of the forms that have been imported. * * @return array */ protected function previously_imported_forms() { $imported = array(); $forms = $this->form_options(); foreach ( $forms as $form ) { $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false; if ( $was_imported ) { $imported[ $form['form'] ] = $was_imported; } } return $imported; } /** * In the new plugin has any dependencies, include them here. * * @return array */ protected function required_plugins() { return array(); } /** * This needs to be overridden. * * @return int */ protected function download_id() { return 0; } /** * Give options for which forms to import. * * @return array */ protected function form_options() { /** * Example: * array( * 'unique-key' => array( * 'keys' => 'forms keys here', * 'name' => 'displayed label here', * 'img' => 'svg code', * ), * ) */ return array(); } /** * Give options for which view to use. * * @return array */ protected function view_options() { return array(); } /** * If the pages aren't imported automatically, set the page names. * * @return array */ protected function needed_pages() { /** * Example: * array( * array( * 'label' => 'Page Name', * 'name' => 'Default name', * 'type' => 'form' or 'view', * ), * ) */ return array(); } /** * @return void */ private function css() { wp_enqueue_style( 'formidable-pro-fields' ); ?>