Skip to content

Commit

Permalink
update to upstream 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Server committed Mar 15, 2022
1 parent 4845333 commit 1066ef0
Show file tree
Hide file tree
Showing 193 changed files with 13,584 additions and 12,740 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
Changelog
=========

#### 4.4 - March 1, 2018

**Fixes**

- AffiliateWP integration subscribing the wrong user if affiliate ID differs from user ID.

**Improvements**

- Renamed "Newsletter" to "Newsletter" to match Newsletter's new branding.
- More accurate handling of timeouts for accounts with many Newsletter lists.
- UX improvements for integrations overview page.
- Validate Newsletter API key format when it's entered.
- Improved compatibility with Klarna Checkout in the WooCommerce checkout integration.
- Bumped required PHP version to 5.3 (soft requirement for now).

**Additions**

- Added Gutenberg block for easily adding a form to a post or page.
- Added subscriber tags setting to forms.


#### 4.3.3 - December 31, 2018

**Fixes**
Expand Down
56 changes: 44 additions & 12 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ var mount = document.getElementById('nl4wp-list-fetcher');

if (mount) {
m.mount(mount, new ListFetcher());
} // expose some things
}

require('./admin/fields/newsletter-api-key.js'); // expose some things


window.nl4wp = window.nl4wp || {};
Expand All @@ -40,7 +42,36 @@ window.nl4wp.events = events;
window.nl4wp.settings = settings;
window.nl4wp.tabs = tabs;

},{"./admin/helpers.js":2,"./admin/list-fetcher.js":3,"./admin/settings.js":4,"./admin/tabs.js":5,"mithril":7,"tlite":10,"wolfy87-eventemitter":11}],2:[function(require,module,exports){
},{"./admin/fields/newsletter-api-key.js":2,"./admin/helpers.js":3,"./admin/list-fetcher.js":4,"./admin/settings.js":5,"./admin/tabs.js":6,"mithril":8,"tlite":11,"wolfy87-eventemitter":12}],2:[function(require,module,exports){
'use strict';

var field;

function validate(evt) {
var node = document.createElement('p');
node.className = 'help red';
node.innerText = window.nl4wp_vars.i18n.invalid_api_key;

if (field.nextElementSibling.innerText === node.innerText) {
field.nextElementSibling.parentElement.removeChild(field.nextElementSibling);
}

if (!field.value.match(/^[0-9a-z]+-[0-9a-z]+-[0-9a-z]+$/)) {
field.parentElement.insertBefore(node, field.nextElementSibling);
}
}

(function () {
field = document.getElementById('newsletter_api_key');

if (!field) {
return;
}

field.addEventListener('change', validate);
})();

},{}],3:[function(require,module,exports){
'use strict';

var helpers = {};
Expand Down Expand Up @@ -133,7 +164,7 @@ helpers.debounce = function (func, wait, immediate) {

module.exports = helpers;

},{}],3:[function(require,module,exports){
},{}],4:[function(require,module,exports){
'use strict';

var $ = window.jQuery;
Expand All @@ -155,7 +186,8 @@ ListFetcher.prototype.fetch = function (e) {
this.done = false;
$.post(ajaxurl, {
action: "nl4wp_renew_newsletter_lists",
timeout: 180000
timeout: 600000 // 10 minutes, matching max_execution_time

}).done(function (data) {
this.success = true;

Expand Down Expand Up @@ -187,7 +219,7 @@ ListFetcher.prototype.view = function () {

module.exports = ListFetcher;

},{}],4:[function(require,module,exports){
},{}],5:[function(require,module,exports){
"use strict";

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Expand Down Expand Up @@ -250,7 +282,7 @@ var Settings = function Settings(context, helpers, events) {

module.exports = Settings;

},{}],5:[function(require,module,exports){
},{}],6:[function(require,module,exports){
'use strict';

var URL = require('./url.js'); // Tabs
Expand Down Expand Up @@ -422,7 +454,7 @@ var Tabs = function Tabs(context) {

module.exports = Tabs;

},{"./url.js":6}],6:[function(require,module,exports){
},{"./url.js":7}],7:[function(require,module,exports){
'use strict';

var URL = {
Expand Down Expand Up @@ -458,7 +490,7 @@ var URL = {
};
module.exports = URL;

},{}],7:[function(require,module,exports){
},{}],8:[function(require,module,exports){
(function (global,setImmediate){
;(function() {
"use strict"
Expand Down Expand Up @@ -1718,7 +1750,7 @@ if (typeof module !== "undefined") module["exports"] = m
else window.m = m
}());
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate)
},{"timers":9}],8:[function(require,module,exports){
},{"timers":10}],9:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};

Expand Down Expand Up @@ -1904,7 +1936,7 @@ process.chdir = function (dir) {
};
process.umask = function() { return 0; };

},{}],9:[function(require,module,exports){
},{}],10:[function(require,module,exports){
(function (setImmediate,clearImmediate){
var nextTick = require('process/browser.js').nextTick;
var apply = Function.prototype.apply;
Expand Down Expand Up @@ -1983,7 +2015,7 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate :
delete immediateIds[id];
};
}).call(this,require("timers").setImmediate,require("timers").clearImmediate)
},{"process/browser.js":8,"timers":9}],10:[function(require,module,exports){
},{"process/browser.js":9,"timers":10}],11:[function(require,module,exports){
function tlite(getTooltipOpts) {
document.addEventListener('mouseover', function (e) {
var el = e.target;
Expand Down Expand Up @@ -2119,7 +2151,7 @@ if (typeof module !== 'undefined' && module.exports) {
module.exports = tlite;
}

},{}],11:[function(require,module,exports){
},{}],12:[function(require,module,exports){
/*!
* EventEmitter v5.2.5 - git.io/ee
* Unlicense - http://unlicense.org/
Expand Down
2 changes: 1 addition & 1 deletion assets/js/admin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/admin.min.js.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions assets/js/forms-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ var FieldHelper = function FieldHelper(m, tabs, editor, fields, events, i18n) {

var generate = require('./field-generator.js')(m);

var overlay = require('./overlay.js')(m, i18n);
var overlay = require('../overlay.js')(m, i18n);

var forms = require('./field-forms.js')(m, i18n);

Expand Down Expand Up @@ -518,7 +518,7 @@ var FieldHelper = function FieldHelper(m, tabs, editor, fields, events, i18n) {

module.exports = FieldHelper;

},{"./field-forms.js":2,"./field-generator.js":3,"./overlay.js":10}],5:[function(require,module,exports){
},{"../overlay.js":10,"./field-forms.js":2,"./field-generator.js":3}],5:[function(require,module,exports){
"use strict";

var FieldFactory = function FieldFactory(fields, i18n) {
Expand Down Expand Up @@ -1347,15 +1347,15 @@ var settings = nl4wp.settings;
var helpers = nl4wp.helpers;
var tabs = nl4wp.tabs;

var FormWatcher = require('./admin/form-watcher.js');
var FormWatcher = require('./admin/form-editor/form-watcher.js');

var FormEditor = require('./admin/form-editor.js');
var FormEditor = require('./admin/form-editor/form-editor.js');

var FieldHelper = require('./admin/field-helper.js');
var FieldHelper = require('./admin/form-editor/field-helper.js');

var FieldsFactory = require('./admin/fields-factory.js');
var FieldsFactory = require('./admin/form-editor/fields-factory.js');

var fields = require('./admin/fields.js')(m, events); // vars
var fields = require('./admin/form-editor/fields.js')(m, events); // vars


var editor = window.formEditor = FormEditor;
Expand All @@ -1382,7 +1382,7 @@ window.nl4wp.forms = window.nl4wp.forms || {};
window.nl4wp.forms.editor = editor;
window.nl4wp.forms.fields = fields;

},{"./admin/field-helper.js":4,"./admin/fields-factory.js":5,"./admin/fields.js":6,"./admin/form-editor.js":7,"./admin/form-watcher.js":8,"./admin/notices":9}],12:[function(require,module,exports){
},{"./admin/form-editor/field-helper.js":4,"./admin/form-editor/fields-factory.js":5,"./admin/form-editor/fields.js":6,"./admin/form-editor/form-editor.js":7,"./admin/form-editor/form-watcher.js":8,"./admin/notices":9}],12:[function(require,module,exports){
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: https://codemirror.net/LICENSE

Expand Down
2 changes: 1 addition & 1 deletion assets/js/forms-admin.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/forms-admin.min.js.map

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions assets/js/forms-block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(function () { var require = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
'use strict';

var __ = window.wp.i18n.__;
var registerBlockType = window.wp.blocks.registerBlockType;
var SelectControl = window.wp.components.SelectControl;
var forms = window.nl4wp_forms;
registerBlockType('newsletter-for-wp/form', {
title: __('Newsletter for WordPress Form'),
description: __('Block showing a Newsletter for WordPress sign-up form'),
category: 'widgets',
attributes: {
id: {
type: 'int'
}
},
supports: {
html: false
},
edit: function edit(props) {
var options = forms.map(function (f) {
return {
label: f.name,
value: f.id
};
});
return React.createElement("div", {
style: {
backgroundColor: '#f8f9f9',
padding: '14px'
}
}, React.createElement(SelectControl, {
label: __('Newsletter for WordPress Sign-up Form'),
value: props.attributes.id,
options: options,
onChange: function onChange(value) {
props.setAttributes({
id: value
});
}
}));
},
// Render nothing in the saved content, because we render in PHP
save: function save(props) {
return null; //return `[nl4wp_form id="${props.attributes.id}"]`;
}
});

},{}]},{},[1]);
})();
2 changes: 2 additions & 0 deletions assets/js/forms-block.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/js/forms-block.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions config/default-form-content.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

$email_label = __( 'Email address', 'newsletter-for-wp' );
$email_placeholder = __( 'Your email address', 'newsletter-for-wp' );
$signup_button = __( 'Sign up', 'newsletter-for-wp' );
$email_label = __('Email address', 'newsletter-for-wp');
$email_placeholder = __('Your email address', 'newsletter-for-wp');
$signup_button = __('Sign up', 'newsletter-for-wp');

$content = "<p>\n\t<label>{$email_label}: </label>\n";
$content .= "\t<input type=\"email\" name=\"EMAIL\" placeholder=\"{$email_placeholder}\" required />\n</p>\n\n";
$content .= "<p>\n\t<input type=\"submit\" value=\"{$signup_button}\" />\n</p>";

return $content;
return $content;
72 changes: 36 additions & 36 deletions config/default-form-messages.php
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<?php
return array(
'subscribed' => array(
'type' => 'success',
'text' => __( 'Thank you, your sign-up request was successful! Please check your email inbox to confirm.', 'newsletter-for-wp' )
),
'updated' => array(
'type' => 'success',
'text' => __( 'Thank you, your records have been updated!', 'newsletter-for-wp' ),
),
'unsubscribed' => array(
'type' => 'success',
'text' => __( 'You were successfully unsubscribed.', 'newsletter-for-wp' ),
),
'not_subscribed' => array(
'type' => 'notice',
'text' => __( 'Given email address is not subscribed.', 'newsletter-for-wp' ),
),
'error' => array(
'type' => 'error',
'text' => __( 'Oops. Something went wrong. Please try again later.', 'newsletter-for-wp' ),
),
'invalid_email' => array(
'type' => 'error',
'text' => __( 'Please provide a valid email address.', 'newsletter-for-wp' ),
),
'already_subscribed' => array(
'type' => 'notice',
'text' => __( 'Given email address is already subscribed, thank you!', 'newsletter-for-wp' ),
),
'required_field_missing' => array(
'type' => 'error',
'text' => __( 'Please fill in the required fields.', 'newsletter-for-wp' ),
),
'no_lists_selected' => array(
'type' => 'error',
'text' => __( 'Please select at least one list.', 'newsletter-for-wp' )
),
'subscribed' => array(
'type' => 'success',
'text' => __('Thank you, your sign-up request was successful! Please check your email inbox to confirm.', 'newsletter-for-wp')
),
'updated' => array(
'type' => 'success',
'text' => __('Thank you, your records have been updated!', 'newsletter-for-wp'),
),
'unsubscribed' => array(
'type' => 'success',
'text' => __('You were successfully unsubscribed.', 'newsletter-for-wp'),
),
'not_subscribed' => array(
'type' => 'notice',
'text' => __('Given email address is not subscribed.', 'newsletter-for-wp'),
),
'error' => array(
'type' => 'error',
'text' => __('Oops. Something went wrong. Please try again later.', 'newsletter-for-wp'),
),
'invalid_email' => array(
'type' => 'error',
'text' => __('Please provide a valid email address.', 'newsletter-for-wp'),
),
'already_subscribed' => array(
'type' => 'notice',
'text' => __('Given email address is already subscribed, thank you!', 'newsletter-for-wp'),
),
'required_field_missing' => array(
'type' => 'error',
'text' => __('Please fill in the required fields.', 'newsletter-for-wp'),
),
'no_lists_selected' => array(
'type' => 'error',
'text' => __('Please select at least one list.', 'newsletter-for-wp')
),
);
17 changes: 9 additions & 8 deletions config/default-form-settings.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
return array(
'css' => 0,
'double_optin' => 1,
'hide_after_success' => 0,
'lists' => array(),
'redirect' => '',
'replace_interests' => 1,
'required_fields' => '',
'update_existing' => 0,
'css' => 0,
'double_optin' => 1,
'hide_after_success' => 0,
'lists' => array(),
'redirect' => '',
'replace_interests' => 1,
'required_fields' => '',
'update_existing' => 0,
'subscriber_tags' => '',
);
6 changes: 3 additions & 3 deletions config/default-settings.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
return array(
'api_key' => '',
'allow_usage_tracking' => 0,
'api_key' => '',
'allow_usage_tracking' => 0,
'debug_log_level' => 'warning',
);
);
Loading

0 comments on commit 1066ef0

Please sign in to comment.