diff --git a/assets/css/admin.scss b/assets/css/admin.scss index 088b26c26..0feaaf131 100644 --- a/assets/css/admin.scss +++ b/assets/css/admin.scss @@ -9274,6 +9274,7 @@ &--field { flex: 2; } + } } @@ -9532,7 +9533,7 @@ .ps__rail { &-x { - display: none; + display: none; } } } @@ -9583,13 +9584,13 @@ display: flex; align-items: center; gap: 6px; - + .evf-toggle-section { .everest-forms-toggle-form { margin: 0; } } - + .everest-forms-toggle-text { font-size: 14px; line-height: 24px; @@ -9697,6 +9698,8 @@ } } + + fieldset { > label { font-size: 14px; @@ -9960,6 +9963,74 @@ height: 14px; } } + .everest-forms-custom-image-delete , .evf-image-container { + + object-fit: cover; + display: inline-flex; + position: relative; + border-radius: 8px; + height: 100px; + width: auto; + overflow: hidden; + object-fit: cover; + object-position: center; + margin:auto; + display: inline-flex; + position: relative; + justify-content: center; + cursor: pointer; + user-select: none; + + i { + display: none; + } + + &:hover { + &::before { + content: ""; + background: #000; + position: absolute; + width: 100%; + height: 100%; + opacity: 0.6; + } + + i { + position: absolute; + display: contents; + + &:hover { + &::before, + &::after { + transform: translate(-50%, -50%) scale(1.1); + } + } + + &::before { + content: ""; + background: #d52626; + width: 42px; + height: 42px; + position: absolute; + border-radius: 50%; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + } + + &::after { + content: "\e907"; + position: absolute; + font-size: 22px; + color: #fff; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + } + } + } + + } } } } @@ -10148,4 +10219,4 @@ left: 435px !important; } } -} \ No newline at end of file +} diff --git a/assets/extensions-json/sections/all_extensions.json b/assets/extensions-json/sections/all_extensions.json index 46f043a6b..3a0d51240 100644 --- a/assets/extensions-json/sections/all_extensions.json +++ b/assets/extensions-json/sections/all_extensions.json @@ -288,23 +288,6 @@ "demo_video_url": "WCsHC7NQ2QQ", "popular_rank": 16 }, - { - "title": "ConvertKit", - "slug": "everest-forms-convertkit", - "name": "Everest Forms ConvertKit", - "image": "extensions-json/sections/images/convertkit.png", - "excerpt": "Allows you to efficiently grow your business by generating more leads with ConvertKit. It also helps increase automated emails for better lead generation.", - "link": "https://docs.everestforms.net/docs/convertkit/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", - "released_date": "10/08/2018", - "plan": [ - "personal", - "agency", - "themegrill agency" - ], - "setting_url": "admin.php?page=evf-settings&tab=integration§ion=convertkit", - "demo_video_url": "GvqPVCK7Ws8", - "popular_rank": 17 - }, { "title": "Post Submissions", "slug": "everest-forms-post-submissions", @@ -389,7 +372,6 @@ "setting_url": "admin.php?page=evf-settings&tab=integration§ion=sms_notifications", "demo_video_url": "tz4UKBX9WxM", "popular_rank": 22 - }, { "title": "Cloud Storage", @@ -425,23 +407,6 @@ "demo_video_url": "GSYQIiyntW0", "popular_rank": 24 }, - { - "title": "Sendinblue", - "slug": "everest-forms-sendinblue", - "name": "Everest Forms Sendinblue", - "image": "extensions-json/sections/images/sendinblue.png", - "excerpt": "Allows your users to subscribe to Sendinblue through form submissions. Users filling up the forms can be directly added to your subscribers list in Sendinblue.", - "link": "https://docs.everestforms.net/docs/sendinblue/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", - "released_date": "26/09/2022", - "plan": [ - "personal", - "agency", - "themegrill agency" - ], - "setting_url": "admin.php?page=evf-settings&tab=integration§ion=sendinblue", - "demo_video_url": "NRRDY1ag6Sk", - "popular_rank": 26 - }, { "title": "ActiveCampaign", "slug": "everest-forms-activecampaign", @@ -543,23 +508,6 @@ "demo_video_url": "1VsyUu4NAhk", "popular_rank": 30 }, - { - "title": "Pipedrive", - "slug": "everest-forms-pipedrive", - "name": "Everest Forms Pipedrive", - "image": "extensions-json/sections/images/pipedrive.png", - "excerpt": "Everest Forms Pipedrive CRM add-on is a WordPress Pipedrive CRM integration plugin that allows you to easily send Everest Forms entries directly to your Pipedrive CRM account. ", - "link": "https://docs.everestforms.net/docs/pipedrive/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", - "released_date": "15/06/2022", - "plan": [ - "personal", - "agency", - "themegrill agency" - ], - "setting_url": "admin.php?page=evf-settings&tab=integration§ion=pipedrive", - "demo_video_url": "wJPX0EJ2OiI", - "popular_rank": 32 - }, { "title": "Authorize.Net", "slug": "everest-forms-authorize-net", @@ -577,23 +525,6 @@ "demo_video_url": "a5EcKjwWD1A", "popular_rank": 31 }, - { - "title": "Constant Contact", - "slug": "everest-forms-constant-contact", - "name": "Everest Forms Constant Contact", - "image": "extensions-json/sections/images/constant-contact.png", - "excerpt": "Everest Forms Constant Contact add-on is a WordPress Constant Contact integration plugin that allows you to easily send Everest Forms entries directly to your Constant Contact account. ", - "link": "https://docs.everestforms.net/docs/constant-contact/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", - "released_date": "31/08/2022", - "plan": [ - "personal", - "agency", - "themegrill agency" - ], - "setting_url": "admin.php?page=evf-settings&tab=integration§ion=constant_contact", - "demo_video_url": "dCeW1GW6-YI", - "popular_rank": 33 - }, { "title": "Drip", "slug": "everest-forms-drip", @@ -644,23 +575,6 @@ "setting_url": "admin.php?page=evf-settings&tab=integration§ion=zoho", "demo_video_url": "sfHFiUIHpg0", "popular_rank": 34 - }, - { - "title": "GetResponse", - "slug": "everest-forms-getresponse", - "name": "Everest Forms GetResponse", - "image": "extensions-json/sections/images/getresponse.png", - "excerpt": "Allows your users to subscribe to GetResponse through form submissions. Users filling up the forms can be directly added to your subscribers list in GetResponse.", - "link": "https://docs.everestforms.net/docs/getresponse/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", - "released_date": "26/09/2022", - "plan": [ - "personal", - "agency", - "themegrill agency" - ], - "setting_url": "admin.php?page=evf-settings&tab=integration§ion=getresponse", - "demo_video_url": "Jhq1dOFXV-I", - "popular_rank": 37 } ], "features": [ @@ -747,7 +661,7 @@ { "title": "OnePageCRM", "slug": "everest-forms-onepagecrm", - "name": "Everest Forms- Mailpoet", + "name": "Everest Forms- OnePageCRM", "image": "extensions-json/sections/images/onepagecrm.webp", "excerpt": "OnePageCRM for Everest Forms helps you to easily send Everest Forms entries directly to your OnePageCRM customer relation account.", "link": "https://docs.everestforms.net/docs/onepagecrm/?utm_source=dashboard-all-features&utm_medium=card-documentation-link", @@ -760,6 +674,139 @@ "setting_url": "admin.php?page=evf-settings&tab=integration§ion=onepagecrm", "demo_video_url": "42EUj-Dlnr0" }, + { + "title": "Telegram", + "slug": "everest-forms-telegram", + "name": "Everest Forms Telegram", + "image": "extensions-json/sections/images/telegram.webp", + "excerpt": "Telegram integration for Everest Forms! Easily integrate this popular messaging platform with Everest Forms to offer your users a smooth and efficient interaction experience.", + "link": "https://docs.everestforms.net/docs/telegram/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", + "released_date": "xx/xx/2024", + "plan": [ + "personal", + "agency", + "themegrill agency" + ], + "setting_url": "admin.php?page=evf-settings&tab=integration§ion=telegram", + "demo_video_url": "" + }, + { + "title": "Brevo", + "slug": "everest-forms-brevo", + "name": "Everest Forms Brevo", + "image": "extensions-json/sections/images/brevo.webp", + "excerpt": "Connect newsletters, SMTP, marketing automation, and all your CRM tools in one place with Brevo integration (formerly Sendinblue) for Everest Forms.", + "link": "https://docs.everestforms.net/docs/sendinblue/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", + "released_date": "26/09/2022", + "plan": [ + "personal", + "agency", + "themegrill agency" + ], + "setting_url": "admin.php?page=evf-settings&tab=integration§ion=sendinblue", + "demo_video_url": "NRRDY1ag6Sk", + "popular_rank": 26 + }, + { + "title": "Drip", + "slug": "everest-forms-drip", + "name": "Everest Forms Drip", + "image": "extensions-json/sections/images/drip.png", + "excerpt": "With the Everest Forms Drip add-on, you can effortlessly create an unlimited number of newsletter signup forms and connect them to Drip.", + "link": "https://docs.everestforms.net/docs/drip/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", + "released_date": "15/06/2022", + "plan": [ + "personal", + "agency", + "themegrill agency" + ], + "setting_url": "admin.php?page=evf-settings&tab=integration§ion=drip", + "demo_video_url": "ODRxkfX6y9Q", + "popular_rank": 35 + }, + { + "title": "ConvertKit", + "slug": "everest-forms-convertkit", + "name": "Everest Forms ConvertKit", + "image": "extensions-json/sections/images/convertkit.png", + "excerpt": "Allows you to efficiently grow your business by generating more leads with ConvertKit. It also helps increase automated emails for better lead generation.", + "link": "https://docs.everestforms.net/docs/convertkit/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", + "released_date": "10/08/2018", + "plan": [ + "personal", + "agency", + "themegrill agency" + ], + "setting_url": "admin.php?page=evf-settings&tab=integration§ion=convertkit", + "demo_video_url": "GvqPVCK7Ws8", + "popular_rank": 17 + }, + { + "title": "GetResponse", + "slug": "everest-forms-getresponse", + "name": "Everest Forms GetResponse", + "image": "extensions-json/sections/images/getresponse.png", + "excerpt": "Allows your users to subscribe to GetResponse through form submissions. Users filling up the forms can be directly added to your subscribers list in GetResponse.", + "link": "https://docs.everestforms.net/docs/getresponse/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", + "released_date": "26/09/2022", + "plan": [ + "personal", + "agency", + "themegrill agency" + ], + "setting_url": "admin.php?page=evf-settings&tab=integration§ion=getresponse", + "demo_video_url": "Jhq1dOFXV-I" + }, + { + "title": "Salesflare", + "slug": "everest-forms-salesflare", + "name": "Everest Forms- Salesflare", + "image": "extensions-json/sections/images/Salesflare.webp", + "excerpt": "Boost your B2B business efficiency with Salesflare's simple and powerful CRM solution, now fully integrated with Everest Forms.", + "link": "https://docs.everestforms.net/docs/salesflare/?utm_source=dashboard-all-features&utm_medium=card-documentation-link", + "released_date": "20/05/2024", + "plan": [ + "personal", + "agency", + "themegrill agency" + ], + "setting_url": "admin.php?page=evf-settings&tab=integration§ion=salesflare", + "demo_video_url": "" + }, + { + "title": "Constant Contact", + "slug": "everest-forms-constant-contact", + "name": "Everest Forms Constant Contact", + "image": "extensions-json/sections/images/constant-contact.png", + "excerpt": "Everest Forms Constant Contact add-on is a WordPress Constant Contact integration plugin that allows you to easily send Everest Forms entries directly to your Constant Contact account. ", + "link": "https://docs.everestforms.net/docs/constant-contact/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", + "released_date": "31/08/2022", + "plan": [ + "personal", + "agency", + "themegrill agency" + ], + "setting_url": "admin.php?page=evf-settings&tab=integration§ion=constant_contact", + "demo_video_url": "dCeW1GW6-YI", + "popular_rank": 33 + }, + { + "title": "Pipedrive", + "slug": "everest-forms-pipedrive", + "name": "Everest Forms Pipedrive", + "image": "extensions-json/sections/images/pipedrive.png", + "excerpt": "Everest Forms Pipedrive CRM add-on is a WordPress Pipedrive CRM integration plugin that allows you to easily send Everest Forms entries directly to your Pipedrive CRM account. ", + "link": "https://docs.everestforms.net/docs/pipedrive/?utm_source=dashboard-all-feature&utm_medium=card-documentation-link", + "released_date": "15/06/2022", + "plan": [ + "personal", + "agency", + "themegrill agency" + ], + "setting_url": "admin.php?page=evf-settings&tab=integration§ion=pipedrive", + "demo_video_url": "wJPX0EJ2OiI", + "popular_rank": 32 + }, { "title": "Square", "slug": "everest-forms-square", @@ -774,7 +821,7 @@ "themegrill agency" ], "setting_url": "admin.php?page=evf-settings&tab=payment", - "demo_video_url": "42EUj-Dlnr0" + "demo_video_url": "" } ] } diff --git a/assets/extensions-json/sections/images/Salesflare.webp b/assets/extensions-json/sections/images/Salesflare.webp new file mode 100644 index 000000000..01af54175 Binary files /dev/null and b/assets/extensions-json/sections/images/Salesflare.webp differ diff --git a/assets/extensions-json/sections/images/brevo.webp b/assets/extensions-json/sections/images/brevo.webp new file mode 100644 index 000000000..0a2562066 Binary files /dev/null and b/assets/extensions-json/sections/images/brevo.webp differ diff --git a/assets/extensions-json/sections/images/convertkit.png b/assets/extensions-json/sections/images/convertkit.png index 033d75925..ca5edd82b 100644 Binary files a/assets/extensions-json/sections/images/convertkit.png and b/assets/extensions-json/sections/images/convertkit.png differ diff --git a/assets/extensions-json/sections/images/telegram.webp b/assets/extensions-json/sections/images/telegram.webp new file mode 100644 index 000000000..5e90a234b Binary files /dev/null and b/assets/extensions-json/sections/images/telegram.webp differ diff --git a/assets/js/admin/evf-file-uploader.js b/assets/js/admin/evf-file-uploader.js index 0a22bfebe..ba7cbcad2 100644 --- a/assets/js/admin/evf-file-uploader.js +++ b/assets/js/admin/evf-file-uploader.js @@ -11,11 +11,8 @@ jQuery(document).ready(function($){ multiple: false }).open() .on('select', function(e){ - // This will return the selected image from the Media Uploader, the result is an object var uploaded_image = image.state().get('selection').first(); - // We convert uploaded_image to a JSON object to make accessing it easier var image_url = uploaded_image.toJSON().url; - // Let's assign the url value to the input field evf_uploader.attr('src', image_url); if( evf_uploader.hasClass( 'evf-button' ) ) { evf_uploader.prev().removeClass( 'everest-forms-hidden' ); @@ -30,7 +27,7 @@ jQuery(document).ready(function($){ }); //Custom upload and delete image. - $('.evf-custom-image-uploader-button').click(function(e) { + $('.evf-custom-image-uploader-button,.evf-button-for-image-upload').click(function(e) { evf_uploader = $(this); e.preventDefault(); var image = wp.media({ @@ -38,13 +35,10 @@ jQuery(document).ready(function($){ type: [ 'image' ] }, title: evf_uploader.upload_file, - // multiple: true if you want to upload multiple files at once multiple: false }).open() .on('select', function(e){ - // This will return the selected image from the Media Uploader, the result is an object var uploaded_image = image.state().get('selection').first(); - // We convert uploaded_image to a JSON object to make accessing it easier var image_url = uploaded_image.toJSON().url; // Let's assign the url value to the input field evf_uploader.addClass('everest-forms-hidden').removeClass('button-secondary'); @@ -53,8 +47,13 @@ jQuery(document).ready(function($){ evf_uploader.parent().prev().removeClass( 'everest-forms-hidden' ); evf_uploader.parent().prev().find('img.evf-custom-image-uploader').attr('src', image_url); evf_uploader.next().val(image_url); - - } else { + } else if( evf_uploader.hasClass( 'evf-button' ) ){ + evf_uploader.next().val(image_url); + evf_uploader.addClass('everest-form-hidden'); + evf_uploader.css('display' , 'none'); + evf_uploader.prev().css('display' , 'inline-block'); + evf_uploader.prev().find('img').removeClass('everest-forms-hidden').attr('src' , image_url); + } else { evf_uploader.attr('src', image_url); evf_uploader.next().next().val(image_url); } @@ -70,4 +69,12 @@ jQuery(document).ready(function($){ evf_uploader_remove.parent().addClass( 'everest-forms-hidden' ); }); + + $('.evf-image-container').click(function(e){ + evf_image_container_delete = $(this); + e.preventDefault(); + evf_image_container_delete.css('display' , 'none'); + evf_image_container_delete.next().css('display' , 'block'); + evf_image_container_delete.parent().find('input').val(''); + }); }); diff --git a/assets/js/admin/form-builder.js b/assets/js/admin/form-builder.js index 359d53d22..665003fb3 100644 --- a/assets/js/admin/form-builder.js +++ b/assets/js/admin/form-builder.js @@ -201,16 +201,18 @@ }); // Live effect for Rating field icon color option. - $( '.everest-forms-field-option-row-icon_color input.colorpicker' ).wpColorPicker({ - change: function( event ) { - var $this = $( this ), - value = $this.val(), - id = $this.closest( '.everest-forms-field-option-row' ).data( 'field-id' ), - $icons = $( '#everest-forms-field-'+id +' .rating-icon svg' ); - - $icons.css( 'fill', value ); - } - }); + $( document ).ready( function( $ ) { + $( '.everest-forms-field-option-row-icon_color input.colorpicker' ).wpColorPicker({ + change: function( event ) { + var $this = $( this ), + value = $this.val(), + id = $this.closest( '.everest-forms-field-option-row' ).data( 'field-id' ), + $icons = $( '#everest-forms-field-'+id +' .rating-icon svg' ); + + $icons.css( 'fill', value ); + } + }); + }); }, /** @@ -540,6 +542,7 @@ EVFPanelBuilder.init_datepickers(); EVFPanelBuilder.bindBulkOptionActions(); EVFPanelBuilder.bindAkismetInit(); + EVFPanelBuilder.bindFormSubmissionMinWaitingTime(); // Fields Panel. EVFPanelBuilder.bindUIActionsFields(); @@ -3202,6 +3205,32 @@ $(document).find('.everest-forms-akismet-protection-type').hide(); } }, + + /** + * Form Submission minimum waiting time. + * + * @since 3.0.2 + */ + bindFormSubmissionMinWaitingTime:function(){ + var submissionWaitingTimeEnabler = $(document).find('#everest-forms-panel-field-settings-form_submission_min_waiting_time'); + EVFPanelBuilder.formSubmissionMinTimeToggler(submissionWaitingTimeEnabler); + $(document).on('change', '#everest-forms-panel-field-settings-form_submission_min_waiting_time', function(){ + EVFPanelBuilder.formSubmissionMinTimeToggler($(this)); + }) + }, + /** + * Form Submission waiting time Toggler. + * + * @param {object} submissionWaitingTimeEnabler + */ + formSubmissionMinTimeToggler:function(submissionWaitingTimeEnabler){ + if($(submissionWaitingTimeEnabler).is(':checked')){ + $(document).find('.everest-forms-form-submission-minimum-waiting-time').show(); + }else{ + $(document).find('.everest-forms-form-submission-minimum-waiting-time').hide(); + } + }, + bindPrivacyPolicyActions: function() { // Consent message change handler. $( document.body ).on( 'input', '.everest-forms-field-option .evf-privacy-policy-consent-message', function ( e ) { @@ -3875,13 +3904,10 @@ jQuery( function ( $ ) { jQuery(function ($) { $(document).ready(function () { - - /** - * Custom CSS - */ + // Custom CSS const customCssElement = $('#everest-forms-panel-field-settings-evf-custom-css'); - var cssEditor = wp.CodeMirror.fromTextArea(customCssElement[0], - { + if (customCssElement.length && typeof wp.CodeMirror !== 'undefined') { + var cssEditor = wp.CodeMirror.fromTextArea(customCssElement[0], { "indentUnit": 2, "indentWithTabs": true, "inputStyle": "contenteditable", @@ -3914,14 +3940,12 @@ jQuery(function ($) { cssEditor.on('change', function () { customCssElement.html(cssEditor.getValue().replace(/<\s*script/gi, '').replace(/\s+on\w+\s*=/gi, ' ')); }); + } - - /** - * Custom JS - */ + // Custom JS const customJsElement = $('#everest-forms-panel-field-settings-evf-custom-js'); - var jsEditor = wp.CodeMirror.fromTextArea(customJsElement[0], - { + if (customJsElement.length && typeof wp.CodeMirror !== 'undefined') { + var jsEditor = wp.CodeMirror.fromTextArea(customJsElement[0], { "indentUnit": 2, "indentWithTabs": true, "inputStyle": "contenteditable", @@ -3953,6 +3977,7 @@ jQuery(function ($) { jsEditor.on('change', function () { customJsElement.html(jsEditor.getValue().replace(/<\s*script/gi, '').replace(/\s+on\w+\s*=/gi, ' ')); }); + } $('#everest-forms-panel-field-settings-evf-enable-custom-css, #everest-forms-panel-field-settings-evf-enable-custom-js').on('change', e => { showHideEditors(); @@ -3960,9 +3985,7 @@ jQuery(function ($) { showHideEditors(); - /** - * Show/Hide the custom css and js input boxes based on the enabled/disabled state. - */ + // Show/Hide the custom CSS and JS input boxes based on the enabled/disabled state. function showHideEditors() { if ($('#everest-forms-panel-field-settings-evf-enable-custom-css').is(':checked')) { $('#everest-forms-panel-field-settings-evf-custom-css-wrap').show(500); @@ -3977,4 +4000,5 @@ jQuery(function ($) { } } }); + }); diff --git a/assets/js/frontend/everest-forms.js b/assets/js/frontend/everest-forms.js index 5065dd088..991301744 100644 --- a/assets/js/frontend/everest-forms.js +++ b/assets/js/frontend/everest-forms.js @@ -35,7 +35,7 @@ jQuery( function ( $ ) { this.loadPhoneField(); this.loadCountryFlags(); this.ratingInit(); - + this.FormSubmissionWaitingTime(); // Inline validation. this.$everest_form.on( 'input validate change', '.input-text, select, input:checkbox, input:radio', this.validate_field ); @@ -47,6 +47,8 @@ jQuery( function ( $ ) { $(this).removeClass('everest-forms-field-active'); }); + ; + $( document.body ).trigger( 'everest_forms_loaded' ); @@ -597,6 +599,7 @@ jQuery( function ( $ ) { var recaptchaID = $submit.get( 0 ).recaptchaID; var razorpayForms = $form.find( "[data-gateway='razorpay']" ); var stripeForms = $form.find( "[data-gateway*='stripe']" ); + // Process form. if ( processText ) { $submit.text( processText ).prop( 'disabled', true ); @@ -948,7 +951,50 @@ jQuery( function ( $ ) { } return $( '
' + country.text + '' ); }, - + + FormSubmissionWaitingTime: function(){ + $(document).ready(function() { + var form_settings = everest_forms_params.form_settings['settings']; + var wait_form_submission_status = form_settings['form_submission_min_waiting_time']; + + if (wait_form_submission_status === '1') { + $('#evf_submission_start_time').val(Date.now()); + + // Create a MutationObserver to observe changes in the DOM. + var observer = new MutationObserver(function(mutations) { + mutations.forEach(function(mutation) { + if (mutation.addedNodes.length > 0) { + $(mutation.addedNodes).each(function() { + var display = $('#evf_submission_duration'); + if (display.length) { + var duration = parseInt(display.data('duration'), 10); + var timer = duration; + var interval = setInterval(function() { + display.text(timer); + if (--timer < 0) { + clearInterval(interval); + $('#evf_submission_duration').parent().remove(); + } + }, 1000); + + // Once the element is found, disconnect the observer. + observer.disconnect(); + } + }); + } + }); + }); + + // Start observing the target node for configured mutations. + var targetNode = document.body; + var config = { childList: true, subtree: true }; + observer.observe(targetNode, config); + } else { + return ''; + } + }); + }, + getFirstBrowserLanguage: function() { var nav = window.navigator, browserLanguagePropertyKeys = [ 'language', 'browserLanguage', 'systemLanguage', 'userLanguage' ], diff --git a/changelog.txt b/changelog.txt index 52a166e24..eda697f13 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,19 @@ == Changelog == += 3.0.2 - xx-xx-2024 +* Feature - Enable minimum time for form submission. +* Feature - Delete option in Header logo in PDF Submission. +* Enhancement - Custom file name field settings. +* Dev - Square Payment. +* Dev - Transaction Table. +* Dev - Salesflare into Module. +* Dev - ConvertKit Compatibility. +* Dev - GetResponse compatibility. +* Dev - Brevo module compatibility. +* Dev - Drip module compatibility. +* Dev - Telegram integration compatibility. +* Dev - Constant contact and PipeDrive compatibility. + = 3.0.1 - 03-07-2024 * Feature - Import entries in our form using csv file. * Enhancement - Global Setting Premium Sidebar. diff --git a/includes/abstracts/class-evf-form-fields-upload.php b/includes/abstracts/class-evf-form-fields-upload.php index ec238bc11..1088d1d96 100644 --- a/includes/abstracts/class-evf-form-fields-upload.php +++ b/includes/abstracts/class-evf-form-fields-upload.php @@ -158,11 +158,12 @@ public function upload_file() { $this->field_id = $validated_form_field['field_id']; $this->field_data = $this->form_data['form_fields'][ $this->field_id ]; - $error = empty( $_FILES['file']['error'] ) ? UPLOAD_ERR_OK : intval( $_FILES['file']['error'] ); - $path = $_FILES['file']['tmp_name']; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.InputNotValidated - $name = sanitize_file_name( wp_unslash( $_FILES['file']['name'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated - $extension = strtolower( pathinfo( $name, PATHINFO_EXTENSION ) ); - $errors = $this->ajax_validate( $error, $extension, $path, $name ); + $error = empty( $_FILES['file']['error'] ) ? UPLOAD_ERR_OK : intval( $_FILES['file']['error'] ); + $path = $_FILES['file']['tmp_name']; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.ValidatedSanitizedInput.InputNotValidated + $name = sanitize_file_name( wp_unslash( $_FILES['file']['name'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated + $extension = strtolower( pathinfo( $name, PATHINFO_EXTENSION ) ); + $errors = $this->ajax_validate( $error, $extension, $path, $name ); + $name_of_file = isset( $this->field_data['custom_file_name'] ) ? sanitize_file_name( $this->field_data['custom_file_name'] ) . '_' . uniqid( '', true ) . '.' . $extension : sanitize_file_name( wp_unslash( $_FILES['file']['name'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated if ( count( $errors ) ) { wp_send_json_error( implode( ',', $errors ), 400 ); @@ -182,7 +183,7 @@ public function upload_file() { wp_send_json_success( array( 'file' => pathinfo( $tmp, PATHINFO_FILENAME ) . '.' . pathinfo( $tmp, PATHINFO_EXTENSION ), - 'name' => $name, + 'name' => $name_of_file, ) ); } @@ -514,6 +515,39 @@ public function upload_message( $field ) { $this->field_element( 'row', $field, $args ); } + /** + * Get the custom user defined file name + * + * @param array $field Field data. + */ + public function custom_file_name( $field ) { + $lbl = $this->field_element( + 'label', + $field, + array( + 'slug' => 'custom_file_name', + 'value' => esc_html__( 'Custom File Name', 'everest-forms' ), + 'tooltip' => esc_html__( 'Enter text to be displayed as file name.', 'everest-forms' ), + ), + false + ); + $fld = $this->field_element( + 'text', + $field, + array( + 'slug' => 'custom_file_name', + 'value' => ! empty( $field['custom_file_name'] ) ? $field['custom_file_name'] : esc_html( 'mycustompdffile', 'everest-forms' ), + ), + false + ); + $args = array( + 'slug' => 'custom_file_name', + 'content' => $lbl . $fld, + ); + + $this->field_element( 'row', $field, $args ); + } + /** * Limit message field option. * diff --git a/includes/admin/builder/class-evf-builder-page.php b/includes/admin/builder/class-evf-builder-page.php index c871f004f..729711fa8 100644 --- a/includes/admin/builder/class-evf-builder-page.php +++ b/includes/admin/builder/class-evf-builder-page.php @@ -176,6 +176,10 @@ public function add_sidebar_tab( $name, $slug, $icon = '', $container_name = 'se 'id' => 'tz4UKBX9WxM', 'name' => esc_html__( 'SMS Notifications', 'everest-forms' ), ), + 'telegram' => array( + 'id' => '', + 'name' => esc_html__( 'Telegram', 'everest-forms' ), + ), ); } else { diff --git a/includes/admin/builder/class-evf-builder-settings.php b/includes/admin/builder/class-evf-builder-settings.php index bf2764a6c..9212b4cb7 100644 --- a/includes/admin/builder/class-evf-builder-settings.php +++ b/includes/admin/builder/class-evf-builder-settings.php @@ -791,6 +791,44 @@ public function output_content() { echo ''; echo ''; do_action( 'everest_forms_inline_security_settings', $this ); + + /** + * Minimum time for form submission. + * + * @since 3.0.1 + */ + echo '

' . esc_html__( 'Waiting time for form submission', 'everest-forms' ) . '

'; + everest_forms_panel_field( + 'toggle', + 'settings', + 'form_submission_min_waiting_time', + $this->form_data, + esc_html__( 'Enable minimum waiting time for form submission', 'everest-forms' ), + array( + 'default' => '0', + 'tooltip' => esc_html__( 'Prevents the form submission before the specified time', 'everest-forms' ), + ) + ); + + echo '
'; + everest_forms_panel_field( + 'number', + 'settings', + 'form_submission_min_waiting_time_input', + $this->form_data, + esc_html__( 'Form submission minimum waiting time (In seconds)', 'everest-forms' ), + array( + 'default' => '5', + 'tooltip' => esc_html__( 'Enter the minimum time waiting time for form submission.', 'everest-forms' ), + 'min_value' => 0, + ) + ); + + do_action( 'everest_forms_inline_form_submission_min_waiting_time_settings', $this, 'form_submission_min_waiting_time', 'connection_1' ); + + do_action( 'everest_forms_inline_form_submission_min_waiting_time_section_settings', $this, 'form_submission_min_waiting_time_section', 'connection_1' ); + echo '
'; + echo '
'; echo ''; do_action( 'everest_forms_settings_panel_content', $this ); @@ -818,6 +856,7 @@ public function add_custom_css_js_section( $arr, $form_data ) { 'user_registration' => esc_html__( 'User Registration', 'everest-forms' ), 'conversation_forms' => esc_html__( 'Conversation Forms', 'everest-forms' ), 'sms_notifications' => esc_html__( 'SMS Notifications', 'everest-forms' ), + 'telegram' => esc_html__( 'Telegram', 'everest-forms' ), ); $arr = array_merge( $arr, $pro_addons ); } diff --git a/includes/admin/class-evf-admin-preview-confirmation.php b/includes/admin/class-evf-admin-preview-confirmation.php index f279fa819..78af65669 100644 --- a/includes/admin/class-evf-admin-preview-confirmation.php +++ b/includes/admin/class-evf-admin-preview-confirmation.php @@ -83,7 +83,7 @@ public static function preview_confirmation( $form_data, $form_fields, $preview_ $formatted_string = str_replace( '
', '', $formatted_string ); } - $label = $formatted_string['label']; + $label = isset( $formatted_string['label'] ) ? $formatted_string['label'] : ''; if ( in_array( $label, $labels ) && empty( $formatted_string['value'] ) ) { continue; // Skip fields with duplicate labels and empty values diff --git a/includes/admin/class-evf-admin-settings.php b/includes/admin/class-evf-admin-settings.php index cc8d94142..c5f6b690c 100644 --- a/includes/admin/class-evf-admin-settings.php +++ b/includes/admin/class-evf-admin-settings.php @@ -355,16 +355,19 @@ class="" ?>
- -
- <?php echo esc_attr( $alt_text ); ?> - - + +
+
> + + <?php echo esc_attr( $alt_text ); ?> +
+ +
', + '', $option, sanitize_html_class( $panel_id ), sanitize_html_class( $field ), $field_name, esc_attr( $value ), $placeholder, + $min_value, $input_class, $data_attr, $custom_attributes @@ -349,7 +351,7 @@ function everest_forms_panel_field( $option, $panel, $field, $form_data, $label, $output .= sprintf( ' ', esc_attr( $item['tooltip'] ) ); } $output .= ''; - $x ++; + $x++; } break; diff --git a/includes/admin/views/html-admin-page-tools.php b/includes/admin/views/html-admin-page-tools.php index 0514465b7..523341ced 100644 --- a/includes/admin/views/html-admin-page-tools.php +++ b/includes/admin/views/html-admin-page-tools.php @@ -51,6 +51,12 @@ case 'form_migrator': EVF_Admin_Tools::form_migrator(); break; + case 'payment_log': + if ( ! class_exists( 'EVFP_Admin_Tools' ) ) { + return; + } + \EVFP_Admin_Tools::payment_log(); + break; default: if ( array_key_exists( $current_tab, $tabs ) && has_action( 'everest_forms_admin_status_content_' . $current_tab ) ) { do_action( 'everest_forms_admin_status_content_' . $current_tab ); diff --git a/includes/class-evf-form-task.php b/includes/class-evf-form-task.php index ba6674cc8..ceba8efb9 100644 --- a/includes/class-evf-form-task.php +++ b/includes/class-evf-form-task.php @@ -93,7 +93,7 @@ public function listen_task() { $settings = $this->form_data['settings']; $success_message = isset( $settings['successful_form_submission_message'] ) ? $settings['successful_form_submission_message'] : __( 'Thanks for contacting us! We will be in touch with you shortly.', 'everest-forms' ); - // Send 400 Bad Request when there are errors. + // Send 400 Bad Request when there are errors. if ( empty( $this->errors[ $form_id ] ) ) { wp_send_json( array( @@ -350,13 +350,25 @@ public function do_task( $entry ) { } } - $recaptcha_verified = true; - break; + $recaptcha_verified = true; + break; } } } // Initial error check. $errors = apply_filters( 'everest_forms_process_initial_errors', $this->errors, $this->form_data ); + + // Minimum time to submit check. + $min_submit_time = $this->form_submission_waiting_time( $this->errors, $this->form_data ); + if ( isset( $min_submit_time[ $form_id ]['header'] ) && ! empty( $min_submit_time ) ) { + $this->errors[ $form_id ]['header'] = $min_submit_time[ $form_id ]['header']; + $logger->error( + $min_submit_time[ $form_id ]['header'], + array( 'source' => 'Minimum time to submit' ) + ); + return $this->errors; + } + if ( isset( $_POST['__amp_form_verify'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing if ( empty( $errors[ $form_id ] ) ) { wp_send_json( array(), 200 ); @@ -649,7 +661,7 @@ public function do_task( $entry ) { $response_data = apply_filters( 'everest_forms_after_success_ajax_message', $response_data, $this->form_data, $entry ); return $response_data; } elseif ( ( 'same' === $this->form_data['settings']['redirect_to'] && empty( $submission_redirection_process ) ) || ( ! empty( $submission_redirection_process ) && 'same_page' == $submission_redirection_process['redirect_to'] ) ) { - evf_add_notice( $message, 'success' ); + evf_add_notice( $message, 'success' ); } $logger->info( 'Everest Forms After success Message.', @@ -974,7 +986,7 @@ public function entry_email( $fields, $entry, $form_data, $entry_id, $context = $emails->send( trim( $address ), $email['subject'], $email['message'], '', $connection_id ); } - endforeach; + endforeach; if ( isset( $attachment ) ) { do_action( 'everest_forms_remove_attachments_after_send_email', $attachment, $fields, $form_data, 'entry-email', $connection_id, $entry_id ); } @@ -1207,7 +1219,7 @@ public function load_previous_field_value( $properties, $field, $form_data ) { } } } elseif ( ! is_array( $data ) ) { - $properties['inputs']['primary']['attr']['value'] = esc_attr( $data ); + $properties['inputs']['primary']['attr']['value'] = esc_attr( $data ); } return $properties; } @@ -1432,4 +1444,41 @@ public function evf_set_approval_status( $entry_id, $form_data ) { update_option( 'everest_forms_admin_entry_approval_token', $evf_new_token ); } } + + /** + * Prevents form submission before the specified duration. + * + * @param array $errors Form submit errors. + * @param object $form_data An object containing settings for the form. + */ + public function form_submission_waiting_time( $errors, $form_data ) { + $form_submission_waiting_time_enable = isset( $form_data['settings']['form_submission_min_waiting_time'] ) ? $form_data['settings']['form_submission_min_waiting_time'] : ''; + $submission_duration = isset( $form_data['settings']['form_submission_min_waiting_time_input'] ) ? $form_data['settings']['form_submission_min_waiting_time_input'] : ''; + + if ( '1' === $form_submission_waiting_time_enable && 0 <= absint( $submission_duration ) ) { + $evf_submission_start_time = isset( $_POST['evf_submission_start_time'] ) ? sanitize_text_field( wp_unslash( $_POST['evf_submission_start_time'] ) ) : ''; //phpcs:ignore WordPress.Security.NonceVerification + $atts = $form_data['id']; + $submission_time = time() * 1000; + + $waiting_time = absint( $submission_time ) - absint( $evf_submission_start_time ); + $form_id = ! empty( $form_data['id'] ) ? $form_data['id'] : 0; + + if ( absint( $submission_time ) - absint( $evf_submission_start_time ) <= absint( $submission_duration ) * 1000 ) { + $form_submission_err_msg = apply_filters( + 'everest_forms_minimum_waiting_time_form_submission', + sprintf( + "%s %s %s", + esc_html__( 'Please wait', 'everest-forms' ), + $submission_duration, + $submission_duration, + esc_html__( 'seconds, security checkup is being executed.', 'everest-forms' ) + ) + ); + + $errors[ $form_id ]['header'] = $form_submission_err_msg; + } + + return $errors; + } + } } diff --git a/includes/class-evf-frontend-scripts.php b/includes/class-evf-frontend-scripts.php index 49613d237..8395974cc 100644 --- a/includes/class-evf-frontend-scripts.php +++ b/includes/class-evf-frontend-scripts.php @@ -182,14 +182,14 @@ private static function register_scripts() { 'deps' => array( 'jquery' ), 'version' => '1.0.8', ), - 'jquery-intl-tel-input' => array( - 'src' => self::get_asset_url( '/assets/js/intlTelInput/jquery.intlTelInput' . $suffix . '.js ' ), - 'deps' => array( 'jquery' ), + 'jquery-intl-tel-input' => array( + 'src' => self::get_asset_url('/assets/js/intlTelInput/jquery.intlTelInput' . $suffix . '.js'), + 'deps' => array('jquery'), 'version' => '16.0.7', ), - 'jquery-validate' => array( - 'src' => self::get_asset_url( 'assets/js/jquery-validate/jquery.validate' . $suffix . '.js' ), - 'deps' => array( 'jquery' ), + 'jquery-validate' => array( + 'src' => self::get_asset_url('assets/js/jquery-validate/jquery.validate' . $suffix . '.js'), + 'deps' => array('jquery'), 'version' => '1.19.2', ), 'everest-forms' => array( @@ -327,6 +327,7 @@ private static function get_script_data( $handle ) { 'plugin_url' => plugin_dir_url( EVF_PLUGIN_FILE ), 'i18n_messages_phone' => get_option( 'everest_forms_phone_validation', __( 'Please enter a valid phone number.', 'everest-forms' ) ), 'i18n_field_rating_greater_than_max_value_error' => esc_html__( 'Please enter in a value less than 100.', 'everest-forms' ), + 'form_settings' => isset( $_GET['form_id'] ) ? evf()->form->get( absint( $_GET['form_id'] ), array( 'content_only' => true ) ) : 0, ); break; case 'everest-forms-text-limit': diff --git a/includes/evf-core-functions.php b/includes/evf-core-functions.php index 18441df12..c1ca54f6f 100644 --- a/includes/evf-core-functions.php +++ b/includes/evf-core-functions.php @@ -4543,7 +4543,7 @@ function evf_sanitize_builder( $post_data = array() ) { $value = wp_kses_post( $data->value ); } elseif ( 'settings[external_url]' === $data->name ) { $value = esc_url_raw( $data->value ); - } elseif ( preg_match( '/evf_email_message/', $data->name ) ) { + } elseif ( preg_match( '/evf_email_message/', $data->name ) || preg_match( '/telegram_message/', $data->name )) { $value = wp_kses_post( $data->value ); } else { $value = sanitize_text_field( $data->value ); diff --git a/includes/fields/class-evf-field-file-upload.php b/includes/fields/class-evf-field-file-upload.php index e08d53212..96b6ae740 100644 --- a/includes/fields/class-evf-field-file-upload.php +++ b/includes/fields/class-evf-field-file-upload.php @@ -30,6 +30,7 @@ public function __construct() { 'description', 'upload_message', 'limit_message', + 'custom_file_name', 'extensions', 'max_size', 'max_file_number', diff --git a/includes/shortcodes/class-evf-shortcode-form.php b/includes/shortcodes/class-evf-shortcode-form.php index 0232e8bba..c13642993 100644 --- a/includes/shortcodes/class-evf-shortcode-form.php +++ b/includes/shortcodes/class-evf-shortcode-form.php @@ -51,6 +51,9 @@ public static function hooks() { // reCaptcha Language. add_filter( 'everest_forms_frontend_recaptcha_url', array( __CLASS__, 'evf_recaptcha_language' ), 10, 1 ); + + // Enable for submission waiting time. + add_filter( 'everest_forms_display_fields_before', array( 'EVF_Shortcode_Form', 'evf_form_submission_waiting_time' ) ); } /** @@ -1157,9 +1160,7 @@ private static function view( $atts ) { * @return $url */ public static function evf_recaptcha_language( $url ) { - return esc_url_raw( add_query_arg( array( 'hl' => get_option( 'everest_forms_recaptcha_recaptcha_language', 'en-GB' ) ), $url ) ); - } /** @@ -1245,4 +1246,22 @@ function () use ( $custom_css, $form_id ) { } } } + + /** + * Function to enable the minimum form submission waiting time. + * + * @since 3.0.2 + * + * @param array $form_data Form Data. + */ + public static function evf_form_submission_waiting_time( $form_data ) { + $form_submission_waiting_time_enable = isset( $form_data['settings']['form_submission_min_waiting_time'] ) ? $form_data['settings']['form_submission_min_waiting_time'] : ''; + $submission_duration = isset( $form_data['settings']['form_submission_min_waiting_time_input'] ) ? $form_data['settings']['form_submission_min_waiting_time_input'] : ''; + + if ( '1' === $form_submission_waiting_time_enable ) { + echo ""; + } else { + return ''; + } + } } diff --git a/readme.txt b/readme.txt index cc9d307c2..884764e26 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: WPEverest Tags: contact form, custom form, form builder, forms, survey Requires at least: 5.2 -Tested up to: 6.5.5 +Tested up to: 6.6.1 Requires PHP: 7.2 -Stable tag: 3.0.1 +Stable tag: 3.0.2 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -308,6 +308,20 @@ Yes you can! Join in on our [GitHub repository](https://github.com/wpeverest/eve == Changelog == += 3.0.2 - xx-xx-2024 +* Feature - Enable minimum time for form submission. +* Feature - Delete option in Header logo in PDF Submission. +* Enhancement - Custom file name field settings. +* Dev - Square Payment. +* Dev - Transaction Table. +* Dev - Salesflare into Module. +* Dev - ConvertKit Compatibility. +* Dev - GetResponse compatibility. +* Dev - Brevo module compatibility. +* Dev - Drip module compatibility. +* Dev - Telegram integration compatibility. +* Dev - Constant contact and PipeDrive compatibility. + = 3.0.1 - 03-07-2024 * Feature - Import entries in our form using csv file. * Enhancement - Global Setting Premium Sidebar.