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 +83 -66 6.2.3 → 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;
@@ -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', '>='),
@@ -322,8 +321,10 @@
322 321 if (Acl::hasAnyFormPermission()) {
323 322 $globalVars['fluent_forms_admin_nonce'] = wp_create_nonce('fluent_forms_admin_nonce');
324 323 }
325 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 +
326 327 wp_localize_script('fluent_forms_global', 'fluent_forms_global_var', $globalVars);
327 328
328 329 $page = sanitize_text_field($this->app->request->get('page'));
329 330 $route = sanitize_text_field($this->app->request->get('route'));
@@ -354,9 +355,9 @@
354 355 }
355 356 } elseif ('fluent_forms' == $page) {
356 357 wp_enqueue_script('fluent_all_forms');
357 358 wp_enqueue_style('fluent_all_forms');
358 - }elseif ('fluent_forms_transfer' == $page) {
359 + } elseif ('fluent_forms_transfer' == $page) {
359 360 wp_enqueue_style('fluentform_settings_global');
360 361 wp_enqueue_script('fluentform-transfer-js');
361 362 } elseif (
362 363 'fluent_forms_settings' == $page ||
@@ -378,9 +379,9 @@
378 379 {
379 380 $dashBoardCapability = apply_filters_deprecated(
380 381 'fluentform_dashboard_capability',
381 382 [
382 - 'fluentform_dashboard_access'
383 + 'fluentform_dashboard_access',
383 384 ],
384 385 FLUENTFORM_FRAMEWORK_UPGRADE,
385 386 'fluentform/dashboard_capability',
386 387 'Use fluentform/dashboard_capability instead of fluentform_dashboard_capability.'
@@ -389,13 +390,13 @@
389 390 $dashBoardCapability = $this->app->applyFilters(
390 391 'fluentform/dashboard_capability',
391 392 $dashBoardCapability
392 393 );
393 -
394 +
394 395 $settingManager = apply_filters_deprecated(
395 396 'fluentform_settings_capability',
396 397 [
397 - 'fluentform_settings_manager'
398 + 'fluentform_settings_manager',
398 399 ],
399 400 FLUENTFORM_FRAMEWORK_UPGRADE,
400 401 'fluentform/settings_capability',
401 402 'Use fluentform/settings_capability instead of fluentform_settings_capability.'
@@ -468,10 +469,10 @@
468 469 if (Helper::isFluentAdminPage()) {
469 470 $allowForms = FormManagerService::getUserAllowedFormsScope();
470 471 $entriesCount = wpFluent()->table('fluentform_submissions')
471 472 ->where('status', 'unread')
472 - ->when(false !== $allowForms, function ($q) use ($allowForms){
473 - return $q->whereIn('form_id', $allowForms ?: [0]);
473 + ->when(false !== $allowForms, function ($q) use ($allowForms) {
474 + return $q->whereIn('form_id', $allowForms ? $allowForms : [0]);
474 475 })
475 476 ->count();
476 477
477 478 if ($entriesCount) {
@@ -501,9 +502,9 @@
501 502
502 503 $isShowPaymentSubmission = apply_filters_deprecated(
503 504 'fluentform_show_payment_entries',
504 505 [
505 - false
506 + false,
506 507 ],
507 508 FLUENTFORM_FRAMEWORK_UPGRADE,
508 509 'fluentform/show_payment_entries',
509 510 'Use fluentform/show_payment_entries instead of fluentform_show_payment_entries.'
@@ -654,9 +655,9 @@
654 655 'fluentform_form_admin_menu',
655 656 [
656 657 $formAdminMenus,
657 658 $form_id,
658 - $form
659 + $form,
659 660 ],
660 661 FLUENTFORM_FRAMEWORK_UPGRADE,
661 662 'fluentform/form_admin_menu',
662 663 'Use fluentform/form_admin_menu instead of fluentform_form_admin_menu.'
@@ -711,11 +712,11 @@
711 712 ];
712 713 }
713 714
714 715 $settingsMenus = apply_filters_deprecated('fluentform_form_settings_menu', [
715 - $settingsMenus,
716 - $form_id
717 - ],
716 + $settingsMenus,
717 + $form_id,
718 + ],
718 719 FLUENTFORM_FRAMEWORK_UPGRADE,
719 720 'fluentform/form_settings_menu',
720 721 'Use fluentform/form_settings_menu instead of fluentform_form_settings_menu.'
721 722 );
@@ -746,9 +747,9 @@
746 747 $this->app->view->render('admin.form.settings_wrapper', [
747 748 'form_id' => $form_id,
748 749 'settings_menus' => $settingsMenus,
749 750 'current_sub_route' => $currentRoute,
750 - 'has_double_opt_in' => $hasDoubleOptinEnable
751 + 'has_double_opt_in' => $hasDoubleOptinEnable,
751 752 ]);
752 753 }
753 754
754 755 /**
@@ -792,9 +793,9 @@
792 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'),
793 794 ],
794 795 'countries' => getFluentFormCountryList(),
795 796 'getIpInfo' => Helper::getIpinfo(),
796 - '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', '>='),
797 798 ]);
798 799
799 800 $this->app->view->render('admin.form.settings', [
800 801 'form_id' => $form_id,
@@ -807,9 +808,9 @@
807 808 (new ActivationHandler())->migrate();
808 809 }
809 810
810 811 if (false !== ($allowForms = FormManagerService::getUserAllowedFormsScope())) {
811 - $formsCount = wpFluent()->table('fluentform_forms')->whereIn('id', $allowForms ?: [0])->count();
812 + $formsCount = wpFluent()->table('fluentform_forms')->whereIn('id', $allowForms ? $allowForms : [0])->count();
812 813 } else {
813 814 $formsCount = wpFluent()->table('fluentform_forms')->count();
814 815 }
815 816
@@ -815,15 +816,15 @@
815 816
816 817 $isDisabledAnalytics = apply_filters_deprecated(
817 818 'fluentform-disabled_analytics',
818 819 [
819 - true
820 + true,
820 821 ],
821 822 FLUENTFORM_FRAMEWORK_UPGRADE,
822 823 'fluentform/disabled_analytics',
823 824 'Use fluentform/disabled_analytics instead of fluentform-disabled_analytics.'
824 825 );
825 -
826 +
826 827 $data = [
827 828 'plugin' => $this->app->config->get('app.slug'),
828 829 'formsCount' => $formsCount,
829 830 'hasPro' => defined('FLUENTFORMPRO'),
@@ -834,17 +835,16 @@
834 835 'plugin_public_url' => fluentformMix(),
835 836 'siteUrl' => site_url(),
836 837 ];
837 838
838 - if (defined('FLUENTFORMPRO')){
839 + if (defined('FLUENTFORMPRO')) {
839 840 $data['landing_page_enabled_forms']= Helper::getLandingPageEnabledForms();
840 841 }
841 -
842 842
843 843 $data = apply_filters_deprecated(
844 844 'fluent_all_forms_vars',
845 845 [
846 - $data
846 + $data,
847 847 ],
848 848 FLUENTFORM_FRAMEWORK_UPGRADE,
849 849 'fluentform/all_forms_vars',
850 850 'Use fluentform/all_forms_vars instead of fluent_all_forms_vars.'
@@ -878,12 +878,16 @@
878 878 $formId = (int) $this->app->request->get('form_id');
879 879
880 880 $form = wpFluent()->table('fluentform_forms')->find($formId);
881 881
882 + if (!$form) {
883 + return;
884 + }
885 +
882 886 do_action_deprecated(
883 887 'fluentform_loading_editor_assets',
884 888 [
885 - $form
889 + $form,
886 890 ],
887 891 FLUENTFORM_FRAMEWORK_UPGRADE,
888 892 'fluentform/loading_editor_assets',
889 893 'Use fluentform/loading_editor_assets instead of fluentform_loading_editor_assets'
@@ -916,9 +920,9 @@
916 920 $formField = apply_filters_deprecated(
917 921 'fluentform_editor_init_element_' . $formField['element'],
918 922 [
919 923 $formField,
920 - $form
924 + $form,
921 925 ],
922 926 FLUENTFORM_FRAMEWORK_UPGRADE,
923 927 'fluentform/editor_init_element_' . $formField['element'],
924 928 'Use fluentform/editor_init_element_' . $formField['element'] . ' instead of fluentform_editor_init_element_' . $formField['element']
@@ -929,9 +933,15 @@
929 933 $formField,
930 934 $form
931 935 );
932 936
933 - 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'])) {
934 944 unset($formFields['fields'][$index]);
935 945 continue;
936 946 }
937 947
@@ -942,9 +952,9 @@
942 952 $columnField = apply_filters_deprecated(
943 953 'fluentform_editor_init_element_' . $columnField['element'],
944 954 [
945 955 $columnField,
946 - $form
956 + $form,
947 957 ],
948 958 FLUENTFORM_FRAMEWORK_UPGRADE,
949 959 'fluentform/editor_init_element_' . $columnField['element'],
950 960 'Use fluentform/editor_init_element_' . $columnField['element'] . ' instead of fluentform_editor_init_element_' . $columnField['element']
@@ -955,12 +965,19 @@
955 965 $columnField,
956 966 $form
957 967 );
958 968
959 - if (!$columns[$columnIndex]['fields'][$fieldIndex]) {
969 + $columnField = $columns[$columnIndex]['fields'][$fieldIndex];
970 +
971 + if (!is_array($columnField) || !isset($columnField['element'])) {
960 972 unset($columns[$columnIndex]['fields'][$fieldIndex]);
961 973 }
962 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']);
963 980 }
964 981
965 982 $formFields['fields'][$index]['columns'] = array_values($columns);
966 983 }
@@ -983,13 +1000,13 @@
983 1000 $form->form_fields = $formFields;
984 1001 }
985 1002
986 1003 $searchTags = fluentformLoadFile('Services/FormBuilder/ElementSearchTags.php');
987 -
1004 +
988 1005 $searchTags = apply_filters_deprecated(
989 1006 'fluentform_editor_element_search_tags',
990 1007 [
991 - $searchTags
1008 + $searchTags,
992 1009 ],
993 1010 FLUENTFORM_FRAMEWORK_UPGRADE,
994 1011 'fluentform/editor_element_search_tags',
995 1012 'Use fluentform/editor_element_search_tags instead of fluent_editor_element_search_tags.'
@@ -994,15 +1011,15 @@
994 1011 'fluentform/editor_element_search_tags',
995 1012 'Use fluentform/editor_element_search_tags instead of fluent_editor_element_search_tags.'
996 1013 );
997 1014 $searchTags = apply_filters('fluentform/editor_element_search_tags', $searchTags, $form);
998 -
1015 +
999 1016 $elementPlacements = fluentformLoadFile('Services/FormBuilder/ElementSettingsPlacement.php');
1000 1017 $elementPlacements = apply_filters_deprecated(
1001 1018 'fluentform_editor_element_settings_placement',
1002 1019 [
1003 1020 $elementPlacements,
1004 - $form
1021 + $form,
1005 1022 ],
1006 1023 FLUENTFORM_FRAMEWORK_UPGRADE,
1007 1024 'fluentform/editor_element_settings_placement',
1008 1025 'Use fluentform/editor_element_settings_placement instead of fluent_editor_element_settings_placement.'
@@ -1037,28 +1054,28 @@
1037 1054 'used_name_attributes' => $this->usedNameAttributes($formId),
1038 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"]}',
1039 1056 ];
1040 1057
1041 - // if has pro and payment enable. We will use this filter hook to push custom elements
1042 - if (defined('FLUENTFORMPRO')) {
1043 - $data['calc_items'] = [
1044 - 'paymentElements' => [
1045 - 'multi_payment_component',
1046 - 'input_number',
1047 - 'repeater_field',
1048 - 'net_promoter_score',
1049 - 'rangeslider',
1050 - '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',
1051 1068 'item_quantity_component',
1052 - 'subscription_payment_component'
1053 - ]
1054 - ];
1055 - }
1069 + 'subscription_payment_component',
1070 + ],
1071 + ];
1072 + }
1056 1073
1057 - $data = apply_filters_deprecated(
1074 + $data = apply_filters_deprecated(
1058 1075 'fluentform_editor_vars',
1059 1076 [
1060 - $data
1077 + $data,
1061 1078 ],
1062 1079 FLUENTFORM_FRAMEWORK_UPGRADE,
1063 1080 'fluentform/editor_vars',
1064 1081 'Use fluentform/editor_vars instead of fluentform_editor_vars.'
@@ -1088,17 +1105,17 @@
1088 1105 // components on this page dynamically & easily.
1089 1106 // N.B. native 'components' will always use
1090 1107 // 'settings' as their current component.
1091 1108 $currentComponent = $this->app->request->get('component', 'settings');
1092 -
1109 +
1093 1110 $currentComponent = apply_filters_deprecated('fluentform_global_settings_current_component', [
1094 - $currentComponent
1095 - ],
1111 + $currentComponent,
1112 + ],
1096 1113 FLUENTFORM_FRAMEWORK_UPGRADE,
1097 1114 'fluentform/global_settings_current_component',
1098 1115 'Use fluentform/global_settings_current_component instead of fluentform_global_settings_current_component.'
1099 1116 );
1100 -
1117 +
1101 1118 $currentComponent = apply_filters(
1102 1119 'fluentform/global_settings_current_component',
1103 1120 $currentComponent
1104 1121 );
@@ -1105,15 +1122,15 @@
1105 1122
1106 1123 $currentComponent = sanitize_key($currentComponent);
1107 1124 $components = [];
1108 1125 $components = apply_filters_deprecated('fluentform_global_settings_components', [
1109 - $components
1110 - ],
1126 + $components,
1127 + ],
1111 1128 FLUENTFORM_FRAMEWORK_UPGRADE,
1112 1129 'fluentform/global_settings_components',
1113 1130 'Use fluentform/global_settings_components instead of fluentform_global_settings_components.'
1114 1131 );
1115 -
1132 +
1116 1133 $components = apply_filters('fluentform/global_settings_components', $components);
1117 1134
1118 1135 $components['reCAPTCHA'] = [
1119 1136 'hash' => 're_captcha',
@@ -1148,10 +1165,10 @@
1148 1165 $allowForms = FormManagerService::getUserAllowedFormsScope();
1149 1166 $forms = wpFluent()->table('fluentform_forms')
1150 1167 ->orderBy('id', 'desc')
1151 1168 ->select(['id', 'title'])
1152 - ->when(false !== $allowForms, function ($q) use ($allowForms){
1153 - return $q->whereIn('id', $allowForms ?: [0]);
1169 + ->when(false !== $allowForms, function ($q) use ($allowForms) {
1170 + return $q->whereIn('id', $allowForms ? $allowForms : [0]);
1154 1171 })
1155 1172 ->get();
1156 1173
1157 1174 wp_localize_script('fluentform-transfer-js', 'FluentFormApp', [
@@ -1168,18 +1185,18 @@
1168 1185 ]);
1169 1186
1170 1187 $this->app->view->render('admin.tools.index');
1171 1188 }
1172 -
1189 +
1173 1190 public function addPreviewButton($formId)
1174 1191 {
1175 1192 $previewUrl = Helper::getPreviewUrl($formId);
1176 1193 $previewText = __('Preview & Design', 'fluentform');
1177 - $formId = (int)$formId;
1194 + $formId = (int) $formId;
1178 1195 if (Helper::isConversionForm($formId)) {
1179 1196 $previewText = __('Preview', 'fluentform');
1180 1197 }
1181 - 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>';
1182 1199 }
1183 1200
1184 1201 public function addCopyShortcodeButton($formId)
1185 1202 {
@@ -1223,10 +1240,10 @@
1223 1240 ->count();
1224 1241 $showPayment = $formCount > 2;
1225 1242 }
1226 1243 $showPaymentEntry = apply_filters_deprecated('fluentform_show_payment_entries', [
1227 - false
1228 - ],
1244 + false,
1245 + ],
1229 1246 FLUENTFORM_FRAMEWORK_UPGRADE,
1230 1247 'fluentform/show_payment_entries',
1231 1248 'Use fluentform/show_payment_entries instead of fluentform/show_payment_entries.'
1232 1249 );