@@ -245,7 +245,6 @@ |
||
| 245 | 245 | * Maybe show review request |
| 246 | 246 | * |
| 247 | 247 | * @since 3.04.03 |
| 248 | - * @param int $asked |
|
| 249 | 248 | */ |
| 250 | 249 | private static function review( $review ) { |
| 251 | 250 | |
@@ -3,14 +3,14 @@ discard block |
||
| 3 | 3 | class FrmAppController { |
| 4 | 4 | |
| 5 | 5 | public static function menu() { |
| 6 | - FrmAppHelper::maybe_add_permissions(); |
|
| 7 | - if ( ! current_user_can( 'frm_view_forms' ) ) { |
|
| 8 | - return; |
|
| 9 | - } |
|
| 6 | + FrmAppHelper::maybe_add_permissions(); |
|
| 7 | + if ( ! current_user_can( 'frm_view_forms' ) ) { |
|
| 8 | + return; |
|
| 9 | + } |
|
| 10 | 10 | |
| 11 | 11 | $menu_name = FrmAppHelper::get_menu_name(); |
| 12 | 12 | add_menu_page( 'Formidable', $menu_name, 'frm_view_forms', 'formidable', 'FrmFormsController::route', '', self::get_menu_position() ); |
| 13 | - } |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | 15 | private static function get_menu_position() { |
| 16 | 16 | return apply_filters( 'frm_menu_position', '29.3' ); |
@@ -39,15 +39,15 @@ discard block |
||
| 39 | 39 | return $is_white_page; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public static function load_wp_admin_style() { |
|
| 43 | - FrmAppHelper::load_font_style(); |
|
| 44 | - } |
|
| 42 | + public static function load_wp_admin_style() { |
|
| 43 | + FrmAppHelper::load_font_style(); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | 46 | public static function get_form_nav( $form, $show_nav = false, $title = 'show' ) { |
| 47 | 47 | $show_nav = FrmAppHelper::get_param( 'show_nav', $show_nav, 'get', 'absint' ); |
| 48 | - if ( empty( $show_nav ) || ! $form ) { |
|
| 49 | - return; |
|
| 50 | - } |
|
| 48 | + if ( empty( $show_nav ) || ! $form ) { |
|
| 49 | + return; |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | FrmForm::maybe_get_form( $form ); |
| 53 | 53 | if ( ! is_object( $form ) ) { |
@@ -108,22 +108,22 @@ discard block |
||
| 108 | 108 | return apply_filters( 'frm_form_nav_list', $nav_items, $nav_args ); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - // Adds a settings link to the plugins page |
|
| 112 | - public static function settings_link( $links ) { |
|
| 111 | + // Adds a settings link to the plugins page |
|
| 112 | + public static function settings_link( $links ) { |
|
| 113 | 113 | $settings = '<a href="' . esc_url( admin_url( 'admin.php?page=formidable' ) ) . '">' . __( 'Build a Form', 'formidable' ) . '</a>'; |
| 114 | - array_unshift( $links, $settings ); |
|
| 114 | + array_unshift( $links, $settings ); |
|
| 115 | 115 | |
| 116 | - return $links; |
|
| 117 | - } |
|
| 116 | + return $links; |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - public static function pro_get_started_headline() { |
|
| 119 | + public static function pro_get_started_headline() { |
|
| 120 | 120 | self::maybe_show_upgrade_bar(); |
| 121 | 121 | self::review_request(); |
| 122 | 122 | |
| 123 | - // Don't display this error as we're upgrading the thing, or if the user shouldn't see the message |
|
| 124 | - if ( 'upgrade-plugin' == FrmAppHelper::simple_get( 'action', 'sanitize_title' ) || ! current_user_can( 'update_plugins' ) ) { |
|
| 125 | - return; |
|
| 126 | - } |
|
| 123 | + // Don't display this error as we're upgrading the thing, or if the user shouldn't see the message |
|
| 124 | + if ( 'upgrade-plugin' == FrmAppHelper::simple_get( 'action', 'sanitize_title' ) || ! current_user_can( 'update_plugins' ) ) { |
|
| 125 | + return; |
|
| 126 | + } |
|
| 127 | 127 | |
| 128 | 128 | $pro_installed = is_dir( WP_PLUGIN_DIR . '/formidable-pro' ); |
| 129 | 129 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } else { |
| 139 | 139 | $inst_install_url = 'https://formidableforms.com/knowledgebase/install-formidable-forms/?utm_source=WordPress&utm_medium=get-started&utm_campaign=liteplugin'; |
| 140 | 140 | } |
| 141 | - ?> |
|
| 141 | + ?> |
|
| 142 | 142 | <div class="error" class="frm_previous_install"> |
| 143 | 143 | <?php |
| 144 | 144 | echo apply_filters( // WPCS: XSS ok. |
@@ -155,8 +155,8 @@ discard block |
||
| 155 | 155 | ?> |
| 156 | 156 | </div> |
| 157 | 157 | <?php |
| 158 | - } |
|
| 159 | - } |
|
| 158 | + } |
|
| 159 | + } |
|
| 160 | 160 | |
| 161 | 161 | private static function maybe_show_upgrade_bar() { |
| 162 | 162 | if ( ! self::is_formidable_page() || FrmAppHelper::pro_is_installed() ) { |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | } |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - public static function admin_js() { |
|
| 394 | + public static function admin_js() { |
|
| 395 | 395 | $version = FrmAppHelper::plugin_version(); |
| 396 | 396 | FrmAppHelper::load_admin_wide_js( false ); |
| 397 | 397 | |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | |
| 413 | 413 | wp_register_script( 'formidable_admin', FrmAppHelper::plugin_url() . '/js/formidable_admin.js', $dependecies, $version, true ); |
| 414 | 414 | wp_register_style( 'formidable-admin', FrmAppHelper::plugin_url() . '/css/frm_admin.css', array(), $version ); |
| 415 | - wp_register_script( 'bootstrap_tooltip', FrmAppHelper::plugin_url() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.4' ); |
|
| 415 | + wp_register_script( 'bootstrap_tooltip', FrmAppHelper::plugin_url() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.4' ); |
|
| 416 | 416 | wp_register_style( 'formidable-grids', FrmAppHelper::plugin_url() . '/css/frm_grids.css', array(), $version ); |
| 417 | 417 | |
| 418 | 418 | // load multselect js |
@@ -424,10 +424,10 @@ discard block |
||
| 424 | 424 | global $pagenow; |
| 425 | 425 | if ( strpos( $page, 'formidable' ) === 0 || ( $pagenow == 'edit.php' && $post_type == 'frm_display' ) ) { |
| 426 | 426 | |
| 427 | - wp_enqueue_script( 'admin-widgets' ); |
|
| 428 | - wp_enqueue_style( 'widgets' ); |
|
| 429 | - wp_enqueue_script( 'formidable' ); |
|
| 430 | - wp_enqueue_script( 'formidable_admin' ); |
|
| 427 | + wp_enqueue_script( 'admin-widgets' ); |
|
| 428 | + wp_enqueue_style( 'widgets' ); |
|
| 429 | + wp_enqueue_script( 'formidable' ); |
|
| 430 | + wp_enqueue_script( 'formidable_admin' ); |
|
| 431 | 431 | FrmAppHelper::localize_script( 'admin' ); |
| 432 | 432 | |
| 433 | 433 | wp_enqueue_style( 'formidable-admin' ); |
@@ -442,36 +442,36 @@ discard block |
||
| 442 | 442 | } |
| 443 | 443 | } |
| 444 | 444 | |
| 445 | - wp_register_script( 'formidable-editinplace', FrmAppHelper::plugin_url() . '/js/jquery/jquery.editinplace.packed.js', array( 'jquery' ), '2.3.0' ); |
|
| 445 | + wp_register_script( 'formidable-editinplace', FrmAppHelper::plugin_url() . '/js/jquery/jquery.editinplace.packed.js', array( 'jquery' ), '2.3.0' ); |
|
| 446 | 446 | |
| 447 | 447 | do_action( 'frm_enqueue_builder_scripts' ); |
| 448 | - } else if ( $pagenow == 'post.php' || ( $pagenow == 'post-new.php' && $post_type == 'frm_display' ) ) { |
|
| 449 | - if ( isset( $_REQUEST['post_type'] ) ) { |
|
| 450 | - $post_type = sanitize_title( $_REQUEST['post_type'] ); |
|
| 448 | + } else if ( $pagenow == 'post.php' || ( $pagenow == 'post-new.php' && $post_type == 'frm_display' ) ) { |
|
| 449 | + if ( isset( $_REQUEST['post_type'] ) ) { |
|
| 450 | + $post_type = sanitize_title( $_REQUEST['post_type'] ); |
|
| 451 | 451 | } else if ( isset( $_REQUEST['post'] ) && absint( $_REQUEST['post'] ) ) { |
| 452 | 452 | $post = get_post( absint( $_REQUEST['post'] ) ); |
| 453 | - if ( ! $post ) { |
|
| 454 | - return; |
|
| 455 | - } |
|
| 456 | - $post_type = $post->post_type; |
|
| 457 | - } else { |
|
| 458 | - return; |
|
| 459 | - } |
|
| 460 | - |
|
| 461 | - if ( $post_type == 'frm_display' ) { |
|
| 462 | - wp_enqueue_script( 'jquery-ui-draggable' ); |
|
| 463 | - wp_enqueue_script( 'formidable_admin' ); |
|
| 464 | - wp_enqueue_style( 'formidable-admin' ); |
|
| 453 | + if ( ! $post ) { |
|
| 454 | + return; |
|
| 455 | + } |
|
| 456 | + $post_type = $post->post_type; |
|
| 457 | + } else { |
|
| 458 | + return; |
|
| 459 | + } |
|
| 460 | + |
|
| 461 | + if ( $post_type == 'frm_display' ) { |
|
| 462 | + wp_enqueue_script( 'jquery-ui-draggable' ); |
|
| 463 | + wp_enqueue_script( 'formidable_admin' ); |
|
| 464 | + wp_enqueue_style( 'formidable-admin' ); |
|
| 465 | 465 | FrmAppHelper::localize_script( 'admin' ); |
| 466 | - } |
|
| 467 | - } else if ( $pagenow == 'widgets.php' ) { |
|
| 468 | - FrmAppHelper::load_admin_wide_js(); |
|
| 469 | - } |
|
| 470 | - } |
|
| 466 | + } |
|
| 467 | + } else if ( $pagenow == 'widgets.php' ) { |
|
| 468 | + FrmAppHelper::load_admin_wide_js(); |
|
| 469 | + } |
|
| 470 | + } |
|
| 471 | 471 | |
| 472 | - public static function load_lang() { |
|
| 473 | - load_plugin_textdomain( 'formidable', false, FrmAppHelper::plugin_folder() . '/languages/' ); |
|
| 474 | - } |
|
| 472 | + public static function load_lang() { |
|
| 473 | + load_plugin_textdomain( 'formidable', false, FrmAppHelper::plugin_folder() . '/languages/' ); |
|
| 474 | + } |
|
| 475 | 475 | |
| 476 | 476 | /** |
| 477 | 477 | * Check if the styles are updated when a form is loaded on the front-end |
@@ -547,14 +547,14 @@ discard block |
||
| 547 | 547 | wp_die(); |
| 548 | 548 | } |
| 549 | 549 | |
| 550 | - public static function install() { |
|
| 551 | - $frmdb = new FrmMigrate(); |
|
| 552 | - $frmdb->upgrade(); |
|
| 553 | - } |
|
| 550 | + public static function install() { |
|
| 551 | + $frmdb = new FrmMigrate(); |
|
| 552 | + $frmdb->upgrade(); |
|
| 553 | + } |
|
| 554 | 554 | |
| 555 | - public static function uninstall() { |
|
| 555 | + public static function uninstall() { |
|
| 556 | 556 | FrmAppHelper::permission_check( 'administrator' ); |
| 557 | - check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 557 | + check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 558 | 558 | |
| 559 | 559 | $frmdb = new FrmMigrate(); |
| 560 | 560 | $frmdb->uninstall(); |
@@ -563,28 +563,28 @@ discard block |
||
| 563 | 563 | deactivate_plugins( FrmAppHelper::plugin_folder() . '/formidable.php', false, false ); |
| 564 | 564 | echo esc_url_raw( admin_url( 'plugins.php?deactivate=true' ) ); |
| 565 | 565 | |
| 566 | - wp_die(); |
|
| 567 | - } |
|
| 566 | + wp_die(); |
|
| 567 | + } |
|
| 568 | 568 | |
| 569 | - public static function drop_tables( $tables ) { |
|
| 570 | - global $wpdb; |
|
| 571 | - $tables[] = $wpdb->prefix . 'frm_fields'; |
|
| 572 | - $tables[] = $wpdb->prefix . 'frm_forms'; |
|
| 573 | - $tables[] = $wpdb->prefix . 'frm_items'; |
|
| 574 | - $tables[] = $wpdb->prefix . 'frm_item_metas'; |
|
| 575 | - return $tables; |
|
| 576 | - } |
|
| 569 | + public static function drop_tables( $tables ) { |
|
| 570 | + global $wpdb; |
|
| 571 | + $tables[] = $wpdb->prefix . 'frm_fields'; |
|
| 572 | + $tables[] = $wpdb->prefix . 'frm_forms'; |
|
| 573 | + $tables[] = $wpdb->prefix . 'frm_items'; |
|
| 574 | + $tables[] = $wpdb->prefix . 'frm_item_metas'; |
|
| 575 | + return $tables; |
|
| 576 | + } |
|
| 577 | 577 | |
| 578 | - public static function deauthorize() { |
|
| 578 | + public static function deauthorize() { |
|
| 579 | 579 | FrmAppHelper::permission_check( 'frm_change_settings' ); |
| 580 | - check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 580 | + check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 581 | 581 | |
| 582 | - delete_option( 'frmpro-credentials' ); |
|
| 583 | - delete_option( 'frmpro-authorized' ); |
|
| 584 | - delete_site_option( 'frmpro-credentials' ); |
|
| 585 | - delete_site_option( 'frmpro-authorized' ); |
|
| 586 | - wp_die(); |
|
| 587 | - } |
|
| 582 | + delete_option( 'frmpro-credentials' ); |
|
| 583 | + delete_option( 'frmpro-authorized' ); |
|
| 584 | + delete_site_option( 'frmpro-credentials' ); |
|
| 585 | + delete_site_option( 'frmpro-authorized' ); |
|
| 586 | + wp_die(); |
|
| 587 | + } |
|
| 588 | 588 | |
| 589 | 589 | public static function set_footer_text( $text ) { |
| 590 | 590 | if ( FrmAppHelper::is_formidable_admin() ) { |
@@ -606,9 +606,9 @@ discard block |
||
| 606 | 606 | * @deprecated 1.07.05 |
| 607 | 607 | * @codeCoverageIgnore |
| 608 | 608 | */ |
| 609 | - public static function get_form_shortcode( $atts ) { |
|
| 610 | - return FrmDeprecated::get_form_shortcode( $atts ); |
|
| 611 | - } |
|
| 609 | + public static function get_form_shortcode( $atts ) { |
|
| 610 | + return FrmDeprecated::get_form_shortcode( $atts ); |
|
| 611 | + } |
|
| 612 | 612 | |
| 613 | 613 | /** |
| 614 | 614 | * @deprecated 2.5.4 |
@@ -253,12 +253,12 @@ |
||
| 253 | 253 | $show_intervals = array( 50, 200, 500 ); |
| 254 | 254 | $asked = $review['asked']; |
| 255 | 255 | |
| 256 | - if ( ! isset( $show_intervals[ $asked ] ) ) { |
|
| 256 | + if ( ! isset( $show_intervals[$asked] ) ) { |
|
| 257 | 257 | return; |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | $entries = FrmEntry::getRecordCount(); |
| 261 | - $count = $show_intervals[ $asked ]; |
|
| 261 | + $count = $show_intervals[$asked]; |
|
| 262 | 262 | $user = wp_get_current_user(); |
| 263 | 263 | |
| 264 | 264 | // Only show review request if the site has collected enough entries |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | return $wpdb->get_charset_collate(); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - private function create_tables() { |
|
| 81 | - $charset_collate = $this->collation(); |
|
| 82 | - $sql = array(); |
|
| 80 | + private function create_tables() { |
|
| 81 | + $charset_collate = $this->collation(); |
|
| 82 | + $sql = array(); |
|
| 83 | 83 | |
| 84 | - /* Create/Upgrade Fields Table */ |
|
| 84 | + /* Create/Upgrade Fields Table */ |
|
| 85 | 85 | $sql[] = 'CREATE TABLE ' . $this->fields . ' ( |
| 86 | 86 | id BIGINT(20) NOT NULL auto_increment, |
| 87 | 87 | field_key varchar(100) default NULL, |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | UNIQUE KEY field_key (field_key) |
| 101 | 101 | )'; |
| 102 | 102 | |
| 103 | - /* Create/Upgrade Forms Table */ |
|
| 103 | + /* Create/Upgrade Forms Table */ |
|
| 104 | 104 | $sql[] = 'CREATE TABLE ' . $this->forms . ' ( |
| 105 | 105 | id int(11) NOT NULL auto_increment, |
| 106 | 106 | form_key varchar(100) default NULL, |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | UNIQUE KEY form_key (form_key) |
| 119 | 119 | )'; |
| 120 | 120 | |
| 121 | - /* Create/Upgrade Items Table */ |
|
| 121 | + /* Create/Upgrade Items Table */ |
|
| 122 | 122 | $sql[] = 'CREATE TABLE ' . $this->entries . ' ( |
| 123 | 123 | id BIGINT(20) NOT NULL auto_increment, |
| 124 | 124 | item_key varchar(100) default NULL, |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | UNIQUE KEY item_key (item_key) |
| 142 | 142 | )'; |
| 143 | 143 | |
| 144 | - /* Create/Upgrade Meta Table */ |
|
| 144 | + /* Create/Upgrade Meta Table */ |
|
| 145 | 145 | $sql[] = 'CREATE TABLE ' . $this->entry_metas . ' ( |
| 146 | 146 | id BIGINT(20) NOT NULL auto_increment, |
| 147 | 147 | meta_value longtext default NULL, |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | KEY item_id (item_id) |
| 154 | 154 | )'; |
| 155 | 155 | |
| 156 | - foreach ( $sql as $q ) { |
|
| 156 | + foreach ( $sql as $q ) { |
|
| 157 | 157 | if ( function_exists( 'dbDelta' ) ) { |
| 158 | 158 | dbDelta( $q . $charset_collate . ';' ); |
| 159 | 159 | } else { |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | $wpdb->query( $q . $charset_collate ); // WPCS: unprepared SQL ok. |
| 162 | 162 | } |
| 163 | 163 | unset( $q ); |
| 164 | - } |
|
| 165 | - } |
|
| 164 | + } |
|
| 165 | + } |
|
| 166 | 166 | |
| 167 | 167 | private function maybe_create_contact_form() { |
| 168 | 168 | $template_id = FrmForm::get_id_by_key( 'contact' ); |
@@ -209,13 +209,13 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | - public function uninstall() { |
|
| 212 | + public function uninstall() { |
|
| 213 | 213 | if ( ! current_user_can( 'administrator' ) ) { |
| 214 | - $frm_settings = FrmAppHelper::get_settings(); |
|
| 214 | + $frm_settings = FrmAppHelper::get_settings(); |
|
| 215 | 215 | wp_die( esc_html( $frm_settings->admin_permission ) ); |
| 216 | - } |
|
| 216 | + } |
|
| 217 | 217 | |
| 218 | - global $wpdb, $wp_roles; |
|
| 218 | + global $wpdb, $wp_roles; |
|
| 219 | 219 | |
| 220 | 220 | $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->fields ); // WPCS: unprepared SQL ok. |
| 221 | 221 | $wpdb->query( 'DROP TABLE IF EXISTS ' . $this->forms ); // WPCS: unprepared SQL ok. |
@@ -227,12 +227,12 @@ discard block |
||
| 227 | 227 | delete_option( 'frm_install_running' ); |
| 228 | 228 | delete_option( 'frm_lite_settings_upgrade' ); |
| 229 | 229 | |
| 230 | - //delete roles |
|
| 231 | - $frm_roles = FrmAppHelper::frm_capabilities(); |
|
| 232 | - $roles = get_editable_roles(); |
|
| 233 | - foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
|
| 234 | - foreach ( $roles as $role => $details ) { |
|
| 235 | - $wp_roles->remove_cap( $role, $frm_role ); |
|
| 230 | + //delete roles |
|
| 231 | + $frm_roles = FrmAppHelper::frm_capabilities(); |
|
| 232 | + $roles = get_editable_roles(); |
|
| 233 | + foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
|
| 234 | + foreach ( $roles as $role => $details ) { |
|
| 235 | + $wp_roles->remove_cap( $role, $frm_role ); |
|
| 236 | 236 | unset( $role, $details ); |
| 237 | 237 | } |
| 238 | 238 | unset( $frm_role, $frm_role_description ); |
@@ -260,8 +260,8 @@ discard block |
||
| 260 | 260 | $wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE %s OR option_name LIKE %s', '_transient_timeout_frm_form_fields_%', '_transient_frm_form_fields_%' ) ); |
| 261 | 261 | |
| 262 | 262 | do_action( 'frm_after_uninstall' ); |
| 263 | - return true; |
|
| 264 | - } |
|
| 263 | + return true; |
|
| 264 | + } |
|
| 265 | 265 | |
| 266 | 266 | /** |
| 267 | 267 | * Reverse migration 17 -- Divide by 9 |
@@ -428,44 +428,44 @@ discard block |
||
| 428 | 428 | $size .= 'px'; |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | - /** |
|
| 432 | - * Migrate post and email notification settings into actions |
|
| 433 | - */ |
|
| 434 | - private function migrate_to_16() { |
|
| 435 | - $forms = FrmDb::get_results( $this->forms, array(), 'id, options, is_template, default_template' ); |
|
| 436 | - |
|
| 437 | - /** |
|
| 438 | - * Old email settings format: |
|
| 439 | - * email_to: Email or field id |
|
| 440 | - * also_email_to: array of fields ids |
|
| 441 | - * reply_to: Email, field id, 'custom' |
|
| 442 | - * cust_reply_to: string |
|
| 443 | - * reply_to_name: field id, 'custom' |
|
| 444 | - * cust_reply_to_name: string |
|
| 445 | - * plain_text: 0|1 |
|
| 446 | - * email_message: string or '' |
|
| 447 | - * email_subject: string or '' |
|
| 448 | - * inc_user_info: 0|1 |
|
| 449 | - * update_email: 0, 1, 2 |
|
| 450 | - * |
|
| 451 | - * Old autoresponder settings format: |
|
| 452 | - * auto_responder: 0|1 |
|
| 453 | - * ar_email_message: string or '' |
|
| 454 | - * ar_email_to: field id |
|
| 455 | - * ar_plain_text: 0|1 |
|
| 456 | - * ar_reply_to_name: string |
|
| 457 | - * ar_reply_to: string |
|
| 458 | - * ar_email_subject: string |
|
| 459 | - * ar_update_email: 0, 1, 2 |
|
| 460 | - * |
|
| 461 | - * New email settings: |
|
| 462 | - * post_content: json settings |
|
| 463 | - * post_title: form id |
|
| 464 | - * post_excerpt: message |
|
| 465 | - * |
|
| 466 | - */ |
|
| 467 | - |
|
| 468 | - foreach ( $forms as $form ) { |
|
| 431 | + /** |
|
| 432 | + * Migrate post and email notification settings into actions |
|
| 433 | + */ |
|
| 434 | + private function migrate_to_16() { |
|
| 435 | + $forms = FrmDb::get_results( $this->forms, array(), 'id, options, is_template, default_template' ); |
|
| 436 | + |
|
| 437 | + /** |
|
| 438 | + * Old email settings format: |
|
| 439 | + * email_to: Email or field id |
|
| 440 | + * also_email_to: array of fields ids |
|
| 441 | + * reply_to: Email, field id, 'custom' |
|
| 442 | + * cust_reply_to: string |
|
| 443 | + * reply_to_name: field id, 'custom' |
|
| 444 | + * cust_reply_to_name: string |
|
| 445 | + * plain_text: 0|1 |
|
| 446 | + * email_message: string or '' |
|
| 447 | + * email_subject: string or '' |
|
| 448 | + * inc_user_info: 0|1 |
|
| 449 | + * update_email: 0, 1, 2 |
|
| 450 | + * |
|
| 451 | + * Old autoresponder settings format: |
|
| 452 | + * auto_responder: 0|1 |
|
| 453 | + * ar_email_message: string or '' |
|
| 454 | + * ar_email_to: field id |
|
| 455 | + * ar_plain_text: 0|1 |
|
| 456 | + * ar_reply_to_name: string |
|
| 457 | + * ar_reply_to: string |
|
| 458 | + * ar_email_subject: string |
|
| 459 | + * ar_update_email: 0, 1, 2 |
|
| 460 | + * |
|
| 461 | + * New email settings: |
|
| 462 | + * post_content: json settings |
|
| 463 | + * post_title: form id |
|
| 464 | + * post_excerpt: message |
|
| 465 | + * |
|
| 466 | + */ |
|
| 467 | + |
|
| 468 | + foreach ( $forms as $form ) { |
|
| 469 | 469 | if ( $form->is_template && $form->default_template ) { |
| 470 | 470 | // don't migrate the default templates since the email will be added anyway |
| 471 | 471 | continue; |
@@ -474,19 +474,19 @@ discard block |
||
| 474 | 474 | // Format form options |
| 475 | 475 | $form_options = maybe_unserialize( $form->options ); |
| 476 | 476 | |
| 477 | - // Migrate settings to actions |
|
| 478 | - FrmXMLHelper::migrate_form_settings_to_actions( $form_options, $form->id ); |
|
| 479 | - } |
|
| 480 | - } |
|
| 477 | + // Migrate settings to actions |
|
| 478 | + FrmXMLHelper::migrate_form_settings_to_actions( $form_options, $form->id ); |
|
| 479 | + } |
|
| 480 | + } |
|
| 481 | 481 | |
| 482 | - private function migrate_to_11() { |
|
| 483 | - global $wpdb; |
|
| 482 | + private function migrate_to_11() { |
|
| 483 | + global $wpdb; |
|
| 484 | 484 | |
| 485 | 485 | $forms = FrmDb::get_results( $this->forms, array(), 'id, options' ); |
| 486 | 486 | |
| 487 | - $sending = __( 'Sending', 'formidable' ); |
|
| 487 | + $sending = __( 'Sending', 'formidable' ); |
|
| 488 | 488 | $img = FrmAppHelper::plugin_url() . '/images/ajax_loader.gif'; |
| 489 | - $old_default_html = <<<DEFAULT_HTML |
|
| 489 | + $old_default_html = <<<DEFAULT_HTML |
|
| 490 | 490 | <div class="frm_submit"> |
| 491 | 491 | [if back_button]<input type="submit" value="[back_label]" name="frm_prev_page" formnovalidate="formnovalidate" [back_hook] />[/if back_button] |
| 492 | 492 | <input type="submit" value="[button_label]" [button_action] /> |
@@ -496,21 +496,21 @@ discard block |
||
| 496 | 496 | unset( $sending, $img ); |
| 497 | 497 | |
| 498 | 498 | $new_default_html = FrmFormsHelper::get_default_html( 'submit' ); |
| 499 | - $draft_link = FrmFormsHelper::get_draft_link(); |
|
| 499 | + $draft_link = FrmFormsHelper::get_draft_link(); |
|
| 500 | 500 | foreach ( $forms as $form ) { |
| 501 | 501 | $form->options = maybe_unserialize( $form->options ); |
| 502 | 502 | if ( ! isset( $form->options['submit_html'] ) || empty( $form->options['submit_html'] ) ) { |
| 503 | - continue; |
|
| 504 | - } |
|
| 503 | + continue; |
|
| 504 | + } |
|
| 505 | 505 | |
| 506 | - if ( $form->options['submit_html'] != $new_default_html && $form->options['submit_html'] == $old_default_html ) { |
|
| 507 | - $form->options['submit_html'] = $new_default_html; |
|
| 506 | + if ( $form->options['submit_html'] != $new_default_html && $form->options['submit_html'] == $old_default_html ) { |
|
| 507 | + $form->options['submit_html'] = $new_default_html; |
|
| 508 | 508 | $wpdb->update( $this->forms, array( 'options' => serialize( $form->options ) ), array( 'id' => $form->id ) ); |
| 509 | 509 | } else if ( ! strpos( $form->options['submit_html'], 'save_draft' ) ) { |
| 510 | 510 | $form->options['submit_html'] = preg_replace( '~\<\/div\>(?!.*\<\/div\>)~', $draft_link . "\r\n</div>", $form->options['submit_html'] ); |
| 511 | 511 | $wpdb->update( $this->forms, array( 'options' => serialize( $form->options ) ), array( 'id' => $form->id ) ); |
| 512 | - } |
|
| 512 | + } |
|
| 513 | 513 | unset( $form ); |
| 514 | - } |
|
| 515 | - } |
|
| 514 | + } |
|
| 515 | + } |
|
| 516 | 516 | } |
@@ -2,11 +2,11 @@ |
||
| 2 | 2 | <div class="frm-satisfied"> |
| 3 | 3 | <p> |
| 4 | 4 | <?php printf( esc_html__( 'Hey%1$s, I noticed you collected over %2$d form submissions from Formidable Forms. That’s awesome!', 'formidable' ), esc_html( $name ), $count ); ?><br/> |
| 5 | - <?php esc_html_e( 'Are you enjoying Formidable Forms?', 'formidable'); ?> |
|
| 5 | + <?php esc_html_e( 'Are you enjoying Formidable Forms?', 'formidable' ); ?> |
|
| 6 | 6 | </p> |
| 7 | 7 | <br/> |
| 8 | - <a href="#" class="frm_reverse_button frm_animate_bg show-frm-feedback" data-link="feedback"><?php esc_html_e( 'Not Really'); ?></a> |
|
| 9 | - <a href="#" class="frm_orange_button frm_animate_bg show-frm-feedback" data-link="review"><?php esc_html_e( 'Yes!'); ?></a> |
|
| 8 | + <a href="#" class="frm_reverse_button frm_animate_bg show-frm-feedback" data-link="feedback"><?php esc_html_e( 'Not Really' ); ?></a> |
|
| 9 | + <a href="#" class="frm_orange_button frm_animate_bg show-frm-feedback" data-link="review"><?php esc_html_e( 'Yes!' ); ?></a> |
|
| 10 | 10 | </div> |
| 11 | 11 | <div class="frm-review-request frm_hidden"> |
| 12 | 12 | <p><?php esc_html_e( 'That\'s great news! Could you please do me a BIG favor and give Formidable Forms a review to help me grow my little business and boost our motivation?', 'formidable' ); ?></p> |