Official MailerLite Sign Up Forms - Version 1.4

Version Description

  • Tweak - Show more than 100 groups when creating a custom form
  • Tweak - Renamed some classes to avoid fatal errors from other plugin having the same class names
  • Tweak - Reformatted code to WordPress code style
  • Tweak - Loading custom form javascript after window load for better optimisations
  • Tweak - Switched loading jQuery validate plugin from MailerLite CDN to your local WordPress site
Download this release

Release Info

Developer mailerlite
Plugin Icon 128x128 Official MailerLite Sign Up Forms
Version 1.4
Comparing to
See all releases

Code changes from version 1.3.6 to 1.4

Files changed (38) hide show
  1. assets/css/mailerlite.css +2 -10
  2. assets/image/header.png +0 -0
  3. assets/js/jquery.validate.min.js +4 -0
  4. include/mailerlite-admin-status.php +53 -57
  5. include/mailerlite-admin.php +82 -42
  6. include/mailerlite-form.php +7 -8
  7. include/templates/admin/ajax_groups.php +20 -0
  8. include/templates/admin/create.php +1 -1
  9. include/templates/admin/edit_custom.php +28 -5
  10. include/templates/admin/edit_embedded.php +1 -1
  11. include/templates/admin/main.php +2 -1
  12. include/templates/admin/sidebar.php +3 -1
  13. include/templates/admin/status.php +19 -19
  14. include/templates/forms/custom_form.php +11 -4
  15. languages/mailerlite-fi_FI.mo +0 -0
  16. languages/mailerlite-fi_FI.po +0 -466
  17. languages/mailerlite-it_IT.mo +0 -0
  18. languages/mailerlite-it_IT.po +0 -466
  19. languages/mailerlite-sv_SE.mo +0 -0
  20. languages/mailerlite-sv_SE.po +0 -466
  21. libs/mailerlite_rest/ML_Fields.php +0 -19
  22. libs/mailerlite_rest/ML_Lists.php +0 -40
  23. libs/mailerlite_rest/ML_Webforms.php +0 -26
  24. libs/mailerlite_rest/{ML_Campaigns.php → MailerLite_Forms_Campaigns.php} +4 -4
  25. libs/mailerlite_rest/MailerLite_Forms_Fields.php +19 -0
  26. libs/mailerlite_rest/MailerLite_Forms_Groups.php +47 -0
  27. libs/mailerlite_rest/{ML_Groups.php → MailerLite_Forms_Lists.php} +11 -12
  28. libs/mailerlite_rest/{ML_Settings_Double_OptIn.php → MailerLite_Forms_Settings_Double_OptIn.php} +4 -5
  29. libs/mailerlite_rest/{ML_Subscribers.php → MailerLite_Forms_Subscribers.php} +4 -4
  30. libs/mailerlite_rest/MailerLite_Forms_Webforms.php +29 -0
  31. libs/mailerlite_rest/base/{ML_Rest.php → MailerLite_Forms_Rest.php} +12 -6
  32. libs/mailerlite_rest/base/{ML_Rest_Base.php → MailerLite_Forms_Rest_Base.php} +4 -4
  33. libs/mailerlite_rest/entities/ML_Webform_Entity.php +0 -11
  34. libs/mailerlite_rest/entities/{ML_Field_Entity.php → MailerLite_Forms_Field_Entity.php} +2 -2
  35. libs/mailerlite_rest/entities/{ML_Group_Entity.php → MailerLite_Forms_Group_Entity.php} +2 -2
  36. libs/mailerlite_rest/entities/MailerLite_Forms_Webform_Entity.php +11 -0
  37. mailerlite.php +97 -95
  38. readme.txt +8 -1
assets/css/mailerlite.css CHANGED
@@ -1,10 +1,3 @@
1
- .mailerlite-activate {
2
- /*background: #FFF;
3
- max-width: 750px;
4
- padding: 30px;
5
- border-radius: 5px;*/
6
- }
7
-
8
  .mailerlite-activate .description-block {
9
  float: left;
10
  min-width: 235px;
@@ -26,7 +19,6 @@
26
  font-weight: 600;
27
  border-radius: 2px;
28
  margin: 0 10px 0 0;
29
-
30
  }
31
 
32
  .mailerlite-empty-list {
@@ -43,13 +35,13 @@
43
 
44
  .popup-description {
45
  background: #ffffff;
46
- margin: 10px 0px 10px 0px;
47
  padding: 15px;
48
  border: 1px solid #e1e1e1;
49
  }
50
 
51
  .popup-description p {
52
- margin: 0px 0px 10px 0px;
53
  }
54
 
55
  .mailerlite-table th {
 
 
 
 
 
 
 
1
  .mailerlite-activate .description-block {
2
  float: left;
3
  min-width: 235px;
19
  font-weight: 600;
20
  border-radius: 2px;
21
  margin: 0 10px 0 0;
 
22
  }
23
 
24
  .mailerlite-empty-list {
35
 
36
  .popup-description {
37
  background: #ffffff;
38
+ margin: 10px 0 10px 0;
39
  padding: 15px;
40
  border: 1px solid #e1e1e1;
41
  }
42
 
43
  .popup-description p {
44
+ margin: 0 0 10px 0;
45
  }
46
 
47
  .mailerlite-table th {
assets/image/header.png DELETED
Binary file
assets/js/jquery.validate.min.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /*! jQuery Validation Plugin - v1.13.0 - 7/1/2014
2
+ * http://jqueryvalidation.org/
3
+ * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",b).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?a("input[name='"+b.name+"']:checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id"),i?i.match(new RegExp("\b"+f+"\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})});
include/mailerlite-admin-status.php CHANGED
@@ -1,63 +1,59 @@
1
- <?php defined('ABSPATH') or die("No direct access allowed!");
2
-
3
 
4
  /**
5
  * Class MailerLite_Admin_Status
6
  */
7
- class MailerLite_Admin_Status
8
- {
9
- public static function init()
10
- {
11
- self::init_hooks();
12
- }
13
-
14
- private static function init_hooks()
15
- {
16
- add_action(
17
- 'admin_menu', array(
18
- 'MailerLite_Admin_Status',
19
- 'mailerlite_admin_generate_menu_link',
20
- )
21
- );
22
- }
23
-
24
- /**
25
- * Generates admin menu links
26
- */
27
- public static function mailerlite_admin_generate_menu_link() {
28
- global $menu, $submenu;
29
-
30
-
31
- if(in_array('mailerlite_main', wp_list_pluck($menu,2))) {
32
- return;
33
- }
34
-
35
- add_menu_page(
36
- 'MailerLite',
37
- 'MailerLite',
38
- 'manage_options',
39
- 'mailerlite_status',
40
- null, MAILERLITE_PLUGIN_URL . '/assets/image/icon.png'
41
- );
42
-
43
- add_submenu_page(
44
- 'mailerlite_main',
45
- __( 'Status', 'mailerlite' ),
46
- __( 'Status', 'mailerlite' ),
47
- 'manage_options',
48
- 'mailerlite_status',
49
- array( 'MailerLite_Admin_Status', 'mailerlite_status' )
50
- );
51
- }
52
-
53
- /**
54
- * status page method
55
- */
56
- public static function mailerlite_status() {
57
- global $mailerlite_error;
58
-
59
- $information = mailerlite_status_information();
60
- include( MAILERLITE_PLUGIN_DIR . 'include/templates/admin/status.php' );
61
- }
62
 
63
  }
1
+ <?php defined( 'ABSPATH' ) or die( "No direct access allowed!" );
 
2
 
3
  /**
4
  * Class MailerLite_Admin_Status
5
  */
6
+ class MailerLite_Admin_Status {
7
+ public static function init() {
8
+ self::init_hooks();
9
+ }
10
+
11
+ private static function init_hooks() {
12
+ add_action(
13
+ 'admin_menu', [
14
+ 'MailerLite_Admin_Status',
15
+ 'mailerlite_admin_generate_menu_link',
16
+ ]
17
+ );
18
+ }
19
+
20
+ /**
21
+ * Generates admin menu links
22
+ */
23
+ public static function mailerlite_admin_generate_menu_link() {
24
+ global $menu, $submenu;
25
+
26
+
27
+ if ( in_array( 'mailerlite_main', wp_list_pluck( $menu, 2 ) ) ) {
28
+ return;
29
+ }
30
+
31
+ add_menu_page(
32
+ 'MailerLite',
33
+ 'MailerLite',
34
+ 'manage_options',
35
+ 'mailerlite_status',
36
+ null, MAILERLITE_PLUGIN_URL . '/assets/image/icon.png'
37
+ );
38
+
39
+ add_submenu_page(
40
+ 'mailerlite_main',
41
+ __( 'Status', 'mailerlite' ),
42
+ __( 'Status', 'mailerlite' ),
43
+ 'manage_options',
44
+ 'mailerlite_status',
45
+ [ 'MailerLite_Admin_Status', 'mailerlite_status' ]
46
+ );
47
+ }
48
+
49
+ /**
50
+ * status page method
51
+ */
52
+ public static function mailerlite_status() {
53
+ global $mailerlite_error;
54
+
55
+ $information = mailerlite_status_information();
56
+ include( MAILERLITE_PLUGIN_DIR . 'include/templates/admin/status.php' );
57
+ }
 
 
 
58
 
59
  }
include/mailerlite-admin.php CHANGED
@@ -1,15 +1,17 @@
1
  <?php defined( 'ABSPATH' ) or die( "No direct access allowed!" );
2
 
3
- require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/ML_Groups.php";
4
- require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/ML_Fields.php";
5
- require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/ML_Webforms.php";
6
- require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/ML_Settings_Double_OptIn.php";
7
 
8
  /**
9
  * Class MailerLite_Admin
10
  */
11
  class MailerLite_Admin {
12
 
 
 
13
  private static $initiated = false;
14
  private static $api_key = false;
15
 
@@ -49,6 +51,31 @@ class MailerLite_Admin {
49
  ) {
50
  self::toggle_double_opt_in();
51
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  /**
@@ -68,28 +95,27 @@ class MailerLite_Admin {
68
  ]
69
  );
70
 
71
- add_action( 'admin_enqueue_scripts', ['MailerLite_Admin', 'load_mailerlite_admin_css'] );
72
  }
73
 
74
- public static function load_mailerlite_admin_css($hook)
75
- {
76
- $allowed_hooks = [
77
- 'toplevel_page_mailerlite_main',
78
- 'mailerlite_page_mailerlite_settings',
79
- 'mailerlite_page_mailerlite_status',
80
- ];
81
-
82
- if (!in_array($hook, $allowed_hooks)) {
83
- return;
84
- }
85
-
86
- wp_register_style(
87
- 'mailerlite.css',
88
- MAILERLITE_PLUGIN_URL . '/assets/css/mailerlite.css', [],
89
- MAILERLITE_VERSION
90
- );
91
- wp_enqueue_style( 'mailerlite.css' );
92
- }
93
 
94
  /**
95
  * Generates admin menu links
@@ -102,25 +128,25 @@ class MailerLite_Admin {
102
 
103
  add_submenu_page(
104
  'mailerlite_main',
105
- __( 'Forms', 'mailerlite' ),
106
  __( 'Signup forms', 'mailerlite' ),
107
- 'manage_options',
108
  'mailerlite_main',
109
- [ 'MailerLite_Admin', 'mailerlite_main' ]
110
  );
111
  add_submenu_page(
112
  'mailerlite_main',
113
- __( 'Settings', 'mailerlite' ),
114
  __( 'Settings', 'mailerlite' ),
115
- 'manage_options',
 
116
  'mailerlite_settings',
117
  [ 'MailerLite_Admin', 'mailerlite_settings' ]
118
  );
119
  add_submenu_page(
120
  'mailerlite_main',
121
- __( 'Status', 'mailerlite' ),
122
  __( 'Status', 'mailerlite' ),
123
- 'manage_options',
 
124
  'mailerlite_status',
125
  [ 'MailerLite_Admin_Status', 'mailerlite_status' ]
126
  );
@@ -133,7 +159,7 @@ class MailerLite_Admin {
133
  * Checks if there is API key set
134
  */
135
  private static function mailerlite_api_key_require() {
136
- global $mailerlite_error;
137
 
138
  if ( self::$api_key == false ) {
139
  include( MAILERLITE_PLUGIN_DIR . 'include/templates/admin/api_key.php' );
@@ -167,7 +193,7 @@ class MailerLite_Admin {
167
  }
168
  }
169
 
170
- $ML_Webforms = new ML_Webforms( $api_key );
171
  $webforms = $ML_Webforms->getAllJson();
172
 
173
  if ( ! empty( $webforms->error ) && ! empty( $webforms->error->message ) ) {
@@ -203,8 +229,22 @@ class MailerLite_Admin {
203
  create_function( '', 'return "tinymce";' )
204
  );
205
 
206
- $ML_Groups = new ML_Groups( $api_key );
207
- $groups = $ML_Groups->getAllJson();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
209
  if ( $ML_Groups->hasCurlError() ) {
210
  $mailerlite_error = '<u>' . __( 'Send this error to info@mailerlite.com or our chat',
@@ -212,7 +252,7 @@ class MailerLite_Admin {
212
 
213
  }
214
 
215
- $ML_Fields = new ML_Fields( $api_key );
216
  $fields = $ML_Fields->getAllJson();
217
 
218
  if ( isset( $_POST['save_custom_signup_form'] ) ) {
@@ -287,7 +327,7 @@ class MailerLite_Admin {
287
 
288
  include( MAILERLITE_PLUGIN_DIR . 'include/templates/admin/edit_custom.php' );
289
  } elseif ( $form->type == MailerLite_Form::TYPE_EMBEDDED ) {
290
- $ML_Webforms = new ML_Webforms( $api_key );
291
  $webforms = $ML_Webforms->getAllJson();
292
 
293
  if ( ! empty( $webforms->error ) && ! empty( $webforms->error->message ) ) {
@@ -367,12 +407,12 @@ class MailerLite_Admin {
367
  * Settings page method
368
  */
369
  public static function mailerlite_settings() {
370
- global $mailerlite_error;
371
  self::mailerlite_api_key_require();
372
 
373
  $api_key = self::$api_key;
374
 
375
- $ML_Settings_Double_OptIn = new ML_Settings_Double_OptIn( $api_key );
376
  $double_optin_enabled = $ML_Settings_Double_OptIn->status();
377
  $double_optin_enabled_local = ! get_option( 'mailerlite_double_optin_disabled' );
378
 
@@ -405,7 +445,7 @@ class MailerLite_Admin {
405
  update_option( 'mailerlite_popups_disabled', false );
406
  self::$api_key = $key;
407
  } else {
408
- $ML_Lists = new ML_Groups( $key );
409
  $ML_Lists->getAll();
410
  $response = $ML_Lists->getResponseInfo();
411
 
@@ -447,7 +487,7 @@ class MailerLite_Admin {
447
 
448
  $api_key = self::$api_key;
449
 
450
- $ML_Settings_Double_OptIn = new ML_Settings_Double_OptIn( $api_key );
451
 
452
  if ( get_option( 'mailerlite_double_optin_disabled' ) ) {
453
  $ML_Settings_Double_OptIn->enable();
@@ -513,7 +553,7 @@ class MailerLite_Admin {
513
  $form_name = $_POST['form_name'];
514
  $form_data['lists'] = $_POST['form_lists'];
515
  } else {
516
- $ML_Groups = new ML_Groups( self::$api_key );
517
  $groups = $ML_Groups->getAllJson();
518
 
519
  require_once( ABSPATH . 'wp-admin/admin-header.php' );
1
  <?php defined( 'ABSPATH' ) or die( "No direct access allowed!" );
2
 
3
+ require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/MailerLite_Forms_Groups.php";
4
+ require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/MailerLite_Forms_Fields.php";
5
+ require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/MailerLite_Forms_Webforms.php";
6
+ require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/MailerLite_Forms_Settings_Double_OptIn.php";
7
 
8
  /**
9
  * Class MailerLite_Admin
10
  */
11
  class MailerLite_Admin {
12
 
13
+ const FIRST_GROUP_LOAD = 100;
14
+
15
  private static $initiated = false;
16
  private static $api_key = false;
17
 
51
  ) {
52
  self::toggle_double_opt_in();
53
  }
54
+
55
+ add_action( 'wp_ajax_mailerlite_get_more_groups', 'MailerLite_Admin::ajax_get_more_groups' );
56
+ add_action( 'wp_ajax_nopriv_mailerlite_get_more_groups', 'MailerLite_Admin::ajax_get_more_groups' );
57
+ }
58
+
59
+ function ajax_get_more_groups() {
60
+ global $wpdb;
61
+
62
+ $form = $wpdb->get_row(
63
+ "SELECT * FROM " . $wpdb->base_prefix
64
+ . "mailerlite_forms WHERE id = " . $_POST['form_id']
65
+ );
66
+
67
+ $form->data = unserialize( $form->data );
68
+
69
+ $ML_Groups = new MailerLite_Forms_Groups( self::$api_key );
70
+
71
+ $groups = $ML_Groups->getAllJson( [
72
+ 'limit' => 1000,
73
+ 'offset' => self::FIRST_GROUP_LOAD,
74
+ ] );
75
+
76
+ include( MAILERLITE_PLUGIN_DIR . 'include/templates/admin/ajax_groups.php' );
77
+
78
+ exit;
79
  }
80
 
81
  /**
95
  ]
96
  );
97
 
98
+ add_action( 'admin_enqueue_scripts', [ 'MailerLite_Admin', 'load_mailerlite_admin_css' ] );
99
  }
100
 
101
+ public static function load_mailerlite_admin_css( $hook ) {
102
+ $allowed_hooks = [
103
+ 'toplevel_page_mailerlite_main',
104
+ 'mailerlite_page_mailerlite_settings',
105
+ 'mailerlite_page_mailerlite_status',
106
+ ];
107
+
108
+ if ( ! in_array( $hook, $allowed_hooks ) ) {
109
+ return;
110
+ }
111
+
112
+ wp_register_style(
113
+ 'mailerlite.css',
114
+ MAILERLITE_PLUGIN_URL . '/assets/css/mailerlite.css', [],
115
+ MAILERLITE_VERSION
116
+ );
117
+ wp_enqueue_style( 'mailerlite.css' );
118
+ }
 
119
 
120
  /**
121
  * Generates admin menu links
128
 
129
  add_submenu_page(
130
  'mailerlite_main',
131
+ __( 'Forms', 'mailerlite' ),
132
  __( 'Signup forms', 'mailerlite' ),
133
+ 'manage_options',
134
  'mailerlite_main',
135
+ [ 'MailerLite_Admin', 'mailerlite_main' ]
136
  );
137
  add_submenu_page(
138
  'mailerlite_main',
 
139
  __( 'Settings', 'mailerlite' ),
140
+ __( 'Settings', 'mailerlite' ),
141
+ 'manage_options',
142
  'mailerlite_settings',
143
  [ 'MailerLite_Admin', 'mailerlite_settings' ]
144
  );
145
  add_submenu_page(
146
  'mailerlite_main',
 
147
  __( 'Status', 'mailerlite' ),
148
+ __( 'Status', 'mailerlite' ),
149
+ 'manage_options',
150
  'mailerlite_status',
151
  [ 'MailerLite_Admin_Status', 'mailerlite_status' ]
152
  );
159
  * Checks if there is API key set
160
  */
161
  private static function mailerlite_api_key_require() {
162
+ global $mailerlite_error;
163
 
164
  if ( self::$api_key == false ) {
165
  include( MAILERLITE_PLUGIN_DIR . 'include/templates/admin/api_key.php' );
193
  }
194
  }
195
 
196
+ $ML_Webforms = new MailerLite_Forms_Webforms( $api_key );
197
  $webforms = $ML_Webforms->getAllJson();
198
 
199
  if ( ! empty( $webforms->error ) && ! empty( $webforms->error->message ) ) {
229
  create_function( '', 'return "tinymce";' )
230
  );
231
 
232
+ $ML_Groups = new MailerLite_Forms_Groups( $api_key );
233
+
234
+ $groups = $ML_Groups->getAllJson( [
235
+ 'limit' => self::FIRST_GROUP_LOAD,
236
+ 'offset' => 0,
237
+ ] );
238
+
239
+ $can_load_more_groups = false;
240
+ $can_load_more_groups_check = $ML_Groups->getAllJson( [
241
+ 'limit' => 1,
242
+ 'offset' => self::FIRST_GROUP_LOAD,
243
+ ] );
244
+
245
+ if ( count( $can_load_more_groups_check ) > 0 ) {
246
+ $can_load_more_groups = true;
247
+ }
248
 
249
  if ( $ML_Groups->hasCurlError() ) {
250
  $mailerlite_error = '<u>' . __( 'Send this error to info@mailerlite.com or our chat',
252
 
253
  }
254
 
255
+ $ML_Fields = new MailerLite_Forms_Fields( $api_key );
256
  $fields = $ML_Fields->getAllJson();
257
 
258
  if ( isset( $_POST['save_custom_signup_form'] ) ) {
327
 
328
  include( MAILERLITE_PLUGIN_DIR . 'include/templates/admin/edit_custom.php' );
329
  } elseif ( $form->type == MailerLite_Form::TYPE_EMBEDDED ) {
330
+ $ML_Webforms = new MailerLite_Forms_Webforms( $api_key );
331
  $webforms = $ML_Webforms->getAllJson();
332
 
333
  if ( ! empty( $webforms->error ) && ! empty( $webforms->error->message ) ) {
407
  * Settings page method
408
  */
409
  public static function mailerlite_settings() {
410
+ global $mailerlite_error;
411
  self::mailerlite_api_key_require();
412
 
413
  $api_key = self::$api_key;
414
 
415
+ $ML_Settings_Double_OptIn = new MailerLite_Forms_Settings_Double_OptIn( $api_key );
416
  $double_optin_enabled = $ML_Settings_Double_OptIn->status();
417
  $double_optin_enabled_local = ! get_option( 'mailerlite_double_optin_disabled' );
418
 
445
  update_option( 'mailerlite_popups_disabled', false );
446
  self::$api_key = $key;
447
  } else {
448
+ $ML_Lists = new MailerLite_Forms_Groups( $key );
449
  $ML_Lists->getAll();
450
  $response = $ML_Lists->getResponseInfo();
451
 
487
 
488
  $api_key = self::$api_key;
489
 
490
+ $ML_Settings_Double_OptIn = new MailerLite_Forms_Settings_Double_OptIn( $api_key );
491
 
492
  if ( get_option( 'mailerlite_double_optin_disabled' ) ) {
493
  $ML_Settings_Double_OptIn->enable();
553
  $form_name = $_POST['form_name'];
554
  $form_data['lists'] = $_POST['form_lists'];
555
  } else {
556
+ $ML_Groups = new MailerLite_Forms_Groups( self::$api_key );
557
  $groups = $ML_Groups->getAllJson();
558
 
559
  require_once( ABSPATH . 'wp-admin/admin-header.php' );
include/mailerlite-form.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/ML_Subscribers.php";
4
 
5
  /**
6
  * Class MailerLite_Form
@@ -15,7 +15,6 @@ class MailerLite_Form {
15
  public $form_data;
16
 
17
  /**
18
- *
19
  * Sets form data for class
20
  */
21
  public static function init() {
@@ -68,7 +67,7 @@ class MailerLite_Form {
68
 
69
  $form->data = unserialize( $form->data );
70
 
71
- $ML_Subscribers = new ML_Subscribers( $api_key );
72
 
73
  $form_email = $form_fields['email'];
74
  unset( $form_fields['email'] );
@@ -76,7 +75,7 @@ class MailerLite_Form {
76
  $fields = [];
77
 
78
  foreach ( $form_fields as $field => $value ) {
79
- $fields[$field] = $value;
80
  }
81
 
82
  $subscriber = [
@@ -162,8 +161,8 @@ class MailerLite_Form {
162
  ) {
163
  wp_register_script(
164
  'jquery-validation-plugin',
165
- 'https://static.mailerlite.com/js/jquery.validate.min.js',
166
- [ 'jquery' ]
167
  );
168
  } elseif ( ! wp_script_is( 'jquery-validation-plugin' )
169
  && wp_script_is(
@@ -172,8 +171,8 @@ class MailerLite_Form {
172
  ) {
173
  wp_register_script(
174
  'jquery-validation-plugin',
175
- 'https://static.mailerlite.com/js/jquery.validate.min.js',
176
- [ 'google-hosted-jquery' ]
177
  );
178
  }
179
 
1
  <?php
2
 
3
+ require_once MAILERLITE_PLUGIN_DIR . "libs/mailerlite_rest/MailerLite_Forms_Subscribers.php";
4
 
5
  /**
6
  * Class MailerLite_Form
15
  public $form_data;
16
 
17
  /**
 
18
  * Sets form data for class
19
  */
20
  public static function init() {
67
 
68
  $form->data = unserialize( $form->data );
69
 
70
+ $ML_Subscribers = new MailerLite_Forms_Subscribers( $api_key );
71
 
72
  $form_email = $form_fields['email'];
73
  unset( $form_fields['email'] );
75
  $fields = [];
76
 
77
  foreach ( $form_fields as $field => $value ) {
78
+ $fields[ $field ] = $value;
79
  }
80
 
81
  $subscriber = [
161
  ) {
162
  wp_register_script(
163
  'jquery-validation-plugin',
164
+ MAILERLITE_PLUGIN_URL . '/assets/js/jquery.validate.min.js',
165
+ [ 'jquery' ], false, true
166
  );
167
  } elseif ( ! wp_script_is( 'jquery-validation-plugin' )
168
  && wp_script_is(
171
  ) {
172
  wp_register_script(
173
  'jquery-validation-plugin',
174
+ MAILERLITE_PLUGIN_URL . '/assets/js/jquery.validate.min.js',
175
+ [ 'google-hosted-jquery' ], false, true
176
  );
177
  }
178
 
include/templates/admin/ajax_groups.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <tbody>
2
+ <?php
3
+ /** @var MailerLite_Forms_Group_Entity $group */
4
+ foreach ( $groups as $group ) { ?>
5
+ <tr>
6
+ <th style="width:1%;"><input
7
+ id="list_<?php echo $group->id; ?>"
8
+ type="checkbox"
9
+ class="input_control"
10
+ name="form_lists[]"
11
+ value="<?php echo $group->id; ?>"<?php echo in_array( $group->
12
+ id,
13
+ $form->data['lists'] ) ? ' checked="checked"' : ''; ?>>
14
+ </th>
15
+ <td>
16
+ <label for="list_<?php echo $group->id; ?>"><?php echo $group->name; ?></label>
17
+ </td>
18
+ </tr>
19
+ <?php } ?>
20
+ </tbody>
include/templates/admin/create.php CHANGED
@@ -42,7 +42,7 @@
42
  <?php
43
  $embed_button_webforms = [];
44
 
45
- /** @var ML_Webform_Entity[] $webforms */
46
  if ( count( $webforms ) ) {
47
  foreach ( $webforms as $webform ) {
48
  if ( ! in_array( $webform->type, [ 'embed', 'embedded', 'button' ] ) ) {
42
  <?php
43
  $embed_button_webforms = [];
44
 
45
+ /** @var MailerLite_Forms_Webform_Entity[] $webforms */
46
  if ( count( $webforms ) ) {
47
  foreach ( $webforms as $webform ) {
48
  if ( ! in_array( $webform->type, [ 'embed', 'embedded', 'button' ] ) ) {
include/templates/admin/edit_custom.php CHANGED
@@ -152,7 +152,7 @@
152
  <tbody>
153
 
154
  <?php
155
- /** @var ML_Field_Entity $field */
156
  foreach ( $fields as $field ): ?>
157
  <tr>
158
  <th style="width:1%;"><input type="checkbox"
@@ -168,8 +168,7 @@
168
  name="form_field[<?php echo $field->key; ?>]"
169
  size="30" maxlength="255"
170
  value="<?php echo array_key_exists( $field->key,
171
- $form->data['fields'] ) ? $form->data['fields'][ $field->key ] : $field->title; ?>"<?php echo $field->
172
- key == 'email' || array_key_exists( $field->key,
173
  $form->data['fields'] ) ?
174
  '' : ' disabled="disabled"'; ?>>
175
  </td>
@@ -185,7 +184,7 @@
185
  <table class="form-table">
186
  <tbody>
187
  <?php
188
- /** @var ML_Group_Entity $group */
189
  foreach ( $groups as $group ) { ?>
190
  <tr>
191
  <th style="width:1%;"><input
@@ -204,6 +203,17 @@
204
  <?php } ?>
205
  </tbody>
206
  </table>
 
 
 
 
 
 
 
 
 
 
 
207
  </td>
208
  </tr>
209
  </table>
@@ -277,7 +287,20 @@
277
  }
278
  });
279
  });
280
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
281
  </script>
282
 
283
 
152
  <tbody>
153
 
154
  <?php
155
+ /** @var MailerLite_Forms_Field_Entity $field */
156
  foreach ( $fields as $field ): ?>
157
  <tr>
158
  <th style="width:1%;"><input type="checkbox"
168
  name="form_field[<?php echo $field->key; ?>]"
169
  size="30" maxlength="255"
170
  value="<?php echo array_key_exists( $field->key,
171
+ $form->data['fields'] ) ? $form->data['fields'][ $field->key ] : $field->title; ?>"<?php echo $field->key == 'email' || array_key_exists( $field->key,
 
172
  $form->data['fields'] ) ?
173
  '' : ' disabled="disabled"'; ?>>
174
  </td>
184
  <table class="form-table">
185
  <tbody>
186
  <?php
187
+ /** @var MailerLite_Forms_Group_Entity $group */
188
  foreach ( $groups as $group ) { ?>
189
  <tr>
190
  <th style="width:1%;"><input
203
  <?php } ?>
204
  </tbody>
205
  </table>
206
+ <table id="more-groups" class="form-table" style="display: none;">
207
+
208
+ </table>
209
+ <?php if ( $can_load_more_groups ) {
210
+ ?>
211
+ <button id="load-more-groups" class="button-primary" type="button">
212
+ Load more
213
+ </button>
214
+ <?php
215
+ }
216
+ ?>
217
  </td>
218
  </tr>
219
  </table>
287
  }
288
  });
289
  });
290
+
291
+ $('#load-more-groups').on('click', function () {
292
+ $('#load-more-groups').prop('disabled', true);
293
+
294
+ jQuery.ajax({
295
+ type: "POST",
296
+ url: ajaxurl,
297
+ data: {action: 'mailerlite_get_more_groups', form_id: <?php echo $form->id;?>}
298
+ }).done(function (html) {
299
+ $('#more-groups').show().html(html);
300
+ $('#load-more-groups').hide();
301
+ });
302
+ });
303
+ });
304
  </script>
305
 
306
 
include/templates/admin/edit_embedded.php CHANGED
@@ -34,7 +34,7 @@
34
  <td>
35
  <select id="form_webform_id" name="form_webform_id">
36
  <?php
37
- /** @var ML_Webform_Entity[] $webforms */
38
  foreach ( $webforms as $webform ): ?>
39
  <?php if ( ! in_array( $webform->type, [ 'embed', 'embedded', 'button' ] ) ) {
40
  continue;
34
  <td>
35
  <select id="form_webform_id" name="form_webform_id">
36
  <?php
37
+ /** @var MailerLite_Forms_Webform_Entity $webform */
38
  foreach ( $webforms as $webform ): ?>
39
  <?php if ( ! in_array( $webform->type, [ 'embed', 'embedded', 'button' ] ) ) {
40
  continue;
include/templates/admin/main.php CHANGED
@@ -9,7 +9,8 @@
9
  <strong><?php echo __( 'MailerLite popup script is',
10
  'mailerlite' ) ?> <?php if ( ! get_option( 'mailerlite_popups_disabled',
11
  'mailerlite' ) ) : ?><?php echo __( 'enabled',
12
- 'mailerlite' ) ?><?php else: ?><?php echo __( 'disabled', 'mailerlite' ) ?><?php endif; ?>.</strong>
 
13
  <?php echo __( 'Go to settings if you want to change it', 'mailerlite' ); ?>.
14
  <br/>
15
  <?php if ( ! get_option( 'mailerlite_popups_disabled' ) ): ?>
9
  <strong><?php echo __( 'MailerLite popup script is',
10
  'mailerlite' ) ?> <?php if ( ! get_option( 'mailerlite_popups_disabled',
11
  'mailerlite' ) ) : ?><?php echo __( 'enabled',
12
+ 'mailerlite' ) ?><?php else: ?><?php echo __( 'disabled', 'mailerlite' ) ?><?php endif; ?>
13
+ .</strong>
14
  <?php echo __( 'Go to settings if you want to change it', 'mailerlite' ); ?>.
15
  <br/>
16
  <?php if ( ! get_option( 'mailerlite_popups_disabled' ) ): ?>
include/templates/admin/sidebar.php CHANGED
@@ -7,7 +7,9 @@
7
  <p><?php echo _e( 'Have any questions? Stuck on something or found bug? Feel free to contact us!',
8
  'mailerlite' ); ?></p>
9
 
10
- <p><a href="mailto:info@mailerlite.com?subject=Official MailerLite Sign Up Forms for WordPress&body=<?php echo mailerlite_status_information_for_mailto_link();?>">info@mailerlite.com</a></p>
 
 
11
  </div>
12
  </div>
13
 
7
  <p><?php echo _e( 'Have any questions? Stuck on something or found bug? Feel free to contact us!',
8
  'mailerlite' ); ?></p>
9
 
10
+ <p>
11
+ <a href="mailto:info@mailerlite.com?subject=Official MailerLite Sign Up Forms for WordPress&body=<?php echo mailerlite_status_information_for_mailto_link(); ?>">info@mailerlite.com</a>
12
+ </p>
13
  </div>
14
  </div>
15
 
include/templates/admin/status.php CHANGED
@@ -1,47 +1,47 @@
1
- <?php defined('ABSPATH') or die("No direct access allowed!"); ?>
2
- <?php include_once('header.php'); ?>
3
 
4
  <div class="wrap columns-2 dd-wrap">
5
- <h1><?php echo __('Status', 'mailerlite'); ?></h1>
6
 
7
  <div class="metabox-holder has-right-sidebar">
8
- <?php include("sidebar.php"); ?>
9
  <div id="post-body">
10
  <div id="post-body-content" class="mailerlite-activate">
11
  <table class="form-table">
12
- <?php foreach ($information as $group => $fields) { ?>
13
  <tr>
14
  <th valign="top">
15
  <label for="mailerlite-api-key">
16
- <?php echo $group; ?>
17
  </label>
18
  </th>
19
  <td>
20
  <ul>
21
- <?php foreach ($fields as $name => $value) {
22
- echo sprintf('<li></li><strong>%s:</strong> %s</li>', $name, $value);
23
- } ?>
24
  </ul>
25
  </td>
26
  </tr>
27
- <?php } ?>
28
  <tr>
29
- <th><?php _e('Copy this for support', 'mailerlite'); ?></th>
30
  <td>
31
 
32
  <textarea onclick="this.focus();this.select()" readonly="readonly" style="width: 100%"
33
  rows="10"><?php
34
- foreach ($information as $group => $fields) {
35
 
36
- echo sprintf("# %s\n\n", $group);
37
 
38
- foreach ($fields as $name => $value) {
39
- echo sprintf("%s: %s\n", $name, $value);
40
- }
41
 
42
- echo "\n";
43
- }
44
- ?></textarea>
45
  </td>
46
  </tr>
47
  </table>
1
+ <?php defined( 'ABSPATH' ) or die( "No direct access allowed!" ); ?>
2
+ <?php include_once( 'header.php' ); ?>
3
 
4
  <div class="wrap columns-2 dd-wrap">
5
+ <h1><?php echo __( 'Status', 'mailerlite' ); ?></h1>
6
 
7
  <div class="metabox-holder has-right-sidebar">
8
+ <?php include( "sidebar.php" ); ?>
9
  <div id="post-body">
10
  <div id="post-body-content" class="mailerlite-activate">
11
  <table class="form-table">
12
+ <?php foreach ( $information as $group => $fields ) { ?>
13
  <tr>
14
  <th valign="top">
15
  <label for="mailerlite-api-key">
16
+ <?php echo $group; ?>
17
  </label>
18
  </th>
19
  <td>
20
  <ul>
21
+ <?php foreach ( $fields as $name => $value ) {
22
+ echo sprintf( '<li></li><strong>%s:</strong> %s</li>', $name, $value );
23
+ } ?>
24
  </ul>
25
  </td>
26
  </tr>
27
+ <?php } ?>
28
  <tr>
29
+ <th><?php _e( 'Copy this for support', 'mailerlite' ); ?></th>
30
  <td>
31
 
32
  <textarea onclick="this.focus();this.select()" readonly="readonly" style="width: 100%"
33
  rows="10"><?php
34
+ foreach ( $information as $group => $fields ) {
35
 
36
+ echo sprintf( "# %s\n\n", $group );
37
 
38
+ foreach ( $fields as $name => $value ) {
39
+ echo sprintf( "%s: %s\n", $name, $value );
40
+ }
41
 
42
+ echo "\n";
43
+ }
44
+ ?></textarea>
45
  </td>
46
  </tr>
47
  </table>
include/templates/forms/custom_form.php CHANGED
@@ -43,12 +43,19 @@
43
  </div>
44
 
45
  <?php if ( ! empty( $form_data['language'] ) ): ?>
46
- <script type='text/javascript'
47
- src='<?php echo MAILERLITE_PLUGIN_URL ?>/assets/js/localization/jquery.validate/messages_<?php echo strtolower( $form_data['language'] ) ?>.js'></script>
 
 
 
 
 
 
 
48
  <?php endif; ?>
49
 
50
  <script type="text/javascript">
51
- (function () {
52
  var jQuery = window.jQueryWP || window.jQuery;
53
 
54
  jQuery(document).ready(function () {
@@ -74,5 +81,5 @@
74
  }
75
  });
76
  });
77
- })();
78
  </script>
43
  </div>
44
 
45
  <?php if ( ! empty( $form_data['language'] ) ): ?>
46
+
47
+ <script type='text/javascript'>
48
+ window.addEventListener("load", function (event) {
49
+ var jQuery = window.jQueryWP || window.jQuery;
50
+
51
+ var js = jQuery("<" + "script src='<?php echo MAILERLITE_PLUGIN_URL ?>/assets/js/localization/jquery.validate/messages_<?php echo strtolower( $form_data['language'] ) ?>.js'></" + "script>");
52
+ jQuery("body").append(js);
53
+ });
54
+ </script>
55
  <?php endif; ?>
56
 
57
  <script type="text/javascript">
58
+ window.addEventListener("load", function (event) {
59
  var jQuery = window.jQueryWP || window.jQuery;
60
 
61
  jQuery(document).ready(function () {
81
  }
82
  });
83
  });
84
+ }, false);
85
  </script>
languages/mailerlite-fi_FI.mo DELETED
Binary file
languages/mailerlite-fi_FI.po DELETED
@@ -1,466 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "MIME-Version: 1.0\n"
4
- "Content-Type: text/plain; charset=UTF-8\n"
5
- "Content-Transfer-Encoding: 8bit\n"
6
- "X-Generator: Poedit 1.6.7\n"
7
- "Project-Id-Version: MailerLite wordpress plugin\n"
8
- "Language: fi\n"
9
- "POT-Creation-Date: \n"
10
- "PO-Revision-Date: \n"
11
- "Last-Translator: \n"
12
- "Language-Team: \n"
13
-
14
- #. mailerlite
15
- #: include/mailerlite-admin.php:52
16
- msgid "Forms"
17
- msgstr "Lomakkeet"
18
-
19
- #. mailerlite
20
- #: include/mailerlite-admin.php:52 include/templates/admin/main.php:5
21
- msgid "Signup forms"
22
- msgstr "Tilauslomake"
23
-
24
- #. mailerlite
25
- #: include/mailerlite-admin.php:53
26
- msgid "Settings"
27
- msgstr "Asetukset"
28
-
29
- #. mailerlite
30
- #: include/mailerlite-admin.php:133
31
- msgid "Subscribe for newsletter!"
32
- msgstr "Tilaa uutiskirje"
33
-
34
- #. mailerlite
35
- #: include/mailerlite-admin.php:134 include/mailerlite-admin.php:301
36
- msgid "Newsletter signup"
37
- msgstr "Uutiskirjeen tilaus"
38
-
39
- #. mailerlite
40
- #: include/mailerlite-admin.php:135 include/mailerlite-admin.php:302
41
- msgid "Just simple MailerLite form!"
42
- msgstr "Helppo MailerLite lomake!"
43
-
44
- #. mailerlite
45
- #. default
46
- #: include/mailerlite-admin.php:136 include/mailerlite-admin.php:303
47
- #: include/templates/admin/edit_custom.php:55
48
- msgid "Subscribe"
49
- msgstr "Tilaa"
50
-
51
- #. mailerlite
52
- #: include/mailerlite-admin.php:142 include/mailerlite-admin.php:305
53
- msgid "Email"
54
- msgstr "Sähköposti"
55
-
56
- #. mailerlite
57
- #: include/mailerlite-admin.php:198
58
- msgid "Embedded webform"
59
- msgstr "Upotettu nettilomake"
60
-
61
- #. mailerlite
62
- #: include/mailerlite-admin.php:267
63
- msgid "You not allowed to do that"
64
- msgstr "Sinulla ei ole lupaa tehdä noin"
65
-
66
- #. mailerlite
67
- #: include/mailerlite-admin.php:277
68
- msgid "Wrong MailerLite API key"
69
- msgstr "Väärä MailerLIte API-avain"
70
-
71
- #. mailerlite
72
- #: include/mailerlite-admin.php:299
73
- msgid "New custom signup form"
74
- msgstr "Uusi rekisteröintilomake"
75
-
76
- #. mailerlite
77
- #: include/mailerlite-admin.php:310
78
- msgid "New embedded signup form"
79
- msgstr "Uusi upotettu rekisteröintilomake"
80
-
81
- #. mailerlite
82
- #: include/mailerlite-form.php:75
83
- msgid "Subscriber successfully saved"
84
- msgstr "Tilaaja tallennettu onnistuneesti"
85
-
86
- #. mailerlite
87
- #: include/mailerlite-form.php:79
88
- msgid "Form not found"
89
- msgstr "Lomaketta ei löydy"
90
-
91
- #. mailerlite
92
- #: include/mailerlite-form.php:84
93
- msgid "Wrong data provided"
94
- msgstr "Väärä tieto syötetty"
95
-
96
- #. mailerlite
97
- #: include/mailerlite-widget.php:13
98
- msgid "Mailerlite sign up form"
99
- msgstr "MailerLiten rekisteröintilomake"
100
-
101
- #. mailerlite
102
- #: include/mailerlite-widget.php:14
103
- msgid "MailerLite sign up form Widget"
104
- msgstr "MailerLiten rekisteröintilomake Widgetiltä"
105
-
106
- #. mailerlite
107
- #: include/mailerlite-widget.php:66
108
- msgid "Select form:"
109
- msgstr "Valitse lomake"
110
-
111
- #. mailerlite
112
- #: include/templates/admin/api_key.php:8
113
- msgid ""
114
- "Hi there! You will be able to create awesome signup forms, but first we need "
115
- "your MailerLite API key!"
116
- msgstr ""
117
- "Hei siellä! Voit nyt luoda hienoja tilauslomakkeita, mutta ensin tarvitsemme "
118
- "sinun MailerLite API-avaimesi!"
119
-
120
- #. mailerlite
121
- #: include/templates/admin/api_key.php:17
122
- #: include/templates/admin/settings.php:19
123
- msgid "Enter an API key"
124
- msgstr "Syötä API-avain"
125
-
126
- #. mailerlite
127
- #: include/templates/admin/api_key.php:18
128
- #: include/templates/admin/settings.php:20
129
- msgid "Don't know where to find it?"
130
- msgstr "Etkö tiedä mistä löytäisit sen?"
131
-
132
- #. mailerlite
133
- #: include/templates/admin/api_key.php:18
134
- #: include/templates/admin/settings.php:20
135
- msgid "Check it here!"
136
- msgstr "Katso tästä!"
137
-
138
- #. mailerlite
139
- #: include/templates/admin/api_key.php:23
140
- #: include/templates/admin/settings.php:25
141
- msgid "Save this key"
142
- msgstr "Tallenna tämä avain"
143
-
144
- #. mailerlite
145
- #: include/templates/admin/api_key.php:29
146
- #: include/templates/admin/settings.php:31
147
- msgid "Don't have an account?"
148
- msgstr "Eikö sinulla ole tiliä?"
149
-
150
- #. mailerlite
151
- #: include/templates/admin/api_key.php:30
152
- #: include/templates/admin/settings.php:32
153
- msgid "Register!"
154
- msgstr "Rekisteröidy!"
155
-
156
- #. mailerlite
157
- #: include/templates/admin/create.php:5
158
- msgid "Create new signup form"
159
- msgstr "Luo uusi rekisteröintilomake"
160
-
161
- #. mailerlite
162
- #: include/templates/admin/create.php:11
163
- msgid "Form type"
164
- msgstr "Lomaketyyppi"
165
-
166
- #. mailerlite
167
- #: include/templates/admin/create.php:17
168
- msgid "Custom signup form"
169
- msgstr "Mukautettu tilauslomake"
170
-
171
- #. mailerlite
172
- #: include/templates/admin/create.php:23
173
- msgid "Webforms created using MailerLite"
174
- msgstr "MailerLitellä tehtyjä tilauslomakkeita"
175
-
176
- #. mailerlite
177
- #: include/templates/admin/create.php:28
178
- msgid "Create form"
179
- msgstr "Luo lomake"
180
-
181
- #. mailerlite
182
- #: include/templates/admin/create.php:29
183
- #: include/templates/admin/edit_custom.php:96
184
- #: include/templates/admin/edit_embedded.php:42
185
- msgid "Back"
186
- msgstr "Takaisin"
187
-
188
- #. mailerlite
189
- #: include/templates/admin/edit_custom.php:5
190
- msgid "Edit custom signup form"
191
- msgstr "Editoi mukautettua lomaketta"
192
-
193
- #. mailerlite
194
- #: include/templates/admin/edit_custom.php:7
195
- #: include/templates/admin/edit_embedded.php:7
196
- msgid "Form saved."
197
- msgstr "Lomake tallennettu"
198
-
199
- #. mailerlite
200
- #: include/templates/admin/edit_custom.php:7
201
- #: include/templates/admin/edit_embedded.php:7
202
- msgid "Back to forms list"
203
- msgstr "Takaisin lomakelistaan"
204
-
205
- #. mailerlite
206
- #: include/templates/admin/edit_custom.php:15
207
- msgid "Main information"
208
- msgstr "Tärkeää tietoa"
209
-
210
- #. default
211
- #: include/templates/admin/edit_custom.php:20
212
- msgid "Form name"
213
- msgstr "Lomakkeen nimi"
214
-
215
- #. mailerlite
216
- #: include/templates/admin/edit_custom.php:21
217
- #: include/templates/admin/edit_embedded.php:21
218
- msgid "Tip:"
219
- msgstr "Vinkki:"
220
-
221
- #. mailerlite
222
- #: include/templates/admin/edit_custom.php:21
223
- #: include/templates/admin/edit_embedded.php:21
224
- msgid "This title won't be displayed in public!"
225
- msgstr "Tätä nimeä ei näytetä julkisesti!"
226
-
227
- #. mailerlite
228
- #: include/templates/admin/edit_custom.php:28
229
- msgid "Form details"
230
- msgstr "Lomakkeen tiedot"
231
-
232
- #. mailerlite
233
- #: include/templates/admin/edit_custom.php:33
234
- #: include/templates/admin/edit_embedded.php:20
235
- msgid "Form title"
236
- msgstr "Lomakkeen otsikko"
237
-
238
- #. mailerlite
239
- #. default
240
- #: include/templates/admin/edit_custom.php:34
241
- #: include/templates/admin/edit_custom.php:55
242
- msgid "Example:"
243
- msgstr "Esimerkki:"
244
-
245
- #. mailerlite
246
- #: include/templates/admin/edit_custom.php:34
247
- msgid "Newsletter signup!"
248
- msgstr "Uutiskirjeen tilaus!"
249
-
250
- #. mailerlite
251
- #: include/templates/admin/edit_custom.php:37
252
- msgid "Form description"
253
- msgstr "Lomakkeen kuvaus"
254
-
255
- #. mailerlite
256
- #: include/templates/admin/edit_custom.php:54
257
- msgid "Button title"
258
- msgstr "Painikkeen otsikko"
259
-
260
- #. mailerlite
261
- #: include/templates/admin/edit_custom.php:62
262
- msgid "Form fields and lists"
263
- msgstr "Lomakkeen kentät ja listat"
264
-
265
- #. mailerlite
266
- #: include/templates/admin/edit_custom.php:67
267
- msgid "Fields"
268
- msgstr "Kentät"
269
-
270
- #. mailerlite
271
- #: include/templates/admin/edit_custom.php:80
272
- msgid "Lists"
273
- msgstr "Listat"
274
-
275
- #. mailerlite
276
- #: include/templates/admin/edit_custom.php:95
277
- #: include/templates/admin/edit_embedded.php:41
278
- msgid "Save form"
279
- msgstr "Tallenna lomake"
280
-
281
- #. mailerlite
282
- #: include/templates/admin/edit_embedded.php:5
283
- msgid "Edit webform"
284
- msgstr "Editoi nettilomaketta"
285
-
286
- #. mailerlite
287
- #: include/templates/admin/edit_embedded.php:15
288
- msgid "Webform details"
289
- msgstr "Nettilomakkeen yksityiskohdat"
290
-
291
- #. mailerlite
292
- #: include/templates/admin/edit_embedded.php:24
293
- msgid "Webform"
294
- msgstr "Nettilomake"
295
-
296
- #. mailerlite
297
- #: include/templates/admin/main.php:5
298
- msgid "Add New"
299
- msgstr "Lisää uusi"
300
-
301
- #. mailerlite
302
- #: include/templates/admin/main.php:14
303
- msgid "ID"
304
- msgstr "ID"
305
-
306
- #. mailerlite
307
- #: include/templates/admin/main.php:15
308
- msgid "Name"
309
- msgstr "Nimi"
310
-
311
- #. mailerlite
312
- #: include/templates/admin/main.php:16
313
- msgid "Type"
314
- msgstr "Tyyppi"
315
-
316
- #. mailerlite
317
- #: include/templates/admin/main.php:17
318
- msgid "Date"
319
- msgstr "Päivä"
320
-
321
- #. mailerlite
322
- #: include/templates/admin/main.php:29
323
- msgid "Edit"
324
- msgstr "Editoi"
325
-
326
- #. mailerlite
327
- #: include/templates/admin/main.php:30
328
- msgid "Are you sure you want to delete this form?"
329
- msgstr "Haluatko varmasti poistaa tämän lomakkeen?"
330
-
331
- #. mailerlite
332
- #: include/templates/admin/main.php:30
333
- msgid "Delete"
334
- msgstr "Poista"
335
-
336
- #. mailerlite
337
- #: include/templates/admin/main.php:33
338
- msgid "Custom form"
339
- msgstr "Mukautettu lomake"
340
-
341
- #. mailerlite
342
- #: include/templates/admin/main.php:33
343
- msgid "Embedded form"
344
- msgstr "Upotettu lomake"
345
-
346
- #. mailerlite
347
- #: include/templates/admin/main.php:42
348
- msgid "There is no signup forms created yet!"
349
- msgstr "Tilauslomake puuttuu vielä!"
350
-
351
- #. mailerlite
352
- #: include/templates/admin/main.php:43
353
- msgid "Add signup form"
354
- msgstr "Luo tilauslomake"
355
-
356
- #. mailerlite
357
- #: include/templates/admin/settings.php:5
358
- msgid "Plugin settings"
359
- msgstr "Liitännäisen asetukset"
360
-
361
- #. mailerlite
362
- #: include/templates/admin/settings.php:10
363
- msgid "Here you are able to change your API key!"
364
- msgstr "Tässä voit muuttaa API-avaintasi!"
365
-
366
- #. mailerlite
367
- #: include/templates/admin/sidebar.php:4
368
- msgid "Need help?"
369
- msgstr "Tarvitsetko apua?"
370
-
371
- #. mailerlite
372
- #: include/templates/admin/sidebar.php:6
373
- msgid ""
374
- "Have any questions? Stuck on something or found bug? Feel free to contact us!"
375
- msgstr ""
376
- "Onko sinulla kysymyksiä? Oletko jumissa tai löysitkö bugin? Ole hyvä ja ole "
377
- "meihin yhteydessä!"
378
-
379
- #. mailerlite
380
- #: include/templates/common/tiny_mce.php:13
381
- msgid ""
382
- "Select form from list below, and hit \"Add Shortcode\" to add the shortcode "
383
- "to your post!"
384
- msgstr ""
385
- "Valitse lomake allaolevasta listasta ja klikkaa \"Lisää Shortkoodi\" "
386
- "lisätäksesi lyhenteen artikkeliisi."
387
-
388
- #. mailerlite
389
- #: include/templates/common/tiny_mce.php:24
390
- msgid "Add Shortcode"
391
- msgstr "Lisää Shortkoodi"
392
-
393
- #. mailerlite
394
- #: include/templates/forms/custom_form.php:19
395
- msgid "Please wait..."
396
- msgstr "Ole hyvä ja odota..."
397
-
398
- #. mailerlite
399
- #: include/templates/forms/custom_form.php:27
400
- msgid "Thank you for signup!"
401
- msgstr "Kiitos tilauksestasi!"
402
-
403
- # @ mailerlite
404
- #: include/mailerlite_admin.php:395
405
- msgid "Send this error to info@mailerlite.com or our chat"
406
- msgstr "Lähetä tämä virhe info@mailerlite.com tai meidän chat"
407
-
408
- # @ mailerlite
409
- #: include/templates/admin/edit_custom.php:20
410
- msgid "Please wait message"
411
- msgstr "\"Ole hyvä ja odota\" viesti"
412
-
413
- # @ mailerlite
414
- #: include/mailerlite/admin.php:150
415
- msgid "Error happened"
416
- msgstr "Virhe tapahtui"
417
-
418
- # @ mailerlite
419
- #: include/mailerlite/admin.php:46
420
- msgid "Explanation about forms"
421
- msgstr "Huomaa, että voit lisätä <b>Embed</b> tai <b>Button</b> tyyppi muodostaa vain. <b>Popup</b> muodot näkyvät automaattisesti Wordpress sivuston. Voit sammuttaa <b>Popup</b> lomakkeet <a href=\"admin.php?page=mailerlite_settings\">Asetuksissa</a>. Et voi sisällyttää sivua <b>Landing</b> sivu sinun Wordpress sivullesi."
422
-
423
- # @ mailerlite
424
- #: include/templates/admin/main.php:8
425
- msgid "MailerLite popup script is"
426
- msgstr "MailerLite seurantakoodi on"
427
-
428
- # @ mailerlite
429
- #: include/templates/admin/main.php:8
430
- msgid "enabled"
431
- msgstr "käytössä"
432
-
433
- # @ mailerlite
434
- #: include/templates/admin/main.php:8
435
- msgid "disabled"
436
- msgstr "vammaiset"
437
-
438
- # @ mailerlite
439
- #: include/templates/admin/settings.php:46
440
- msgid "Enable"
441
- msgstr "Mahdollistaa"
442
-
443
- # @ mailerlite
444
- #: include/templates/admin/settings.php:46
445
- msgid "Disable"
446
- msgstr "Vammauttaa"
447
-
448
- # @ mailerlite
449
- #: include/templates/admin/main.php:9
450
- msgid "Go to settings if you want to change it"
451
- msgstr "Siirry <a href=\"admin.php?page=mailerlite_settings\">asetuksiin</a>, jos haluat muuttaa sen"
452
-
453
- # @ mailerlite
454
- #: include/templates/admin/main.php:12
455
- msgid "Your popup forms will be displayed automatically while the popup script is enabled"
456
- msgstr "Popup lomakkeet näkyvät automaattisesti, kun seurantakoodi on käytössä"
457
-
458
- # @ mailerlite
459
- #: include/templates/admin/main.php:14
460
- msgid "Your popup forms wont be displayed while the popup script is disabled"
461
- msgstr "Popup lomakkeet eivät tule näkyviin, kun seurantakoodi on poistettu käytöstä"
462
-
463
- # @ mailerlite
464
- #: include/templates/admin/settings.php:34
465
- msgid "Popup forms script"
466
- msgstr "Popup-lomakkeiden seurantakoodi"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/mailerlite-it_IT.mo DELETED
Binary file
languages/mailerlite-it_IT.po DELETED
@@ -1,466 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "MIME-Version: 1.0\n"
4
- "Content-Type: text/plain; charset=UTF-8\n"
5
- "Content-Transfer-Encoding: 8bit\n"
6
- "X-Generator: Poedit 1.6.7\n"
7
- "Project-Id-Version: MailerLite wordpress plugin\n"
8
- "Language: it\n"
9
- "POT-Creation-Date: \n"
10
- "PO-Revision-Date: \n"
11
- "Last-Translator: \n"
12
- "Language-Team: \n"
13
-
14
- #. mailerlite
15
- #: include/mailerlite-admin.php:52
16
- msgid "Forms"
17
- msgstr "Moduli"
18
-
19
- #. mailerlite
20
- #: include/mailerlite-admin.php:52 include/templates/admin/main.php:5
21
- msgid "Signup forms"
22
- msgstr "Form d'iscrizione"
23
-
24
- #. mailerlite
25
- #: include/mailerlite-admin.php:53
26
- msgid "Settings"
27
- msgstr "Impostazioni"
28
-
29
- #. mailerlite
30
- #: include/mailerlite-admin.php:133
31
- msgid "Subscribe for newsletter!"
32
- msgstr "Iscriviti alla newsletter!"
33
-
34
- #. mailerlite
35
- #: include/mailerlite-admin.php:134 include/mailerlite-admin.php:301
36
- msgid "Newsletter signup"
37
- msgstr "Iscrizione alla newsletter"
38
-
39
- #. mailerlite
40
- #: include/mailerlite-admin.php:135 include/mailerlite-admin.php:302
41
- msgid "Just simple MailerLite form!"
42
- msgstr "Un semplice form MailerLite!"
43
-
44
- #. mailerlite
45
- #. default
46
- #: include/mailerlite-admin.php:136 include/mailerlite-admin.php:303
47
- #: include/templates/admin/edit_custom.php:55
48
- msgid "Subscribe"
49
- msgstr "Iscriviti"
50
-
51
- #. mailerlite
52
- #: include/mailerlite-admin.php:142 include/mailerlite-admin.php:305
53
- msgid "Email"
54
- msgstr "Email"
55
-
56
- #. mailerlite
57
- #: include/mailerlite-admin.php:198
58
- msgid "Embedded webform"
59
- msgstr "Form incorporato"
60
-
61
- #. mailerlite
62
- #: include/mailerlite-admin.php:267
63
- msgid "You not allowed to do that"
64
- msgstr "Non puoi fare questo"
65
-
66
- #. mailerlite
67
- #: include/mailerlite-admin.php:277
68
- msgid "Wrong MailerLite API key"
69
- msgstr "API key di MailerLite errata"
70
-
71
- #. mailerlite
72
- #: include/mailerlite-admin.php:299
73
- msgid "New custom signup form"
74
- msgstr "Nuovo form d'iscrizione personalizzato"
75
-
76
- #. mailerlite
77
- #: include/mailerlite-admin.php:310
78
- msgid "New embedded signup form"
79
- msgstr "Nuovo form d'iscrizione incorporato"
80
-
81
- #. mailerlite
82
- #: include/mailerlite-form.php:75
83
- msgid "Subscriber successfully saved"
84
- msgstr "Il destinatario è stato salvato"
85
-
86
- #. mailerlite
87
- #: include/mailerlite-form.php:79
88
- msgid "Form not found"
89
- msgstr "Form non trovato"
90
-
91
- #. mailerlite
92
- #: include/mailerlite-form.php:84
93
- msgid "Wrong data provided"
94
- msgstr "Dati forniti sono errati"
95
-
96
- #. mailerlite
97
- #: include/mailerlite-widget.php:13
98
- msgid "Mailerlite sign up form"
99
- msgstr "Form d'iscrizione MailerLite"
100
-
101
- #. mailerlite
102
- #: include/mailerlite-widget.php:14
103
- msgid "MailerLite sign up form Widget"
104
- msgstr "Widget per form d'iscrizione MailerLite"
105
-
106
- #. mailerlite
107
- #: include/mailerlite-widget.php:66
108
- msgid "Select form:"
109
- msgstr "Scegli il form:"
110
-
111
- #. mailerlite
112
- #: include/templates/admin/api_key.php:8
113
- msgid ""
114
- "Hi there! You will be able to create awesome signup forms, but first we need "
115
- "your MailerLite API key!"
116
- msgstr ""
117
- "Ciao! Potrai creare form d'iscrizione fantastici, ma prim devi fornire la "
118
- "tua API key MailerLite!"
119
-
120
- #. mailerlite
121
- #: include/templates/admin/api_key.php:17
122
- #: include/templates/admin/settings.php:19
123
- msgid "Enter an API key"
124
- msgstr "Inserisci API key"
125
-
126
- #. mailerlite
127
- #: include/templates/admin/api_key.php:18
128
- #: include/templates/admin/settings.php:20
129
- msgid "Don't know where to find it?"
130
- msgstr "Non sai dove si trova?"
131
-
132
- #. mailerlite
133
- #: include/templates/admin/api_key.php:18
134
- #: include/templates/admin/settings.php:20
135
- msgid "Check it here!"
136
- msgstr "Clicca qui!"
137
-
138
- #. mailerlite
139
- #: include/templates/admin/api_key.php:23
140
- #: include/templates/admin/settings.php:25
141
- msgid "Save this key"
142
- msgstr "Salva questa key"
143
-
144
- #. mailerlite
145
- #: include/templates/admin/api_key.php:29
146
- #: include/templates/admin/settings.php:31
147
- msgid "Don't have an account?"
148
- msgstr "Non hai un account?"
149
-
150
- #. mailerlite
151
- #: include/templates/admin/api_key.php:30
152
- #: include/templates/admin/settings.php:32
153
- msgid "Register!"
154
- msgstr "Registrati!"
155
-
156
- #. mailerlite
157
- #: include/templates/admin/create.php:5
158
- msgid "Create new signup form"
159
- msgstr "Crea un nuovo form d'iscrizione"
160
-
161
- #. mailerlite
162
- #: include/templates/admin/create.php:11
163
- msgid "Form type"
164
- msgstr "Tipo di form"
165
-
166
- #. mailerlite
167
- #: include/templates/admin/create.php:17
168
- msgid "Custom signup form"
169
- msgstr "Forma d'iscrizione"
170
-
171
- #. mailerlite
172
- #: include/templates/admin/create.php:23
173
- msgid "Webforms created using MailerLite"
174
- msgstr "Form d'iscrizione creati usando MailerLite"
175
-
176
- #. mailerlite
177
- #: include/templates/admin/create.php:28
178
- msgid "Create form"
179
- msgstr "Crea un form"
180
-
181
- #. mailerlite
182
- #: include/templates/admin/create.php:29
183
- #: include/templates/admin/edit_custom.php:96
184
- #: include/templates/admin/edit_embedded.php:42
185
- msgid "Back"
186
- msgstr "Indietro"
187
-
188
- #. mailerlite
189
- #: include/templates/admin/edit_custom.php:5
190
- msgid "Edit custom signup form"
191
- msgstr "Modifica form d'iscrizione personalizzati"
192
-
193
- #. mailerlite
194
- #: include/templates/admin/edit_custom.php:7
195
- #: include/templates/admin/edit_embedded.php:7
196
- msgid "Form saved."
197
- msgstr "Form salvato."
198
-
199
- #. mailerlite
200
- #: include/templates/admin/edit_custom.php:7
201
- #: include/templates/admin/edit_embedded.php:7
202
- msgid "Back to forms list"
203
- msgstr "Torna alla lista dei moduli"
204
-
205
- #. mailerlite
206
- #: include/templates/admin/edit_custom.php:15
207
- msgid "Main information"
208
- msgstr "Informazioni principali"
209
-
210
- #. default
211
- #: include/templates/admin/edit_custom.php:20
212
- msgid "Form name"
213
- msgstr "Nome del form"
214
-
215
- #. mailerlite
216
- #: include/templates/admin/edit_custom.php:21
217
- #: include/templates/admin/edit_embedded.php:21
218
- msgid "Tip:"
219
- msgstr "Consiglio:"
220
-
221
- #. mailerlite
222
- #: include/templates/admin/edit_custom.php:21
223
- #: include/templates/admin/edit_embedded.php:21
224
- msgid "This title won't be displayed in public!"
225
- msgstr "Questo titolo non sarà visualizzato al pubblico!"
226
-
227
- #. mailerlite
228
- #: include/templates/admin/edit_custom.php:28
229
- msgid "Form details"
230
- msgstr "Dettagli del form"
231
-
232
- #. mailerlite
233
- #: include/templates/admin/edit_custom.php:33
234
- #: include/templates/admin/edit_embedded.php:20
235
- msgid "Form title"
236
- msgstr "Titolo del form"
237
-
238
- #. mailerlite
239
- #. default
240
- #: include/templates/admin/edit_custom.php:34
241
- #: include/templates/admin/edit_custom.php:55
242
- msgid "Example:"
243
- msgstr "Esempi:"
244
-
245
- #. mailerlite
246
- #: include/templates/admin/edit_custom.php:34
247
- msgid "Newsletter signup!"
248
- msgstr "Iscrizione alla newsletter!"
249
-
250
- #. mailerlite
251
- #: include/templates/admin/edit_custom.php:37
252
- msgid "Form description"
253
- msgstr "Descrizione del form"
254
-
255
- #. mailerlite
256
- #: include/templates/admin/edit_custom.php:54
257
- msgid "Button title"
258
- msgstr "Nome del pulsante"
259
-
260
- #. mailerlite
261
- #: include/templates/admin/edit_custom.php:62
262
- msgid "Form fields and lists"
263
- msgstr "Campi del form e liste"
264
-
265
- #. mailerlite
266
- #: include/templates/admin/edit_custom.php:67
267
- msgid "Fields"
268
- msgstr "Campi"
269
-
270
- #. mailerlite
271
- #: include/templates/admin/edit_custom.php:80
272
- msgid "Lists"
273
- msgstr "Liste"
274
-
275
- #. mailerlite
276
- #: include/templates/admin/edit_custom.php:95
277
- #: include/templates/admin/edit_embedded.php:41
278
- msgid "Save form"
279
- msgstr "Salva form"
280
-
281
- #. mailerlite
282
- #: include/templates/admin/edit_embedded.php:5
283
- msgid "Edit webform"
284
- msgstr "Modifica webform"
285
-
286
- #. mailerlite
287
- #: include/templates/admin/edit_embedded.php:15
288
- msgid "Webform details"
289
- msgstr "Dettagli webform"
290
-
291
- #. mailerlite
292
- #: include/templates/admin/edit_embedded.php:24
293
- msgid "Webform"
294
- msgstr "Webform"
295
-
296
- #. mailerlite
297
- #: include/templates/admin/main.php:5
298
- msgid "Add New"
299
- msgstr "Aggiungi nuovo"
300
-
301
- #. mailerlite
302
- #: include/templates/admin/main.php:14
303
- msgid "ID"
304
- msgstr "ID"
305
-
306
- #. mailerlite
307
- #: include/templates/admin/main.php:15
308
- msgid "Name"
309
- msgstr "Nome"
310
-
311
- #. mailerlite
312
- #: include/templates/admin/main.php:16
313
- msgid "Type"
314
- msgstr "Tipo"
315
-
316
- #. mailerlite
317
- #: include/templates/admin/main.php:17
318
- msgid "Date"
319
- msgstr "Data"
320
-
321
- #. mailerlite
322
- #: include/templates/admin/main.php:29
323
- msgid "Edit"
324
- msgstr "Modifica"
325
-
326
- #. mailerlite
327
- #: include/templates/admin/main.php:30
328
- msgid "Are you sure you want to delete this form?"
329
- msgstr "Vuoi davvero eliminare questo form?"
330
-
331
- #. mailerlite
332
- #: include/templates/admin/main.php:30
333
- msgid "Delete"
334
- msgstr "Elimina"
335
-
336
- #. mailerlite
337
- #: include/templates/admin/main.php:33
338
- msgid "Custom form"
339
- msgstr "Form personalizzato"
340
-
341
- #. mailerlite
342
- #: include/templates/admin/main.php:33
343
- msgid "Embedded form"
344
- msgstr "Form incorporato"
345
-
346
- #. mailerlite
347
- #: include/templates/admin/main.php:42
348
- msgid "There is no signup forms created yet!"
349
- msgstr "Non ci sono form d'iscrizione!"
350
-
351
- #. mailerlite
352
- #: include/templates/admin/main.php:43
353
- msgid "Add signup form"
354
- msgstr "Crea form d'iscrizione"
355
-
356
- #. mailerlite
357
- #: include/templates/admin/settings.php:5
358
- msgid "Plugin settings"
359
- msgstr "Impostazioni plugin"
360
-
361
- #. mailerlite
362
- #: include/templates/admin/settings.php:10
363
- msgid "Here you are able to change your API key!"
364
- msgstr "Qui puoi cambiare la tua API key!"
365
-
366
- #. mailerlite
367
- #: include/templates/admin/sidebar.php:4
368
- msgid "Need help?"
369
- msgstr "Serve aiuto?"
370
-
371
- #. mailerlite
372
- #: include/templates/admin/sidebar.php:6
373
- msgid ""
374
- "Have any questions? Stuck on something or found bug? Feel free to contact us!"
375
- msgstr ""
376
- "Hai delle domande? Ti sei bloccato s o hai trovato un bug? Non esitare a "
377
- "contattarci!"
378
-
379
- #. mailerlite
380
- #: include/templates/common/tiny_mce.php:13
381
- msgid ""
382
- "Select form from list below, and hit \"Add Shortcode\" to add the shortcode "
383
- "to your post!"
384
- msgstr ""
385
- "Scegli il form dalla lista e clicca \"Aggiungi Shortcode\" per aggiungere il "
386
- "shortcode ai tuoi post!"
387
-
388
- #. mailerlite
389
- #: include/templates/common/tiny_mce.php:24
390
- msgid "Add Shortcode"
391
- msgstr "Aggiungi Shortcode"
392
-
393
- #. mailerlite
394
- #: include/templates/forms/custom_form.php:19
395
- msgid "Please wait..."
396
- msgstr "Aspetta..."
397
-
398
- #. mailerlite
399
- #: include/templates/forms/custom_form.php:27
400
- msgid "Thank you for signup!"
401
- msgstr "Grazie per la tua iscrizione!"
402
-
403
- # @ mailerlite
404
- #: include/mailerlite_admin.php:395
405
- msgid "Send this error to info@mailerlite.com or our chat"
406
- msgstr "Invia questo errore di info@mailerlite.com o la nostra chat"
407
-
408
- # @ mailerlite
409
- #: include/templates/admin/edit_custom.php:20
410
- msgid "Please wait message"
411
- msgstr "\"Aspetta\" nota"
412
-
413
- # @ mailerlite
414
- #: include/mailerlite/admin.php:150
415
- msgid "Error happened"
416
- msgstr "Errore è accaduto"
417
-
418
- # @ mailerlite
419
- #: include/mailerlite/admin.php:46
420
- msgid "Explanation about forms"
421
- msgstr "Si prega di notare che è possibile aggiungere <b>Embed</b> o <b>Button</b> solo i tipi di forme. <b>Popup</b> forme vengono visualizzate automaticamente sul tuo sito Wordpress. Si può spegnere <b>Popup</b> forme nelle <a href=\"admin.php?page=mailerlite_settings\">impostazioni</a>. Non puoi includere la pagina <b>Landing</b> nella tua pagina di Wordpress."
422
-
423
- # @ mailerlite
424
- #: include/templates/admin/main.php:8
425
- msgid "MailerLite popup script is"
426
- msgstr "MailerLite lo script di monitoraggio è"
427
-
428
- # @ mailerlite
429
- #: include/templates/admin/main.php:8
430
- msgid "enabled"
431
- msgstr "abilitato"
432
-
433
- # @ mailerlite
434
- #: include/templates/admin/main.php:8
435
- msgid "disabled"
436
- msgstr "disabilitato"
437
-
438
- # @ mailerlite
439
- #: include/templates/admin/settings.php:46
440
- msgid "Enable"
441
- msgstr "Abilitare"
442
-
443
- # @ mailerlite
444
- #: include/templates/admin/settings.php:46
445
- msgid "Disable"
446
- msgstr "Disattivare"
447
-
448
- # @ mailerlite
449
- #: include/templates/admin/main.php:9
450
- msgid "Go to settings if you want to change it"
451
- msgstr "Passare alle <a href=\"admin.php?page=mailerlite_settings\">impostazioni</a> se si desidera modificarlo"
452
-
453
- # @ mailerlite
454
- #: include/templates/admin/main.php:12
455
- msgid "Your popup forms will be displayed automatically while the popup script is enabled"
456
- msgstr "I tuoi moduli popup verranno visualizzati automaticamente mentre lo script di monitoraggio è abilitato"
457
-
458
- # @ mailerlite
459
- #: include/templates/admin/main.php:14
460
- msgid "Your popup forms wont be displayed while the popup script is disabled"
461
- msgstr "I moduli popup non verranno visualizzati mentre lo script di monitoraggio è disabilitato"
462
-
463
- # @ mailerlite
464
- #: include/templates/admin/settings.php:34
465
- msgid "Popup forms script"
466
- msgstr "Formato di popup script"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/mailerlite-sv_SE.mo DELETED
Binary file
languages/mailerlite-sv_SE.po DELETED
@@ -1,466 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "MIME-Version: 1.0\n"
4
- "Content-Type: text/plain; charset=UTF-8\n"
5
- "Content-Transfer-Encoding: 8bit\n"
6
- "X-Generator: Poedit 1.6.7\n"
7
- "Project-Id-Version: MailerLite wordpress plugin\n"
8
- "Language: sv\n"
9
- "POT-Creation-Date: \n"
10
- "PO-Revision-Date: \n"
11
- "Last-Translator: \n"
12
- "Language-Team: \n"
13
-
14
- #. mailerlite
15
- #: include/mailerlite-admin.php:52
16
- msgid "Forms"
17
- msgstr "Formulär"
18
-
19
- #. mailerlite
20
- #: include/mailerlite-admin.php:52 include/templates/admin/main.php:5
21
- msgid "Signup forms"
22
- msgstr "Prenumerationsformulär"
23
-
24
- #. mailerlite
25
- #: include/mailerlite-admin.php:53
26
- msgid "Settings"
27
- msgstr "Inställningar"
28
-
29
- #. mailerlite
30
- #: include/mailerlite-admin.php:133
31
- msgid "Subscribe for newsletter!"
32
- msgstr "Prenumerera på nyhetsbrev!"
33
-
34
- #. mailerlite
35
- #: include/mailerlite-admin.php:134 include/mailerlite-admin.php:301
36
- msgid "Newsletter signup"
37
- msgstr "Prenumeration på nyhetsbrev "
38
-
39
- #. mailerlite
40
- #: include/mailerlite-admin.php:135 include/mailerlite-admin.php:302
41
- msgid "Just simple MailerLite form!"
42
- msgstr "Enkelt Mailerlite formulär"
43
-
44
- #. mailerlite
45
- #. default
46
- #: include/mailerlite-admin.php:136 include/mailerlite-admin.php:303
47
- #: include/templates/admin/edit_custom.php:55
48
- msgid "Subscribe"
49
- msgstr "Prenumerera "
50
-
51
- #. mailerlite
52
- #: include/mailerlite-admin.php:142 include/mailerlite-admin.php:305
53
- msgid "Email"
54
- msgstr "Epost"
55
-
56
- #. mailerlite
57
- #: include/mailerlite-admin.php:198
58
- msgid "Embedded webform"
59
- msgstr "Inbäddat webbformulär"
60
-
61
- #. mailerlite
62
- #: include/mailerlite-admin.php:267
63
- msgid "You not allowed to do that"
64
- msgstr "Detta är inte tillåtet "
65
-
66
- #. mailerlite
67
- #: include/mailerlite-admin.php:277
68
- msgid "Wrong MailerLite API key"
69
- msgstr "Felaktig MailerLite API nyckel"
70
-
71
- #. mailerlite
72
- #: include/mailerlite-admin.php:299
73
- msgid "New custom signup form"
74
- msgstr "Nytt anpassat registreringsformulär"
75
-
76
- #. mailerlite
77
- #: include/mailerlite-admin.php:310
78
- msgid "New embedded signup form"
79
- msgstr "Nytt inbäddat registreringsformulär"
80
-
81
- #. mailerlite
82
- #: include/mailerlite-form.php:75
83
- msgid "Subscriber successfully saved"
84
- msgstr "Prenumerant har sparats"
85
-
86
- #. mailerlite
87
- #: include/mailerlite-form.php:79
88
- msgid "Form not found"
89
- msgstr "Formuläret hittades inte"
90
-
91
- #. mailerlite
92
- #: include/mailerlite-form.php:84
93
- msgid "Wrong data provided"
94
- msgstr "Felaktiga uppgifter har lämnats"
95
-
96
- #. mailerlite
97
- #: include/mailerlite-widget.php:13
98
- msgid "Mailerlite sign up form"
99
- msgstr "Mailerlite registreringsformulär"
100
-
101
- #. mailerlite
102
- #: include/mailerlite-widget.php:14
103
- msgid "MailerLite sign up form Widget"
104
- msgstr "Mailerlite registreringsformulär Widget"
105
-
106
- #. mailerlite
107
- #: include/mailerlite-widget.php:66
108
- msgid "Select form:"
109
- msgstr "Välj formulär:"
110
-
111
- #. mailerlite
112
- #: include/templates/admin/api_key.php:8
113
- msgid ""
114
- "Hi there! You will be able to create awesome signup forms, but first we need "
115
- "your MailerLite API key!"
116
- msgstr ""
117
- "Hej där! Du kommer att kunna skapa fantastiska registreringsformulär, men "
118
- "först behöver vi din MailerLite API-nyckel!"
119
-
120
- #. mailerlite
121
- #: include/templates/admin/api_key.php:17
122
- #: include/templates/admin/settings.php:19
123
- msgid "Enter an API key"
124
- msgstr "Ange en API nyckel"
125
-
126
- #. mailerlite
127
- #: include/templates/admin/api_key.php:18
128
- #: include/templates/admin/settings.php:20
129
- msgid "Don't know where to find it?"
130
- msgstr "Vet du inte var den finns?"
131
-
132
- #. mailerlite
133
- #: include/templates/admin/api_key.php:18
134
- #: include/templates/admin/settings.php:20
135
- msgid "Check it here!"
136
- msgstr "Kolla här!"
137
-
138
- #. mailerlite
139
- #: include/templates/admin/api_key.php:23
140
- #: include/templates/admin/settings.php:25
141
- msgid "Save this key"
142
- msgstr "Spara den här nyckeln"
143
-
144
- #. mailerlite
145
- #: include/templates/admin/api_key.php:29
146
- #: include/templates/admin/settings.php:31
147
- msgid "Don't have an account?"
148
- msgstr "Har du inget konto?"
149
-
150
- #. mailerlite
151
- #: include/templates/admin/api_key.php:30
152
- #: include/templates/admin/settings.php:32
153
- msgid "Register!"
154
- msgstr "Registrera!"
155
-
156
- #. mailerlite
157
- #: include/templates/admin/create.php:5
158
- msgid "Create new signup form"
159
- msgstr "Skapa ett nytt registreringsformulär"
160
-
161
- #. mailerlite
162
- #: include/templates/admin/create.php:11
163
- msgid "Form type"
164
- msgstr "Typ av formulär"
165
-
166
- #. mailerlite
167
- #: include/templates/admin/create.php:17
168
- msgid "Custom signup form"
169
- msgstr "Anpassat registreringsformulär"
170
-
171
- #. mailerlite
172
- #: include/templates/admin/create.php:23
173
- msgid "Webforms created using MailerLite"
174
- msgstr "Webbformulär som skapats med MailerLite"
175
-
176
- #. mailerlite
177
- #: include/templates/admin/create.php:28
178
- msgid "Create form"
179
- msgstr "Skapa formulär"
180
-
181
- #. mailerlite
182
- #: include/templates/admin/create.php:29
183
- #: include/templates/admin/edit_custom.php:96
184
- #: include/templates/admin/edit_embedded.php:42
185
- msgid "Back"
186
- msgstr "Tillbaka"
187
-
188
- #. mailerlite
189
- #: include/templates/admin/edit_custom.php:5
190
- msgid "Edit custom signup form"
191
- msgstr "Redigera anpassat registreringsformulär"
192
-
193
- #. mailerlite
194
- #: include/templates/admin/edit_custom.php:7
195
- #: include/templates/admin/edit_embedded.php:7
196
- msgid "Form saved."
197
- msgstr "Formuläret är sparat."
198
-
199
- #. mailerlite
200
- #: include/templates/admin/edit_custom.php:7
201
- #: include/templates/admin/edit_embedded.php:7
202
- msgid "Back to forms list"
203
- msgstr "Tillbaka till lista över formulär"
204
-
205
- #. mailerlite
206
- #: include/templates/admin/edit_custom.php:15
207
- msgid "Main information"
208
- msgstr "Huvudinformation"
209
-
210
- #. default
211
- #: include/templates/admin/edit_custom.php:20
212
- msgid "Form name"
213
- msgstr "Formulärets namn"
214
-
215
- #. mailerlite
216
- #: include/templates/admin/edit_custom.php:21
217
- #: include/templates/admin/edit_embedded.php:21
218
- msgid "Tip:"
219
- msgstr "Tips:"
220
-
221
- #. mailerlite
222
- #: include/templates/admin/edit_custom.php:21
223
- #: include/templates/admin/edit_embedded.php:21
224
- msgid "This title won't be displayed in public!"
225
- msgstr "Den här rubriken kommer inte att visas offentligt!"
226
-
227
- #. mailerlite
228
- #: include/templates/admin/edit_custom.php:28
229
- msgid "Form details"
230
- msgstr "Formulärets detaljer"
231
-
232
- #. mailerlite
233
- #: include/templates/admin/edit_custom.php:33
234
- #: include/templates/admin/edit_embedded.php:20
235
- msgid "Form title"
236
- msgstr "Formulärets rubrik"
237
-
238
- #. mailerlite
239
- #. default
240
- #: include/templates/admin/edit_custom.php:34
241
- #: include/templates/admin/edit_custom.php:55
242
- msgid "Example:"
243
- msgstr "Exempel:"
244
-
245
- #. mailerlite
246
- #: include/templates/admin/edit_custom.php:34
247
- msgid "Newsletter signup!"
248
- msgstr "Prenumeration av nyhetsbrev!"
249
-
250
- #. mailerlite
251
- #: include/templates/admin/edit_custom.php:37
252
- msgid "Form description"
253
- msgstr "Beskrivning av formulär"
254
-
255
- #. mailerlite
256
- #: include/templates/admin/edit_custom.php:54
257
- msgid "Button title"
258
- msgstr "Knappens rubrik"
259
-
260
- #. mailerlite
261
- #: include/templates/admin/edit_custom.php:62
262
- msgid "Form fields and lists"
263
- msgstr "Formulärfält och listor"
264
-
265
- #. mailerlite
266
- #: include/templates/admin/edit_custom.php:67
267
- msgid "Fields"
268
- msgstr "Fält"
269
-
270
- #. mailerlite
271
- #: include/templates/admin/edit_custom.php:80
272
- msgid "Lists"
273
- msgstr "Listor"
274
-
275
- #. mailerlite
276
- #: include/templates/admin/edit_custom.php:95
277
- #: include/templates/admin/edit_embedded.php:41
278
- msgid "Save form"
279
- msgstr "Spara formulär"
280
-
281
- #. mailerlite
282
- #: include/templates/admin/edit_embedded.php:5
283
- msgid "Edit webform"
284
- msgstr "Redigera webb-formulär"
285
-
286
- #. mailerlite
287
- #: include/templates/admin/edit_embedded.php:15
288
- msgid "Webform details"
289
- msgstr "Webb-formulärets detaljer"
290
-
291
- #. mailerlite
292
- #: include/templates/admin/edit_embedded.php:24
293
- msgid "Webform"
294
- msgstr "Webb-formulär"
295
-
296
- #. mailerlite
297
- #: include/templates/admin/main.php:5
298
- msgid "Add New"
299
- msgstr "Lägg till nytt"
300
-
301
- #. mailerlite
302
- #: include/templates/admin/main.php:14
303
- msgid "ID"
304
- msgstr "ID"
305
-
306
- #. mailerlite
307
- #: include/templates/admin/main.php:15
308
- msgid "Name"
309
- msgstr "Namn"
310
-
311
- #. mailerlite
312
- #: include/templates/admin/main.php:16
313
- msgid "Type"
314
- msgstr "Typ"
315
-
316
- #. mailerlite
317
- #: include/templates/admin/main.php:17
318
- msgid "Date"
319
- msgstr "Datum"
320
-
321
- #. mailerlite
322
- #: include/templates/admin/main.php:29
323
- msgid "Edit"
324
- msgstr "Redigera"
325
-
326
- #. mailerlite
327
- #: include/templates/admin/main.php:30
328
- msgid "Are you sure you want to delete this form?"
329
- msgstr "Är du säker på att du vill radera det här formuläret?"
330
-
331
- #. mailerlite
332
- #: include/templates/admin/main.php:30
333
- msgid "Delete"
334
- msgstr "Radera"
335
-
336
- #. mailerlite
337
- #: include/templates/admin/main.php:33
338
- msgid "Custom form"
339
- msgstr "Anpassat formulär"
340
-
341
- #. mailerlite
342
- #: include/templates/admin/main.php:33
343
- msgid "Embedded form"
344
- msgstr "Inbäddat formulär"
345
-
346
- #. mailerlite
347
- #: include/templates/admin/main.php:42
348
- msgid "There is no signup forms created yet!"
349
- msgstr "Det finns inget registreringsformulär skapat ännu"
350
-
351
- #. mailerlite
352
- #: include/templates/admin/main.php:43
353
- msgid "Create signup form"
354
- msgstr "Skapa registreringsformulär "
355
-
356
- #. mailerlite
357
- #: include/templates/admin/settings.php:5
358
- msgid "Plugin settings"
359
- msgstr "Inställningar för Plugin"
360
-
361
- #. mailerlite
362
- #: include/templates/admin/settings.php:10
363
- msgid "Here you are able to change your API key!"
364
- msgstr "Här kan du ändra din API nyckel"
365
-
366
- #. mailerlite
367
- #: include/templates/admin/sidebar.php:4
368
- msgid "Need help?"
369
- msgstr "Behöver du hjälp?"
370
-
371
- #. mailerlite
372
- #: include/templates/admin/sidebar.php:6
373
- msgid ""
374
- "Have any questions? Stuck on something or found bug? Feel free to contact us!"
375
- msgstr ""
376
- "Har du några frågor? Fastnat på något eller hittat en bugg? Tveka inte att "
377
- "kontakta oss!"
378
-
379
- #. mailerlite
380
- #: include/templates/common/tiny_mce.php:13
381
- msgid ""
382
- "Select form from list below, and hit \"Add Shortcode\" to add the shortcode "
383
- "to your post!"
384
- msgstr ""
385
- "Välj formuläret från listan nedan, och tryck på \"Lägg till shortkod \" för "
386
- "att lägga in shortkoden i ditt inlägg!"
387
-
388
- #. mailerlite
389
- #: include/templates/common/tiny_mce.php:24
390
- msgid "Add Shortcode"
391
- msgstr "Lägg till shortkod"
392
-
393
- #. mailerlite
394
- #: include/templates/forms/custom_form.php:19
395
- msgid "Please wait..."
396
- msgstr "Vänligen vänta..."
397
-
398
- #. mailerlite
399
- #: include/templates/forms/custom_form.php:27
400
- msgid "Thank you for signup!"
401
- msgstr "Tack för din prenumeration!"
402
-
403
- # @ mailerlite
404
- #: include/mailerlite_admin.php:395
405
- msgid "Send this error to info@mailerlite.com or our chat"
406
- msgstr "Skicka detta fel att info@mailerlite.com eller vår chatt"
407
-
408
- # @ mailerlite
409
- #: include/templates/admin/edit_custom.php:20
410
- msgid "Please wait message"
411
- msgstr "\"Vänligen vänta\" meddelande"
412
-
413
- # @ mailerlite
414
- #: include/mailerlite/admin.php:150
415
- msgid "Error happened"
416
- msgstr "Fel har hänt"
417
-
418
- # @ mailerlite
419
- #: include/mailerlite/admin.php:46
420
- msgid "Explanation about forms"
421
- msgstr "Observera att du kan lägga till <b>Embed</b> eller <b>Button</b> bara skriva formulär. <b>Popup</b> formulär visas automatiskt på din Wordpress-webbplats. Du kan stänga av <b>Popup</b> formulär i <a href=\"admin.php?page=mailerlite_settings\">Inställningar</a>. Du kan inte inkludera sidan <b>Landing</b> på din Wordpress-sida."
422
-
423
- # @ mailerlite
424
- #: include/templates/admin/main.php:8
425
- msgid "MailerLite popup script is"
426
- msgstr "MailerLite spårningsskriptet är"
427
-
428
- # @ mailerlite
429
- #: include/templates/admin/main.php:8
430
- msgid "enabled"
431
- msgstr "aktiverad"
432
-
433
- # @ mailerlite
434
- #: include/templates/admin/main.php:8
435
- msgid "disabled"
436
- msgstr "inaktiverad"
437
-
438
- # @ mailerlite
439
- #: include/templates/admin/settings.php:46
440
- msgid "Enable"
441
- msgstr "Gör det möjligt"
442
-
443
- # @ mailerlite
444
- #: include/templates/admin/settings.php:46
445
- msgid "Disable"
446
- msgstr "inaktivera"
447
-
448
- # @ mailerlite
449
- #: include/templates/admin/main.php:9
450
- msgid "Go to settings if you want to change it"
451
- msgstr "Gå till <a href=\"admin.php?page=mailerlite_settings\">inställningar</a> om du vill ändra det"
452
-
453
- # @ mailerlite
454
- #: include/templates/admin/main.php:12
455
- msgid "Your popup forms will be displayed automatically while the popup script is enabled"
456
- msgstr "Dina popup-formulär visas automatiskt medan spårningsskriptet är aktiverat"
457
-
458
- # @ mailerlite
459
- #: include/templates/admin/main.php:14
460
- msgid "Your popup forms wont be displayed while the popup script is disabled"
461
- msgstr "Dina popup-formulär visas inte när spårningsskriptet är inaktiverat"
462
-
463
- # @ mailerlite
464
- #: include/templates/admin/settings.php:34
465
- msgid "Popup forms script"
466
- msgstr "Popup former bildar spårningsskript"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/mailerlite_rest/ML_Fields.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- require_once dirname( __FILE__ ) . '/base/ML_Rest.php';
4
-
5
- /**
6
- * Class ML_Fields
7
- */
8
- class ML_Fields extends ML_Rest {
9
- /**
10
- * ML_Fields constructor.
11
- *
12
- * @param $api_key
13
- */
14
- function __construct( $api_key ) {
15
- $this->endpoint = 'fields';
16
-
17
- parent::__construct( $api_key );
18
- }
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/mailerlite_rest/ML_Lists.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- require_once dirname(__FILE__) . '/base/ML_Rest.php';
4
-
5
- class ML_Lists extends ML_Rest
6
- {
7
- function __construct($api_key)
8
- {
9
- $this->name = 'lists';
10
-
11
- parent::__construct($api_key);
12
- }
13
-
14
- function getActive()
15
- {
16
- $this->path .= 'active/';
17
-
18
- return $this->execute('GET');
19
- }
20
-
21
- function getUnsubscribed()
22
- {
23
- $this->path .= 'unsubscribed/';
24
-
25
- return $this->execute('GET');
26
- }
27
-
28
- function getBounced()
29
- {
30
- $this->path .= 'bounced/';
31
-
32
- return $this->execute('GET');
33
- }
34
-
35
- function getFields()
36
- {
37
- $this->path .= 'fields/';
38
- return $this->execute('GET');
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/mailerlite_rest/ML_Webforms.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
-
3
- require_once dirname( __FILE__ ) . '/base/ML_Rest.php';
4
-
5
- /**
6
- * Class ML_Webforms
7
- */
8
- class ML_Webforms extends ML_Rest {
9
- /**
10
- * ML_Webforms constructor.
11
- *
12
- * @param $api_key
13
- */
14
- function __construct( $api_key ) {
15
- $this->endpoint = 'webforms';
16
-
17
- parent::__construct( $api_key );
18
- }
19
-
20
- /**
21
- * @return ML_Webform_Entity[]
22
- */
23
- public function getAllJson() {
24
- return parent::getAllJson();
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
libs/mailerlite_rest/{ML_Campaigns.php → MailerLite_Forms_Campaigns.php} RENAMED
@@ -1,13 +1,13 @@
1
  <?php
2
 
3
- require_once dirname( __FILE__ ) . '/base/ML_Rest.php';
4
 
5
  /**
6
- * Class ML_Campaigns
7
  */
8
- class ML_Campaigns extends ML_Rest {
9
  /**
10
- * ML_Campaigns constructor.
11
  *
12
  * @param $api_key
13
  */
1
  <?php
2
 
3
+ require_once dirname( __FILE__ ) . '/base/MailerLite_Forms_Rest.php';
4
 
5
  /**
6
+ * Class MailerLite_Forms_Campaigns
7
  */
8
+ class MailerLite_Forms_Campaigns extends MailerLite_Forms_Rest {
9
  /**
10
+ * MailerLite_Forms_Campaigns constructor.
11
  *
12
  * @param $api_key
13
  */
libs/mailerlite_rest/MailerLite_Forms_Fields.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname( __FILE__ ) . '/base/MailerLite_Forms_Rest.php';
4
+
5
+ /**
6
+ * Class MailerLite_Forms_Fields
7
+ */
8
+ class MailerLite_Forms_Fields extends MailerLite_Forms_Rest {
9
+ /**
10
+ * MailerLite_Forms_Fields constructor.
11
+ *
12
+ * @param $api_key
13
+ */
14
+ function __construct( $api_key ) {
15
+ $this->endpoint = 'fields';
16
+
17
+ parent::__construct( $api_key );
18
+ }
19
+ }
libs/mailerlite_rest/MailerLite_Forms_Groups.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname( __FILE__ ) . '/base/MailerLite_Forms_Rest.php';
4
+
5
+ /**
6
+ * Class MailerLite_Forms_Groups
7
+ */
8
+ class MailerLite_Forms_Groups extends MailerLite_Forms_Rest {
9
+ /**
10
+ * MailerLite_Forms_Groups constructor.
11
+ *
12
+ * @param $api_key
13
+ */
14
+ function __construct( $api_key ) {
15
+ $this->endpoint = 'groups';
16
+
17
+ parent::__construct( $api_key );
18
+ }
19
+
20
+ /**
21
+ * @param array $data
22
+ *
23
+ * @return MailerLite_Forms_Group_Entity[]
24
+ * @throws Exception
25
+ */
26
+ public function getAllJson( $data = [] ) {
27
+ return parent::getAllJson( $data );
28
+ }
29
+
30
+ function getActive() {
31
+ $this->path .= 'active/';
32
+
33
+ return $this->execute( 'GET' );
34
+ }
35
+
36
+ function getUnsubscribed() {
37
+ $this->path .= 'unsubscribed/';
38
+
39
+ return $this->execute( 'GET' );
40
+ }
41
+
42
+ function getBounced() {
43
+ $this->path .= 'bounced/';
44
+
45
+ return $this->execute( 'GET' );
46
+ }
47
+ }
libs/mailerlite_rest/{ML_Groups.php → MailerLite_Forms_Lists.php} RENAMED
@@ -1,29 +1,22 @@
1
  <?php
2
 
3
- require_once dirname( __FILE__ ) . '/base/ML_Rest.php';
4
 
5
  /**
6
- * Class ML_Groups
7
  */
8
- class ML_Groups extends ML_Rest {
9
  /**
10
- * ML_Groups constructor.
11
  *
12
  * @param $api_key
13
  */
14
  function __construct( $api_key ) {
15
- $this->endpoint = 'groups';
16
 
17
  parent::__construct( $api_key );
18
  }
19
 
20
- /**
21
- * @return ML_Group_Entity[]
22
- */
23
- public function getAllJson() {
24
- return parent::getAllJson();
25
- }
26
-
27
  function getActive() {
28
  $this->path .= 'active/';
29
 
@@ -41,4 +34,10 @@ class ML_Groups extends ML_Rest {
41
 
42
  return $this->execute( 'GET' );
43
  }
 
 
 
 
 
 
44
  }
1
  <?php
2
 
3
+ require_once dirname( __FILE__ ) . '/base/MailerLite_Forms_Rest.php';
4
 
5
  /**
6
+ * Class MailerLite_Forms_Lists
7
  */
8
+ class MailerLite_Forms_Lists extends MailerLite_Forms_Rest {
9
  /**
10
+ * MailerLite_Forms_Lists constructor.
11
  *
12
  * @param $api_key
13
  */
14
  function __construct( $api_key ) {
15
+ $this->name = 'lists';
16
 
17
  parent::__construct( $api_key );
18
  }
19
 
 
 
 
 
 
 
 
20
  function getActive() {
21
  $this->path .= 'active/';
22
 
34
 
35
  return $this->execute( 'GET' );
36
  }
37
+
38
+ function getFields() {
39
+ $this->path .= 'fields/';
40
+
41
+ return $this->execute( 'GET' );
42
+ }
43
  }
libs/mailerlite_rest/{ML_Settings_Double_OptIn.php → MailerLite_Forms_Settings_Double_OptIn.php} RENAMED
@@ -1,14 +1,13 @@
1
  <?php
2
 
3
- require_once dirname( __FILE__ ) . '/base/ML_Rest.php';
4
 
5
  /**
6
- * Class ML_Settings_Double_OptIn
7
  */
8
- class ML_Settings_Double_OptIn extends ML_Rest {
9
-
10
  /**
11
- * ML_Settings_Double_OptIn constructor.
12
  *
13
  * @param $api_key
14
  */
1
  <?php
2
 
3
+ require_once dirname( __FILE__ ) . '/base/MailerLite_Forms_Rest.php';
4
 
5
  /**
6
+ * Class MailerLite_Forms_Settings_Double_OptIn
7
  */
8
+ class MailerLite_Forms_Settings_Double_OptIn extends MailerLite_Forms_Rest {
 
9
  /**
10
+ * MailerLite_Forms_Settings_Double_OptIn constructor.
11
  *
12
  * @param $api_key
13
  */
libs/mailerlite_rest/{ML_Subscribers.php → MailerLite_Forms_Subscribers.php} RENAMED
@@ -1,16 +1,16 @@
1
  <?php
2
 
3
- require_once dirname( __FILE__ ) . '/base/ML_Rest.php';
4
 
5
  /**
6
- * Class ML_Subscribers
7
  */
8
- class ML_Subscribers extends ML_Rest {
9
  /** @var int|null */
10
  var $groupId = null;
11
 
12
  /**
13
- * ML_Subscribers constructor.
14
  *
15
  * @param $api_key
16
  */
1
  <?php
2
 
3
+ require_once dirname( __FILE__ ) . '/base/MailerLite_Forms_Rest.php';
4
 
5
  /**
6
+ * Class MailerLite_Forms_Subscribers
7
  */
8
+ class MailerLite_Forms_Subscribers extends MailerLite_Forms_Rest {
9
  /** @var int|null */
10
  var $groupId = null;
11
 
12
  /**
13
+ * MailerLite_Forms_Subscribers constructor.
14
  *
15
  * @param $api_key
16
  */
libs/mailerlite_rest/MailerLite_Forms_Webforms.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once dirname( __FILE__ ) . '/base/MailerLite_Forms_Rest.php';
4
+
5
+ /**
6
+ * Class MailerLite_Forms_Webforms
7
+ */
8
+ class MailerLite_Forms_Webforms extends MailerLite_Forms_Rest {
9
+ /**
10
+ * MailerLite_Forms_Webforms constructor.
11
+ *
12
+ * @param $api_key
13
+ */
14
+ function __construct( $api_key ) {
15
+ $this->endpoint = 'webforms';
16
+
17
+ parent::__construct( $api_key );
18
+ }
19
+
20
+ /**
21
+ * @param array $data
22
+ *
23
+ * @return MailerLite_Forms_Webform_Entity[]
24
+ * @throws Exception
25
+ */
26
+ public function getAllJson( $data = [] ) {
27
+ return parent::getAllJson( $data );
28
+ }
29
+ }
libs/mailerlite_rest/base/{ML_Rest.php → MailerLite_Forms_Rest.php} RENAMED
@@ -1,16 +1,16 @@
1
  <?php
2
 
3
- require_once dirname( __FILE__ ) . '/ML_Rest_Base.php';
4
 
5
  /**
6
- * Class ML_Rest
7
  */
8
- class ML_Rest extends ML_Rest_Base {
9
  /** @var string */
10
  var $endpoint = '';
11
 
12
  /**
13
- * ML_Rest constructor.
14
  *
15
  * @param $api_key
16
  */
@@ -26,8 +26,14 @@ class ML_Rest extends ML_Rest_Base {
26
  return $this->execute( 'GET' );
27
  }
28
 
29
- function getAllJson() {
30
- return json_decode( $this->execute( 'GET' ) );
 
 
 
 
 
 
31
  }
32
 
33
  function get( $data = null ) {
1
  <?php
2
 
3
+ require_once dirname( __FILE__ ) . '/MailerLite_Forms_Rest_Base.php';
4
 
5
  /**
6
+ * Class MailerLite_Forms_Rest
7
  */
8
+ class MailerLite_Forms_Rest extends MailerLite_Forms_Rest_Base {
9
  /** @var string */
10
  var $endpoint = '';
11
 
12
  /**
13
+ * MailerLite_Forms_Rest constructor.
14
  *
15
  * @param $api_key
16
  */
26
  return $this->execute( 'GET' );
27
  }
28
 
29
+ /**
30
+ * @param array $data
31
+ *
32
+ * @return array|mixed|object|null
33
+ * @throws Exception
34
+ */
35
+ function getAllJson( $data = [] ) {
36
+ return json_decode( $this->execute( 'GET', $data ) );
37
  }
38
 
39
  function get( $data = null ) {
libs/mailerlite_rest/base/{ML_Rest_Base.php → MailerLite_Forms_Rest_Base.php} RENAMED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
  /**
4
- * Class ML_Rest_Base
5
  */
6
- class ML_Rest_Base {
7
  protected $url;
8
  protected $verb;
9
  protected $requestBody;
@@ -20,7 +20,7 @@ class ML_Rest_Base {
20
  private $curlError = false;
21
 
22
  /**
23
- * ML_Rest_Base constructor.
24
  *
25
  * @param string $url
26
  * @param string $verb
@@ -90,7 +90,7 @@ class ML_Rest_Base {
90
  $data['apiKey'] = $this->apiKey;
91
 
92
  if ( ! is_array( $data ) ) {
93
- throw new InvalidArgumentException( 'Invalid data input for postBody. Array expected' );
94
  }
95
 
96
  $data = http_build_query( $data, '', '&' );
1
  <?php
2
 
3
  /**
4
+ * Class MailerLite_Forms_Rest_Base
5
  */
6
+ class MailerLite_Forms_Rest_Base {
7
  protected $url;
8
  protected $verb;
9
  protected $requestBody;
20
  private $curlError = false;
21
 
22
  /**
23
+ * MailerLite_Forms_Rest_Base constructor.
24
  *
25
  * @param string $url
26
  * @param string $verb
90
  $data['apiKey'] = $this->apiKey;
91
 
92
  if ( ! is_array( $data ) ) {
93
+ throw new InvalidArgumentException( 'Invalid data input for postBody. Array expected' );
94
  }
95
 
96
  $data = http_build_query( $data, '', '&' );
libs/mailerlite_rest/entities/ML_Webform_Entity.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Class ML_Webform_Entity
5
- */
6
- class ML_Webform_Entity {
7
- public $id;
8
- public $type;
9
- public $name;
10
- public $code;
11
- }
 
 
 
 
 
 
 
 
 
 
 
libs/mailerlite_rest/entities/{ML_Field_Entity.php → MailerLite_Forms_Field_Entity.php} RENAMED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
  /**
4
- * Class ML_Field_Entity
5
  */
6
- class ML_Field_Entity {
7
  public $id;
8
  public $title;
9
  public $key;
1
  <?php
2
 
3
  /**
4
+ * Class MailerLite_Forms_Field_Entity
5
  */
6
+ class MailerLite_Forms_Field_Entity {
7
  public $id;
8
  public $title;
9
  public $key;
libs/mailerlite_rest/entities/{ML_Group_Entity.php → MailerLite_Forms_Group_Entity.php} RENAMED
@@ -1,9 +1,9 @@
1
  <?php
2
 
3
  /**
4
- * Class ML_Group_Entity
5
  */
6
- class ML_Group_Entity {
7
  public $id;
8
  public $name;
9
  public $total;
1
  <?php
2
 
3
  /**
4
+ * Class MailerLite_Forms_Group_Entity
5
  */
6
+ class MailerLite_Forms_Group_Entity {
7
  public $id;
8
  public $name;
9
  public $total;
libs/mailerlite_rest/entities/MailerLite_Forms_Webform_Entity.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class MailerLite_Forms_Webform_Entity
5
+ */
6
+ class MailerLite_Forms_Webform_Entity {
7
+ public $id;
8
+ public $type;
9
+ public $name;
10
+ public $code;
11
+ }
mailerlite.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  * Plugin Name: Official MailerLite Sign Up Forms
5
  * Description: Official MailerLite Sign Up Forms plugin for WordPress. Ability to embed MailerLite webforms and create custom ones just with few clicks.
6
- * Version: 1.3.6
7
  * Author: MailerGroup
8
  * Author URI: https://www.mailerlite.com
9
  * License: GPLv2 or later
@@ -29,7 +29,7 @@
29
  define( 'MAILERLITE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
30
  define( 'MAILERLITE_PLUGIN_URL', plugins_url( '', __FILE__ ) );
31
 
32
- define( 'MAILERLITE_VERSION', '1.3.6' );
33
 
34
  define( 'MAILERLITE_PHP_VERSION', '5.6.0' );
35
  define( 'MAILERLITE_WP_VERSION', '3.0.1' );
@@ -49,7 +49,7 @@ function mailerlite_install() {
49
  $message = '';
50
 
51
  if ( version_compare( PHP_VERSION, MAILERLITE_PHP_VERSION, '<' ) ) {
52
- $message = '<p> The <strong>MailerLite</strong> plugin requires PHP version ' . MAILERLITE_PHP_VERSION . ' or greater. You are currently using PHP version '.PHP_VERSION.'</p>';
53
  }
54
 
55
  if ( version_compare( $wp_version, MAILERLITE_WP_VERSION, '<' ) ) {
@@ -62,7 +62,7 @@ function mailerlite_install() {
62
 
63
  if ( $message ) {
64
  deactivate_plugins( basename( __FILE__ ) );
65
- wp_die( $message, 'Plugin Activation Error', array( 'response' => 200, 'back_link' => true ) );
66
  }
67
 
68
  $table_name = $wpdb->base_prefix . "mailerlite_forms";
@@ -98,7 +98,7 @@ register_activation_hook( __FILE__, 'mailerlite_install' );
98
  function register_mailerlite_styles() {
99
  wp_register_style(
100
  'mailerlite_forms.css',
101
- MAILERLITE_PLUGIN_URL . '/assets/css/mailerlite_forms.css', array(),
102
  MAILERLITE_VERSION
103
  );
104
  wp_enqueue_style( 'mailerlite_forms.css' );
@@ -106,116 +106,118 @@ function register_mailerlite_styles() {
106
 
107
  add_action( 'wp_enqueue_scripts', 'register_mailerlite_styles' );
108
 
109
- function mailerlite_status_information_for_mailto_link(){
110
- $data = mailerlite_status_information();
111
 
112
- $body = "\n\n\n";
113
 
114
- $body .= "Official MailerLite Sign Up Forms information: \n\n";
115
 
116
- foreach ($data as $group => $fields) {
117
- $body.=sprintf("# %s \n\n", $group);
118
 
119
- foreach ($fields as $name=>$value) {
120
- $body .= sprintf("%s: %s\n", $name,$value);
121
- }
122
 
123
- $body.="\n";
124
- }
125
 
126
- $body = str_replace("\n", '%0A', $body);
127
 
128
- return $body;
129
  }
130
 
131
  mailerlite_status_information_for_mailto_link();
132
 
133
- function mailerlite_status_information(){
134
- global $wpdb;
135
-
136
- $theme=wp_get_theme();
137
- $curl_version = '';
138
- if (function_exists('curl_version')) {
139
- $curl_info = curl_version();
140
- $curl_version = $curl_info['version'].', '.$curl_info['ssl_version'];
141
- }
142
-
143
- // Only if loading the plugin succeeded
144
- if (class_exists('MailerLite_Form')) {
145
- $forms = $wpdb->get_results(sprintf("SELECT * FROM %smailerlite_forms", $wpdb->base_prefix));
146
- $number_of_custom_forms = 0;
147
- $number_of_embedded_forms = 0;
148
-
149
- foreach ($forms as $form) {
150
- if ($form->type == MailerLite_Form::TYPE_CUSTOM) {
151
- $number_of_custom_forms++;
152
- } elseif ($form->type == MailerLite_Form::TYPE_EMBEDDED) {
153
- $number_of_embedded_forms++;
154
- }
155
- }
156
- }
157
-
158
- $environment_group = __('Environment', 'mailerlite');
159
- $plugin_group = __('Plugin', 'mailerlite');
160
-
161
- $fields = array();
162
- $fields['WordPress']['Version'] = get_bloginfo('version');
163
- $fields['WordPress']['Home URL'] = get_option('home');
164
- $fields['WordPress']['Site URL'] = get_option('home');
165
- $fields['WordPress']['Multisite'] = is_multisite() ? 'Yes' : 'No';
166
- $fields['WordPress']['Debug mode'] = (defined('WP_DEBUG') && WP_DEBUG) ? 'Yes' : 'No';
167
- $fields['WordPress']['Theme name'] = $theme->get('Name');
168
- $fields['WordPress']['Theme URI'] = $theme->get('ThemeURI');
169
- $fields['WordPress']['Active plugins'] = implode(', ', get_option('active_plugins'));
170
- $fields[$environment_group]['Required PHP version'] = MAILERLITE_PHP_VERSION;
171
- $fields[$environment_group]['PHP version'] = phpversion();
172
- $fields[$environment_group]['Server information'] = isset($_SERVER['SERVER_SOFTWARE']) ? wp_unslash($_SERVER['SERVER_SOFTWARE']) : '';
173
- $fields[$environment_group]['cURL version'] = $curl_version;
174
- $fields[$plugin_group]['Version'] = MAILERLITE_VERSION;
175
- $fields[$plugin_group]['API key provided'] = (bool)get_option('mailerlite_api_key') ? 'Yes' : 'No';
176
- $fields[$plugin_group]['Popups enabled'] =! get_option( 'mailerlite_popups_disabled' )?'Yes': 'No';
177
- $fields[$plugin_group]['Double opt-in enabled'] =! get_option( 'mailerlite_double_optin_disabled' )?'Yes': 'No';
178
-
179
- if (class_exists('MailerLite_Form')) {
180
- $fields[$plugin_group]['Custom forms'] = $number_of_custom_forms;
181
- $fields[$plugin_group]['Embedded forms'] = $number_of_embedded_forms;
182
- }
183
-
184
- return $fields;
 
185
  }
186
 
187
  mailerlite_status_information();
188
 
189
- if (in_array('official-mailerlite-sign-up-forms/mailerlite.php', get_option('active_plugins'))) {
190
 
191
- // Double check
192
- if (!version_compare(PHP_VERSION, MAILERLITE_PHP_VERSION, '<')) {
193
 
194
- if (is_admin()) {
195
- require_once(MAILERLITE_PLUGIN_DIR.'include/mailerlite-admin.php');
196
- require_once(MAILERLITE_PLUGIN_DIR.'include/mailerlite-admin-status.php');
197
 
198
- add_action('init', array('MailerLite_Admin', 'init'));
199
- add_action('init', array('MailerLite_Admin_Status', 'init'));
200
- }
201
 
202
- require_once(MAILERLITE_PLUGIN_DIR.'include/mailerlite-widget.php');
203
- require_once(MAILERLITE_PLUGIN_DIR.'include/mailerlite-shortcode.php');
204
- require_once(MAILERLITE_PLUGIN_DIR.'include/mailerlite-gutenberg.php');
205
 
206
- add_action('init', array('MailerLite_Shortcode', 'init'));
207
- add_action('init', array('MailerLite_Form', 'init'));
208
- add_action('init', array('MailerLite_Gutenberg', 'init'));
209
- } else {
210
- function mailerlite_old_php_notice() {
211
- $class = 'notice notice-error';
212
- $message = '<p> The <strong>MailerLite</strong> plugin requires PHP version ' . MAILERLITE_PHP_VERSION . ' or greater. You are currently using PHP version <strong>'.PHP_VERSION.'</strong></p>';
213
 
214
- printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), $message );
215
- }
216
- add_action( 'admin_notices', 'mailerlite_old_php_notice' );
217
 
218
- require_once(MAILERLITE_PLUGIN_DIR.'include/mailerlite-admin-status.php');
219
- add_action('init', array('MailerLite_Admin_Status', 'init'));
220
- }
 
 
221
  }
3
  /**
4
  * Plugin Name: Official MailerLite Sign Up Forms
5
  * Description: Official MailerLite Sign Up Forms plugin for WordPress. Ability to embed MailerLite webforms and create custom ones just with few clicks.
6
+ * Version: 1.4
7
  * Author: MailerGroup
8
  * Author URI: https://www.mailerlite.com
9
  * License: GPLv2 or later
29
  define( 'MAILERLITE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
30
  define( 'MAILERLITE_PLUGIN_URL', plugins_url( '', __FILE__ ) );
31
 
32
+ define( 'MAILERLITE_VERSION', '1.4' );
33
 
34
  define( 'MAILERLITE_PHP_VERSION', '5.6.0' );
35
  define( 'MAILERLITE_WP_VERSION', '3.0.1' );
49
  $message = '';
50
 
51
  if ( version_compare( PHP_VERSION, MAILERLITE_PHP_VERSION, '<' ) ) {
52
+ $message = '<p> The <strong>MailerLite</strong> plugin requires PHP version ' . MAILERLITE_PHP_VERSION . ' or greater. You are currently using PHP version ' . PHP_VERSION . '</p>';
53
  }
54
 
55
  if ( version_compare( $wp_version, MAILERLITE_WP_VERSION, '<' ) ) {
62
 
63
  if ( $message ) {
64
  deactivate_plugins( basename( __FILE__ ) );
65
+ wp_die( $message, 'Plugin Activation Error', [ 'response' => 200, 'back_link' => true ] );
66
  }
67
 
68
  $table_name = $wpdb->base_prefix . "mailerlite_forms";
98
  function register_mailerlite_styles() {
99
  wp_register_style(
100
  'mailerlite_forms.css',
101
+ MAILERLITE_PLUGIN_URL . '/assets/css/mailerlite_forms.css', [],
102
  MAILERLITE_VERSION
103
  );
104
  wp_enqueue_style( 'mailerlite_forms.css' );
106
 
107
  add_action( 'wp_enqueue_scripts', 'register_mailerlite_styles' );
108
 
109
+ function mailerlite_status_information_for_mailto_link() {
110
+ $data = mailerlite_status_information();
111
 
112
+ $body = "\n\n\n";
113
 
114
+ $body .= "Official MailerLite Sign Up Forms information: \n\n";
115
 
116
+ foreach ( $data as $group => $fields ) {
117
+ $body .= sprintf( "# %s \n\n", $group );
118
 
119
+ foreach ( $fields as $name => $value ) {
120
+ $body .= sprintf( "%s: %s\n", $name, $value );
121
+ }
122
 
123
+ $body .= "\n";
124
+ }
125
 
126
+ $body = str_replace( "\n", '%0A', $body );
127
 
128
+ return $body;
129
  }
130
 
131
  mailerlite_status_information_for_mailto_link();
132
 
133
+ function mailerlite_status_information() {
134
+ global $wpdb;
135
+
136
+ $theme = wp_get_theme();
137
+ $curl_version = '';
138
+ if ( function_exists( 'curl_version' ) ) {
139
+ $curl_info = curl_version();
140
+ $curl_version = $curl_info['version'] . ', ' . $curl_info['ssl_version'];
141
+ }
142
+
143
+ // Only if loading the plugin succeeded
144
+ if ( class_exists( 'MailerLite_Form' ) ) {
145
+ $forms = $wpdb->get_results( sprintf( "SELECT * FROM %smailerlite_forms",
146
+ $wpdb->base_prefix ) );
147
+ $number_of_custom_forms = 0;
148
+ $number_of_embedded_forms = 0;
149
+
150
+ foreach ( $forms as $form ) {
151
+ if ( $form->type == MailerLite_Form::TYPE_CUSTOM ) {
152
+ $number_of_custom_forms ++;
153
+ } elseif ( $form->type == MailerLite_Form::TYPE_EMBEDDED ) {
154
+ $number_of_embedded_forms ++;
155
+ }
156
+ }
157
+ }
158
+
159
+ $environment_group = __( 'Environment', 'mailerlite' );
160
+ $plugin_group = __( 'Plugin', 'mailerlite' );
161
+
162
+ $fields = [];
163
+ $fields['WordPress']['Version'] = get_bloginfo( 'version' );
164
+ $fields['WordPress']['Home URL'] = get_option( 'home' );
165
+ $fields['WordPress']['Site URL'] = get_option( 'home' );
166
+ $fields['WordPress']['Multisite'] = is_multisite() ? 'Yes' : 'No';
167
+ $fields['WordPress']['Debug mode'] = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? 'Yes' : 'No';
168
+ $fields['WordPress']['Theme name'] = $theme->get( 'Name' );
169
+ $fields['WordPress']['Theme URI'] = $theme->get( 'ThemeURI' );
170
+ $fields['WordPress']['Active plugins'] = implode( ', ', get_option( 'active_plugins' ) );
171
+ $fields[ $environment_group ]['Required PHP version'] = MAILERLITE_PHP_VERSION;
172
+ $fields[ $environment_group ]['PHP version'] = phpversion();
173
+ $fields[ $environment_group ]['Server information'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? wp_unslash( $_SERVER['SERVER_SOFTWARE'] ) : '';
174
+ $fields[ $environment_group ]['cURL version'] = $curl_version;
175
+ $fields[ $plugin_group ]['Version'] = MAILERLITE_VERSION;
176
+ $fields[ $plugin_group ]['API key provided'] = (bool) get_option( 'mailerlite_api_key' ) ? 'Yes' : 'No';
177
+ $fields[ $plugin_group ]['Popups enabled'] = ! get_option( 'mailerlite_popups_disabled' ) ? 'Yes' : 'No';
178
+ $fields[ $plugin_group ]['Double opt-in enabled'] = ! get_option( 'mailerlite_double_optin_disabled' ) ? 'Yes' : 'No';
179
+
180
+ if ( class_exists( 'MailerLite_Form' ) ) {
181
+ $fields[ $plugin_group ]['Custom forms'] = $number_of_custom_forms;
182
+ $fields[ $plugin_group ]['Embedded forms'] = $number_of_embedded_forms;
183
+ }
184
+
185
+ return $fields;
186
  }
187
 
188
  mailerlite_status_information();
189
 
190
+ if ( in_array( 'official-mailerlite-sign-up-forms/mailerlite.php', get_option( 'active_plugins' ) ) ) {
191
 
192
+ // Double check
193
+ if ( ! version_compare( PHP_VERSION, MAILERLITE_PHP_VERSION, '<' ) ) {
194
 
195
+ if ( is_admin() ) {
196
+ require_once( MAILERLITE_PLUGIN_DIR . 'include/mailerlite-admin.php' );
197
+ require_once( MAILERLITE_PLUGIN_DIR . 'include/mailerlite-admin-status.php' );
198
 
199
+ add_action( 'init', [ 'MailerLite_Admin', 'init' ] );
200
+ add_action( 'init', [ 'MailerLite_Admin_Status', 'init' ] );
201
+ }
202
 
203
+ require_once( MAILERLITE_PLUGIN_DIR . 'include/mailerlite-widget.php' );
204
+ require_once( MAILERLITE_PLUGIN_DIR . 'include/mailerlite-shortcode.php' );
205
+ require_once( MAILERLITE_PLUGIN_DIR . 'include/mailerlite-gutenberg.php' );
206
 
207
+ add_action( 'init', [ 'MailerLite_Shortcode', 'init' ] );
208
+ add_action( 'init', [ 'MailerLite_Form', 'init' ] );
209
+ add_action( 'init', [ 'MailerLite_Gutenberg', 'init' ] );
210
+ } else {
211
+ function mailerlite_old_php_notice() {
212
+ $class = 'notice notice-error';
213
+ $message = '<p> The <strong>MailerLite</strong> plugin requires PHP version ' . MAILERLITE_PHP_VERSION . ' or greater. You are currently using PHP version <strong>' . PHP_VERSION . '</strong></p>';
214
 
215
+ printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), $message );
216
+ }
 
217
 
218
+ add_action( 'admin_notices', 'mailerlite_old_php_notice' );
219
+
220
+ require_once( MAILERLITE_PLUGIN_DIR . 'include/mailerlite-admin-status.php' );
221
+ add_action( 'init', [ 'MailerLite_Admin_Status', 'init' ] );
222
+ }
223
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: mailerlite, newsletter, subscribe, form, webform
5
  Requires at least: 3.0.1
6
  Tested up to: 5.0.2
7
  Requires PHP: 5.6.0
8
- Stable tag: 1.3.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -130,6 +130,13 @@ Add your custom CSS rules to the end of your theme stylesheet, /wp-content/theme
130
 
131
  == Changelog ==
132
 
 
 
 
 
 
 
 
133
  = 1.3.6 =
134
  * Feature - Status page to provide information about your environment
135
  * Tweak - Even better support for older PHP versions in main plugin file
5
  Requires at least: 3.0.1
6
  Tested up to: 5.0.2
7
  Requires PHP: 5.6.0
8
+ Stable tag: 1.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
130
 
131
  == Changelog ==
132
 
133
+ = 1.4 =
134
+ * Tweak - Show more than 100 groups when creating a custom form
135
+ * Tweak - Renamed some classes to avoid fatal errors from other plugin having the same class names
136
+ * Tweak - Reformatted code to WordPress code style
137
+ * Tweak - Loading custom form javascript after window load for better optimisations
138
+ * Tweak - Switched loading jQuery validate plugin from MailerLite CDN to your local WordPress site
139
+
140
  = 1.3.6 =
141
  * Feature - Status page to provide information about your environment
142
  * Tweak - Even better support for older PHP versions in main plugin file