Version Description
- Fixed: Conflicts with other plugins using the Constant Contact PHP SDK.
- Fixed: Added honeypot-style spam prevention on forms.
- Fixed: Removed anonymous function usage in widget to prevent potential errors.
- Fixed: Hardened up helper function in cases where internal function does not exist.
- Fixed: Issues with multiple custom textareas and the Constant Contact API. See the "Learn more" link/modal for some more information.
- Added: Potential admin notice requesting users to review plugin if they have not already.
Download this release
Release Info
Developer | constantcontact |
Plugin | Constant Contact Forms |
Version | 1.2.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 1.2.2
- assets/css/admin-forms.css +15 -0
- assets/css/style.min.css +1 -1
- assets/images/fields-image.png +0 -0
- assets/js/ctct-plugin-admin.js +41 -2
- assets/js/ctct-plugin-admin.min.js +1 -1
- assets/js/ctct-plugin-admin/ajax.js +32 -0
- assets/js/ctct-plugin-admin/modal.js +9 -2
- assets/sass/_modal.scss +14 -0
- constant-contact-forms.php +2 -2
- includes/class-api.php +17 -0
- includes/class-builder.php +48 -0
- includes/class-display.php +19 -3
- includes/class-mail.php +8 -4
- includes/class-notification-content.php +47 -0
- includes/class-process-form.php +16 -0
- includes/class-settings.php +23 -5
- includes/helper-functions.php +98 -1
- includes/widgets/contact-form-select.php +5 -3
- languages/constant-contact-forms.pot +101 -53
- readme.txt +9 -1
- vendor/constantcontact/constantcontact/constantcontact/src/Ctct/SplClassLoader.php +1 -1
- vendor/constantcontact/constantcontact/constantcontact/src/Ctct/autoload.php +1 -1
assets/css/admin-forms.css
CHANGED
@@ -269,6 +269,21 @@
|
|
269 |
}
|
270 |
}
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
.ctct-modal .ctct-modal-content .ctct-modal-body .button {
|
273 |
border-radius: 4px;
|
274 |
color: #fff;
|
269 |
}
|
270 |
}
|
271 |
|
272 |
+
.ctct-modal .ctct-modal-content .ctct-modal-body.ctct-custom-textarea .ctct-modal-left {
|
273 |
+
border: none;
|
274 |
+
padding-left: 15px;
|
275 |
+
text-align: left;
|
276 |
+
}
|
277 |
+
|
278 |
+
.ctct-modal .ctct-modal-content .ctct-modal-body.ctct-custom-textarea .ctct-modal-right {
|
279 |
+
border: none;
|
280 |
+
padding: 15px;
|
281 |
+
}
|
282 |
+
|
283 |
+
.ctct-modal .ctct-modal-content .ctct-modal-body.ctct-custom-textarea .ctct-modal-right img {
|
284 |
+
max-width: 100%;
|
285 |
+
}
|
286 |
+
|
287 |
.ctct-modal .ctct-modal-content .ctct-modal-body .button {
|
288 |
border-radius: 4px;
|
289 |
color: #fff;
|
assets/css/style.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.ctct-form-wrapper .ctct-button{font-size:.9em}.ctct-form-wrapper .ctct-message{border:1px solid;padding:1em}.ctct-form-wrapper .error{background-color:rgba(255,65,54,.02);border-color:#ff4136;color:#cf0b00}.ctct-form-wrapper .success{background-color:rgba(46,204,64,.02);border-color:#2ecc40;color:#1b7926}.ctct-form-wrapper .ctct-form-field{margin:0 0 1em}.ctct-form-wrapper .ctct-field-inline{display:inline-block}.ctct-form-wrapper input[type=email]:required:valid,.ctct-form-wrapper input[type=number]:required:valid,.ctct-form-wrapper input[type=password]:required:valid,.ctct-form-wrapper input[type=tel]:required:valid,.ctct-form-wrapper input[type=text]:required:valid{background:#fff url(../images/check_circle.svg) no-repeat;background-position:8px 50%;background-size:24px;border-color:#2ecc40;padding-left:40px}.ctct-form-wrapper input[type=email].ctct-invalid,.ctct-form-wrapper input[type=email]:required.ctct-invalid,.ctct-form-wrapper input[type=number].ctct-invalid,.ctct-form-wrapper input[type=number]:required.ctct-invalid,.ctct-form-wrapper input[type=password].ctct-invalid,.ctct-form-wrapper input[type=password]:required.ctct-invalid,.ctct-form-wrapper input[type=tel].ctct-invalid,.ctct-form-wrapper input[type=tel]:required.ctct-invalid,.ctct-form-wrapper input[type=text].ctct-invalid,.ctct-form-wrapper input[type=text]:required.ctct-invalid{background:#fff url(../images/error.svg) no-repeat;background-color:rgba(255,65,54,.02);background-position:8px 50%;background-size:24px;border-color:#ff4136;padding-left:40px}.ctct-form-wrapper .ctct-field-error{font-size:.85em;font-style:italic}.ctct-form-wrapper input.ctct-invalid{background:#fff url(../images/error.svg) no-repeat;background-color:rgba(255,65,54,.02);background-position:8px 50%;background-size:24px;border-color:#ff4136;padding-left:40px}.ctct-form-wrapper .ctct-form:after{clear:both;content:"";display:table}.ctct-form-wrapper .ctct-form abbr{border:none;color:#ff4136;font-size:.9em}.ctct-form-wrapper .ctct-input-container label{color:#aaa;font-size:.8em}.ctct-form-wrapper .ctct-field-error{color:#ff4136}.ctct-twentyfourteen .ctct-form-field input{width:100%}@media (min-width:992px){.ctct-form-wrapper .ctct-field-half{float:left;margin-right:2%;width:48%}.ctct-form-wrapper .ctct-field-half:last-of-type{margin-right:0}.ctct-form-wrapper .ctct-field-third{float:left;margin-right:2%;width:32%}.ctct-form-wrapper .ctct-field-third:last-of-type{margin-right:0}.ctct-form-wrapper .ctct-field-fourth{float:left;margin-right:2%;width:24%}.ctct-form-wrapper .ctct-field-fourth:last-of-type{margin-right:0}}
|
1 |
+
.ctct-form-wrapper .ctct-button{font-size:.9em}.ctct-form-wrapper .ctct-message{border:1px solid;padding:1em}.ctct-form-wrapper .error{background-color:rgba(255,65,54,.02);border-color:#ff4136;color:#cf0b00}.ctct-form-wrapper .success{background-color:rgba(46,204,64,.02);border-color:#2ecc40;color:#1b7926}.ctct-form-wrapper .ctct-form-field{margin:0 0 1em}.ctct-form-wrapper .ctct-field-inline{display:inline-block}.ctct-form-wrapper input[type=email]:required:valid,.ctct-form-wrapper input[type=number]:required:valid,.ctct-form-wrapper input[type=password]:required:valid,.ctct-form-wrapper input[type=tel]:required:valid,.ctct-form-wrapper input[type=text]:required:valid{background:#fff url(../images/check_circle.svg) no-repeat;background-position:8px 50%;background-size:24px;border-color:#2ecc40;padding-left:40px}.ctct-form-wrapper input[type=email].ctct-invalid,.ctct-form-wrapper input[type=email]:required.ctct-invalid,.ctct-form-wrapper input[type=number].ctct-invalid,.ctct-form-wrapper input[type=number]:required.ctct-invalid,.ctct-form-wrapper input[type=password].ctct-invalid,.ctct-form-wrapper input[type=password]:required.ctct-invalid,.ctct-form-wrapper input[type=tel].ctct-invalid,.ctct-form-wrapper input[type=tel]:required.ctct-invalid,.ctct-form-wrapper input[type=text].ctct-invalid,.ctct-form-wrapper input[type=text]:required.ctct-invalid{background:#fff url(../images/error.svg) no-repeat;background-color:rgba(255,65,54,.02);background-position:8px 50%;background-size:24px;border-color:#ff4136;padding-left:40px}.ctct-form-wrapper .ctct-field-error{font-size:.85em;font-style:italic}.ctct-form-wrapper input.ctct-invalid{background:#fff url(../images/error.svg) no-repeat;background-color:rgba(255,65,54,.02);background-position:8px 50%;background-size:24px;border-color:#ff4136;padding-left:40px}.ctct-form-wrapper .ctct-form:after{clear:both;content:"";display:table}.ctct-form-wrapper .ctct-form abbr{border:none;color:#ff4136;font-size:.9em}.ctct-form-wrapper .ctct-input-container label{color:#aaa;font-size:.8em}.ctct-form-wrapper .ctct-field-error{color:#ff4136}.ctct-twentyfourteen .ctct-form-field input{width:100%}@media (min-width:992px){.ctct-form-wrapper .ctct-field-half{float:left;margin-right:2%;width:48%}.ctct-form-wrapper .ctct-field-half:last-of-type{margin-right:0}.ctct-form-wrapper .ctct-field-third{float:left;margin-right:2%;width:32%}.ctct-form-wrapper .ctct-field-third:last-of-type{margin-right:0}.ctct-form-wrapper .ctct-field-fourth{float:left;margin-right:2%;width:24%}.ctct-form-wrapper .ctct-field-fourth:last-of-type{margin-right:0}}
|
assets/images/fields-image.png
ADDED
Binary file
|
assets/js/ctct-plugin-admin.js
CHANGED
@@ -5,6 +5,7 @@ window.CTCTAJAX = {};
|
|
5 |
that.init = function() {
|
6 |
// Trigger any field modifications we need to do
|
7 |
that.handleOptinAJAX();
|
|
|
8 |
}
|
9 |
|
10 |
// We need to manipulate our form builder a bit. We do this here.
|
@@ -67,6 +68,37 @@ window.CTCTAJAX = {};
|
|
67 |
|
68 |
};
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
// Engage!
|
71 |
$( that.init );
|
72 |
|
@@ -353,14 +385,18 @@ window.CTCTModal = {};
|
|
353 |
window: $( window ),
|
354 |
modalSelector: $( '.ctct-modal' ),
|
355 |
modalClose: $( '.ctct-modal-close' ),
|
|
|
|
|
356 |
};
|
357 |
};
|
358 |
|
359 |
// Combine all events
|
360 |
app.bindEvents = function() {
|
361 |
-
|
362 |
app.$c.modalSelector.removeClass( 'ctct-modal-open' );
|
363 |
-
|
|
|
|
|
364 |
jQuery.ajax({
|
365 |
type : "post",
|
366 |
dataType : "json",
|
@@ -371,6 +407,9 @@ window.CTCTModal = {};
|
|
371 |
}
|
372 |
});
|
373 |
});
|
|
|
|
|
|
|
374 |
};
|
375 |
|
376 |
// Engage
|
5 |
that.init = function() {
|
6 |
// Trigger any field modifications we need to do
|
7 |
that.handleOptinAJAX();
|
8 |
+
that.handleReviewAJAX();
|
9 |
}
|
10 |
|
11 |
// We need to manipulate our form builder a bit. We do this here.
|
68 |
|
69 |
};
|
70 |
|
71 |
+
that.handleReviewAJAX = function() {
|
72 |
+
$('#ctct-admin-notice-review_request').on('click', 'a', function (e) {
|
73 |
+
var ctct_action = 'dismissed';
|
74 |
+
if ( $(this).hasClass('ctct-review') ) {
|
75 |
+
ctct_action = 'reviewed';
|
76 |
+
}
|
77 |
+
var ctct_review_ajax = {
|
78 |
+
'action': 'constant_contact_review_ajax_handler',
|
79 |
+
'ctct-review-action': ctct_action
|
80 |
+
}
|
81 |
+
|
82 |
+
$.ajax({
|
83 |
+
url : ajaxurl,
|
84 |
+
data : ctct_review_ajax,
|
85 |
+
dataType: 'json',
|
86 |
+
success: function (resp) {
|
87 |
+
if (window.console) {
|
88 |
+
console.log(resp);
|
89 |
+
}
|
90 |
+
e.preventDefault();
|
91 |
+
$('#ctct-admin-notice-review_request').hide();
|
92 |
+
},
|
93 |
+
error : function (x, t, m) {
|
94 |
+
if (window.console) {
|
95 |
+
console.log([t, m]);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
});
|
99 |
+
});
|
100 |
+
}
|
101 |
+
|
102 |
// Engage!
|
103 |
$( that.init );
|
104 |
|
385 |
window: $( window ),
|
386 |
modalSelector: $( '.ctct-modal' ),
|
387 |
modalClose: $( '.ctct-modal-close' ),
|
388 |
+
textareaModal: $( '#ctct-custom-textarea-modal' ),
|
389 |
+
textareaLink: $( '#ctct-open-textarea-info' ),
|
390 |
};
|
391 |
};
|
392 |
|
393 |
// Combine all events
|
394 |
app.bindEvents = function() {
|
395 |
+
app.$c.modalClose.click( function() {
|
396 |
app.$c.modalSelector.removeClass( 'ctct-modal-open' );
|
397 |
+
if ( app.$c.modalSelector.hasClass('ctct-custom-textarea-modal') ) {
|
398 |
+
return;
|
399 |
+
}
|
400 |
jQuery.ajax({
|
401 |
type : "post",
|
402 |
dataType : "json",
|
407 |
}
|
408 |
});
|
409 |
});
|
410 |
+
app.$c.textareaLink.on('click', function(){
|
411 |
+
app.$c.textareaModal.addClass( 'ctct-modal-open' );
|
412 |
+
});
|
413 |
};
|
414 |
|
415 |
// Engage
|
assets/js/ctct-plugin-admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
window.CTCTAJAX={},function(t,
|
1 |
+
window.CTCTAJAX={},function(t,e,c){c.init=function(){c.handleOptinAJAX(),c.handleReviewAJAX()},c.handleOptinAJAX=function(){e("#ctct_admin_notice_tracking_optin").on("click",function(c){var n={action:"constant_contact_optin_ajax_handler",optin:e(this).is(":checked")?"on":"off"};e.ajax({url:ajaxurl,data:n,dataType:"json",success:function(t){},error:function(e,c,n){t.console&&console.log([c,n])}}),e("#ctct-privacy-modal").toggleClass("ctct-modal-open")}),e("#_ctct_data_tracking").on("click",function(t){e("#ctct-privacy-modal").toggleClass("ctct-modal-open")}),e(".ctct-modal-close").on("click",function(t){e("#_ctct_data_tracking").is(":checked")&&e("#_ctct_data_tracking").attr("checked",!1)}),e("#ctct-modal-footer-privacy a").on("click",function(c){var n={action:"constant_contact_privacy_ajax_handler",privacy_agree:e(this).attr("data-agree")};e.ajax({url:ajaxurl,data:n,dataType:"json",success:function(t){e("#ctct-privacy-modal").toggleClass("ctct-modal-open"),"false"===n.privacy_agree&&e("#_ctct_data_tracking").is(":checked")&&e("#_ctct_data_tracking").attr("checked",!1)},error:function(e,c,n){t.console&&console.log([c,n])}})})},c.handleReviewAJAX=function(){e("#ctct-admin-notice-review_request").on("click","a",function(c){var n="dismissed";e(this).hasClass("ctct-review")&&(n="reviewed");var i={action:"constant_contact_review_ajax_handler","ctct-review-action":n};e.ajax({url:ajaxurl,data:i,dataType:"json",success:function(n){t.console&&console.log(n),c.preventDefault(),e("#ctct-admin-notice-review_request").hide()},error:function(e,c,n){t.console&&console.log([c,n])}})})},e(c.init)}(window,jQuery,window.CTCTAJAX),window.CTCTBuilder={},function(t,e,c){c.init=function(){e("#cmb2-metabox-ctct_2_fields_metabox option[value='email']:selected").length&&e("#ctct-no-email-error").remove(),c.cache(),c.bindEvents(),c.selectBinds(),c.modifyFields(),e("#ctct_0_description_metabox h2.hndle").removeClass("ui-sortable-handle, hndle"),e("head").append('<style> #cmb2-metabox-ctct_2_fields_metabox a.move-up::after { content: "'+ctct_texts.move_up+'" } #cmb2-metabox-ctct_2_fields_metabox a.move-down::after { content: "'+ctct_texts.move_down+'" }</style>')},c.cache=function(){c.$c={window:e(t),body:e("body")},c.isLeaveWarningBound=!1},c.bindLeaveWarning=function(){c.isLeaveWarningBound||(e(t).bind("beforeunload",function(){return ctct_texts.leavewarning}),c.isLeaveWarningBound=!0)},c.unbindLeaveWarning=function(){e(t).unbind("beforeunload")},c.bindEvents=function(){e("#post").submit(function(){e(".ctct-email-disabled").removeClass("disabled").prop("disabled",!1),c.unbindLeaveWarning()}),e(".cmb2-wrap input, .cmb2-wrap textarea").on("input",function(){c.bindLeaveWarning()}),e(document).on("cmb2_shift_rows_complete",function(){c.modifyFields(),c.bindLeaveWarning(),c.removeDuplicateMappings()}),e(document).on("cmb2_add_row",function(t){e("#custom_fields_group_repeat .postbox").last().find(".map select").val("none"),c.modifyFields(),c.selectBinds(),c.removeDuplicateMappings()}),c.removeDuplicateMappings()},c.selectBinds=function(){e("#cmb2-metabox-ctct_2_fields_metabox .cmb2_select").change(function(){c.modifyFields(),c.removeDuplicateMappings(),c.bindLeaveWarning()})},c.modifyFields=function(){var c=!1;e("#cmb2-metabox-ctct_2_fields_metabox #custom_fields_group_repeat .cmb-repeatable-grouping").each(function(n,i){var o=e(this).find(".cmb-field-list"),a=e(o).find(".cmb-remove-group-row"),s=e(o).find(".required input[type=checkbox]"),l=s.closest(".cmb-row"),d=e(o).find(".map select option:selected"),r=d.text(),u=e(this).find("h3"),_=e(this).find("input[name*='_ctct_field_label']"),m=e(this).find("input[name*='_ctct_field_desc']");if(u.text(r),(0===_.val().length||_.hasClass("ctct-label-filled"))&&_.val(r).addClass("ctct-label-filled"),c||"email"!==e(d).val()?(e(i).find("select").removeClass("disabled ctct-email-disabled").prop("disabled",!1),l.show(),a.show()):(c=!0,s.prop("checked",!0),e(i).find("select").addClass("disabled ctct-email-disabled").prop("disabled",!0),l.hide(),a.hide()),t.ctct_admin_placeholders){var p=t.ctct_admin_placeholders[e(i).find("select").val()];p&&p.length&&m.length?m.attr("placeholder","Example: "+p):t.ctct_admin_placeholders["default"]&&m.attr("placeholder",t.ctct_admin_placeholders["default"])}})},c.removeDuplicateMappings=function(){var t=[],c="#cmb2-metabox-ctct_2_fields_metabox #custom_fields_group_repeat .cmb-repeatable-grouping select",n=e(c);n.each(function(c,n){t.push(e(n).val())}),n.children().show(),t.forEach(function(t){"custom_text_area"!=t&&"custom"!=t&&e(c+" option[value="+t+"]:not( :selected )").hide()})},e(c.init)}(window,jQuery,window.CTCTBuilder),window.CTCTForms={},function(t,e,c){c.init=function(){c.cache(),c.bindEvents()},c.cache=function(){c.$c={window:e(t),body:e("body"),disconnect:".ctct-disconnect"}},c.bindEvents=function(){e(c.$c.disconnect).on("click",function(t){confirm(ctct_texts.disconnectconfirm)})},e(c.init)}(window,jQuery,window.CTCTForms),window.CTCTModal={},function(t,e,c){c.init=function(){c.cache(),c.bindEvents()},c.cache=function(){c.$c={window:e(t),modalSelector:e(".ctct-modal"),modalClose:e(".ctct-modal-close"),textareaModal:e("#ctct-custom-textarea-modal"),textareaLink:e("#ctct-open-textarea-info")}},c.bindEvents=function(){c.$c.modalClose.click(function(){c.$c.modalSelector.removeClass("ctct-modal-open"),c.$c.modalSelector.hasClass("ctct-custom-textarea-modal")||jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:"ctct_dismiss_first_modal",ctct_is_dismissed:"true"}})}),c.$c.textareaLink.on("click",function(){c.$c.textareaModal.addClass("ctct-modal-open")})},e(c.init)}(window,jQuery,window.CTCTModal),window.CTCTNewsletter={},function(t,e,c){c.init=function(){c.submitNewsletter()},e(c.init),c.submitNewsletter=function(){e(".ctct-body #subscribe").on("submit",function(t){t.preventDefault(),console.log("connect");var c=e("#subscribe .ctct-call-to-action"),n=e(".ctct-body #subscribe")[0],i=e(".ctct-call-to-action input[type='text']")[0],o=t.target.action;i.validity.valid===!0?(e("<iframe>",{src:o+"?"+e(n).serialize(),height:0,width:0,style:"display: none;"}).appendTo(c),e("#subbutton").val("Thanks for signing up").css({"background-color":"rgb(1, 128, 0)",color:"rgb(255,255,255)"}),e("#subscribe .ctct-call-to-action-text").css({width:"70%"})):e("#subbutton").val("Error occurred")}),e(".ctct-section #subscribe").on("submit",function(t){t.preventDefault();var c=e(".section-marketing-tips"),n=e(".ctct-section #subscribe")[0],i=e(".ctct-section #subscribe input[type='text']")[0],o=t.target.action;i.validity.valid===!0?(e("<iframe>",{src:o+"?"+e(n).serialize(),height:0,width:0,style:"display: none;"}).appendTo(c),e("#subbutton").val("Thanks for signing up").css({"background-color":"rgb(1, 128, 0)"})):e("#subbutton").val("Error occurred")})}}(window,jQuery,window.CTCTNewsletter),window.CTCT_OptIns={},function(t,e,c){c.init=function(){c.cache(),c.bindEvents()},c.cache=function(){c.$c={optin_no_conn:e("#cmb2-metabox-ctct_1_optin_metabox #_ctct_opt_in_not_connected"),list:e("#cmb2-metabox-ctct_1_optin_metabox #_ctct_list"),optin:e("#cmb2-metabox-ctct_1_optin_metabox .cmb2-id--ctct-opt-in"),instruct:e("#cmb2-metabox-ctct_1_optin_metabox .cmb2-id--ctct-opt-in-instructions")}},c.bindEvents=function(){c.$c.optin_no_conn.length&&(c.toggleNoConnectionFields(),c.$c.optin_no_conn.change(function(){c.toggleNoConnectionFields()})),c.$c.list.length&&(c.toggleConnectionFields(),c.$c.list.change(function(){c.toggleConnectionFields()}))},c.toggleNoConnectionFields=function(){c.$c.optin_no_conn.prop("checked")?c.$c.instruct.slideDown():c.$c.instruct.slideUp()},c.toggleConnectionFields=function(){""!=c.$c.list.val()?(c.$c.optin.slideDown(),c.$c.instruct.slideDown()):(c.$c.optin.slideUp(),c.$c.instruct.slideUp())},e(c.init)}(window,jQuery,window.CTCT_OptIns);
|
assets/js/ctct-plugin-admin/ajax.js
CHANGED
@@ -5,6 +5,7 @@ window.CTCTAJAX = {};
|
|
5 |
that.init = function() {
|
6 |
// Trigger any field modifications we need to do
|
7 |
that.handleOptinAJAX();
|
|
|
8 |
}
|
9 |
|
10 |
// We need to manipulate our form builder a bit. We do this here.
|
@@ -67,6 +68,37 @@ window.CTCTAJAX = {};
|
|
67 |
|
68 |
};
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
// Engage!
|
71 |
$( that.init );
|
72 |
|
5 |
that.init = function() {
|
6 |
// Trigger any field modifications we need to do
|
7 |
that.handleOptinAJAX();
|
8 |
+
that.handleReviewAJAX();
|
9 |
}
|
10 |
|
11 |
// We need to manipulate our form builder a bit. We do this here.
|
68 |
|
69 |
};
|
70 |
|
71 |
+
that.handleReviewAJAX = function() {
|
72 |
+
$('#ctct-admin-notice-review_request').on('click', 'a', function (e) {
|
73 |
+
var ctct_action = 'dismissed';
|
74 |
+
if ( $(this).hasClass('ctct-review') ) {
|
75 |
+
ctct_action = 'reviewed';
|
76 |
+
}
|
77 |
+
var ctct_review_ajax = {
|
78 |
+
'action': 'constant_contact_review_ajax_handler',
|
79 |
+
'ctct-review-action': ctct_action
|
80 |
+
}
|
81 |
+
|
82 |
+
$.ajax({
|
83 |
+
url : ajaxurl,
|
84 |
+
data : ctct_review_ajax,
|
85 |
+
dataType: 'json',
|
86 |
+
success: function (resp) {
|
87 |
+
if (window.console) {
|
88 |
+
console.log(resp);
|
89 |
+
}
|
90 |
+
e.preventDefault();
|
91 |
+
$('#ctct-admin-notice-review_request').hide();
|
92 |
+
},
|
93 |
+
error : function (x, t, m) {
|
94 |
+
if (window.console) {
|
95 |
+
console.log([t, m]);
|
96 |
+
}
|
97 |
+
}
|
98 |
+
});
|
99 |
+
});
|
100 |
+
}
|
101 |
+
|
102 |
// Engage!
|
103 |
$( that.init );
|
104 |
|
assets/js/ctct-plugin-admin/modal.js
CHANGED
@@ -13,14 +13,18 @@ window.CTCTModal = {};
|
|
13 |
window: $( window ),
|
14 |
modalSelector: $( '.ctct-modal' ),
|
15 |
modalClose: $( '.ctct-modal-close' ),
|
|
|
|
|
16 |
};
|
17 |
};
|
18 |
|
19 |
// Combine all events
|
20 |
app.bindEvents = function() {
|
21 |
-
|
22 |
app.$c.modalSelector.removeClass( 'ctct-modal-open' );
|
23 |
-
|
|
|
|
|
24 |
jQuery.ajax({
|
25 |
type : "post",
|
26 |
dataType : "json",
|
@@ -31,6 +35,9 @@ window.CTCTModal = {};
|
|
31 |
}
|
32 |
});
|
33 |
});
|
|
|
|
|
|
|
34 |
};
|
35 |
|
36 |
// Engage
|
13 |
window: $( window ),
|
14 |
modalSelector: $( '.ctct-modal' ),
|
15 |
modalClose: $( '.ctct-modal-close' ),
|
16 |
+
textareaModal: $( '#ctct-custom-textarea-modal' ),
|
17 |
+
textareaLink: $( '#ctct-open-textarea-info' ),
|
18 |
};
|
19 |
};
|
20 |
|
21 |
// Combine all events
|
22 |
app.bindEvents = function() {
|
23 |
+
app.$c.modalClose.click( function() {
|
24 |
app.$c.modalSelector.removeClass( 'ctct-modal-open' );
|
25 |
+
if ( app.$c.modalSelector.hasClass('ctct-custom-textarea-modal') ) {
|
26 |
+
return;
|
27 |
+
}
|
28 |
jQuery.ajax({
|
29 |
type : "post",
|
30 |
dataType : "json",
|
35 |
}
|
36 |
});
|
37 |
});
|
38 |
+
app.$c.textareaLink.on('click', function(){
|
39 |
+
app.$c.textareaModal.addClass( 'ctct-modal-open' );
|
40 |
+
});
|
41 |
};
|
42 |
|
43 |
// Engage
|
assets/sass/_modal.scss
CHANGED
@@ -254,6 +254,20 @@
|
|
254 |
}
|
255 |
} // right
|
256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
.button {
|
258 |
border-radius: 4px;
|
259 |
color: $color-white;
|
254 |
}
|
255 |
} // right
|
256 |
|
257 |
+
&.ctct-custom-textarea {
|
258 |
+
.ctct-modal-left {
|
259 |
+
border: none;
|
260 |
+
padding-left: 15px;
|
261 |
+
text-align: left;
|
262 |
+
}
|
263 |
+
.ctct-modal-right {
|
264 |
+
border: none;
|
265 |
+
padding: 15px;
|
266 |
+
img {
|
267 |
+
max-width: 100%;
|
268 |
+
}
|
269 |
+
}
|
270 |
+
}
|
271 |
.button {
|
272 |
border-radius: 4px;
|
273 |
color: $color-white;
|
constant-contact-forms.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
* Plugin Name: Constant Contact Forms for WordPress
|
13 |
* Plugin URI: https://www.constantcontact.com
|
14 |
* Description: Be a better marketer. All it takes is Constant Contact email marketing.
|
15 |
-
* Version: 1.2.
|
16 |
* Author: Constant Contact
|
17 |
* Author URI: https://www.constantcontact.com
|
18 |
* License: GPLv3
|
@@ -77,7 +77,7 @@ class Constant_Contact {
|
|
77 |
* @var string
|
78 |
* @since 1.0.0
|
79 |
*/
|
80 |
-
const VERSION = '1.2.
|
81 |
|
82 |
/**
|
83 |
* URL of plugin directory
|
12 |
* Plugin Name: Constant Contact Forms for WordPress
|
13 |
* Plugin URI: https://www.constantcontact.com
|
14 |
* Description: Be a better marketer. All it takes is Constant Contact email marketing.
|
15 |
+
* Version: 1.2.2
|
16 |
* Author: Constant Contact
|
17 |
* Author URI: https://www.constantcontact.com
|
18 |
* License: GPLv3
|
77 |
* @var string
|
78 |
* @since 1.0.0
|
79 |
*/
|
80 |
+
const VERSION = '1.2.2';
|
81 |
|
82 |
/**
|
83 |
* URL of plugin directory
|
includes/class-api.php
CHANGED
@@ -517,6 +517,8 @@ class ConstantContact_API {
|
|
517 |
|
518 |
$address = null;
|
519 |
$count = 0;
|
|
|
|
|
520 |
|
521 |
// Loop through each of our values and set it as a property.
|
522 |
foreach ( $user_data as $original => $value ) {
|
@@ -598,6 +600,21 @@ class ConstantContact_API {
|
|
598 |
// Attach it.
|
599 |
$contact->addCustomField( $custom );
|
600 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
default:
|
602 |
// If we got here, try to map our field to the key.
|
603 |
try {
|
517 |
|
518 |
$address = null;
|
519 |
$count = 0;
|
520 |
+
$textareas = 0;
|
521 |
+
$contact->notes = array();
|
522 |
|
523 |
// Loop through each of our values and set it as a property.
|
524 |
foreach ( $user_data as $original => $value ) {
|
600 |
// Attach it.
|
601 |
$contact->addCustomField( $custom );
|
602 |
break;
|
603 |
+
case 'custom_text_area':
|
604 |
+
$textareas++;
|
605 |
+
// API version 2 only allows for 1 note for a given request.
|
606 |
+
// Version 3 will allow multiple notes.
|
607 |
+
if ( $textareas > 1 ) {
|
608 |
+
break;
|
609 |
+
}
|
610 |
+
$unique_id = explode( '___', $original );
|
611 |
+
$contact->notes[] = array(
|
612 |
+
'created_date' => date( 'Y-m-d\TH:i:s' ),
|
613 |
+
'id' => $unique_id[1],
|
614 |
+
'modified_date' => date( 'Y-m-d\TH:i:s' ),
|
615 |
+
'note' => $value,
|
616 |
+
);
|
617 |
+
break;
|
618 |
default:
|
619 |
// If we got here, try to map our field to the key.
|
620 |
try {
|
includes/class-builder.php
CHANGED
@@ -196,6 +196,24 @@ class ConstantContact_Builder {
|
|
196 |
echo '</p></div>';
|
197 |
}
|
198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
// Check for our query arg
|
200 |
if ( isset( $_GET['ctct_not_connected'] ) && sanitize_text_field( wp_unslash( $_GET['ctct_not_connected'] ) ) ) { //Input var okay.
|
201 |
|
@@ -348,4 +366,34 @@ class ConstantContact_Builder {
|
|
348 |
</div><!-- .modal-dialog -->
|
349 |
</div>
|
350 |
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
}
|
196 |
echo '</p></div>';
|
197 |
}
|
198 |
|
199 |
+
$custom_fields = get_post_meta( $post->ID, 'custom_fields_group', true );
|
200 |
+
$custom_textareas_count = (int) 0;
|
201 |
+
if ( ! empty( $custom_fields ) && is_array( $custom_fields) ) {
|
202 |
+
foreach ( $custom_fields as $field ) {
|
203 |
+
if ( 'custom_text_area' === $field['_ctct_map_select'] ) {
|
204 |
+
$custom_textareas_count++;
|
205 |
+
}
|
206 |
+
}
|
207 |
+
if ( $custom_textareas_count > 1 && constant_contact()->api->is_connected() ) {
|
208 |
+
echo '<div id="ctct-too-many-textareas" class="notice notice-warning"><p>';
|
209 |
+
// @todo address the lack of escaping.
|
210 |
+
_e( 'You have multiple <strong>Custom Text Area</strong> fields in this form. <strong>Only the first field</strong> will be sent to Constant Contact. <a id="ctct-open-textarea-info" href="#">Learn More ></a>', 'constant-contact-forms' );
|
211 |
+
echo '</p></div>';
|
212 |
+
|
213 |
+
$this->output_custom_textarea_modal();
|
214 |
+
}
|
215 |
+
}
|
216 |
+
|
217 |
// Check for our query arg
|
218 |
if ( isset( $_GET['ctct_not_connected'] ) && sanitize_text_field( wp_unslash( $_GET['ctct_not_connected'] ) ) ) { //Input var okay.
|
219 |
|
366 |
</div><!-- .modal-dialog -->
|
367 |
</div>
|
368 |
<?php }
|
369 |
+
|
370 |
+
/**
|
371 |
+
* Outputs our modal for too many custom textareas information.
|
372 |
+
*
|
373 |
+
* @since 1.2.2
|
374 |
+
*/
|
375 |
+
public function output_custom_textarea_modal() {
|
376 |
+
?>
|
377 |
+
<div id="ctct-custom-textarea-modal" class="ctct-modal ctct-custom-textarea-modal">
|
378 |
+
<div class="ctct-modal-dialog" role="document">
|
379 |
+
<div class="ctct-modal-content">
|
380 |
+
<div class="ctct-modal-header">
|
381 |
+
<a href="#" class="ctct-modal-close" aria-hidden="true">×</a>
|
382 |
+
<h2><?php esc_html_e( 'Custom Text Area limitations.', 'constant-contact-forms' ); ?></h2>
|
383 |
+
</div>
|
384 |
+
<div class="ctct-modal-body ctct-custom-textarea-modal-body ctct-custom-textarea">
|
385 |
+
<div class="ctct-modal-left">
|
386 |
+
<?php echo wpautop( __( 'Apology, at this time, we can only upload one <strong>"Custom Text Area"</strong> field to your Constant Contact account, per form submission. The uploaded field is placed into your contact\'s "Notes" field.', 'constant-contact-forms' ) );
|
387 |
+
echo wpautop( __( '<strong>The first listed "Custom Text Area"</strong> field is sent to Constant Contact.', 'constant-contact-forms' ) );
|
388 |
+
echo wpautop( esc_html__( 'Subsequent "Custom Text Area" fields are only sent with the admin email when the form is submitted, and not to your Constant Contact account.', 'constant-contact-forms' ) );
|
389 |
+
?></div>
|
390 |
+
<div class="ctct-modal-right">
|
391 |
+
<img src="<?php echo esc_url_raw( $this->plugin->url . 'assets/images/fields-image.png' ); ?>" alt="<?php echo esc_attr_x( 'screenshot regarding custom text areas', 'connect alt text', 'constant-contact-forms' ); ?>" />
|
392 |
+
</div>
|
393 |
+
</div><!-- modal body -->
|
394 |
+
</div><!-- .modal-content -->
|
395 |
+
</div><!-- .modal-dialog -->
|
396 |
+
</div>
|
397 |
+
<?php
|
398 |
+
}
|
399 |
}
|
includes/class-display.php
CHANGED
@@ -160,6 +160,9 @@ class ConstantContact_Display {
|
|
160 |
// Output our normal form fields.
|
161 |
$return .= $this->build_form_fields( $form_data, $old_values, $req_errors );
|
162 |
|
|
|
|
|
|
|
163 |
// Add our hidden verification fields.
|
164 |
$return .= $this->add_verify_fields( $form_data );
|
165 |
|
@@ -290,6 +293,18 @@ class ConstantContact_Display {
|
|
290 |
return $return;
|
291 |
}
|
292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
/**
|
294 |
* Wrapper for single field display.
|
295 |
*
|
@@ -375,7 +390,7 @@ class ConstantContact_Display {
|
|
375 |
return $this->input( 'text', $name, $map, $value, $desc, $req, false, $field_error );
|
376 |
break;
|
377 |
case 'custom_text_area':
|
378 |
-
return $this->textarea( $name, $map, $value, $desc, $req,
|
379 |
break;
|
380 |
case 'email':
|
381 |
return $this->input( 'email', $name, $map, $value, $desc, $req, false, $field_error );
|
@@ -1125,9 +1140,10 @@ class ConstantContact_Display {
|
|
1125 |
* @param string $desc Description/label of field.
|
1126 |
* @param boolean $req If is required.
|
1127 |
* @param string $field_error Error from field.
|
|
|
1128 |
* @return string HTML markup.
|
1129 |
*/
|
1130 |
-
public function textarea( $name = '', $map = '', $value = '', $desc = '', $req = false, $field_error = '' ) {
|
1131 |
// Set our required text.
|
1132 |
$req_text = $req ? 'required' : '';
|
1133 |
|
@@ -1146,7 +1162,7 @@ class ConstantContact_Display {
|
|
1146 |
}
|
1147 |
|
1148 |
$return = '<p><label for="' . esc_attr( $map ) . '">' . esc_attr( $name ) . ' ' . $req_label . '</label>';
|
1149 |
-
$return .= '<textarea class="ctct-textarea" ' . $req_text . ' name="' . esc_attr( $map ) . '" placeholder="' . esc_attr( $desc ) . '">' . esc_html( $value ) . '</textarea>';
|
1150 |
|
1151 |
if ( $field_error ) {
|
1152 |
$return .= '<span class="ctct-field-error"><label for="' . esc_attr( $map ) . '">' . esc_attr( __( 'Error: Please correct your entry.', 'constant-contact-forms' ) ) . '</label></span>';
|
160 |
// Output our normal form fields.
|
161 |
$return .= $this->build_form_fields( $form_data, $old_values, $req_errors );
|
162 |
|
163 |
+
// Output a field that should not be populated, and will be visually hidden with inline CSS.
|
164 |
+
$return .= $this->build_honeypot_field();
|
165 |
+
|
166 |
// Add our hidden verification fields.
|
167 |
$return .= $this->add_verify_fields( $form_data );
|
168 |
|
293 |
return $return;
|
294 |
}
|
295 |
|
296 |
+
public function build_honeypot_field() {
|
297 |
+
$return = '';
|
298 |
+
|
299 |
+
$return .= sprintf(
|
300 |
+
'<div id="ctct_usage" style="%s"><label for="ctct_usage_field">%s</label><input type="text" value="" name="ctct_usage_field" id="ctct_usage_field" /></div>',
|
301 |
+
'position:absolute;overflow:hidden;clip:rect(0px,0px,0px,0px);height:1px;width:1px;margin:-1px;border:0px none;padding:0px;"',
|
302 |
+
esc_html__( 'Constant Contact Use.', 'constant-contact-forms' )
|
303 |
+
);
|
304 |
+
|
305 |
+
return $return;
|
306 |
+
}
|
307 |
+
|
308 |
/**
|
309 |
* Wrapper for single field display.
|
310 |
*
|
390 |
return $this->input( 'text', $name, $map, $value, $desc, $req, false, $field_error );
|
391 |
break;
|
392 |
case 'custom_text_area':
|
393 |
+
return $this->textarea( $name, $map, $value, $desc, $req, $field_error, 'maxlength="500"' );
|
394 |
break;
|
395 |
case 'email':
|
396 |
return $this->input( 'email', $name, $map, $value, $desc, $req, false, $field_error );
|
1140 |
* @param string $desc Description/label of field.
|
1141 |
* @param boolean $req If is required.
|
1142 |
* @param string $field_error Error from field.
|
1143 |
+
* @param string $extra_attrs Extra attributes to append.
|
1144 |
* @return string HTML markup.
|
1145 |
*/
|
1146 |
+
public function textarea( $name = '', $map = '', $value = '', $desc = '', $req = false, $field_error = '', $extra_attrs = '' ) {
|
1147 |
// Set our required text.
|
1148 |
$req_text = $req ? 'required' : '';
|
1149 |
|
1162 |
}
|
1163 |
|
1164 |
$return = '<p><label for="' . esc_attr( $map ) . '">' . esc_attr( $name ) . ' ' . $req_label . '</label>';
|
1165 |
+
$return .= '<textarea class="ctct-textarea" ' . $req_text . ' name="' . esc_attr( $map ) . '" placeholder="' . esc_attr( $desc ) . '" ' . $extra_attrs . '>' . esc_html( $value ) . '</textarea>';
|
1166 |
|
1167 |
if ( $field_error ) {
|
1168 |
$return .= '<span class="ctct-field-error"><label for="' . esc_attr( $map ) . '">' . esc_attr( __( 'Error: Please correct your entry.', 'constant-contact-forms' ) ) . '</label></span>';
|
includes/class-mail.php
CHANGED
@@ -78,6 +78,9 @@ class ConstantContact_Mail {
|
|
78 |
// Format them.
|
79 |
$email_values = $this->format_values_for_email( $values );
|
80 |
|
|
|
|
|
|
|
81 |
// Skip sending e-mail if we're connected and the user has opted out of notification emails.
|
82 |
if ( constant_contact()->api->is_connected() && ( 'on' === ctct_get_settings_option( '_ctct_disable_email_notifications' ) ) ) {
|
83 |
return true;
|
@@ -175,10 +178,11 @@ class ConstantContact_Mail {
|
|
175 |
/**
|
176 |
* Sends our mail out.
|
177 |
*
|
178 |
-
* @since
|
179 |
-
*
|
180 |
-
* @param
|
181 |
-
* @
|
|
|
182 |
*/
|
183 |
public function mail( $destination_email, $content ) {
|
184 |
|
78 |
// Format them.
|
79 |
$email_values = $this->format_values_for_email( $values );
|
80 |
|
81 |
+
// Increment our counter for processed form entries.
|
82 |
+
constant_contact()->process_form->increment_processed_form_count();
|
83 |
+
|
84 |
// Skip sending e-mail if we're connected and the user has opted out of notification emails.
|
85 |
if ( constant_contact()->api->is_connected() && ( 'on' === ctct_get_settings_option( '_ctct_disable_email_notifications' ) ) ) {
|
86 |
return true;
|
178 |
/**
|
179 |
* Sends our mail out.
|
180 |
*
|
181 |
+
* @since 1.0.0
|
182 |
+
*
|
183 |
+
* @param string $destination_email Intended mail address.
|
184 |
+
* @param array $content Data from clean values.
|
185 |
+
* @return bool Whether or not sent.
|
186 |
*/
|
187 |
public function mail( $destination_email, $content ) {
|
188 |
|
includes/class-notification-content.php
CHANGED
@@ -118,6 +118,32 @@ class ConstantContact_Notification_Content {
|
|
118 |
return $output;
|
119 |
}
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
/**
|
122 |
* Sample update notification for updating to 1.0.1
|
123 |
*
|
@@ -164,3 +190,24 @@ function constant_contact_add_optin_notification( $notifications = array() ) {
|
|
164 |
return $notifications;
|
165 |
}
|
166 |
add_filter( 'constant_contact_notifications', 'constant_contact_add_optin_notification' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
return $output;
|
119 |
}
|
120 |
|
121 |
+
public static function review_request() {
|
122 |
+
add_filter( 'wp_kses_allowed_html', 'constant_contact_filter_html_tags_for_optin' );
|
123 |
+
|
124 |
+
ob_start();
|
125 |
+
?>
|
126 |
+
|
127 |
+
<div class="admin-notice-logo">
|
128 |
+
<img src="<?php echo constant_contact()->url; ?>/assets/images/ctct-admin-notice-logo.png" alt="<?php esc_attr_e( 'Constant Contact logo', 'constant-contact-forms' ); ?>" />
|
129 |
+
</div>
|
130 |
+
<div class="admin-notice-message">
|
131 |
+
<div>
|
132 |
+
<?php _e( 'You have been successfully using <strong>Constant Contact Forms</strong>. Congratulations on capturing valuable site visitor information! Please consider leaving us a nice review. Reviews help fellow WordPress admins find our plugin and lets you provide us useful feedback.', 'constant-contact-forms' ); ?>
|
133 |
+
|
134 |
+
</div>
|
135 |
+
<p>
|
136 |
+
<a class="button button-secondary ctct-review" target="_blank" href="https://wordpress.org/support/plugin/constant-contact-forms/reviews/">Leave a review</a>
|
137 |
+
<a class="button button-secondary ctct-review-dismiss" href="#">Dismiss</a>
|
138 |
+
</p>
|
139 |
+
</div>
|
140 |
+
<?php
|
141 |
+
$output = ob_get_clean();
|
142 |
+
// Be a good citizen, clean up after ourselves.
|
143 |
+
#remove_filter( 'wp_kses_allowed_html', 'constant_contact_filter_html_tags_for_optin' );
|
144 |
+
return $output;
|
145 |
+
}
|
146 |
+
|
147 |
/**
|
148 |
* Sample update notification for updating to 1.0.1
|
149 |
*
|
190 |
return $notifications;
|
191 |
}
|
192 |
add_filter( 'constant_contact_notifications', 'constant_contact_add_optin_notification' );
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Adds our opt-in notification to the notification system.
|
196 |
+
* @since 1.2.0
|
197 |
+
*
|
198 |
+
* @param array $notifications Array of notifications pending to show.
|
199 |
+
*
|
200 |
+
* @return array Array of notifications to show.
|
201 |
+
*/
|
202 |
+
function constant_contact_add_review_notification( $notifications = array() ) {
|
203 |
+
|
204 |
+
$notifications[] = array(
|
205 |
+
'ID' => 'review_request',
|
206 |
+
'callback' => array( 'ConstantContact_Notification_Content', 'review_request' ),
|
207 |
+
'require_cb' => 'constant_contact_maybe_display_review_notification',
|
208 |
+
);
|
209 |
+
|
210 |
+
return $notifications;
|
211 |
+
}
|
212 |
+
|
213 |
+
add_filter( 'constant_contact_notifications', 'constant_contact_add_review_notification' );
|
includes/class-process-form.php
CHANGED
@@ -138,6 +138,11 @@ class ConstantContact_Process_Form {
|
|
138 |
return;
|
139 |
}
|
140 |
|
|
|
|
|
|
|
|
|
|
|
141 |
// Verify our nonce first.
|
142 |
if (
|
143 |
! isset( $data['ctct_form'] ) ||
|
@@ -582,4 +587,15 @@ class ConstantContact_Process_Form {
|
|
582 |
'message' => $message,
|
583 |
);
|
584 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
585 |
}
|
138 |
return;
|
139 |
}
|
140 |
|
141 |
+
// Honeypot. Should be empty to proceed.
|
142 |
+
if ( ! empty ( $data['ctct_usage_field' ] ) ) {
|
143 |
+
return;
|
144 |
+
}
|
145 |
+
|
146 |
// Verify our nonce first.
|
147 |
if (
|
148 |
! isset( $data['ctct_form'] ) ||
|
587 |
'message' => $message,
|
588 |
);
|
589 |
}
|
590 |
+
|
591 |
+
/**
|
592 |
+
* Increment a counter for processed form submissions.
|
593 |
+
*
|
594 |
+
* @since 1.2.2
|
595 |
+
*/
|
596 |
+
public function increment_processed_form_count() {
|
597 |
+
$count = absint( get_option( 'ctct-processed-forms' ) );
|
598 |
+
$count++;
|
599 |
+
update_option( 'ctct-processed-forms', $count );
|
600 |
+
}
|
601 |
}
|
includes/class-settings.php
CHANGED
@@ -772,10 +772,28 @@ class ConstantContact_Settings {
|
|
772 |
/**
|
773 |
* Wrapper function around cmb2_get_option.
|
774 |
*
|
775 |
-
* @since
|
776 |
-
*
|
777 |
-
* @
|
|
|
|
|
778 |
*/
|
779 |
-
function ctct_get_settings_option( $key = '' ) {
|
780 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
781 |
}
|
772 |
/**
|
773 |
* Wrapper function around cmb2_get_option.
|
774 |
*
|
775 |
+
* @since 1.0.0
|
776 |
+
*
|
777 |
+
* @param string $key Options array key.
|
778 |
+
* @param string $default Default value if no option exists.
|
779 |
+
* @return mixed Option value.
|
780 |
*/
|
781 |
+
function ctct_get_settings_option( $key = '', $default = null ) {
|
782 |
+
if ( function_exists( 'cmb2_get_option' ) ) {
|
783 |
+
// Use cmb2_get_option as it passes through some key filters.
|
784 |
+
return cmb2_get_option( constant_contact()->settings->key, $key, $default );
|
785 |
+
}
|
786 |
+
|
787 |
+
// Fallback to get_option if CMB2 is not loaded yet.
|
788 |
+
$opts = get_option( constant_contact()->settings->key, $key, $default );
|
789 |
+
|
790 |
+
$val = $default;
|
791 |
+
|
792 |
+
if ( 'all' == $key ) {
|
793 |
+
$val = $opts;
|
794 |
+
} elseif ( array_key_exists( $key, $opts ) && false !== $opts[ $key ] ) {
|
795 |
+
$val = $opts[ $key ];
|
796 |
+
}
|
797 |
+
|
798 |
+
return $val;
|
799 |
}
|
includes/helper-functions.php
CHANGED
@@ -68,7 +68,7 @@ function constant_contact_get_forms() {
|
|
68 |
*
|
69 |
* @since 1.2.0
|
70 |
*
|
71 |
-
* @param $form_id Form ID to provide in the output.
|
72 |
* @return string Non-parsed shortcode.
|
73 |
*/
|
74 |
function constant_contact_display_shortcode( $form_id ) {
|
@@ -106,6 +106,63 @@ function constant_contact_maybe_display_optin_notification() {
|
|
106 |
return true;
|
107 |
}
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
/**
|
110 |
* Handle the optin checkbox for the admin notice.
|
111 |
*
|
@@ -143,3 +200,43 @@ function constant_contact_privacy_ajax_handler() {
|
|
143 |
exit();
|
144 |
}
|
145 |
add_action( 'wp_ajax_constant_contact_privacy_ajax_handler', 'constant_contact_privacy_ajax_handler' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
*
|
69 |
* @since 1.2.0
|
70 |
*
|
71 |
+
* @param string $form_id Form ID to provide in the output.
|
72 |
* @return string Non-parsed shortcode.
|
73 |
*/
|
74 |
function constant_contact_display_shortcode( $form_id ) {
|
106 |
return true;
|
107 |
}
|
108 |
|
109 |
+
/**
|
110 |
+
* Maybe display the review request notification in the Constant Contact areas.
|
111 |
+
*
|
112 |
+
* @since 1.2.2
|
113 |
+
*
|
114 |
+
* @return bool
|
115 |
+
*/
|
116 |
+
function constant_contact_maybe_display_review_notification() {
|
117 |
+
|
118 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
119 |
+
return false;
|
120 |
+
}
|
121 |
+
|
122 |
+
if ( ! constant_contact()->is_constant_contact() ) {
|
123 |
+
return false;
|
124 |
+
}
|
125 |
+
|
126 |
+
if ( 'true' === get_option( 'ctct-reviewed', 'false' ) ) {
|
127 |
+
return false;
|
128 |
+
}
|
129 |
+
|
130 |
+
// @todo date_diff() comparisons.
|
131 |
+
//
|
132 |
+
$dismissed = get_option( 'ctct-review-dismissed', array() );
|
133 |
+
if ( isset( $dismissed['count'] ) && '1' === $dismissed['count'] ) {
|
134 |
+
$fourteen_days = strtotime( '-14 days' );
|
135 |
+
if ( isset( $dismissed['time'] ) &&
|
136 |
+
$dismissed['time'] < $fourteen_days
|
137 |
+
) {
|
138 |
+
return true;
|
139 |
+
} else {
|
140 |
+
return false;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
if ( isset( $dismissed['count'] ) && '2' === $dismissed['count'] ) {
|
145 |
+
$thirty_days = strtotime( '-30 days' );
|
146 |
+
if ( isset( $dismissed['time'] ) &&
|
147 |
+
$dismissed['time'] < $thirty_days
|
148 |
+
) {
|
149 |
+
return true;
|
150 |
+
} else {
|
151 |
+
return false;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
if ( isset( $dismissed['count'] ) && '3' === $dismissed['count'] ) {
|
156 |
+
return false;
|
157 |
+
}
|
158 |
+
|
159 |
+
if ( absint( get_option( 'ctct-processed-forms' ) ) >= 10 ) {
|
160 |
+
return true;
|
161 |
+
}
|
162 |
+
|
163 |
+
return true;
|
164 |
+
}
|
165 |
+
|
166 |
/**
|
167 |
* Handle the optin checkbox for the admin notice.
|
168 |
*
|
200 |
exit();
|
201 |
}
|
202 |
add_action( 'wp_ajax_constant_contact_privacy_ajax_handler', 'constant_contact_privacy_ajax_handler' );
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Handle the ajax for the review admin notice.
|
206 |
+
*
|
207 |
+
* @since 1.2.2
|
208 |
+
*/
|
209 |
+
function constant_contact_review_ajax_handler() {
|
210 |
+
|
211 |
+
if ( isset( $_REQUEST['ctct-review-action'] ) ) {
|
212 |
+
$action = strtolower( sanitize_text_field( $_REQUEST['ctct-review-action'] ) );
|
213 |
+
|
214 |
+
switch ( $action ) {
|
215 |
+
case 'dismissed':
|
216 |
+
$dismissed = get_option( 'ctct-review-dismissed', array() );
|
217 |
+
$dismissed['time'] = time();
|
218 |
+
if ( empty( $dismissed['count'] ) ) {
|
219 |
+
$dismissed['count'] = '1';
|
220 |
+
} elseif ( isset( $dismissed['count'] ) && '2' === $dismissed['count'] ) {
|
221 |
+
$dismissed['count'] = '3';
|
222 |
+
} else {
|
223 |
+
$dismissed['count'] = '2';
|
224 |
+
}
|
225 |
+
update_option( 'ctct-review-dismissed', $dismissed );
|
226 |
+
|
227 |
+
break;
|
228 |
+
|
229 |
+
case 'reviewed':
|
230 |
+
update_option( 'ctct-reviewed', 'true' );
|
231 |
+
break;
|
232 |
+
|
233 |
+
default:
|
234 |
+
break;
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
wp_send_json_success( array( 'review-action' => 'processed' ) );
|
239 |
+
exit();
|
240 |
+
}
|
241 |
+
|
242 |
+
add_action( 'wp_ajax_constant_contact_review_ajax_handler', 'constant_contact_review_ajax_handler' );
|
includes/widgets/contact-form-select.php
CHANGED
@@ -118,14 +118,16 @@ class ConstantContactWidget extends WP_Widget {
|
|
118 |
);
|
119 |
$forms = new WP_Query( $args );
|
120 |
if ( $forms->have_posts() ) {
|
121 |
-
return array_map(
|
122 |
-
return array( $post->ID => $post->post_title );
|
123 |
-
}, $forms->posts );
|
124 |
}
|
125 |
|
126 |
return array();
|
127 |
}
|
128 |
|
|
|
|
|
|
|
|
|
129 |
/**
|
130 |
* Return a text input.
|
131 |
*
|
118 |
);
|
119 |
$forms = new WP_Query( $args );
|
120 |
if ( $forms->have_posts() ) {
|
121 |
+
return array_map( array( $this, 'get_form_fields' ), $forms->posts );
|
|
|
|
|
122 |
}
|
123 |
|
124 |
return array();
|
125 |
}
|
126 |
|
127 |
+
public function get_form_fields( $post ) {
|
128 |
+
return array( $post->ID => $post->post_title );
|
129 |
+
}
|
130 |
+
|
131 |
/**
|
132 |
* Return a text input.
|
133 |
*
|
languages/constant-contact-forms.pot
CHANGED
@@ -3,14 +3,14 @@ msgid ""
|
|
3 |
msgstr ""
|
4 |
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
5 |
"Project-Id-Version: Constant Contact Forms for WordPress\n"
|
6 |
-
"POT-Creation-Date: 2017-02-
|
7 |
"PO-Revision-Date: 2017-01-12 14:46-0600\n"
|
8 |
"Last-Translator: Michael Beckwith <michael.d.beckwith@gmail.com>\n"
|
9 |
"Language-Team: Constant Contact\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"X-Generator: Poedit 1.8.
|
14 |
"X-Poedit-Basepath: ..\n"
|
15 |
"X-Poedit-WPHeader: constant-contact-forms.php\n"
|
16 |
"X-Poedit-SourceCharset: UTF-8\n"
|
@@ -24,7 +24,7 @@ msgstr ""
|
|
24 |
"X-Poedit-SearchPathExcluded-3: node_modules\n"
|
25 |
|
26 |
#. Author of the plugin/theme
|
27 |
-
#: constant-contact-forms.php:201 includes/class-builder.php:
|
28 |
#: includes/class-cpts.php:95 includes/class-cpts.php:153
|
29 |
msgid "Constant Contact"
|
30 |
msgstr ""
|
@@ -35,7 +35,7 @@ msgid ""
|
|
35 |
"website administrator should be able to assist in updating your PHP version."
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: constant-contact-forms.php:
|
39 |
msgid "Error loading license."
|
40 |
msgstr ""
|
41 |
|
@@ -302,7 +302,7 @@ msgstr ""
|
|
302 |
msgid "Contact type not returned"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: includes/class-api.php:
|
306 |
msgid ""
|
307 |
"Your API access token is invalid. Reconnect to Constant Contact to receive a "
|
308 |
"new token."
|
@@ -515,67 +515,102 @@ msgstr ""
|
|
515 |
msgid "Please add an email field to continue."
|
516 |
msgstr ""
|
517 |
|
518 |
-
#: includes/class-builder.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
519 |
msgid "Your first form is ready!"
|
520 |
msgstr ""
|
521 |
|
522 |
-
#: includes/class-builder.php:
|
523 |
#, php-format
|
524 |
msgid "Paste shortcode %s into a post or page editor."
|
525 |
msgstr ""
|
526 |
|
527 |
-
#: includes/class-builder.php:
|
528 |
msgid "Now, how would you like to manage the information you collect?"
|
529 |
msgstr ""
|
530 |
|
531 |
-
#: includes/class-builder.php:
|
532 |
msgctxt "email marketing alt text"
|
533 |
msgid "? mail"
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: includes/class-builder.php:
|
537 |
msgid "Try email marketing."
|
538 |
msgstr ""
|
539 |
|
540 |
-
#: includes/class-builder.php:
|
541 |
msgid ""
|
542 |
"Import everything into Constant Contact so I can see what email marketing "
|
543 |
"can do for me."
|
544 |
msgstr ""
|
545 |
|
546 |
-
#: includes/class-builder.php:
|
547 |
msgctxt "connect alt text"
|
548 |
msgid "hand holding phone"
|
549 |
msgstr ""
|
550 |
|
551 |
-
#: includes/class-builder.php:
|
552 |
msgid "Connect my account."
|
553 |
msgstr ""
|
554 |
|
555 |
-
#: includes/class-builder.php:
|
556 |
msgid ""
|
557 |
"Automatically add collected information to contacts in my Constant Contact "
|
558 |
"account."
|
559 |
msgstr ""
|
560 |
|
561 |
-
#: includes/class-builder.php:
|
562 |
msgid "Connect Plugin"
|
563 |
msgstr ""
|
564 |
|
565 |
-
#: includes/class-builder.php:
|
566 |
msgid ""
|
567 |
"By connecting, you authorize this\n"
|
568 |
"\t\t\t\t\t\t\tplugin to access your account."
|
569 |
msgstr ""
|
570 |
|
571 |
-
#: includes/class-builder.php:
|
572 |
msgid "I'm all set"
|
573 |
msgstr ""
|
574 |
|
575 |
-
#: includes/class-builder.php:
|
576 |
msgid "I'll manage the information on my own for now."
|
577 |
msgstr ""
|
578 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
579 |
#: includes/class-check.php:47
|
580 |
msgid "Server Check"
|
581 |
msgstr ""
|
@@ -674,7 +709,7 @@ msgstr ""
|
|
674 |
msgid "New Form"
|
675 |
msgstr ""
|
676 |
|
677 |
-
#: includes/class-cpts.php:78 includes/class-display.php:
|
678 |
msgid "Edit Form"
|
679 |
msgstr ""
|
680 |
|
@@ -905,99 +940,103 @@ msgstr ""
|
|
905 |
msgid "%s (last modified %s ago)"
|
906 |
msgstr ""
|
907 |
|
908 |
-
#: includes/class-display.php:
|
|
|
|
|
|
|
|
|
909 |
msgid "Error: Please correct your entry."
|
910 |
msgstr ""
|
911 |
|
912 |
-
#: includes/class-display.php:
|
913 |
msgid " Error: Please fill out this field."
|
914 |
msgstr ""
|
915 |
|
916 |
-
#: includes/class-display.php:
|
917 |
msgid "Send"
|
918 |
msgstr ""
|
919 |
|
920 |
-
#: includes/class-display.php:
|
921 |
msgid "Street Address"
|
922 |
msgstr ""
|
923 |
|
924 |
-
#: includes/class-display.php:
|
925 |
msgid "Address Line 2"
|
926 |
msgstr ""
|
927 |
|
928 |
-
#: includes/class-display.php:
|
929 |
msgid "City"
|
930 |
msgstr ""
|
931 |
|
932 |
-
#: includes/class-display.php:
|
933 |
msgid "State"
|
934 |
msgstr ""
|
935 |
|
936 |
-
#: includes/class-display.php:
|
937 |
msgid "ZIP Code"
|
938 |
msgstr ""
|
939 |
|
940 |
-
#: includes/class-display.php:
|
941 |
msgid "Month"
|
942 |
msgstr ""
|
943 |
|
944 |
-
#: includes/class-display.php:
|
945 |
msgid "Day"
|
946 |
msgstr ""
|
947 |
|
948 |
-
#: includes/class-display.php:
|
949 |
msgid "Year"
|
950 |
msgstr ""
|
951 |
|
952 |
-
#: includes/class-display.php:
|
953 |
msgid "January"
|
954 |
msgstr ""
|
955 |
|
956 |
-
#: includes/class-display.php:
|
957 |
msgid "February"
|
958 |
msgstr ""
|
959 |
|
960 |
-
#: includes/class-display.php:
|
961 |
msgid "March"
|
962 |
msgstr ""
|
963 |
|
964 |
-
#: includes/class-display.php:
|
965 |
msgid "April"
|
966 |
msgstr ""
|
967 |
|
968 |
-
#: includes/class-display.php:
|
969 |
msgid "May"
|
970 |
msgstr ""
|
971 |
|
972 |
-
#: includes/class-display.php:
|
973 |
msgid "June"
|
974 |
msgstr ""
|
975 |
|
976 |
-
#: includes/class-display.php:
|
977 |
msgid "July "
|
978 |
msgstr ""
|
979 |
|
980 |
-
#: includes/class-display.php:
|
981 |
msgid "August"
|
982 |
msgstr ""
|
983 |
|
984 |
-
#: includes/class-display.php:
|
985 |
msgid "September"
|
986 |
msgstr ""
|
987 |
|
988 |
-
#: includes/class-display.php:
|
989 |
msgid "October"
|
990 |
msgstr ""
|
991 |
|
992 |
-
#: includes/class-display.php:
|
993 |
msgid "November"
|
994 |
msgstr ""
|
995 |
|
996 |
-
#: includes/class-display.php:
|
997 |
msgid "December"
|
998 |
msgstr ""
|
999 |
|
1000 |
-
#: includes/class-display.php:
|
1001 |
#, php-format
|
1002 |
msgid ""
|
1003 |
"By submitting this form, you are granting: %s, permission to email you. You "
|
@@ -1022,18 +1061,18 @@ msgstr ""
|
|
1022 |
msgid "Sync Lists with Constant Contact"
|
1023 |
msgstr ""
|
1024 |
|
1025 |
-
#: includes/class-mail.php:
|
1026 |
#, php-format
|
1027 |
msgid "Duplicate send mail for: %s and: %s"
|
1028 |
msgstr ""
|
1029 |
|
1030 |
-
#: includes/class-mail.php:
|
1031 |
msgid ""
|
1032 |
"Congratulations! Your Constant Contact Forms plugin has successfully "
|
1033 |
"captured new information:"
|
1034 |
msgstr ""
|
1035 |
|
1036 |
-
#: includes/class-mail.php:
|
1037 |
msgid ""
|
1038 |
"Don't forget: Email marketing is a great way to stay connected and engage "
|
1039 |
"with visitors after they've left your site. When you connect to a Constant "
|
@@ -1042,7 +1081,7 @@ msgid ""
|
|
1042 |
"on the Connect page in the Plugin console view."
|
1043 |
msgstr ""
|
1044 |
|
1045 |
-
#: includes/class-mail.php:
|
1046 |
msgid "Great News: You just captured a new visitor submission"
|
1047 |
msgstr ""
|
1048 |
|
@@ -1072,7 +1111,8 @@ msgid ""
|
|
1072 |
"You may experience some issues with syncing them."
|
1073 |
msgstr ""
|
1074 |
|
1075 |
-
#: includes/class-notification-content.php:105
|
|
|
1076 |
#: includes/class-settings.php:736
|
1077 |
msgid "Constant Contact logo"
|
1078 |
msgstr ""
|
@@ -1088,6 +1128,14 @@ msgid ""
|
|
1088 |
"within the plugin's settings page at any time."
|
1089 |
msgstr ""
|
1090 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1091 |
#: includes/class-notifications.php:404
|
1092 |
msgid "Dismiss this notice."
|
1093 |
msgstr ""
|
@@ -1100,24 +1148,24 @@ msgstr ""
|
|
1100 |
msgid "Disagree"
|
1101 |
msgstr ""
|
1102 |
|
1103 |
-
#: includes/class-process-form.php:
|
1104 |
msgid ""
|
1105 |
"We had trouble processing your submission. Please review your entries and "
|
1106 |
"try again."
|
1107 |
msgstr ""
|
1108 |
|
1109 |
-
#: includes/class-process-form.php:
|
1110 |
-
#: includes/class-process-form.php:
|
1111 |
msgid ""
|
1112 |
"We had trouble processing your submission. Make sure you haven't changed the "
|
1113 |
"required Form ID and try again."
|
1114 |
msgstr ""
|
1115 |
|
1116 |
-
#: includes/class-process-form.php:
|
1117 |
msgid "There was an error sending your form."
|
1118 |
msgstr ""
|
1119 |
|
1120 |
-
#: includes/class-process-form.php:
|
1121 |
msgid "Your information has been submitted."
|
1122 |
msgstr ""
|
1123 |
|
3 |
msgstr ""
|
4 |
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
5 |
"Project-Id-Version: Constant Contact Forms for WordPress\n"
|
6 |
+
"POT-Creation-Date: 2017-02-23 22:39-0600\n"
|
7 |
"PO-Revision-Date: 2017-01-12 14:46-0600\n"
|
8 |
"Last-Translator: Michael Beckwith <michael.d.beckwith@gmail.com>\n"
|
9 |
"Language-Team: Constant Contact\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Generator: Poedit 1.8.12\n"
|
14 |
"X-Poedit-Basepath: ..\n"
|
15 |
"X-Poedit-WPHeader: constant-contact-forms.php\n"
|
16 |
"X-Poedit-SourceCharset: UTF-8\n"
|
24 |
"X-Poedit-SearchPathExcluded-3: node_modules\n"
|
25 |
|
26 |
#. Author of the plugin/theme
|
27 |
+
#: constant-contact-forms.php:201 includes/class-builder.php:336
|
28 |
#: includes/class-cpts.php:95 includes/class-cpts.php:153
|
29 |
msgid "Constant Contact"
|
30 |
msgstr ""
|
35 |
"website administrator should be able to assist in updating your PHP version."
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: constant-contact-forms.php:552
|
39 |
msgid "Error loading license."
|
40 |
msgstr ""
|
41 |
|
302 |
msgid "Contact type not returned"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: includes/class-api.php:683
|
306 |
msgid ""
|
307 |
"Your API access token is invalid. Reconnect to Constant Contact to receive a "
|
308 |
"new token."
|
515 |
msgid "Please add an email field to continue."
|
516 |
msgstr ""
|
517 |
|
518 |
+
#: includes/class-builder.php:210
|
519 |
+
msgid ""
|
520 |
+
"You have multiple <strong>Custom Text Area</strong> fields in this form. "
|
521 |
+
"<strong>Only the first field</strong> will be sent to Constant Contact. <a "
|
522 |
+
"id=\"ctct-open-textarea-info\" href=\"#\">Learn More ></a>"
|
523 |
+
msgstr ""
|
524 |
+
|
525 |
+
#: includes/class-builder.php:309
|
526 |
msgid "Your first form is ready!"
|
527 |
msgstr ""
|
528 |
|
529 |
+
#: includes/class-builder.php:313
|
530 |
#, php-format
|
531 |
msgid "Paste shortcode %s into a post or page editor."
|
532 |
msgstr ""
|
533 |
|
534 |
+
#: includes/class-builder.php:320
|
535 |
msgid "Now, how would you like to manage the information you collect?"
|
536 |
msgstr ""
|
537 |
|
538 |
+
#: includes/class-builder.php:326
|
539 |
msgctxt "email marketing alt text"
|
540 |
msgid "? mail"
|
541 |
msgstr ""
|
542 |
|
543 |
+
#: includes/class-builder.php:328
|
544 |
msgid "Try email marketing."
|
545 |
msgstr ""
|
546 |
|
547 |
+
#: includes/class-builder.php:330
|
548 |
msgid ""
|
549 |
"Import everything into Constant Contact so I can see what email marketing "
|
550 |
"can do for me."
|
551 |
msgstr ""
|
552 |
|
553 |
+
#: includes/class-builder.php:343
|
554 |
msgctxt "connect alt text"
|
555 |
msgid "hand holding phone"
|
556 |
msgstr ""
|
557 |
|
558 |
+
#: includes/class-builder.php:345
|
559 |
msgid "Connect my account."
|
560 |
msgstr ""
|
561 |
|
562 |
+
#: includes/class-builder.php:347
|
563 |
msgid ""
|
564 |
"Automatically add collected information to contacts in my Constant Contact "
|
565 |
"account."
|
566 |
msgstr ""
|
567 |
|
568 |
+
#: includes/class-builder.php:350 includes/class-connect.php:225
|
569 |
msgid "Connect Plugin"
|
570 |
msgstr ""
|
571 |
|
572 |
+
#: includes/class-builder.php:352
|
573 |
msgid ""
|
574 |
"By connecting, you authorize this\n"
|
575 |
"\t\t\t\t\t\t\tplugin to access your account."
|
576 |
msgstr ""
|
577 |
|
578 |
+
#: includes/class-builder.php:360
|
579 |
msgid "I'm all set"
|
580 |
msgstr ""
|
581 |
|
582 |
+
#: includes/class-builder.php:361
|
583 |
msgid "I'll manage the information on my own for now."
|
584 |
msgstr ""
|
585 |
|
586 |
+
#: includes/class-builder.php:382
|
587 |
+
msgid "Custom Text Area limitations."
|
588 |
+
msgstr ""
|
589 |
+
|
590 |
+
#: includes/class-builder.php:386
|
591 |
+
msgid ""
|
592 |
+
"Apology, at this time, we can only upload one <strong>\"Custom Text Area\"</"
|
593 |
+
"strong> field to your Constant Contact account, per form submission. The "
|
594 |
+
"uploaded field is placed into your contact's \"Notes\" field."
|
595 |
+
msgstr ""
|
596 |
+
|
597 |
+
#: includes/class-builder.php:387
|
598 |
+
msgid ""
|
599 |
+
"<strong>The first listed \"Custom Text Area\"</strong> field is sent to "
|
600 |
+
"Constant Contact."
|
601 |
+
msgstr ""
|
602 |
+
|
603 |
+
#: includes/class-builder.php:388
|
604 |
+
msgid ""
|
605 |
+
"Subsequent \"Custom Text Area\" fields are only sent with the admin email "
|
606 |
+
"when the form is submitted, and not to your Constant Contact account."
|
607 |
+
msgstr ""
|
608 |
+
|
609 |
+
#: includes/class-builder.php:391
|
610 |
+
msgctxt "connect alt text"
|
611 |
+
msgid "screenshot regarding custom text areas"
|
612 |
+
msgstr ""
|
613 |
+
|
614 |
#: includes/class-check.php:47
|
615 |
msgid "Server Check"
|
616 |
msgstr ""
|
709 |
msgid "New Form"
|
710 |
msgstr ""
|
711 |
|
712 |
+
#: includes/class-cpts.php:78 includes/class-display.php:540
|
713 |
msgid "Edit Form"
|
714 |
msgstr ""
|
715 |
|
940 |
msgid "%s (last modified %s ago)"
|
941 |
msgstr ""
|
942 |
|
943 |
+
#: includes/class-display.php:302
|
944 |
+
msgid "Constant Contact Use."
|
945 |
+
msgstr ""
|
946 |
+
|
947 |
+
#: includes/class-display.php:365 includes/class-display.php:1168
|
948 |
msgid "Error: Please correct your entry."
|
949 |
msgstr ""
|
950 |
|
951 |
+
#: includes/class-display.php:367
|
952 |
msgid " Error: Please fill out this field."
|
953 |
msgstr ""
|
954 |
|
955 |
+
#: includes/class-display.php:768
|
956 |
msgid "Send"
|
957 |
msgstr ""
|
958 |
|
959 |
+
#: includes/class-display.php:881
|
960 |
msgid "Street Address"
|
961 |
msgstr ""
|
962 |
|
963 |
+
#: includes/class-display.php:882
|
964 |
msgid "Address Line 2"
|
965 |
msgstr ""
|
966 |
|
967 |
+
#: includes/class-display.php:883
|
968 |
msgid "City"
|
969 |
msgstr ""
|
970 |
|
971 |
+
#: includes/class-display.php:884
|
972 |
msgid "State"
|
973 |
msgstr ""
|
974 |
|
975 |
+
#: includes/class-display.php:885
|
976 |
msgid "ZIP Code"
|
977 |
msgstr ""
|
978 |
|
979 |
+
#: includes/class-display.php:941
|
980 |
msgid "Month"
|
981 |
msgstr ""
|
982 |
|
983 |
+
#: includes/class-display.php:942
|
984 |
msgid "Day"
|
985 |
msgstr ""
|
986 |
|
987 |
+
#: includes/class-display.php:943
|
988 |
msgid "Year"
|
989 |
msgstr ""
|
990 |
|
991 |
+
#: includes/class-display.php:1064
|
992 |
msgid "January"
|
993 |
msgstr ""
|
994 |
|
995 |
+
#: includes/class-display.php:1065
|
996 |
msgid "February"
|
997 |
msgstr ""
|
998 |
|
999 |
+
#: includes/class-display.php:1066
|
1000 |
msgid "March"
|
1001 |
msgstr ""
|
1002 |
|
1003 |
+
#: includes/class-display.php:1067
|
1004 |
msgid "April"
|
1005 |
msgstr ""
|
1006 |
|
1007 |
+
#: includes/class-display.php:1068
|
1008 |
msgid "May"
|
1009 |
msgstr ""
|
1010 |
|
1011 |
+
#: includes/class-display.php:1069
|
1012 |
msgid "June"
|
1013 |
msgstr ""
|
1014 |
|
1015 |
+
#: includes/class-display.php:1070
|
1016 |
msgid "July "
|
1017 |
msgstr ""
|
1018 |
|
1019 |
+
#: includes/class-display.php:1071
|
1020 |
msgid "August"
|
1021 |
msgstr ""
|
1022 |
|
1023 |
+
#: includes/class-display.php:1072
|
1024 |
msgid "September"
|
1025 |
msgstr ""
|
1026 |
|
1027 |
+
#: includes/class-display.php:1073
|
1028 |
msgid "October"
|
1029 |
msgstr ""
|
1030 |
|
1031 |
+
#: includes/class-display.php:1074
|
1032 |
msgid "November"
|
1033 |
msgstr ""
|
1034 |
|
1035 |
+
#: includes/class-display.php:1075
|
1036 |
msgid "December"
|
1037 |
msgstr ""
|
1038 |
|
1039 |
+
#: includes/class-display.php:1232
|
1040 |
#, php-format
|
1041 |
msgid ""
|
1042 |
"By submitting this form, you are granting: %s, permission to email you. You "
|
1061 |
msgid "Sync Lists with Constant Contact"
|
1062 |
msgstr ""
|
1063 |
|
1064 |
+
#: includes/class-mail.php:204
|
1065 |
#, php-format
|
1066 |
msgid "Duplicate send mail for: %s and: %s"
|
1067 |
msgstr ""
|
1068 |
|
1069 |
+
#: includes/class-mail.php:225
|
1070 |
msgid ""
|
1071 |
"Congratulations! Your Constant Contact Forms plugin has successfully "
|
1072 |
"captured new information:"
|
1073 |
msgstr ""
|
1074 |
|
1075 |
+
#: includes/class-mail.php:227
|
1076 |
msgid ""
|
1077 |
"Don't forget: Email marketing is a great way to stay connected and engage "
|
1078 |
"with visitors after they've left your site. When you connect to a Constant "
|
1081 |
"on the Connect page in the Plugin console view."
|
1082 |
msgstr ""
|
1083 |
|
1084 |
+
#: includes/class-mail.php:233
|
1085 |
msgid "Great News: You just captured a new visitor submission"
|
1086 |
msgstr ""
|
1087 |
|
1111 |
"You may experience some issues with syncing them."
|
1112 |
msgstr ""
|
1113 |
|
1114 |
+
#: includes/class-notification-content.php:105
|
1115 |
+
#: includes/class-notification-content.php:128 includes/class-optin.php:117
|
1116 |
#: includes/class-settings.php:736
|
1117 |
msgid "Constant Contact logo"
|
1118 |
msgstr ""
|
1128 |
"within the plugin's settings page at any time."
|
1129 |
msgstr ""
|
1130 |
|
1131 |
+
#: includes/class-notification-content.php:132
|
1132 |
+
msgid ""
|
1133 |
+
"You have been successfully using <strong>Constant Contact Forms</strong>. "
|
1134 |
+
"Congratulations on capturing valuable site visitor information! Please "
|
1135 |
+
"consider leaving us a nice review. Reviews help fellow WordPress admins find "
|
1136 |
+
"our plugin and lets you provide us useful feedback."
|
1137 |
+
msgstr ""
|
1138 |
+
|
1139 |
#: includes/class-notifications.php:404
|
1140 |
msgid "Dismiss this notice."
|
1141 |
msgstr ""
|
1148 |
msgid "Disagree"
|
1149 |
msgstr ""
|
1150 |
|
1151 |
+
#: includes/class-process-form.php:154 includes/class-process-form.php:574
|
1152 |
msgid ""
|
1153 |
"We had trouble processing your submission. Please review your entries and "
|
1154 |
"try again."
|
1155 |
msgstr ""
|
1156 |
|
1157 |
+
#: includes/class-process-form.php:163 includes/class-process-form.php:172
|
1158 |
+
#: includes/class-process-form.php:181
|
1159 |
msgid ""
|
1160 |
"We had trouble processing your submission. Make sure you haven't changed the "
|
1161 |
"required Form ID and try again."
|
1162 |
msgstr ""
|
1163 |
|
1164 |
+
#: includes/class-process-form.php:543
|
1165 |
msgid "There was an error sending your form."
|
1166 |
msgstr ""
|
1167 |
|
1168 |
+
#: includes/class-process-form.php:557
|
1169 |
msgid "Your information has been submitted."
|
1170 |
msgstr ""
|
1171 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: constantcontact
|
|
3 |
Tags: capture, contacts, constant contact, constant contact form, constant contact newsletter, constant contact official, contact forms, email, form, forms, marketing, mobile, newsletter, opt-in, plugin, signup, subscribe, subscription, widget
|
4 |
Requires at least: 4.0.0
|
5 |
Tested up to: 4.7.2
|
6 |
-
Stable tag: 1.2.
|
7 |
License: GPLv2
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -33,6 +33,14 @@ BONUS: If you have a Constant Contact account, all new email addresses that you
|
|
33 |
|
34 |
== Changelog ==
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
= 1.2.1 =
|
37 |
* Fixed: Re-show sections of "Publish" metabox incorrectly hidden for post types outside Constant Contact Forms.
|
38 |
* Fixed: Issues with transparent background on frontend forms when input is valid.
|
3 |
Tags: capture, contacts, constant contact, constant contact form, constant contact newsletter, constant contact official, contact forms, email, form, forms, marketing, mobile, newsletter, opt-in, plugin, signup, subscribe, subscription, widget
|
4 |
Requires at least: 4.0.0
|
5 |
Tested up to: 4.7.2
|
6 |
+
Stable tag: 1.2.2
|
7 |
License: GPLv2
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
33 |
|
34 |
== Changelog ==
|
35 |
|
36 |
+
= 1.2.2 =
|
37 |
+
* Fixed: Conflicts with other plugins using the Constant Contact PHP SDK.
|
38 |
+
* Fixed: Added honeypot-style spam prevention on forms.
|
39 |
+
* Fixed: Removed anonymous function usage in widget to prevent potential errors.
|
40 |
+
* Fixed: Hardened up helper function in cases where internal function does not exist.
|
41 |
+
* Fixed: Issues with multiple custom textareas and the Constant Contact API. See the "Learn more" link/modal for some more information.
|
42 |
+
* Added: Potential admin notice requesting users to review plugin if they have not already.
|
43 |
+
|
44 |
= 1.2.1 =
|
45 |
* Fixed: Re-show sections of "Publish" metabox incorrectly hidden for post types outside Constant Contact Forms.
|
46 |
* Fixed: Issues with transparent background on frontend forms when input is valid.
|
vendor/constantcontact/constantcontact/constantcontact/src/Ctct/SplClassLoader.php
CHANGED
@@ -19,7 +19,7 @@ namespace Ctct;
|
|
19 |
* @author Fabien Potencier <fabien.potencier@symfony-project.org>
|
20 |
*/
|
21 |
|
22 |
-
class
|
23 |
{
|
24 |
private $fileExtension = '.php';
|
25 |
private $namespace;
|
19 |
* @author Fabien Potencier <fabien.potencier@symfony-project.org>
|
20 |
*/
|
21 |
|
22 |
+
class CTCTSplClassLoader
|
23 |
{
|
24 |
private $fileExtension = '.php';
|
25 |
private $namespace;
|
vendor/constantcontact/constantcontact/constantcontact/src/Ctct/autoload.php
CHANGED
@@ -2,5 +2,5 @@
|
|
2 |
require_once( 'SplClassLoader.php' );
|
3 |
|
4 |
// Load the Ctct namespace
|
5 |
-
$loader = new \Ctct\
|
6 |
$loader->register();
|
2 |
require_once( 'SplClassLoader.php' );
|
3 |
|
4 |
// Load the Ctct namespace
|
5 |
+
$loader = new \Ctct\CTCTSplClassLoader('Ctct', dirname(__DIR__));
|
6 |
$loader->register();
|