diff --git a/README.md b/README.md index 34e0193..57d3d9c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Requires at least:** 5.0 **Requires PHP:** 7.2 **Tested up to:** 6.4 -**Stable tag:** 1.6.20 +**Stable tag:** 1.6.21 **License:** GPLv2 or later **License URI:** https://www.gnu.org/licenses/gpl-2.0.html @@ -237,6 +237,9 @@ weForms is the most beginner friendly and fastest WordPress contact form plugin ## Changelog ## +### Version 1.6.21 ( 01 February, 2024 ) ### +* Fix: Fixes access control issue with login required form submissions. + ### Version 1.6.20 ( 12 December, 2023 ) ### * Fix: Fixes invalid nonce message when exporting entries from entry table. diff --git a/assets/js/spa-app.js b/assets/js/spa-app.js index a4fc4a1..ab448fc 100644 --- a/assets/js/spa-app.js +++ b/assets/js/spa-app.js @@ -1,6 +1,12 @@ 'use strict'; -var _typeof27 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; +var _typeof28 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _typeof27 = typeof Symbol === "function" && _typeof28(Symbol.iterator) === "symbol" ? function (obj) { + return typeof obj === "undefined" ? "undefined" : _typeof28(obj); +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof28(obj); +}; var _typeof26 = typeof Symbol === "function" && _typeof27(Symbol.iterator) === "symbol" ? function (obj) { return typeof obj === "undefined" ? "undefined" : _typeof27(obj); diff --git a/assets/js/spa-app.min.js b/assets/js/spa-app.min.js index dc3db82..5979f2b 100644 --- a/assets/js/spa-app.min.js +++ b/assets/js/spa-app.min.js @@ -1 +1 @@ -"use strict";var _typeof27="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof26="function"==typeof Symbol&&"symbol"===_typeof27(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof27(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof27(t)},_typeof25="function"==typeof Symbol&&"symbol"===_typeof26(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof26(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof26(t)},_typeof24="function"==typeof Symbol&&"symbol"===_typeof25(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof25(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof25(t)},_typeof23="function"==typeof Symbol&&"symbol"===_typeof24(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof24(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof24(t)},_typeof22="function"==typeof Symbol&&"symbol"===_typeof23(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof23(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof23(t)},_typeof21="function"==typeof Symbol&&"symbol"===_typeof22(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof22(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof22(t)},_typeof20="function"==typeof Symbol&&"symbol"===_typeof21(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof21(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof21(t)},_typeof19="function"==typeof Symbol&&"symbol"===_typeof20(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof20(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof20(t)},_typeof18="function"==typeof Symbol&&"symbol"===_typeof19(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof19(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof19(t)},_typeof17="function"==typeof Symbol&&"symbol"===_typeof18(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof18(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof18(t)},_typeof16="function"==typeof Symbol&&"symbol"===_typeof17(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof17(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof17(t)},_typeof15="function"==typeof Symbol&&"symbol"===_typeof16(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof16(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof16(t)},_typeof14="function"==typeof Symbol&&"symbol"===_typeof15(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof15(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof15(t)},_typeof13="function"==typeof Symbol&&"symbol"===_typeof14(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof14(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof14(t)},_typeof12="function"==typeof Symbol&&"symbol"===_typeof13(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof13(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof13(t)},_typeof11="function"==typeof Symbol&&"symbol"===_typeof12(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof12(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof12(t)},_typeof10="function"==typeof Symbol&&"symbol"===_typeof11(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof11(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof11(t)},_typeof9="function"==typeof Symbol&&"symbol"===_typeof10(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof10(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof10(t)},_typeof8="function"==typeof Symbol&&"symbol"===_typeof9(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof9(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof9(t)},_typeof7="function"==typeof Symbol&&"symbol"===_typeof8(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof8(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof8(t)},_typeof6="function"==typeof Symbol&&"symbol"===_typeof7(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof7(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof7(t)},_typeof5="function"==typeof Symbol&&"symbol"===_typeof6(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof6(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof6(t)},_typeof4="function"==typeof Symbol&&"symbol"===_typeof5(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof5(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof5(t)},_typeof3="function"==typeof Symbol&&"symbol"===_typeof4(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof4(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof4(t)},_typeof2="function"==typeof Symbol&&"symbol"===_typeof3(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof3(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof3(t)},_typeof="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(t){return void 0===t?"undefined":_typeof2(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":_typeof2(t)};!function(s){Vue.component("wpuf-table",{template:"#tmpl-wpuf-component-table",mixins:[weForms.mixins.Loading,weForms.mixins.Paginate,weForms.mixins.BulkAction],props:{has_export:String,action:String,delete:String,id:[String,Number],status:[String]},data:function(){return{loading:!1,columns:[],items:[],ajaxAction:this.action,nonce:weForms.nonce,index:"id",bulkDeleteAction:this.delete?this.delete:"weforms_form_entry_trash_bulk"}},created:function(){this.fetchData()},computed:{columnLength:function(){return Object.keys(this.columns).length}},methods:{fetchData:function(){var e=this;this.loading=!0,wp.ajax.send(e.action,{data:{id:e.id,page:e.currentPage,status:e.status,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.columns=t.columns,e.items=t.entries,e.form_title=t.form_title,e.totalItems=t.pagination.total,e.perPage=t.pagination.per_page,e.totalPage=t.pagination.pages,e.$emit("ajaxsuccess",t)},error:function(t){e.loading=!1,alert(t)}})},handleBulkAction:function(){if("-1"!==this.bulkAction){if("delete"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to delete.");confirm("Are you sure to delete the entries?")&&this.deleteBulk()}if("restore"===this.bulkAction){if(!this.checkedItems.length)return void alert("Please select atleast one entry to restore.");this.restoreBulk()}}else alert("Please chose a bulk action to perform")},restore:function(t){var e=this;e.loading=!0,wp.ajax.send("weforms_form_entry_restore",{data:{entry_id:t,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.fetchData()},error:function(t){e.loading=!1,alert(t)}})},deletePermanently:function(t){if(confirm("Are you sure to delete this entry?")){var e=this;e.loading=!0,wp.ajax.send("weforms_form_entry_delete",{data:{entry_id:t,_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.fetchData()},error:function(t){e.loading=!1,alert(t)}})}}},watch:{id:function(){this.fetchData()},status:function(){this.currentPage=1,this.bulkAction=-1,this.fetchData()}}}),weForms.routeComponents.Entries={template:"#tmpl-wpuf-entries",data:function(){return{selected:0,forms:{},form_title:"Loading...",status:"publish",total:0,totalTrash:0}},created:function(){this.get_forms()},methods:{get_forms:function(){var e=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:e.currentPage,posts_per_page:-1,filter:"entries"},success:function(t){Object.keys(t.forms).length?(e.forms=t.forms,e.selected=e.forms[Object.keys(e.forms)[0]].id):e.form_title="No entry found"},error:function(t){alert(t)}})}}},weForms.routeComponents.FormEditComponent={template:"#tmpl-wpuf-form-builder",mixins:wpuf_form_builder_mixins(wpuf_mixins.root),data:function(){return{is_form_saving:!1,is_form_saved:!1,is_form_switcher:!1,post_title_editing:!1,loading:!1,activeTab:"editor",activeSettingsTab:"form",activePaymentTab:"paypal"}},watch:{loading:function(t){t?(NProgress.configure({parent:"#wpadminbar"}),NProgress.start()):NProgress.done()},form_fields:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},notifications:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},integrations:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},settings:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0},payment:{handler:function(){window.weFormsBuilderisDirty=!0},deep:!0}},created:function(){this.set_current_panel("form-fields"),this.fetchForm(),this.$store.commit("panel_add_show_prop"),wpuf_form_builder.event_hub=new Vue},computed:{current_panel:function(){return this.$store.state.current_panel},post:function(){return this.$store.state.post},form_fields_count:function(){return this.$store.state.form_fields.length},form_fields:function(){return this.$store.state.form_fields},notifications:function(){return this.$store.state.notifications},integrations:function(){return this.$store.state.integrations},settings:function(){return this.$store.state.settings},payment:function(){return this.$store.state.payment}},mounted:function(){var t=new window.Clipboard(".form-id");s(".form-id").tooltip();var e=this;this.started=!0,t.on("success",function(t){s(t.trigger).attr("data-original-title","Copied!").tooltip("show"),setTimeout(function(){s(t.trigger).tooltip("hide").attr("data-original-title",e.i18n.copy_shortcode)},1e3),t.clearSelection()}),this.initSharingClipBoard(),setTimeout(function(){window.weFormsBuilderisDirty=!1},500),window.onbeforeunload=function(){if(window.weFormsBuilderisDirty)return e.i18n.unsaved_changes}},methods:{makeActive:function(t){this.activeTab=t},isActiveTab:function(t){return this.activeTab===t},isActiveSettingsTab:function(t){return this.activeSettingsTab===t},makeActiveSettingsTab:function(t){this.activeSettingsTab=t},isActivePaymentTab:function(t){return this.activePaymentTab===t},makeActivePaymentTab:function(t){this.activePaymentTab=t},fetchForm:function(){var e=this;e.loading=!0,wp.ajax.send("weforms_get_form",{data:{form_id:this.$route.params.id,_wpnonce:weForms.nonce},success:function(t){e.$store.commit("set_form_post",t.post),e.$store.commit("set_form_fields",t.form_fields),e.$store.commit("set_form_notification",t.notifications),e.$store.commit("set_form_settings",t.settings),void 0!==t.integrations.length?e.$store.commit("set_form_integrations",{}):e.$store.commit("set_form_integrations",t.integrations)},error:function(t){alert(t)},complete:function(){e.loading=!1}})},set_current_panel:function(t){this.$store.commit("set_current_panel",t)},save_form_builder:function(){var e=this;!_.isFunction(this.validate_form_before_submit)||this.validate_form_before_submit()?(e.is_form_saving=!0,e.set_current_panel("form-fields"),wp.ajax.send("wpuf_form_builder_save_form",{data:{form_data:s("#wpuf-form-builder").weSerialize(),form_fields:JSON.stringify(e.form_fields),notifications:JSON.stringify(e.notifications),settings:JSON.stringify(e.settings),payment:JSON.stringify(e.payment),integrations:JSON.stringify(e.integrations)},success:function(t){t.form_fields&&e.$store.commit("set_form_fields",t.form_fields),e.is_form_saving=!1,e.is_form_saved=!0,setTimeout(function(){window.weFormsBuilderisDirty=!1},500),toastr.success(e.i18n.saved_form_data)},error:function(){e.is_form_saving=!1}})):this.warn({text:this.validation_error_msg})},save_settings:function(){toastr.options.preventDuplicates=!0,this.save_form_builder()},shareForm:function(t,e){var o=this;if("on"===o.settings.sharing_on){var n=t+"?weforms="+btoa(o.getSharingHash()+"_"+Math.floor(Date.now()/1e3)+"_"+e.ID);swal({title:o.i18n.shareYourForm,html:"

"+o.i18n.shareYourFormText+'

',showCloseButton:!0,showCancelButton:!0,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger",confirmButtonColor:"#d54e21",confirmButtonText:o.i18n.disableSharing,cancelButtonText:o.i18n.close,focusCancel:!0}).then(function(){swal({title:o.i18n.areYouSure,html:"

"+o.i18n.areYouSureDesc+"

",type:"info",confirmButtonColor:"#d54e21",showCancelButton:!0,confirmButtonText:o.i18n.disable,cancelButtonText:o.i18n.cancel}).then(function(){o.disableSharing()})})}else swal({title:o.i18n.shareYourForm,html:o.i18n.shareYourFormDesc,type:"info",showCancelButton:!0,confirmButtonText:"Enable",cancelButtonText:"Cancel"}).then(function(){o.enableSharing(t,e)})},enableSharing:function(t,e){this.settings.sharing_on="on",this.save_settings(),this.shareForm(t,e)},disableSharing:function(){this.settings.sharing_on=!1,this.save_settings()},getSharingHash:function(){return this.settings.sharing_hash||(this.settings.sharing_hash=this.makeRandomString(8),this.save_settings()),this.settings.sharing_hash},makeRandomString:function(t){t=t||8;for(var e="",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n=t.limit_number||void 0))},formatTime:function(t){var e=new Date(t);return e.toLocaleString("en-us",{month:"short"})+" "+e.getDate()+", "+e.getFullYear()}}}),weForms.routeComponents.FormPayments={props:{id:[String,Number]},template:"#tmpl-wpuf-form-payments",data:function(){return{form_title:"Loading..."}}},weForms.routeComponents.Home={template:"#tmpl-wpuf-home-page",data:function(){return{showTemplateModal:!1}},methods:{displayModal:function(){this.showTemplateModal=!0},closeModal:function(){this.showTemplateModal=!1}}},weForms.routeComponents.Tools={template:"#tmpl-wpuf-tools",mixins:[weForms.mixins.Tabs,weForms.mixins.Loading],data:function(){return{activeTab:"export",exportType:"all",loading:!1,forms:[],importButton:"Import",currentStatus:0,responseMessage:"",logs:[],ximport:{current:"",title:"",action:"",message:"",type:"updated",refs:{}}}},computed:{isInitial:function(){return 0===this.currentStatus},isSaving:function(){return 1===this.currentStatus},isSuccess:function(){return 2===this.currentStatus},isFailed:function(){return 3===this.currentStatus},hasRefs:function(){return Object.keys(this.ximport.refs).length},hasLogs:function(){return Object.keys(this.logs).length}},created:function(){this.fetchData(),this.fetchLogs()},methods:{fetchLogs:function(e){var o=this;o.startLoading(e),wp.ajax.send("weforms_read_logs",{data:{_wpnonce:weForms.nonce},success:function(t){o.stopLoading(e),o.logs=t},error:function(){o.stopLoading(e),o.logs=[]}})},deleteLogs:function(e){var o=this;confirm("Are you sure to clear the log file?")&&(o.startLoading(e),wp.ajax.send("weforms_delete_logs",{data:{_wpnonce:weForms.nonce},success:function(t){o.logs=[],o.stopLoading(e),o.fetchLogs()},error:function(t){o.logs=[],o.stopLoading(e),o.fetchLogs()}}))},stopLoading:function(t){(t=s(t)).is("button")?t.removeClass("updating-message").find("span").show():t.is("span")&&t.show().parent().removeClass("updating-message")},startLoading:function(t){(t=s(t)).is("button")?t.addClass("updating-message").find("span").hide():t.is("span")&&t.hide().parent().addClass("updating-message")},fetchData:function(){var e=this;this.loading=!0,wp.ajax.send("weforms_form_names",{data:{_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.forms=t},error:function(t){e.loading=!1,alert(t)}})},importForm:function(t,e,o){if(e.length){var n=new FormData,i=this;n.append(t,e[0],e[0].name),n.append("action","weforms_import_form"),n.append("_wpnonce",weForms.nonce),i.currentStatus=1,s.ajax({type:"POST",url:window.ajaxurl,data:n,processData:!1,contentType:!1,success:function(t){i.responseMessage=t.data,t.success?i.currentStatus=2:i.currentStatus=3,s(o.target).val("")},error:function(t){console.log(t),i.currentStatus=3},complete:function(){s(o.target).val("")}})}},importx:function(t,e){var o=s(t),n=this;n.ximport.current=e,o.addClass("updating-message").text(o.data("importing")),wp.ajax.send("weforms_import_xforms_"+e,{data:{_wpnonce:weForms.nonce},success:function(t){n.ximport.title=t.title,n.ximport.message=t.message,n.ximport.action=t.action,n.ximport.refs=t.refs},error:function(t){alert(t.message)},complete:function(){o.removeClass("updating-message").text(o.data("original"))}})},replaceX:function(t,e){var o=s(t),n=this;o.addClass("updating-message"),wp.ajax.send("weforms_import_xreplace_"+n.ximport.current,{data:{type:e,_wpnonce:weForms.nonce},success:function(t){"replace"===o.data("type")&&alert(t)},error:function(t){alert(t)},complete:function(){n.ximport.current="",n.ximport.title=""}})}}},weForms.routeComponents.Transactions={template:"#tmpl-wpuf-transactions",data:function(){return{selected:0,no_transactions:!1,forms:{},form_title:"Loading..."}},created:function(){this.get_forms()},methods:{get_forms:function(){var e=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:e.currentPage,filter:"transactions"},success:function(t){Object.keys(t.forms).length?(e.forms=t.forms,e.selected=e.forms[Object.keys(e.forms)[0]].id):(e.form_title="No transaction found",e.no_transactions=!0)},error:function(t){alert(t)}})}}},weForms.routeComponents.Help={template:"#tmpl-wpuf-weforms-page-help"},weForms.routeComponents.Privacy={template:"#tmpl-wpuf-weforms-page-privacy"},weForms.routeComponents.Premium={template:"#tmpl-wpuf-weforms-premium",data:function(){return{showModal:!1}}},weForms.routeComponents.Settings={template:"#tmpl-wpuf-weforms-settings",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,settings:{email_gateway:"wordpress",credit:!1,permission:"manage_options",gateways:{sendgrid:"",mailgun:"",sparkpost:""},recaptcha:{type:"v2",key:"",secret:""}},activeTab:"general"}},computed:{is_pro:function(){return"true"===weForms.is_pro}},created:function(){this.fetchSettings(),this.getCookie("weforms_settings_active_tab")&&(this.activeTab=this.getCookie("weforms_settings_active_tab"))},methods:{makeActive:function(t){this.activeTab=t},isActiveTab:function(t){return this.activeTab===t},fetchSettings:function(){var t=this;t.loading=!0,wp.ajax.send("weforms_get_settings",{data:{_wpnonce:weForms.nonce},success:function(o){void 0!==o&&(s.each(t.settings,function(t,e){void 0===o[t]&&(o[t]=e)}),t.settings=o)},complete:function(){t.loading=!1}})},saveSettings:function(t){s(t).addClass("updating-message"),wp.ajax.send("weforms_save_settings",{data:{settings:JSON.stringify(this.settings),_wpnonce:weForms.nonce},success:function(t){toastr.options.timeOut=1e3,toastr.success("Settings has been updated"),weForms.settings=t},error:function(t){console.log(t)},complete:function(){s(t).removeClass("updating-message")}})},post:function(t,e,o){o=o||function(){},(e=e||{})._wpnonce=weForms.nonce,wp.ajax.send(t,{data:e,success:function(t){o(t)},error:function(t){console.log(t)},complete:function(){}})}},watch:{activeTab:function(t){this.setCookie("weforms_settings_active_tab",t,"365")}}},Array.prototype.hasOwnProperty("swap")||(Array.prototype.swap=function(t,e){this.splice(e,0,this.splice(t,1)[0])}),Vue.component("datepicker",{template:'',props:["value"],mounted:function(){s(this.$el).datetimepicker({dateFormat:"yy-mm-dd",timeFormat:"HH:mm:ss",onClose:this.onClose})},methods:{onClose:function(t){this.$emit("input",t)}}}),Vue.component("weforms-colorpicker",{template:'',props:["value"],mounted:function(){s(this.$el).wpColorPicker({change:this.onChange})},methods:{onChange:function(t,e){this.$emit("input",e.color.toString())}}});var t=new Vuex.Store({state:{post:{},form_fields:[],panel_sections:wpuf_form_builder.panel_sections,field_settings:wpuf_form_builder.field_settings,notifications:[],settings:{},integrations:{},current_panel:"form-fields",editing_field_id:0},mutations:{set_form_fields:function(t,e){Vue.set(t,"form_fields",e)},set_form_post:function(t,e){Vue.set(t,"post",e)},set_form_notification:function(t,e){Vue.set(t,"notifications",e)},set_form_integrations:function(t,e){Vue.set(t,"integrations",e)},set_form_settings:function(t,e){Vue.set(t,"settings",e)},set_current_panel:function(t,e){"field-options"!==t.current_panel&&"field-options"===e&&t.form_fields.length&&(t.editing_field_id=t.form_fields[0].id),"form-fields"===(t.current_panel=e)&&(t.editing_field_id=0)},panel_add_show_prop:function(o){o.panel_sections.map(function(t,e){t.hasOwnProperty("show")||Vue.set(o.panel_sections[e],"show",!0)})},panel_toggle:function(t,e){t.panel_sections[e].show=!t.panel_sections[e].show},open_field_settings:function(t,e){var o=t.form_fields.filter(function(t){return parseInt(e)===parseInt(t.id)});"field-options"===t.current_panel&&o[0].id===t.editing_field_id||o.length&&(t.editing_field_id=0,t.current_panel="field-options",setTimeout(function(){t.editing_field_id=o[0].id},400))},update_editing_form_field:function(t,e){var o=0;for(o=0;o'},weForms.routeComponents.SingleForm={template:"#tmpl-wpuf-form-editor"},weForms.routeComponents.FormEntriesHome={template:'
'},function t(e){for(var o=0;o"+o.i18n.shareYourFormText+'

',showCloseButton:!0,showCancelButton:!0,confirmButtonClass:"btn btn-success",cancelButtonClass:"btn btn-danger",confirmButtonColor:"#d54e21",confirmButtonText:o.i18n.disableSharing,cancelButtonText:o.i18n.close,focusCancel:!0}).then(function(){swal({title:o.i18n.areYouSure,html:"

"+o.i18n.areYouSureDesc+"

",type:"info",confirmButtonColor:"#d54e21",showCancelButton:!0,confirmButtonText:o.i18n.disable,cancelButtonText:o.i18n.cancel}).then(function(){o.disableSharing()})})}else swal({title:o.i18n.shareYourForm,html:o.i18n.shareYourFormDesc,type:"info",showCancelButton:!0,confirmButtonText:"Enable",cancelButtonText:"Cancel"}).then(function(){o.enableSharing(t,e)})},enableSharing:function(t,e){this.settings.sharing_on="on",this.save_settings(),this.shareForm(t,e)},disableSharing:function(){this.settings.sharing_on=!1,this.save_settings()},getSharingHash:function(){return this.settings.sharing_hash||(this.settings.sharing_hash=this.makeRandomString(8),this.save_settings()),this.settings.sharing_hash},makeRandomString:function(t){t=t||8;for(var e="",o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n=t.limit_number||void 0))},formatTime:function(t){var e=new Date(t);return e.toLocaleString("en-us",{month:"short"})+" "+e.getDate()+", "+e.getFullYear()}}}),weForms.routeComponents.FormPayments={props:{id:[String,Number]},template:"#tmpl-wpuf-form-payments",data:function(){return{form_title:"Loading..."}}},weForms.routeComponents.Home={template:"#tmpl-wpuf-home-page",data:function(){return{showTemplateModal:!1}},methods:{displayModal:function(){this.showTemplateModal=!0},closeModal:function(){this.showTemplateModal=!1}}},weForms.routeComponents.Tools={template:"#tmpl-wpuf-tools",mixins:[weForms.mixins.Tabs,weForms.mixins.Loading],data:function(){return{activeTab:"export",exportType:"all",loading:!1,forms:[],importButton:"Import",currentStatus:0,responseMessage:"",logs:[],ximport:{current:"",title:"",action:"",message:"",type:"updated",refs:{}}}},computed:{isInitial:function(){return 0===this.currentStatus},isSaving:function(){return 1===this.currentStatus},isSuccess:function(){return 2===this.currentStatus},isFailed:function(){return 3===this.currentStatus},hasRefs:function(){return Object.keys(this.ximport.refs).length},hasLogs:function(){return Object.keys(this.logs).length}},created:function(){this.fetchData(),this.fetchLogs()},methods:{fetchLogs:function(e){var o=this;o.startLoading(e),wp.ajax.send("weforms_read_logs",{data:{_wpnonce:weForms.nonce},success:function(t){o.stopLoading(e),o.logs=t},error:function(){o.stopLoading(e),o.logs=[]}})},deleteLogs:function(e){var o=this;confirm("Are you sure to clear the log file?")&&(o.startLoading(e),wp.ajax.send("weforms_delete_logs",{data:{_wpnonce:weForms.nonce},success:function(t){o.logs=[],o.stopLoading(e),o.fetchLogs()},error:function(t){o.logs=[],o.stopLoading(e),o.fetchLogs()}}))},stopLoading:function(t){(t=s(t)).is("button")?t.removeClass("updating-message").find("span").show():t.is("span")&&t.show().parent().removeClass("updating-message")},startLoading:function(t){(t=s(t)).is("button")?t.addClass("updating-message").find("span").hide():t.is("span")&&t.hide().parent().addClass("updating-message")},fetchData:function(){var e=this;this.loading=!0,wp.ajax.send("weforms_form_names",{data:{_wpnonce:weForms.nonce},success:function(t){e.loading=!1,e.forms=t},error:function(t){e.loading=!1,alert(t)}})},importForm:function(t,e,o){if(e.length){var n=new FormData,i=this;n.append(t,e[0],e[0].name),n.append("action","weforms_import_form"),n.append("_wpnonce",weForms.nonce),i.currentStatus=1,s.ajax({type:"POST",url:window.ajaxurl,data:n,processData:!1,contentType:!1,success:function(t){i.responseMessage=t.data,t.success?i.currentStatus=2:i.currentStatus=3,s(o.target).val("")},error:function(t){console.log(t),i.currentStatus=3},complete:function(){s(o.target).val("")}})}},importx:function(t,e){var o=s(t),n=this;n.ximport.current=e,o.addClass("updating-message").text(o.data("importing")),wp.ajax.send("weforms_import_xforms_"+e,{data:{_wpnonce:weForms.nonce},success:function(t){n.ximport.title=t.title,n.ximport.message=t.message,n.ximport.action=t.action,n.ximport.refs=t.refs},error:function(t){alert(t.message)},complete:function(){o.removeClass("updating-message").text(o.data("original"))}})},replaceX:function(t,e){var o=s(t),n=this;o.addClass("updating-message"),wp.ajax.send("weforms_import_xreplace_"+n.ximport.current,{data:{type:e,_wpnonce:weForms.nonce},success:function(t){"replace"===o.data("type")&&alert(t)},error:function(t){alert(t)},complete:function(){n.ximport.current="",n.ximport.title=""}})}}},weForms.routeComponents.Transactions={template:"#tmpl-wpuf-transactions",data:function(){return{selected:0,no_transactions:!1,forms:{},form_title:"Loading..."}},created:function(){this.get_forms()},methods:{get_forms:function(){var e=this;wp.ajax.send("weforms_form_list",{data:{_wpnonce:weForms.nonce,page:e.currentPage,filter:"transactions"},success:function(t){Object.keys(t.forms).length?(e.forms=t.forms,e.selected=e.forms[Object.keys(e.forms)[0]].id):(e.form_title="No transaction found",e.no_transactions=!0)},error:function(t){alert(t)}})}}},weForms.routeComponents.Help={template:"#tmpl-wpuf-weforms-page-help"},weForms.routeComponents.Privacy={template:"#tmpl-wpuf-weforms-page-privacy"},weForms.routeComponents.Premium={template:"#tmpl-wpuf-weforms-premium",data:function(){return{showModal:!1}}},weForms.routeComponents.Settings={template:"#tmpl-wpuf-weforms-settings",mixins:[weForms.mixins.Loading,weForms.mixins.Cookie],data:function(){return{loading:!1,settings:{email_gateway:"wordpress",credit:!1,permission:"manage_options",gateways:{sendgrid:"",mailgun:"",sparkpost:""},recaptcha:{type:"v2",key:"",secret:""}},activeTab:"general"}},computed:{is_pro:function(){return"true"===weForms.is_pro}},created:function(){this.fetchSettings(),this.getCookie("weforms_settings_active_tab")&&(this.activeTab=this.getCookie("weforms_settings_active_tab"))},methods:{makeActive:function(t){this.activeTab=t},isActiveTab:function(t){return this.activeTab===t},fetchSettings:function(){var t=this;t.loading=!0,wp.ajax.send("weforms_get_settings",{data:{_wpnonce:weForms.nonce},success:function(o){void 0!==o&&(s.each(t.settings,function(t,e){void 0===o[t]&&(o[t]=e)}),t.settings=o)},complete:function(){t.loading=!1}})},saveSettings:function(t){s(t).addClass("updating-message"),wp.ajax.send("weforms_save_settings",{data:{settings:JSON.stringify(this.settings),_wpnonce:weForms.nonce},success:function(t){toastr.options.timeOut=1e3,toastr.success("Settings has been updated"),weForms.settings=t},error:function(t){console.log(t)},complete:function(){s(t).removeClass("updating-message")}})},post:function(t,e,o){o=o||function(){},(e=e||{})._wpnonce=weForms.nonce,wp.ajax.send(t,{data:e,success:function(t){o(t)},error:function(t){console.log(t)},complete:function(){}})}},watch:{activeTab:function(t){this.setCookie("weforms_settings_active_tab",t,"365")}}},Array.prototype.hasOwnProperty("swap")||(Array.prototype.swap=function(t,e){this.splice(e,0,this.splice(t,1)[0])}),Vue.component("datepicker",{template:'',props:["value"],mounted:function(){s(this.$el).datetimepicker({dateFormat:"yy-mm-dd",timeFormat:"HH:mm:ss",onClose:this.onClose})},methods:{onClose:function(t){this.$emit("input",t)}}}),Vue.component("weforms-colorpicker",{template:'',props:["value"],mounted:function(){s(this.$el).wpColorPicker({change:this.onChange})},methods:{onChange:function(t,e){this.$emit("input",e.color.toString())}}});var t=new Vuex.Store({state:{post:{},form_fields:[],panel_sections:wpuf_form_builder.panel_sections,field_settings:wpuf_form_builder.field_settings,notifications:[],settings:{},integrations:{},current_panel:"form-fields",editing_field_id:0},mutations:{set_form_fields:function(t,e){Vue.set(t,"form_fields",e)},set_form_post:function(t,e){Vue.set(t,"post",e)},set_form_notification:function(t,e){Vue.set(t,"notifications",e)},set_form_integrations:function(t,e){Vue.set(t,"integrations",e)},set_form_settings:function(t,e){Vue.set(t,"settings",e)},set_current_panel:function(t,e){"field-options"!==t.current_panel&&"field-options"===e&&t.form_fields.length&&(t.editing_field_id=t.form_fields[0].id),"form-fields"===(t.current_panel=e)&&(t.editing_field_id=0)},panel_add_show_prop:function(o){o.panel_sections.map(function(t,e){t.hasOwnProperty("show")||Vue.set(o.panel_sections[e],"show",!0)})},panel_toggle:function(t,e){t.panel_sections[e].show=!t.panel_sections[e].show},open_field_settings:function(t,e){var o=t.form_fields.filter(function(t){return parseInt(e)===parseInt(t.id)});"field-options"===t.current_panel&&o[0].id===t.editing_field_id||o.length&&(t.editing_field_id=0,t.current_panel="field-options",setTimeout(function(){t.editing_field_id=o[0].id},400))},update_editing_form_field:function(t,e){var o=0;for(o=0;o'},weForms.routeComponents.SingleForm={template:"#tmpl-wpuf-form-editor"},weForms.routeComponents.FormEntriesHome={template:'
'},function t(e){for(var o=0;o\n" "Language-Team: LANGUAGE \n" "Language: en\n" @@ -1467,8 +1467,8 @@ msgid "No form fields found!" msgstr "" #: includes/api/class-weforms-forms-controller.php:251 -#: includes/class-ajax.php:862 includes/class-ajax.php:871 -#: includes/class-ajax.php:912 includes/class-ajax.php:927 +#: includes/class-ajax.php:874 includes/class-ajax.php:883 +#: includes/class-ajax.php:924 includes/class-ajax.php:939 msgid "reCAPTCHA validation failed" msgstr "" @@ -1567,22 +1567,22 @@ msgid "form deleted successfully " msgstr "" #: includes/api/class-weforms-forms-controller.php:1235 -#: includes/class-ajax.php:1156 +#: includes/class-ajax.php:1168 msgid "No file found to import." msgstr "" #: includes/api/class-weforms-forms-controller.php:1249 -#: includes/class-ajax.php:1169 +#: includes/class-ajax.php:1181 msgid "The forms have been imported successfully!" msgstr "" #: includes/api/class-weforms-forms-controller.php:1257 -#: includes/class-ajax.php:1171 +#: includes/class-ajax.php:1183 msgid "Something went wrong importing the file." msgstr "" #: includes/api/class-weforms-forms-controller.php:1260 -#: includes/class-ajax.php:1174 +#: includes/class-ajax.php:1186 msgid "Invalid file or file size too big." msgstr "" @@ -1608,7 +1608,7 @@ msgid "data not exist" msgstr "" #: includes/api/class-weforms-log-controller.php:85 -#: includes/class-ajax.php:1215 +#: includes/class-ajax.php:1227 msgid "ago" msgstr "" @@ -1652,11 +1652,15 @@ msgstr "" msgid "No form id provided!" msgstr "" -#: includes/class-ajax.php:740 +#: includes/class-ajax.php:724 +msgid "Login Required for submission." +msgstr "" + +#: includes/class-ajax.php:752 msgid "\"%s\" field requires a unique entry and \"%s\" has already been used." msgstr "" -#: includes/class-ajax.php:751 +#: includes/class-ajax.php:763 msgid "No form field was found." msgstr "" diff --git a/package.json b/package.json index 8843e81..759495e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "weForms", "author": "BoldGrid", - "version": "1.6.20", + "version": "1.6.21", "license": "GPL-2.0", "repository": { "type": "git", diff --git a/readme.txt b/readme.txt index 22d3d06..46d9e7f 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: forms, contact form, contact form plugin, custom form, form builder, form, Requires at least: 5.0 Requires PHP: 7.2 Tested up to: 6.4 -Stable tag: 1.6.20 +Stable tag: 1.6.21 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -237,6 +237,9 @@ weForms is the most beginner friendly and fastest WordPress contact form plugin == Changelog == += Version 1.6.21 ( 01 February, 2024 ) = +* Fix: Fixes access control issue with login required form submissions. + = Version 1.6.20 ( 12 December, 2023 ) = * Fix: Fixes invalid nonce message when exporting entries from entry table. diff --git a/weforms.php b/weforms.php index e2714a5..d578d45 100644 --- a/weforms.php +++ b/weforms.php @@ -5,7 +5,7 @@ * Plugin URI: https://weformspro.com/ * Author: weForms * Author URI: https://weformspro.com/ - * Version: 1.6.20 + * Version: 1.6.21 * License: GPL2 or later * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Text Domain: weforms @@ -55,7 +55,7 @@ final class WeForms { * * @var string */ - public $version = '1.6.20'; + public $version = '1.6.21'; /** * Form field value seperator