PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.15
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.15
6.2.15 6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 All 197 releases
← All changes | app/Modules/Registerer/Menu.php +100 -94 6.2.2 → 6.2.15 View file →
@@ -1,9 +1,9 @@
1 1 <?php
2 2
3 3 namespace FluentForm\App\Modules\Registerer;
4 4
5 -defined('ABSPATH') or die;
5 +defined('ABSPATH') || die;
6 6
7 7 use FluentForm\App\Helpers\Helper;
8 8 use FluentForm\App\Hooks\Handlers\ActivationHandler;
9 9 use FluentForm\App\Modules\Acl\Acl;
@@ -10,8 +10,9 @@
10 10 use FluentForm\App\Modules\AddOnModule;
11 11 use FluentForm\App\Modules\DocumentationModule;
12 12 use FluentForm\App\Modules\Payments\PaymentHelper;
13 13 use FluentForm\App\Services\FluentConversational\Classes\Converter\Converter;
14 +use FluentForm\App\Services\Form\Fields;
14 15 use FluentForm\App\Services\Manager\FormManagerService;
15 16 use FluentForm\Framework\Foundation\Application;
16 17 use FluentForm\Framework\Helpers\ArrayHelper;
17 18
@@ -126,9 +127,8 @@
126 127 FLUENTFORM_VERSION,
127 128 true
128 129 );
129 130
130 -
131 131 wp_register_style(
132 132 'fluentform_editor_style',
133 133 $fluentFormAdminEditorStyles,
134 134 [],
@@ -238,9 +238,9 @@
238 238 [],
239 239 FLUENTFORM_VERSION,
240 240 'all'
241 241 );
242 -
242 +
243 243 add_filter('admin_footer_text', function ($text) {
244 244 return '<span id="footer-thankyou">If you like the plugin please rate Fluent Forms <a target="_blank" rel="nofollow" href="https://wordpress.org/support/plugin/fluentform/reviews/#new-post">★★★★★ </a> on <a target="_blank" rel="nofollow" href="https://wordpress.org/support/plugin/fluentform/reviews/#new-post">WordPress.org</a> to help us spread the word ♥ from the Fluent Forms team. </span>';
245 245 });
246 246
@@ -276,11 +276,11 @@
276 276 return;
277 277 }
278 278
279 279 $forms = wpFluent()->table('fluentform_forms')
280 - ->orderBy('id', 'desc')
281 - ->select(['id', 'title'])
282 - ->get();
280 + ->orderBy('id', 'desc')
281 + ->select(['id', 'title'])
282 + ->get();
283 283
284 284 wp_enqueue_script('fluent_forms_global');
285 285
286 286 // Check if default style is enabled
@@ -300,15 +300,15 @@
300 300 'card_brands' => [
301 301 'visa' => fluentformMix('img/card-brand/visa.jpg'),
302 302 'paypal' => fluentformMix('img/card-brand/paypal.jpg'),
303 303 'mastercard' => fluentformMix('img/card-brand/mastercard.jpg'),
304 - 'amex' => fluentformMix('img/card-brand/amex.jpg')
304 + 'amex' => fluentformMix('img/card-brand/amex.jpg'),
305 305 ],
306 306 'payment_icons' => [
307 307 'offline' => fluentformMix('img/payment/offline.png'),
308 308 'mollie' => fluentformMix('img/payment/mollie.png'),
309 309 'paypal' => fluentformMix('img/payment/paypal.png'),
310 - 'stripe' => fluentformMix('img/payment/stripe.png')
310 + 'stripe' => fluentformMix('img/payment/stripe.png'),
311 311 ],
312 312 'forms' => $forms,
313 313 'hasPro' => defined('FLUENTFORMPRO'),
314 314 'has_entries_import' => defined('FLUENTFORMPRO') && version_compare(FLUENTFORMPRO_VERSION, '5.1.7', '>='),
@@ -321,8 +321,10 @@
321 321 if (Acl::hasAnyFormPermission()) {
322 322 $globalVars['fluent_forms_admin_nonce'] = wp_create_nonce('fluent_forms_admin_nonce');
323 323 }
324 324
325 + $globalVars['i18n_rest_404'] = __('Fluent Forms REST endpoints are unreachable on this site. This sometimes happens after a plugin update — try reloading the page, clearing your site cache, or asking your host to clear PHP OpCache. If the issue persists, check whether a security plugin is blocking REST requests.', 'fluentform');
326 +
325 327 wp_localize_script('fluent_forms_global', 'fluent_forms_global_var', $globalVars);
326 328
327 329 $page = sanitize_text_field($this->app->request->get('page'));
328 330 $route = sanitize_text_field($this->app->request->get('route'));
@@ -353,9 +355,9 @@
353 355 }
354 356 } elseif ('fluent_forms' == $page) {
355 357 wp_enqueue_script('fluent_all_forms');
356 358 wp_enqueue_style('fluent_all_forms');
357 - }elseif ('fluent_forms_transfer' == $page) {
359 + } elseif ('fluent_forms_transfer' == $page) {
358 360 wp_enqueue_style('fluentform_settings_global');
359 361 wp_enqueue_script('fluentform-transfer-js');
360 362 } elseif (
361 363 'fluent_forms_settings' == $page ||
@@ -364,9 +366,9 @@
364 366 ) {
365 367 wp_enqueue_style('fluentform_settings_global');
366 368 } elseif ('fluent_forms_add_ons' == $page) {
367 369 wp_enqueue_style('fluentform-add-ons');
368 - } elseif ('fluent_forms_docs' == $page || 'fluent_forms_smtp' == $page) {
370 + } elseif ('fluent_forms_docs' == $page) {
369 371 wp_enqueue_style('fluentform_doc_style');
370 372 }
371 373 }
372 374
@@ -377,9 +379,9 @@
377 379 {
378 380 $dashBoardCapability = apply_filters_deprecated(
379 381 'fluentform_dashboard_capability',
380 382 [
381 - 'fluentform_dashboard_access'
383 + 'fluentform_dashboard_access',
382 384 ],
383 385 FLUENTFORM_FRAMEWORK_UPGRADE,
384 386 'fluentform/dashboard_capability',
385 387 'Use fluentform/dashboard_capability instead of fluentform_dashboard_capability.'
@@ -388,13 +390,13 @@
388 390 $dashBoardCapability = $this->app->applyFilters(
389 391 'fluentform/dashboard_capability',
390 392 $dashBoardCapability
391 393 );
392 -
394 +
393 395 $settingManager = apply_filters_deprecated(
394 396 'fluentform_settings_capability',
395 397 [
396 - 'fluentform_settings_manager'
398 + 'fluentform_settings_manager',
397 399 ],
398 400 FLUENTFORM_FRAMEWORK_UPGRADE,
399 401 'fluentform/settings_capability',
400 402 'Use fluentform/settings_capability instead of fluentform_settings_capability.'
@@ -467,10 +469,10 @@
467 469 if (Helper::isFluentAdminPage()) {
468 470 $allowForms = FormManagerService::getUserAllowedFormsScope();
469 471 $entriesCount = wpFluent()->table('fluentform_submissions')
470 472 ->where('status', 'unread')
471 - ->when(false !== $allowForms, function ($q) use ($allowForms){
472 - return $q->whereIn('form_id', $allowForms ?: [0]);
473 + ->when(false !== $allowForms, function ($q) use ($allowForms) {
474 + return $q->whereIn('form_id', $allowForms ? $allowForms : [0]);
473 475 })
474 476 ->count();
475 477
476 478 if ($entriesCount) {
@@ -500,9 +502,9 @@
500 502
501 503 $isShowPaymentSubmission = apply_filters_deprecated(
502 504 'fluentform_show_payment_entries',
503 505 [
504 - false
506 + false,
505 507 ],
506 508 FLUENTFORM_FRAMEWORK_UPGRADE,
507 509 'fluentform/show_payment_entries',
508 510 'Use fluentform/show_payment_entries instead of fluentform_show_payment_entries.'
@@ -538,18 +540,8 @@
538 540 'fluent_forms_transfer',
539 541 [$this, 'renderTransfer']
540 542 );
541 543
542 - // Register FluentSMTP Sub Menu.
543 - add_submenu_page(
544 - 'fluent_forms',
545 - __('SMTP', 'fluentform'),
546 - __('SMTP', 'fluentform'),
547 - $fromRole ? $settingsCapability : 'fluentform_settings_manager',
548 - 'fluent_forms_smtp',
549 - [$this, 'renderSmtpPromo']
550 - );
551 -
552 544 // Register Add-Ons
553 545 add_submenu_page(
554 546 'fluent_forms',
555 547 __('Integrations', 'fluentform'),
@@ -663,9 +655,9 @@
663 655 'fluentform_form_admin_menu',
664 656 [
665 657 $formAdminMenus,
666 658 $form_id,
667 - $form
659 + $form,
668 660 ],
669 661 FLUENTFORM_FRAMEWORK_UPGRADE,
670 662 'fluentform/form_admin_menu',
671 663 'Use fluentform/form_admin_menu instead of fluentform_form_admin_menu.'
@@ -720,11 +712,11 @@
720 712 ];
721 713 }
722 714
723 715 $settingsMenus = apply_filters_deprecated('fluentform_form_settings_menu', [
724 - $settingsMenus,
725 - $form_id
726 - ],
716 + $settingsMenus,
717 + $form_id,
718 + ],
727 719 FLUENTFORM_FRAMEWORK_UPGRADE,
728 720 'fluentform/form_settings_menu',
729 721 'Use fluentform/form_settings_menu instead of fluentform_form_settings_menu.'
730 722 );
@@ -755,9 +747,9 @@
755 747 $this->app->view->render('admin.form.settings_wrapper', [
756 748 'form_id' => $form_id,
757 749 'settings_menus' => $settingsMenus,
758 750 'current_sub_route' => $currentRoute,
759 - 'has_double_opt_in' => $hasDoubleOptinEnable
751 + 'has_double_opt_in' => $hasDoubleOptinEnable,
760 752 ]);
761 753 }
762 754
763 755 /**
@@ -790,9 +782,11 @@
790 782 'upgrade_url' => fluentform_upgrade_url(),
791 783 'ace_path_url' => fluentformMix('libs/ace'),
792 784 'is_conversion_form' => Helper::isConversionForm($form_id),
793 785 'has_fluent_smtp' => defined('FLUENTMAIL'),
794 - 'fluent_smtp_url' => admin_url('admin.php?page=fluent_forms_smtp'),
786 + 'fluent_smtp_url' => defined('FLUENTMAIL')
787 + ? admin_url('options-general.php?page=fluent-mail#/connections')
788 + : admin_url('admin.php?page=fluent_forms_add_ons&sub_page=suggested_plugins'),
795 789 'form_settings_str' => TranslationString::getSettingsI18n(),
796 790 'integrationsResource' => [
797 791 'asset_url' => fluentformMix('img/integrations.png'),
798 792 'list_url' => fluentform_integrations_url(),
@@ -799,9 +793,9 @@
799 793 'instruction' => __("Fluent Forms Pro has tons of integrations to take your forms to the next level. From payment gateways to quiz building, SMS notifications to email marketing - you'll get integrations for various purposes. Even if you don't find your favorite tools, you can integrate them easily with Zapier.", 'fluentform'),
800 794 ],
801 795 'countries' => getFluentFormCountryList(),
802 796 'getIpInfo' => Helper::getIpinfo(),
803 - 'has_conv_form_save_and_resume' => defined('FLUENTFORMPRO') && version_compare(FLUENTFORMPRO_VERSION, '5.1.12', '>=')
797 + 'has_conv_form_save_and_resume' => defined('FLUENTFORMPRO') && version_compare(FLUENTFORMPRO_VERSION, '5.1.12', '>='),
804 798 ]);
805 799
806 800 $this->app->view->render('admin.form.settings', [
807 801 'form_id' => $form_id,
@@ -814,9 +808,9 @@
814 808 (new ActivationHandler())->migrate();
815 809 }
816 810
817 811 if (false !== ($allowForms = FormManagerService::getUserAllowedFormsScope())) {
818 - $formsCount = wpFluent()->table('fluentform_forms')->whereIn('id', $allowForms ?: [0])->count();
812 + $formsCount = wpFluent()->table('fluentform_forms')->whereIn('id', $allowForms ? $allowForms : [0])->count();
819 813 } else {
820 814 $formsCount = wpFluent()->table('fluentform_forms')->count();
821 815 }
822 816
@@ -822,15 +816,15 @@
822 816
823 817 $isDisabledAnalytics = apply_filters_deprecated(
824 818 'fluentform-disabled_analytics',
825 819 [
826 - true
820 + true,
827 821 ],
828 822 FLUENTFORM_FRAMEWORK_UPGRADE,
829 823 'fluentform/disabled_analytics',
830 824 'Use fluentform/disabled_analytics instead of fluentform-disabled_analytics.'
831 825 );
832 -
826 +
833 827 $data = [
834 828 'plugin' => $this->app->config->get('app.slug'),
835 829 'formsCount' => $formsCount,
836 830 'hasPro' => defined('FLUENTFORMPRO'),
@@ -841,17 +835,16 @@
841 835 'plugin_public_url' => fluentformMix(),
842 836 'siteUrl' => site_url(),
843 837 ];
844 838
845 - if (defined('FLUENTFORMPRO')){
839 + if (defined('FLUENTFORMPRO')) {
846 840 $data['landing_page_enabled_forms']= Helper::getLandingPageEnabledForms();
847 841 }
848 -
849 842
850 843 $data = apply_filters_deprecated(
851 844 'fluent_all_forms_vars',
852 845 [
853 - $data
846 + $data,
854 847 ],
855 848 FLUENTFORM_FRAMEWORK_UPGRADE,
856 849 'fluentform/all_forms_vars',
857 850 'Use fluentform/all_forms_vars instead of fluent_all_forms_vars.'
@@ -885,12 +878,16 @@
885 878 $formId = (int) $this->app->request->get('form_id');
886 879
887 880 $form = wpFluent()->table('fluentform_forms')->find($formId);
888 881
882 + if (!$form) {
883 + return;
884 + }
885 +
889 886 do_action_deprecated(
890 887 'fluentform_loading_editor_assets',
891 888 [
892 - $form
889 + $form,
893 890 ],
894 891 FLUENTFORM_FRAMEWORK_UPGRADE,
895 892 'fluentform/loading_editor_assets',
896 893 'Use fluentform/loading_editor_assets instead of fluentform_loading_editor_assets'
@@ -923,9 +920,9 @@
923 920 $formField = apply_filters_deprecated(
924 921 'fluentform_editor_init_element_' . $formField['element'],
925 922 [
926 923 $formField,
927 - $form
924 + $form,
928 925 ],
929 926 FLUENTFORM_FRAMEWORK_UPGRADE,
930 927 'fluentform/editor_init_element_' . $formField['element'],
931 928 'Use fluentform/editor_init_element_' . $formField['element'] . ' instead of fluentform_editor_init_element_' . $formField['element']
@@ -936,9 +933,15 @@
936 933 $formField,
937 934 $form
938 935 );
939 936
940 - if (!$formFields['fields'][$index]) {
937 + // Shape check, not truthiness: a listener that returns false
938 + // to remove an element can be handed to a LATER listener on
939 + // the same hook, whose `$item['settings'][...] = ...` makes
940 + // PHP auto-vivify false into a truthy, element-less array.
941 + // A plain falsy test would then keep that malformed stub and
942 + // read $formField['element'] off it a few lines below.
943 + if (!is_array($formField) || !isset($formField['element'])) {
941 944 unset($formFields['fields'][$index]);
942 945 continue;
943 946 }
944 947
@@ -949,9 +952,9 @@
949 952 $columnField = apply_filters_deprecated(
950 953 'fluentform_editor_init_element_' . $columnField['element'],
951 954 [
952 955 $columnField,
953 - $form
956 + $form,
954 957 ],
955 958 FLUENTFORM_FRAMEWORK_UPGRADE,
956 959 'fluentform/editor_init_element_' . $columnField['element'],
957 960 'Use fluentform/editor_init_element_' . $columnField['element'] . ' instead of fluentform_editor_init_element_' . $columnField['element']
@@ -962,12 +965,19 @@
962 965 $columnField,
963 966 $form
964 967 );
965 968
966 - if (!$columns[$columnIndex]['fields'][$fieldIndex]) {
969 + $columnField = $columns[$columnIndex]['fields'][$fieldIndex];
970 +
971 + if (!is_array($columnField) || !isset($columnField['element'])) {
967 972 unset($columns[$columnIndex]['fields'][$fieldIndex]);
968 973 }
969 974 }
975 +
976 + // Reindex after any removal: array_values() below only
977 + // reindexes the COLUMNS, so a gap left here would encode
978 + // as a JSON object and the editor iterates a list.
979 + $columns[$columnIndex]['fields'] = array_values($columns[$columnIndex]['fields']);
970 980 }
971 981
972 982 $formFields['fields'][$index]['columns'] = array_values($columns);
973 983 }
@@ -972,8 +982,18 @@
972 982 $formFields['fields'][$index]['columns'] = array_values($columns);
973 983 }
974 984 }
975 985
986 + if (!empty($formFields['stepsWrapper']['stepStart'])) {
987 + $stepStart = $formFields['stepsWrapper']['stepStart'];
988 +
989 + $formFields['stepsWrapper']['stepStart'] = apply_filters(
990 + 'fluentform/editor_init_element_' . $stepStart['element'],
991 + $stepStart,
992 + $form
993 + );
994 + }
995 +
976 996 $formFields['fields'] = array_values($formFields['fields']);
977 997 $formFields = json_encode($formFields, true);
978 998 }
979 999
@@ -980,13 +1000,13 @@
980 1000 $form->form_fields = $formFields;
981 1001 }
982 1002
983 1003 $searchTags = fluentformLoadFile('Services/FormBuilder/ElementSearchTags.php');
984 -
1004 +
985 1005 $searchTags = apply_filters_deprecated(
986 1006 'fluentform_editor_element_search_tags',
987 1007 [
988 - $searchTags
1008 + $searchTags,
989 1009 ],
990 1010 FLUENTFORM_FRAMEWORK_UPGRADE,
991 1011 'fluentform/editor_element_search_tags',
992 1012 'Use fluentform/editor_element_search_tags instead of fluent_editor_element_search_tags.'
@@ -991,15 +1011,15 @@
991 1011 'fluentform/editor_element_search_tags',
992 1012 'Use fluentform/editor_element_search_tags instead of fluent_editor_element_search_tags.'
993 1013 );
994 1014 $searchTags = apply_filters('fluentform/editor_element_search_tags', $searchTags, $form);
995 -
1015 +
996 1016 $elementPlacements = fluentformLoadFile('Services/FormBuilder/ElementSettingsPlacement.php');
997 1017 $elementPlacements = apply_filters_deprecated(
998 1018 'fluentform_editor_element_settings_placement',
999 1019 [
1000 1020 $elementPlacements,
1001 - $form
1021 + $form,
1002 1022 ],
1003 1023 FLUENTFORM_FRAMEWORK_UPGRADE,
1004 1024 'fluentform/editor_element_settings_placement',
1005 1025 'Use fluentform/editor_element_settings_placement instead of fluent_editor_element_settings_placement.'
@@ -1019,8 +1039,9 @@
1019 1039 'hasPro' => defined('FLUENTFORMPRO'),
1020 1040 'countries' => getFluentFormCountryList(),
1021 1041 'element_customization_settings' => fluentformLoadFile('Services/FormBuilder/ElementCustomization.php'),
1022 1042 'validation_rule_settings' => fluentformLoadFile('Services/FormBuilder/ValidationRuleSettings.php'),
1043 + 'supported_conditional_fields' => (new Fields())->supportedConditionalFields(),
1023 1044 'conversational_form_fields' => array_keys(Converter::fieldTypes()),
1024 1045 'form_editor_str' => TranslationString::getEditorI18n(),
1025 1046 'element_search_tags' => $searchTags,
1026 1047 'element_settings_placement' => $elementPlacements,
@@ -1033,28 +1054,28 @@
1033 1054 'used_name_attributes' => $this->usedNameAttributes($formId),
1034 1055 'bulk_options_json' => '{"Countries":["Afghanistan","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bonaire, Sint Eustatius and Saba","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory","Brunei Darussalam","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central African Republic","Chad","Chile","China","Christmas Island","Cocos Islands","Colombia","Comoros","Congo, Democratic Republic of the","Congo, Republic of the","Cook Islands","Costa Rica","Croatia","Cuba","Cura\u00e7ao","Cyprus","Czech Republic","C\u00f4te d\'Ivoire","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini (Swaziland)","Ethiopia","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Guiana","French Polynesia","French Southern Territories","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea-Bissau","Guyana","Haiti","Heard and McDonald Islands","Holy See","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Kuwait","Kyrgyzstan","Lao People\'s Democratic Republic","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macau","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","North Korea","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Palestine, State of","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn","Poland","Portugal","Puerto Rico","Qatar","Romania","Russia","Rwanda","R\u00e9union","Saint Barth\u00e9lemy","Saint Helena","Saint Kitts and Nevis","Saint Lucia","Saint Martin","Saint Pierre and Miquelon","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Sint Maarten","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Georgia","South Korea","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Svalbard and Jan Mayen Islands","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Timor-Leste","Togo","Tokelau","Tonga","Trinidad and Tobago","Tunisia","Türkiye","Turkmenistan","Turks and Caicos Islands","Tuvalu","US Minor Outlying Islands","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Venezuela","Vietnam","Virgin Islands, British","Virgin Islands, U.S.","Wallis and Futuna","Western Sahara","Yemen","Zambia","Zimbabwe","\u00c5land Islands"],"U.S. States":["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming","Armed Forces Americas","Armed Forces Europe","Armed Forces Pacific"],"Canadian Province\/Territory":["Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland and Labrador","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon"],"Continents":["Africa","Antarctica","Asia","Australia","Europe","North America","South America"],"Gender":["Male","Female","Prefer Not to Answer"],"Age":["Under 18","18-24","25-34","35-44","45-54","55-64","65 or Above","Prefer Not to Answer"],"Marital Status":["Single","Married","Divorced","Widowed"],"Employment":["Employed Full-Time","Employed Part-Time","Self-employed","Not employed but looking for work","Not employed and not looking for work","Homemaker","Retired","Student","Prefer Not to Answer"],"Job Type":["Full-Time","Part-Time","Per Diem","Employee","Temporary","Contract","Intern","Seasonal"],"Industry":["Accounting\/Finance","Advertising\/Public Relations","Aerospace\/Aviation","Arts\/Entertainment\/Publishing","Automotive","Banking\/Mortgage","Business Development","Business Opportunity","Clerical\/Administrative","Construction\/Facilities","Consumer Goods","Customer Service","Education\/Training","Energy\/Utilities","Engineering","Government\/Military","Green","Healthcare","Hospitality\/Travel","Human Resources","Installation\/Maintenance","Insurance","Internet","Job Search Aids","Law Enforcement\/Security","Legal","Management\/Executive","Manufacturing\/Operations","Marketing","Non-Profit\/Volunteer","Pharmaceutical\/Biotech","Professional Services","QA\/Quality Control","Real Estate","Restaurant\/Food Service","Retail","Sales","Science\/Research","Skilled Labor","Technology","Telecommunications","Transportation\/Logistics","Other"],"Education":["High School","Associate Degree","Bachelor\'s Degree","Graduate or Professional Degree","Some College","Other","Prefer Not to Answer"],"Days of the Week":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"Months of the Year":["January","February","March","April","May","June","July","August","September","October","November","December"],"How Often":["Every day","Once a week","2 to 3 times a week","Once a month","2 to 3 times a month","Less than once a month"],"How Long":["Less than a month","1-6 months","1-3 years","Over 3 years","Never used"],"Satisfaction":["Very Satisfied","Satisfied","Neutral","Unsatisfied","Very Unsatisfied"],"Importance":["Very Important","Important","Somewhat Important","Not Important"],"Agreement":["Strongly Agree","Agree","Disagree","Strongly Disagree"],"Comparison":["Much Better","Somewhat Better","About the Same","Somewhat Worse","Much Worse"],"Would You":["Definitely","Probably","Not Sure","Probably Not","Definitely Not"],"Size":["Extra Small","Small","Medium","Large","Extra Large"],"Timezone":["(GMT -12-00) Eniwetok, Kwajalein:-12","(GMT -11-00) Midway Island, Samoa:-11","(GMT -10-00) Hawaii:-10","(GMT -9-00) Alaska:-9","(GMT -8-00) Pacific Time (US & Canada):-8","(GMT -7-00) Mountain Time (US & Canada):-7","(GMT -6-00) Central Time (US & Canada), Mexico City:-6","(GMT -5-00) Eastern Time (US & Canada), Bogota, Lima:-5","(GMT -4-00) Atlantic Time (Canada), Caracas, La Paz:-4","(GMT -3-30) Newfoundland:-3.5","(GMT -3-00) Brazil, Buenos Aires, Georgetown:-3","(GMT -2-00) Mid-Atlantic:-2","(GMT -1-00) Azores, Cape Verde Islands:-1","(GMT) Western Europe Time, London, Lisbon, Casablanca:0","(GMT +1-00) Brussels, Copenhagen, Madrid, Paris:1","(GMT +2-00) Kaliningrad, South Africa:2","(GMT +3-00) Baghdad, Riyadh, Moscow, St. Petersburg:3","(GMT +3-30) Tehran:3.5","(GMT +4-00) Abu Dhabi, Muscat, Baku, Tbilisi:4","(GMT +4-30) Kabul:4.5","(GMT +5-00) Ekaterinburg, Islamabad, Karachi, Tashkent:5","(GMT +5-30) Bombay, Calcutta, Madras, New Delhi:5.5","(GMT +5-45) Kathmandu:5.75","(GMT +6-00) Almaty, Dhaka, Colombo:6","(GMT +7-00) Bangkok, Hanoi, Jakarta:7","(GMT +8-00) Beijing, Perth, Singapore, Hong Kong:8","(GMT +9-00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk:9","(GMT +9-30) Adelaide, Darwin:9.5","(GMT +10-00) Eastern Australia, Guam, Vladivostok:10","(GMT +11-00) Magadan, Solomon Islands, New Caledonia:11","(GMT +12-00) Auckland, Wellington, Fiji, Kamchatka:12"]}',
1035 1056 ];
1036 1057
1037 - // if has pro and payment enable. We will use this filter hook to push custom elements
1038 - if (defined('FLUENTFORMPRO')) {
1039 - $data['calc_items'] = [
1040 - 'paymentElements' => [
1041 - 'multi_payment_component',
1042 - 'input_number',
1043 - 'repeater_field',
1044 - 'net_promoter_score',
1045 - 'rangeslider',
1046 - 'custom_payment_component',
1058 + // if has pro and payment enable. We will use this filter hook to push custom elements
1059 + if (defined('FLUENTFORMPRO')) {
1060 + $data['calc_items'] = [
1061 + 'paymentElements' => [
1062 + 'multi_payment_component',
1063 + 'input_number',
1064 + 'repeater_field',
1065 + 'net_promoter_score',
1066 + 'rangeslider',
1067 + 'custom_payment_component',
1047 1068 'item_quantity_component',
1048 - 'subscription_payment_component'
1049 - ]
1050 - ];
1051 - }
1069 + 'subscription_payment_component',
1070 + ],
1071 + ];
1072 + }
1052 1073
1053 - $data = apply_filters_deprecated(
1074 + $data = apply_filters_deprecated(
1054 1075 'fluentform_editor_vars',
1055 1076 [
1056 - $data
1077 + $data,
1057 1078 ],
1058 1079 FLUENTFORM_FRAMEWORK_UPGRADE,
1059 1080 'fluentform/editor_vars',
1060 1081 'Use fluentform/editor_vars instead of fluentform_editor_vars.'
@@ -1084,17 +1105,17 @@
1084 1105 // components on this page dynamically & easily.
1085 1106 // N.B. native 'components' will always use
1086 1107 // 'settings' as their current component.
1087 1108 $currentComponent = $this->app->request->get('component', 'settings');
1088 -
1109 +
1089 1110 $currentComponent = apply_filters_deprecated('fluentform_global_settings_current_component', [
1090 - $currentComponent
1091 - ],
1111 + $currentComponent,
1112 + ],
1092 1113 FLUENTFORM_FRAMEWORK_UPGRADE,
1093 1114 'fluentform/global_settings_current_component',
1094 1115 'Use fluentform/global_settings_current_component instead of fluentform_global_settings_current_component.'
1095 1116 );
1096 -
1117 +
1097 1118 $currentComponent = apply_filters(
1098 1119 'fluentform/global_settings_current_component',
1099 1120 $currentComponent
1100 1121 );
@@ -1101,15 +1122,15 @@
1101 1122
1102 1123 $currentComponent = sanitize_key($currentComponent);
1103 1124 $components = [];
1104 1125 $components = apply_filters_deprecated('fluentform_global_settings_components', [
1105 - $components
1106 - ],
1126 + $components,
1127 + ],
1107 1128 FLUENTFORM_FRAMEWORK_UPGRADE,
1108 1129 'fluentform/global_settings_components',
1109 1130 'Use fluentform/global_settings_components instead of fluentform_global_settings_components.'
1110 1131 );
1111 -
1132 +
1112 1133 $components = apply_filters('fluentform/global_settings_components', $components);
1113 1134
1114 1135 $components['reCAPTCHA'] = [
1115 1136 'hash' => 're_captcha',
@@ -1144,10 +1165,10 @@
1144 1165 $allowForms = FormManagerService::getUserAllowedFormsScope();
1145 1166 $forms = wpFluent()->table('fluentform_forms')
1146 1167 ->orderBy('id', 'desc')
1147 1168 ->select(['id', 'title'])
1148 - ->when(false !== $allowForms, function ($q) use ($allowForms){
1149 - return $q->whereIn('id', $allowForms ?: [0]);
1169 + ->when(false !== $allowForms, function ($q) use ($allowForms) {
1170 + return $q->whereIn('id', $allowForms ? $allowForms : [0]);
1150 1171 })
1151 1172 ->get();
1152 1173
1153 1174 wp_localize_script('fluentform-transfer-js', 'FluentFormApp', [
@@ -1164,18 +1185,18 @@
1164 1185 ]);
1165 1186
1166 1187 $this->app->view->render('admin.tools.index');
1167 1188 }
1168 -
1189 +
1169 1190 public function addPreviewButton($formId)
1170 1191 {
1171 1192 $previewUrl = Helper::getPreviewUrl($formId);
1172 1193 $previewText = __('Preview & Design', 'fluentform');
1173 - $formId = (int)$formId;
1194 + $formId = (int) $formId;
1174 1195 if (Helper::isConversionForm($formId)) {
1175 1196 $previewText = __('Preview', 'fluentform');
1176 1197 }
1177 - echo '<a target="_blank" class="el-button el-button--info is-plain" href="' . esc_url($previewUrl) . '">' . '<i class="ff-icon ff-icon-eye-filled fs-15"></i> ' . '<span>' . esc_attr($previewText) . '</span>' . '</a>';
1198 + echo '<a target="_blank" class="el-button el-button--info is-plain" href="' . esc_url($previewUrl) . '"><i class="ff-icon ff-icon-eye-filled fs-15"></i> <span>' . esc_attr($previewText) . '</span></a>';
1178 1199 }
1179 1200
1180 1201 public function addCopyShortcodeButton($formId)
1181 1202 {
@@ -1183,9 +1204,9 @@
1183 1204 $shortcode = '[fluentform id="' . $formId . '"]';
1184 1205 if (Helper::isConversionForm($formId)) {
1185 1206 $shortcode = '[fluentform type="conversational" id="' . $formId . '"]';
1186 1207 }
1187 - echo '<button title="Click to Copy" class="ff_shortcode_btn ff_shortcode_btn_md copy truncate" data-clipboard-text=\'' . $shortcode . '\'><i class="el-icon el-icon-document-copy"></i> ' . $shortcode . '</button>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $shortcode is escaped before being passed in.
1208 + echo '<button title="' . esc_attr__('Click to Copy', 'fluentform') . '" class="ff_shortcode_btn ff_shortcode_btn_md copy truncate" data-clipboard-text=\'' . $shortcode . '\'><i class="el-icon el-icon-document-copy"></i> ' . $shortcode . '</button>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $shortcode is escaped before being passed in.
1188 1209 return;
1189 1210 }
1190 1211
1191 1212 public function commonAction()
@@ -1195,9 +1216,8 @@
1195 1216 'fluent_forms_transfer',
1196 1217 'fluent_forms_settings',
1197 1218 'fluent_forms_add_ons',
1198 1219 'fluent_forms_docs',
1199 - 'fluent_forms_smtp',
1200 1220 ];
1201 1221
1202 1222 $page = sanitize_text_field($this->app->request->get('page'));
1203 1223
@@ -1220,10 +1240,10 @@
1220 1240 ->count();
1221 1241 $showPayment = $formCount > 2;
1222 1242 }
1223 1243 $showPaymentEntry = apply_filters_deprecated('fluentform_show_payment_entries', [
1224 - false
1225 - ],
1244 + false,
1245 + ],
1226 1246 FLUENTFORM_FRAMEWORK_UPGRADE,
1227 1247 'fluentform/show_payment_entries',
1228 1248 'Use fluentform/show_payment_entries instead of fluentform/show_payment_entries.'
1229 1249 );
@@ -1244,22 +1264,8 @@
1244 1264 'Use fluentform/render_payment_entries instead of flunetform/render_payment_entries'
1245 1265 );
1246 1266
1247 1267 do_action('fluentform/render_payment_entries');
1248 - }
1249 -
1250 - public function renderSmtpPromo()
1251 - {
1252 - wp_enqueue_script('fluentform_admin_notice', fluentformMix('js/admin_notices.js'), [
1253 - 'jquery',
1254 - ], FLUENTFORM_VERSION, true);
1255 -
1256 - $this->app->view->render('admin.smtp.index', [
1257 - 'logo' => fluentformMix('img/fluentsmtp.svg'),
1258 - 'banner_image' => fluentformMix('img/fluentsmtp-banner.png'),
1259 - 'is_installed' => defined('FLUENTMAIL'),
1260 - 'setup_url' => admin_url('options-general.php?page=fluent-mail#/connections'),
1261 - ]);
1262 1268 }
1263 1269
1264 1270 public function renderReports()
1265 1271 {