PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.14
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.14
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 3.6.65 All 196 releases
← All changes | app/Modules/Registerer/Menu.php +81 -66 6.2.46.2.14 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;
@@ -127,9 +127,8 @@
127 127 FLUENTFORM_VERSION,
128 128 true
129 129 );
130 130
131 -
132 131 wp_register_style(
133 132 'fluentform_editor_style',
134 133 $fluentFormAdminEditorStyles,
135 134 [],
@@ -239,9 +238,9 @@
239 238 [],
240 239 FLUENTFORM_VERSION,
241 240 'all'
242 241 );
243 -
242 +
244 243 add_filter('admin_footer_text', function ($text) {
245 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>';
246 245 });
247 246
@@ -277,11 +276,11 @@
277 276 return;
278 277 }
279 278
280 279 $forms = wpFluent()->table('fluentform_forms')
281 - ->orderBy('id', 'desc')
282 - ->select(['id', 'title'])
283 - ->get();
280 + ->orderBy('id', 'desc')
281 + ->select(['id', 'title'])
282 + ->get();
284 283
285 284 wp_enqueue_script('fluent_forms_global');
286 285
287 286 // Check if default style is enabled
@@ -301,15 +300,15 @@
301 300 'card_brands' => [
302 301 'visa' => fluentformMix('img/card-brand/visa.jpg'),
303 302 'paypal' => fluentformMix('img/card-brand/paypal.jpg'),
304 303 'mastercard' => fluentformMix('img/card-brand/mastercard.jpg'),
305 - 'amex' => fluentformMix('img/card-brand/amex.jpg')
304 + 'amex' => fluentformMix('img/card-brand/amex.jpg'),
306 305 ],
307 306 'payment_icons' => [
308 307 'offline' => fluentformMix('img/payment/offline.png'),
309 308 'mollie' => fluentformMix('img/payment/mollie.png'),
310 309 'paypal' => fluentformMix('img/payment/paypal.png'),
311 - 'stripe' => fluentformMix('img/payment/stripe.png')
310 + 'stripe' => fluentformMix('img/payment/stripe.png'),
312 311 ],
313 312 'forms' => $forms,
314 313 'hasPro' => defined('FLUENTFORMPRO'),
315 314 'has_entries_import' => defined('FLUENTFORMPRO') && version_compare(FLUENTFORMPRO_VERSION, '5.1.7', '>='),
@@ -356,9 +355,9 @@
356 355 }
357 356 } elseif ('fluent_forms' == $page) {
358 357 wp_enqueue_script('fluent_all_forms');
359 358 wp_enqueue_style('fluent_all_forms');
360 - }elseif ('fluent_forms_transfer' == $page) {
359 + } elseif ('fluent_forms_transfer' == $page) {
361 360 wp_enqueue_style('fluentform_settings_global');
362 361 wp_enqueue_script('fluentform-transfer-js');
363 362 } elseif (
364 363 'fluent_forms_settings' == $page ||
@@ -380,9 +379,9 @@
380 379 {
381 380 $dashBoardCapability = apply_filters_deprecated(
382 381 'fluentform_dashboard_capability',
383 382 [
384 - 'fluentform_dashboard_access'
383 + 'fluentform_dashboard_access',
385 384 ],
386 385 FLUENTFORM_FRAMEWORK_UPGRADE,
387 386 'fluentform/dashboard_capability',
388 387 'Use fluentform/dashboard_capability instead of fluentform_dashboard_capability.'
@@ -391,13 +390,13 @@
391 390 $dashBoardCapability = $this->app->applyFilters(
392 391 'fluentform/dashboard_capability',
393 392 $dashBoardCapability
394 393 );
395 -
394 +
396 395 $settingManager = apply_filters_deprecated(
397 396 'fluentform_settings_capability',
398 397 [
399 - 'fluentform_settings_manager'
398 + 'fluentform_settings_manager',
400 399 ],
401 400 FLUENTFORM_FRAMEWORK_UPGRADE,
402 401 'fluentform/settings_capability',
403 402 'Use fluentform/settings_capability instead of fluentform_settings_capability.'
@@ -470,10 +469,10 @@
470 469 if (Helper::isFluentAdminPage()) {
471 470 $allowForms = FormManagerService::getUserAllowedFormsScope();
472 471 $entriesCount = wpFluent()->table('fluentform_submissions')
473 472 ->where('status', 'unread')
474 - ->when(false !== $allowForms, function ($q) use ($allowForms){
475 - return $q->whereIn('form_id', $allowForms ?: [0]);
473 + ->when(false !== $allowForms, function ($q) use ($allowForms) {
474 + return $q->whereIn('form_id', $allowForms ? $allowForms : [0]);
476 475 })
477 476 ->count();
478 477
479 478 if ($entriesCount) {
@@ -503,9 +502,9 @@
503 502
504 503 $isShowPaymentSubmission = apply_filters_deprecated(
505 504 'fluentform_show_payment_entries',
506 505 [
507 - false
506 + false,
508 507 ],
509 508 FLUENTFORM_FRAMEWORK_UPGRADE,
510 509 'fluentform/show_payment_entries',
511 510 'Use fluentform/show_payment_entries instead of fluentform_show_payment_entries.'
@@ -656,9 +655,9 @@
656 655 'fluentform_form_admin_menu',
657 656 [
658 657 $formAdminMenus,
659 658 $form_id,
660 - $form
659 + $form,
661 660 ],
662 661 FLUENTFORM_FRAMEWORK_UPGRADE,
663 662 'fluentform/form_admin_menu',
664 663 'Use fluentform/form_admin_menu instead of fluentform_form_admin_menu.'
@@ -713,11 +712,11 @@
713 712 ];
714 713 }
715 714
716 715 $settingsMenus = apply_filters_deprecated('fluentform_form_settings_menu', [
717 - $settingsMenus,
718 - $form_id
719 - ],
716 + $settingsMenus,
717 + $form_id,
718 + ],
720 719 FLUENTFORM_FRAMEWORK_UPGRADE,
721 720 'fluentform/form_settings_menu',
722 721 'Use fluentform/form_settings_menu instead of fluentform_form_settings_menu.'
723 722 );
@@ -748,9 +747,9 @@
748 747 $this->app->view->render('admin.form.settings_wrapper', [
749 748 'form_id' => $form_id,
750 749 'settings_menus' => $settingsMenus,
751 750 'current_sub_route' => $currentRoute,
752 - 'has_double_opt_in' => $hasDoubleOptinEnable
751 + 'has_double_opt_in' => $hasDoubleOptinEnable,
753 752 ]);
754 753 }
755 754
756 755 /**
@@ -794,9 +793,9 @@
794 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'),
795 794 ],
796 795 'countries' => getFluentFormCountryList(),
797 796 'getIpInfo' => Helper::getIpinfo(),
798 - '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', '>='),
799 798 ]);
800 799
801 800 $this->app->view->render('admin.form.settings', [
802 801 'form_id' => $form_id,
@@ -809,9 +808,9 @@
809 808 (new ActivationHandler())->migrate();
810 809 }
811 810
812 811 if (false !== ($allowForms = FormManagerService::getUserAllowedFormsScope())) {
813 - $formsCount = wpFluent()->table('fluentform_forms')->whereIn('id', $allowForms ?: [0])->count();
812 + $formsCount = wpFluent()->table('fluentform_forms')->whereIn('id', $allowForms ? $allowForms : [0])->count();
814 813 } else {
815 814 $formsCount = wpFluent()->table('fluentform_forms')->count();
816 815 }
817 816
@@ -817,15 +816,15 @@
817 816
818 817 $isDisabledAnalytics = apply_filters_deprecated(
819 818 'fluentform-disabled_analytics',
820 819 [
821 - true
820 + true,
822 821 ],
823 822 FLUENTFORM_FRAMEWORK_UPGRADE,
824 823 'fluentform/disabled_analytics',
825 824 'Use fluentform/disabled_analytics instead of fluentform-disabled_analytics.'
826 825 );
827 -
826 +
828 827 $data = [
829 828 'plugin' => $this->app->config->get('app.slug'),
830 829 'formsCount' => $formsCount,
831 830 'hasPro' => defined('FLUENTFORMPRO'),
@@ -836,17 +835,16 @@
836 835 'plugin_public_url' => fluentformMix(),
837 836 'siteUrl' => site_url(),
838 837 ];
839 838
840 - if (defined('FLUENTFORMPRO')){
839 + if (defined('FLUENTFORMPRO')) {
841 840 $data['landing_page_enabled_forms']= Helper::getLandingPageEnabledForms();
842 841 }
843 -
844 842
845 843 $data = apply_filters_deprecated(
846 844 'fluent_all_forms_vars',
847 845 [
848 - $data
846 + $data,
849 847 ],
850 848 FLUENTFORM_FRAMEWORK_UPGRADE,
851 849 'fluentform/all_forms_vars',
852 850 'Use fluentform/all_forms_vars instead of fluent_all_forms_vars.'
@@ -880,12 +878,16 @@
880 878 $formId = (int) $this->app->request->get('form_id');
881 879
882 880 $form = wpFluent()->table('fluentform_forms')->find($formId);
883 881
882 + if (!$form) {
883 + return;
884 + }
885 +
884 886 do_action_deprecated(
885 887 'fluentform_loading_editor_assets',
886 888 [
887 - $form
889 + $form,
888 890 ],
889 891 FLUENTFORM_FRAMEWORK_UPGRADE,
890 892 'fluentform/loading_editor_assets',
891 893 'Use fluentform/loading_editor_assets instead of fluentform_loading_editor_assets'
@@ -918,9 +920,9 @@
918 920 $formField = apply_filters_deprecated(
919 921 'fluentform_editor_init_element_' . $formField['element'],
920 922 [
921 923 $formField,
922 - $form
924 + $form,
923 925 ],
924 926 FLUENTFORM_FRAMEWORK_UPGRADE,
925 927 'fluentform/editor_init_element_' . $formField['element'],
926 928 'Use fluentform/editor_init_element_' . $formField['element'] . ' instead of fluentform_editor_init_element_' . $formField['element']
@@ -931,9 +933,15 @@
931 933 $formField,
932 934 $form
933 935 );
934 936
935 - 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'])) {
936 944 unset($formFields['fields'][$index]);
937 945 continue;
938 946 }
939 947
@@ -944,9 +952,9 @@
944 952 $columnField = apply_filters_deprecated(
945 953 'fluentform_editor_init_element_' . $columnField['element'],
946 954 [
947 955 $columnField,
948 - $form
956 + $form,
949 957 ],
950 958 FLUENTFORM_FRAMEWORK_UPGRADE,
951 959 'fluentform/editor_init_element_' . $columnField['element'],
952 960 'Use fluentform/editor_init_element_' . $columnField['element'] . ' instead of fluentform_editor_init_element_' . $columnField['element']
@@ -957,12 +965,19 @@
957 965 $columnField,
958 966 $form
959 967 );
960 968
961 - if (!$columns[$columnIndex]['fields'][$fieldIndex]) {
969 + $columnField = $columns[$columnIndex]['fields'][$fieldIndex];
970 +
971 + if (!is_array($columnField) || !isset($columnField['element'])) {
962 972 unset($columns[$columnIndex]['fields'][$fieldIndex]);
963 973 }
964 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']);
965 980 }
966 981
967 982 $formFields['fields'][$index]['columns'] = array_values($columns);
968 983 }
@@ -985,13 +1000,13 @@
985 1000 $form->form_fields = $formFields;
986 1001 }
987 1002
988 1003 $searchTags = fluentformLoadFile('Services/FormBuilder/ElementSearchTags.php');
989 -
1004 +
990 1005 $searchTags = apply_filters_deprecated(
991 1006 'fluentform_editor_element_search_tags',
992 1007 [
993 - $searchTags
1008 + $searchTags,
994 1009 ],
995 1010 FLUENTFORM_FRAMEWORK_UPGRADE,
996 1011 'fluentform/editor_element_search_tags',
997 1012 'Use fluentform/editor_element_search_tags instead of fluent_editor_element_search_tags.'
@@ -996,15 +1011,15 @@
996 1011 'fluentform/editor_element_search_tags',
997 1012 'Use fluentform/editor_element_search_tags instead of fluent_editor_element_search_tags.'
998 1013 );
999 1014 $searchTags = apply_filters('fluentform/editor_element_search_tags', $searchTags, $form);
1000 -
1015 +
1001 1016 $elementPlacements = fluentformLoadFile('Services/FormBuilder/ElementSettingsPlacement.php');
1002 1017 $elementPlacements = apply_filters_deprecated(
1003 1018 'fluentform_editor_element_settings_placement',
1004 1019 [
1005 1020 $elementPlacements,
1006 - $form
1021 + $form,
1007 1022 ],
1008 1023 FLUENTFORM_FRAMEWORK_UPGRADE,
1009 1024 'fluentform/editor_element_settings_placement',
1010 1025 'Use fluentform/editor_element_settings_placement instead of fluent_editor_element_settings_placement.'
@@ -1039,28 +1054,28 @@
1039 1054 'used_name_attributes' => $this->usedNameAttributes($formId),
1040 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"]}',
1041 1056 ];
1042 1057
1043 - // if has pro and payment enable. We will use this filter hook to push custom elements
1044 - if (defined('FLUENTFORMPRO')) {
1045 - $data['calc_items'] = [
1046 - 'paymentElements' => [
1047 - 'multi_payment_component',
1048 - 'input_number',
1049 - 'repeater_field',
1050 - 'net_promoter_score',
1051 - 'rangeslider',
1052 - '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',
1053 1068 'item_quantity_component',
1054 - 'subscription_payment_component'
1055 - ]
1056 - ];
1057 - }
1069 + 'subscription_payment_component',
1070 + ],
1071 + ];
1072 + }
1058 1073
1059 - $data = apply_filters_deprecated(
1074 + $data = apply_filters_deprecated(
1060 1075 'fluentform_editor_vars',
1061 1076 [
1062 - $data
1077 + $data,
1063 1078 ],
1064 1079 FLUENTFORM_FRAMEWORK_UPGRADE,
1065 1080 'fluentform/editor_vars',
1066 1081 'Use fluentform/editor_vars instead of fluentform_editor_vars.'
@@ -1090,17 +1105,17 @@
1090 1105 // components on this page dynamically & easily.
1091 1106 // N.B. native 'components' will always use
1092 1107 // 'settings' as their current component.
1093 1108 $currentComponent = $this->app->request->get('component', 'settings');
1094 -
1109 +
1095 1110 $currentComponent = apply_filters_deprecated('fluentform_global_settings_current_component', [
1096 - $currentComponent
1097 - ],
1111 + $currentComponent,
1112 + ],
1098 1113 FLUENTFORM_FRAMEWORK_UPGRADE,
1099 1114 'fluentform/global_settings_current_component',
1100 1115 'Use fluentform/global_settings_current_component instead of fluentform_global_settings_current_component.'
1101 1116 );
1102 -
1117 +
1103 1118 $currentComponent = apply_filters(
1104 1119 'fluentform/global_settings_current_component',
1105 1120 $currentComponent
1106 1121 );
@@ -1107,15 +1122,15 @@
1107 1122
1108 1123 $currentComponent = sanitize_key($currentComponent);
1109 1124 $components = [];
1110 1125 $components = apply_filters_deprecated('fluentform_global_settings_components', [
1111 - $components
1112 - ],
1126 + $components,
1127 + ],
1113 1128 FLUENTFORM_FRAMEWORK_UPGRADE,
1114 1129 'fluentform/global_settings_components',
1115 1130 'Use fluentform/global_settings_components instead of fluentform_global_settings_components.'
1116 1131 );
1117 -
1132 +
1118 1133 $components = apply_filters('fluentform/global_settings_components', $components);
1119 1134
1120 1135 $components['reCAPTCHA'] = [
1121 1136 'hash' => 're_captcha',
@@ -1150,10 +1165,10 @@
1150 1165 $allowForms = FormManagerService::getUserAllowedFormsScope();
1151 1166 $forms = wpFluent()->table('fluentform_forms')
1152 1167 ->orderBy('id', 'desc')
1153 1168 ->select(['id', 'title'])
1154 - ->when(false !== $allowForms, function ($q) use ($allowForms){
1155 - return $q->whereIn('id', $allowForms ?: [0]);
1169 + ->when(false !== $allowForms, function ($q) use ($allowForms) {
1170 + return $q->whereIn('id', $allowForms ? $allowForms : [0]);
1156 1171 })
1157 1172 ->get();
1158 1173
1159 1174 wp_localize_script('fluentform-transfer-js', 'FluentFormApp', [
@@ -1170,18 +1185,18 @@
1170 1185 ]);
1171 1186
1172 1187 $this->app->view->render('admin.tools.index');
1173 1188 }
1174 -
1189 +
1175 1190 public function addPreviewButton($formId)
1176 1191 {
1177 1192 $previewUrl = Helper::getPreviewUrl($formId);
1178 1193 $previewText = __('Preview & Design', 'fluentform');
1179 - $formId = (int)$formId;
1194 + $formId = (int) $formId;
1180 1195 if (Helper::isConversionForm($formId)) {
1181 1196 $previewText = __('Preview', 'fluentform');
1182 1197 }
1183 - 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>';
1184 1199 }
1185 1200
1186 1201 public function addCopyShortcodeButton($formId)
1187 1202 {
@@ -1225,10 +1240,10 @@
1225 1240 ->count();
1226 1241 $showPayment = $formCount > 2;
1227 1242 }
1228 1243 $showPaymentEntry = apply_filters_deprecated('fluentform_show_payment_entries', [
1229 - false
1230 - ],
1244 + false,
1245 + ],
1231 1246 FLUENTFORM_FRAMEWORK_UPGRADE,
1232 1247 'fluentform/show_payment_entries',
1233 1248 'Use fluentform/show_payment_entries instead of fluentform/show_payment_entries.'
1234 1249 );