Merged in feature/Plugin-updates (pull request #19)

Updated plugins

* Updated plugins
This commit is contained in:
Tony Volpe
2024-01-10 21:13:38 +00:00
parent 768ebbdc75
commit 14f187dd80
168 changed files with 9219 additions and 9861 deletions

View File

@@ -1,226 +1,226 @@
var $ = jQuery.noConflict(), var $ = jQuery.noConflict(),
dtx = { dtx = {
queue: [], queue: [],
init: function() { init: function() {
var $inputs = $('input.dtx-pageload[data-dtx-value]'); var $inputs = $('input.dtx-pageload[data-dtx-value]');
if ($inputs.length) { if ($inputs.length) {
// If this is any of our built-in shortcodes, see if there's any that can be duplicated via client side // If this is any of our built-in shortcodes, see if there's any that can be duplicated via client side
$inputs.each(function(i, el) { $inputs.each(function(i, el) {
var $input = $(el), var $input = $(el),
raw_value = $input.attr('data-dtx-value'), raw_value = $input.attr('data-dtx-value'),
v = decodeURIComponent(raw_value).split(' '); v = decodeURIComponent(raw_value).split(' ');
if (v.length) { if (v.length) {
var tag = v[0], var tag = v[0],
atts = {}; atts = {};
if (v.length > 1) { if (v.length > 1) {
for (var x = 1; x < v.length; x++) { for (var x = 1; x < v.length; x++) {
var att = v[x].split('='); var att = v[x].split('=');
if (att.length === 2) { if (att.length === 2) {
var key = att[0]; var key = att[0];
atts[key] = att[1].split("'").join(''); atts[key] = att[1].split("'").join('');
} }
} }
} }
var value = ''; var value = '';
switch (tag) { switch (tag) {
case 'CF7_GET': case 'CF7_GET':
value = dtx.get(atts); value = dtx.get(atts);
break; break;
case 'CF7_referrer': case 'CF7_referrer':
value = dtx.referrer(atts); value = dtx.referrer(atts);
break; break;
case 'CF7_URL': case 'CF7_URL':
value = dtx.current_url(atts); value = dtx.current_url(atts);
break; break;
case 'CF7_get_cookie': case 'CF7_get_cookie':
value = dtx.get_cookie(atts); value = dtx.get_cookie(atts);
break; break;
case 'CF7_guid': case 'CF7_guid':
value = dtx.guid(); value = dtx.guid();
break; break;
case 'CF7_get_current_var': case 'CF7_get_current_var':
if (dtx.validKey(atts, 'key') && atts.key == 'url') { if (dtx.validKey(atts, 'key') && atts.key == 'url') {
value = dtx.current_url(atts); value = dtx.current_url(atts);
} else { } else {
return; // Do nothing, current page variables are safe to cache, just use the value that was calculated by server return; // Do nothing, current page variables are safe to cache, just use the value that was calculated by server
} }
break; break;
case 'CF7_get_post_var': // Current post variables are safe to cache case 'CF7_get_post_var': // Current post variables are safe to cache
case 'CF7_get_custom_field': // Meta data is safe to cache case 'CF7_get_custom_field': // Meta data is safe to cache
case 'CF7_get_taxonomy': // Terms are safe to cache case 'CF7_get_taxonomy': // Terms are safe to cache
case 'CF7_get_attachment': // Media attachment info is safe to cache case 'CF7_get_attachment': // Media attachment info is safe to cache
case 'CF7_bloginfo': // Site info is safe to cache case 'CF7_bloginfo': // Site info is safe to cache
case 'CF7_get_theme_option': // Theme options are safe to cache case 'CF7_get_theme_option': // Theme options are safe to cache
return; // Do nothing, just use the value that was calculated by server return; // Do nothing, just use the value that was calculated by server
default: default:
if (tag) { if (tag) {
// Queue the requests for an AJAX call at the end of init // Queue the requests for an AJAX call at the end of init
dtx.queue.push({ 'value': raw_value, 'multiline': $input.is('textarea') }); dtx.queue.push({ 'value': raw_value, 'multiline': $input.is('textarea') });
} }
return; // Don't continue after queuing it for AJAX return; // Don't continue after queuing it for AJAX
} }
dtx.set($input, value); dtx.set($input, value);
} }
}); });
if (dtx.queue.length) { if (dtx.queue.length) {
setTimeout(function() { // Set timeout to force it async setTimeout(function() { // Set timeout to force it async
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: dtx_obj.ajax_url, url: dtx_obj.ajax_url,
dataType: 'json', // only accept strict JSON objects dataType: 'json', // only accept strict JSON objects
data: { data: {
'action': 'wpcf7dtx', 'action': 'wpcf7dtx',
'shortcodes': dtx.queue 'shortcodes': dtx.queue
}, },
cache: false, cache: false,
error: function(xhr, status, error) { error: function(xhr, status, error) {
console.error('[CF7 DTX AJAX ERROR]', error, status, xhr); console.error('[CF7 DTX AJAX ERROR]', error, status, xhr);
}, },
success: function(data, status, xhr) { success: function(data, status, xhr) {
if (typeof(data) == 'object' && data.length) { if (typeof(data) == 'object' && data.length) {
$.each(data, function(i, obj) { $.each(data, function(i, obj) {
var $inputs = $('.wpcf7 form input.dtx-pageload[data-dtx-value="' + obj.raw_value + '"]'); var $inputs = $('.wpcf7 form input.dtx-pageload[data-dtx-value="' + obj.raw_value + '"]');
if ($inputs.length) { if ($inputs.length) {
dtx.set($inputs, obj.value); dtx.set($inputs, obj.value);
$inputs.addClass('dtx-ajax-loaded'); $inputs.addClass('dtx-ajax-loaded');
} }
}); });
} }
} }
}); });
}, 10); }, 10);
} }
} }
}, },
/** /**
* Check if Key Exists in Object * Check if Key Exists in Object
*/ */
validKey: function(obj, key) { validKey: function(obj, key) {
return obj.hasOwnProperty(key) && typeof(obj[key]) == 'string' && obj[key].trim(); return obj.hasOwnProperty(key) && typeof(obj[key]) == 'string' && obj[key].trim();
}, },
/** /**
* Maybe Obfuscate Value * Maybe Obfuscate Value
* *
* @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-attribute-obfuscate/ * @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-attribute-obfuscate/
*/ */
obfuscate: function(value, atts) { obfuscate: function(value, atts) {
value = value.trim(); value = value.trim();
if (dtx.validKey(atts, 'obfuscate') && atts.obfuscate) { if (dtx.validKey(atts, 'obfuscate') && atts.obfuscate) {
var o = ''; var o = '';
for (var i = 0; i < value.length; i++) { for (var i = 0; i < value.length; i++) {
o += '&#' + value.codePointAt(i) + ';'; o += '&#' + value.codePointAt(i) + ';';
} }
return o; return o;
} }
return value; return value;
}, },
/** /**
* Set Value for Form Field * Set Value for Form Field
*/ */
set: function($input, value) { set: function($input, value) {
$input.attr('value', value).addClass('dtx-loaded'); $input.attr('value', value).addClass('dtx-loaded');
}, },
/** /**
* Get Value form URL Query by Key * Get Value form URL Query by Key
* *
* @see @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-php-get-variables/ * @see @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-php-get-variables/
*/ */
get: function(atts) { get: function(atts) {
if (dtx.validKey(atts, 'key')) { if (dtx.validKey(atts, 'key')) {
var query = window.location.search; var query = window.location.search;
if (query) { if (query) {
query = new URLSearchParams(query); query = new URLSearchParams(query);
return dtx.obfuscate(query.get(atts.key).trim(), atts); return dtx.obfuscate(query.get(atts.key).trim(), atts);
} }
} }
return ''; return '';
}, },
/** /**
* Get Referrering URL * Get Referrering URL
* *
* @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-referrer-url/ * @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-referrer-url/
*/ */
referrer: function(atts) { referrer: function(atts) {
return dtx.obfuscate(document.referrer, atts); return dtx.obfuscate(document.referrer, atts);
}, },
/** /**
* Get Current URL or Part * Get Current URL or Part
* *
* @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-current-url/ * @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-current-url/
*/ */
current_url: function(atts) { current_url: function(atts) {
if (atts.hasOwnProperty('part')) { if (atts.hasOwnProperty('part')) {
var parts = [ var parts = [
'scheme', // e.g. `http` 'scheme', // e.g. `http`
'host', 'host',
'port', 'port',
'path', 'path',
'query', // after the question mark ? 'query', // after the question mark ?
'fragment' // after the pound sign # 'fragment' // after the pound sign #
]; ];
if (parts.includes(atts.part)) { if (parts.includes(atts.part)) {
// return part of the url // return part of the url
switch (atts.part) { switch (atts.part) {
case 'scheme': case 'scheme':
return dtx.obfuscate(window.location.protocol.replace(':', ''), atts); return dtx.obfuscate(window.location.protocol.replace(':', ''), atts);
case 'host': case 'host':
return dtx.obfuscate(window.location.host, atts); return dtx.obfuscate(window.location.host, atts);
case 'port': case 'port':
return dtx.obfuscate(window.location.port, atts); return dtx.obfuscate(window.location.port, atts);
case 'path': case 'path':
return dtx.obfuscate(window.location.pathname, atts); return dtx.obfuscate(window.location.pathname, atts);
case 'query': case 'query':
return dtx.obfuscate(window.location.search.replace('?', ''), atts); return dtx.obfuscate(window.location.search.replace('?', ''), atts);
case 'fragment': case 'fragment':
return dtx.obfuscate(window.location.hash.replace('#', ''), atts); return dtx.obfuscate(window.location.hash.replace('#', ''), atts);
default: default:
break; break;
} }
} }
} else { } else {
return dtx.obfuscate(window.location.href, atts); // Return the full url return dtx.obfuscate(window.location.href, atts); // Return the full url
} }
return ''; return '';
}, },
/** /**
* Get Cookie Value * Get Cookie Value
* *
* @since 3.3.0 * @since 3.3.0
* *
* @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-cookie/ * @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-cookie/
*/ */
get_cookie: function(atts) { get_cookie: function(atts) {
if (atts.hasOwnProperty('key') && typeof(atts.key) == 'string' && atts.key.trim() != '') { if (atts.hasOwnProperty('key') && typeof(atts.key) == 'string' && atts.key.trim() != '') {
var keyValue = document.cookie.match('(^|;) ?' + atts.key.trim() + '=([^;]*)(;|$)'); var keyValue = document.cookie.match('(^|;) ?' + atts.key.trim() + '=([^;]*)(;|$)');
return keyValue ? dtx.obfuscate(keyValue[2], atts) : ''; return keyValue ? dtx.obfuscate(keyValue[2], atts) : '';
} }
return ''; return '';
}, },
/** /**
* Generate a random GUID (globally unique identifier) * Generate a random GUID (globally unique identifier)
* *
* @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-guid/ * @see https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-guid/
*/ */
guid: function() { guid: function() {
if (typeof(window.crypto) != 'undefined' && typeof(window.crypto.getRandomValues) != 'undefined') { if (typeof(window.crypto) != 'undefined' && typeof(window.crypto.getRandomValues) != 'undefined') {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
).toUpperCase(); ).toUpperCase();
} }
console.warn('[CF7 DTX] Cryptographically secure PRNG is not available for generating GUID value'); console.warn('[CF7 DTX] Cryptographically secure PRNG is not available for generating GUID value');
var d = new Date().getTime(), //Timestamp var d = new Date().getTime(), //Timestamp
d2 = ((typeof performance !== 'undefined') && performance.now && (performance.now() * 1000)) || 0; //Time in microseconds since page-load or 0 if unsupported d2 = ((typeof performance !== 'undefined') && performance.now && (performance.now() * 1000)) || 0; //Time in microseconds since page-load or 0 if unsupported
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16; //random number between 0 and 16 var r = Math.random() * 16; //random number between 0 and 16
if (d > 0) { //Use timestamp until depleted if (d > 0) { //Use timestamp until depleted
r = (d + r) % 16 | 0; r = (d + r) % 16 | 0;
d = Math.floor(d / 16); d = Math.floor(d / 16);
} else { //Use microseconds since page-load if supported } else { //Use microseconds since page-load if supported
r = (d2 + r) % 16 | 0; r = (d2 + r) % 16 | 0;
d2 = Math.floor(d2 / 16); d2 = Math.floor(d2 / 16);
} }
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16).toUpperCase(); return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16).toUpperCase();
}).toUpperCase();; }).toUpperCase();;
} }
}; };
$(document).ready(dtx.init); $(document).ready(dtx.init);

View File

@@ -1,2 +1,2 @@
/*! Do not edit, this file is generated automatically - 2023-09-18 14:09:50 EDT */ /*! Do not edit, this file is generated automatically - 2024-01-09 15:01:30 MST */
var $=jQuery.noConflict(),dtx={queue:[],init:function(){var e=$("input.dtx-pageload[data-dtx-value]");e.length&&(e.each(function(e,t){var r=$(t),a=r.attr("data-dtx-value"),o=decodeURIComponent(a).split(" ");if(o.length){var n=o[0],c={};if(1<o.length)for(var u=1;u<o.length;u++){var i=o[u].split("="),d;2===i.length&&(c[i[0]]=i[1].split("'").join(""))}var s="";switch(n){case"CF7_GET":s=dtx.get(c);break;case"CF7_referrer":s=dtx.referrer(c);break;case"CF7_URL":s=dtx.current_url(c);break;case"CF7_get_cookie":s=dtx.get_cookie(c);break;case"CF7_guid":s=dtx.guid();break;case"CF7_get_current_var":if(!dtx.validKey(c,"key")||"url"!=c.key)return;s=dtx.current_url(c);break;case"CF7_get_post_var":case"CF7_get_custom_field":case"CF7_get_taxonomy":case"CF7_get_attachment":case"CF7_bloginfo":case"CF7_get_theme_option":return;default:return void(n&&dtx.queue.push({value:a,multiline:r.is("textarea")}))}dtx.set(r,s)}}),dtx.queue.length)&&setTimeout(function(){$.ajax({type:"POST",url:dtx_obj.ajax_url,dataType:"json",data:{action:"wpcf7dtx",shortcodes:dtx.queue},cache:!1,error:function(e,t,r){},success:function(e,t,r){"object"==typeof e&&e.length&&$.each(e,function(e,t){var r=$('.wpcf7 form input.dtx-pageload[data-dtx-value="'+t.raw_value+'"]');r.length&&(dtx.set(r,t.value),r.addClass("dtx-ajax-loaded"))})}})},10)},validKey:function(e,t){return e.hasOwnProperty(t)&&"string"==typeof e[t]&&e[t].trim()},obfuscate:function(e,t){if(e=e.trim(),dtx.validKey(t,"obfuscate")&&t.obfuscate){for(var r="",a=0;a<e.length;a++)r+="&#"+e.codePointAt(a)+";";return r}return e},set:function(e,t){e.attr("value",t).addClass("dtx-loaded")},get:function(e){if(dtx.validKey(e,"key")){var t=window.location.search;if(t)return t=new URLSearchParams(t),dtx.obfuscate(t.get(e.key).trim(),e)}return""},referrer:function(e){return dtx.obfuscate(document.referrer,e)},current_url:function(e){if(!e.hasOwnProperty("part"))return dtx.obfuscate(window.location.href,e);var t;if(["scheme","host","port","path","query","fragment"].includes(e.part))switch(e.part){case"scheme":return dtx.obfuscate(window.location.protocol.replace(":",""),e);case"host":return dtx.obfuscate(window.location.host,e);case"port":return dtx.obfuscate(window.location.port,e);case"path":return dtx.obfuscate(window.location.pathname,e);case"query":return dtx.obfuscate(window.location.search.replace("?",""),e);case"fragment":return dtx.obfuscate(window.location.hash.replace("#",""),e)}return""},get_cookie:function(e){var t;return e.hasOwnProperty("key")&&"string"==typeof e.key&&""!=e.key.trim()&&(t=document.cookie.match("(^|;) ?"+e.key.trim()+"=([^;]*)(;|$)"))?dtx.obfuscate(t[2],e):""},guid:function(){var r,a;return(void 0!==window.crypto&&void 0!==window.crypto.getRandomValues?([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)):(r=(new Date).getTime(),a="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0,"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random();return 0<r?(t=(r+t)%16|0,r=Math.floor(r/16)):(t=(a+t)%16|0,a=Math.floor(a/16)),("x"===e?t:3&t|8).toString(16).toUpperCase()}))).toUpperCase()}};$(document).ready(dtx.init); var $=jQuery.noConflict(),dtx={queue:[],init:function(){var e=$("input.dtx-pageload[data-dtx-value]");e.length&&(e.each(function(e,t){var r=$(t),a=r.attr("data-dtx-value"),o=decodeURIComponent(a).split(" ");if(o.length){var n=o[0],c={};if(1<o.length)for(var u=1;u<o.length;u++){var i=o[u].split("="),d;2===i.length&&(c[i[0]]=i[1].split("'").join(""))}var s="";switch(n){case"CF7_GET":s=dtx.get(c);break;case"CF7_referrer":s=dtx.referrer(c);break;case"CF7_URL":s=dtx.current_url(c);break;case"CF7_get_cookie":s=dtx.get_cookie(c);break;case"CF7_guid":s=dtx.guid();break;case"CF7_get_current_var":if(!dtx.validKey(c,"key")||"url"!=c.key)return;s=dtx.current_url(c);break;case"CF7_get_post_var":case"CF7_get_custom_field":case"CF7_get_taxonomy":case"CF7_get_attachment":case"CF7_bloginfo":case"CF7_get_theme_option":return;default:return void(n&&dtx.queue.push({value:a,multiline:r.is("textarea")}))}dtx.set(r,s)}}),dtx.queue.length)&&setTimeout(function(){$.ajax({type:"POST",url:dtx_obj.ajax_url,dataType:"json",data:{action:"wpcf7dtx",shortcodes:dtx.queue},cache:!1,error:function(e,t,r){},success:function(e,t,r){"object"==typeof e&&e.length&&$.each(e,function(e,t){var r=$('.wpcf7 form input.dtx-pageload[data-dtx-value="'+t.raw_value+'"]');r.length&&(dtx.set(r,t.value),r.addClass("dtx-ajax-loaded"))})}})},10)},validKey:function(e,t){return e.hasOwnProperty(t)&&"string"==typeof e[t]&&e[t].trim()},obfuscate:function(e,t){if(e=e.trim(),dtx.validKey(t,"obfuscate")&&t.obfuscate){for(var r="",a=0;a<e.length;a++)r+="&#"+e.codePointAt(a)+";";return r}return e},set:function(e,t){e.attr("value",t).addClass("dtx-loaded")},get:function(e){if(dtx.validKey(e,"key")){var t=window.location.search;if(t)return t=new URLSearchParams(t),dtx.obfuscate(t.get(e.key).trim(),e)}return""},referrer:function(e){return dtx.obfuscate(document.referrer,e)},current_url:function(e){if(!e.hasOwnProperty("part"))return dtx.obfuscate(window.location.href,e);var t;if(["scheme","host","port","path","query","fragment"].includes(e.part))switch(e.part){case"scheme":return dtx.obfuscate(window.location.protocol.replace(":",""),e);case"host":return dtx.obfuscate(window.location.host,e);case"port":return dtx.obfuscate(window.location.port,e);case"path":return dtx.obfuscate(window.location.pathname,e);case"query":return dtx.obfuscate(window.location.search.replace("?",""),e);case"fragment":return dtx.obfuscate(window.location.hash.replace("#",""),e)}return""},get_cookie:function(e){var t;return e.hasOwnProperty("key")&&"string"==typeof e.key&&""!=e.key.trim()&&(t=document.cookie.match("(^|;) ?"+e.key.trim()+"=([^;]*)(;|$)"))?dtx.obfuscate(t[2],e):""},guid:function(){var r,a;return(void 0!==window.crypto&&void 0!==window.crypto.getRandomValues?([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)):(r=(new Date).getTime(),a="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0,"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random();return 0<r?(t=(r+t)%16|0,r=Math.floor(r/16)):(t=(a+t)%16|0,a=Math.floor(a/16)),("x"===e?t:3&t|8).toString(16).toUpperCase()}))).toUpperCase()}};$(document).ready(dtx.init);

View File

@@ -1,2 +1,2 @@
/*! Do not edit, this file is generated automatically - 2023-09-18 14:09:50 EDT */ /*! Do not edit, this file is generated automatically - 2024-01-09 15:01:30 MST */
!function(n){"use strict";"undefined"!=typeof wpcf7&&null!==wpcf7&&(window.wpcf7dtx=window.wpcf7dtx||{},wpcf7dtx.taggen={},wpcf7dtx.taggen.escapeRegExp=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")},wpcf7dtx.taggen.replaceAll=function(e,t,n,a){var c;return null!=e&&"string"==typeof e&&""!==e.trim()&&-1<e.indexOf(t)?(c=new RegExp(wpcf7dtx.taggen.escapeRegExp(t),"g"),a&&(c=new RegExp(t,"g")),e.replace(c,n)):e},wpcf7dtx.taggen.updateOption=function(e){var e=n(e.currentTarget),t=encodeURIComponent(wpcf7dtx.taggen.replaceAll(e.val(),"'","&#39;"));e.siblings('input[type="hidden"].option').val(t)},n(function(){n("form.tag-generator-panel .dtx-option").on("change keyup click",wpcf7dtx.taggen.updateOption),n('.contact-form-editor-panel #tag-generator-list a.thickbox.button[href*="inlineId=tag-generator-panel-dynamic_"]').each(function(){var e=n(this),t=e.text();e.addClass("dtx-form-tag"),"dynamic drop-down menu"!=t&&"dynamic checkboxes"!=t&&"dynamic radio buttons"!=t||e.attr("href",e.attr("href").replace("height=500","height=750"))})}))}(jQuery); !function(n){"use strict";"undefined"!=typeof wpcf7&&null!==wpcf7&&(window.wpcf7dtx=window.wpcf7dtx||{},wpcf7dtx.taggen={},wpcf7dtx.taggen.escapeRegExp=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")},wpcf7dtx.taggen.replaceAll=function(e,t,n,a){var c;return null!=e&&"string"==typeof e&&""!==e.trim()&&-1<e.indexOf(t)?(c=new RegExp(wpcf7dtx.taggen.escapeRegExp(t),"g"),a&&(c=new RegExp(t,"g")),e.replace(c,n)):e},wpcf7dtx.taggen.updateOption=function(e){var e=n(e.currentTarget),t=encodeURIComponent(wpcf7dtx.taggen.replaceAll(e.val(),"'","&#39;"));e.siblings('input[type="hidden"].option').val(t)},n(function(){n("form.tag-generator-panel .dtx-option").on("change keyup click",wpcf7dtx.taggen.updateOption),n('.contact-form-editor-panel #tag-generator-list a.thickbox.button[href*="inlineId=tag-generator-panel-dynamic_"]').each(function(){var e=n(this),t=e.text();e.addClass("dtx-form-tag"),"dynamic drop-down menu"!=t&&"dynamic checkboxes"!=t&&"dynamic radio buttons"!=t||e.attr("href",e.attr("href").replace("height=500","height=750"))})}))}(jQuery);

View File

@@ -1,211 +1,218 @@
== Changelog == == Changelog ==
= 4.1.0 = = 4.2.0 =
* Feature: Looks for a `dtx.php` file in the `wp_content` directory to maybe load custom shortcodes, [see support thread](https://wordpress.org/support/topic/how-to-avoid-custom-shortcodes-being-overwritten-on-updates/) * Security Update: ** Please be sure to review this doc, as you may need to adjust the settings: https://sevenspark.com/docs/contact-form-7-dynamic-text-extension/allow-data-access **
* Feature: Looks for a `dtx.php` file in the current active theme's directory to maybe load custom shortcodes, [see support thread](https://wordpress.org/support/topic/how-to-avoid-custom-shortcodes-being-overwritten-on-updates/) * Feature: Added Settings Screen with Allow Lists
* Feature: Looks for a `dtx.php` file in the current active theme's parent directory to maybe load custom shortcodes, [see support thread](https://wordpress.org/support/topic/how-to-avoid-custom-shortcodes-being-overwritten-on-updates/) * Feature: Added Form Scanner
* Fix: addressed user reported bug, [see support thread](https://wordpress.org/support/topic/fatal-error-v4-0-3/) * Feature: Added Allow List key validation in CF7 Form Validator
= 4.0.3 = = 4.1.0 =
* Feature: Added `exclusive` option to checkbox tag generator * Feature: Looks for a `dtx.php` file in the `wp_content` directory to maybe load custom shortcodes, [see support thread](https://wordpress.org/support/topic/how-to-avoid-custom-shortcodes-being-overwritten-on-updates/)
* Fix: addressed bug that put all dynamic checkbox/radio options into one * Feature: Looks for a `dtx.php` file in the current active theme's directory to maybe load custom shortcodes, [see support thread](https://wordpress.org/support/topic/how-to-avoid-custom-shortcodes-being-overwritten-on-updates/)
* Fix: addressed bug in frontend validator for multiple selected values * Feature: Looks for a `dtx.php` file in the current active theme's parent directory to maybe load custom shortcodes, [see support thread](https://wordpress.org/support/topic/how-to-avoid-custom-shortcodes-being-overwritten-on-updates/)
* Fix: addressed user reported bug, [see support thread](https://wordpress.org/support/topic/fatal-error-v4-0-3/)
= 4.0.2 =
= 4.0.3 =
* Fix: addressed bug that put all dynamic select options into one, [see support thread](https://wordpress.org/support/topic/dynamic-select-get-option-values-from-shortcode/)
* Update: sanitizing and escaping filters now accept `none` as value for `$type` to bypass. Use with caution. * Feature: Added `exclusive` option to checkbox tag generator
* Fix: addressed bug that put all dynamic checkbox/radio options into one
= 4.0.1 = * Fix: addressed bug in frontend validator for multiple selected values
* Fix: addressed bug that prevented translation for cache compatibility description = 4.0.2 =
= 4.0.0 = * Fix: addressed bug that put all dynamic select options into one, [see support thread](https://wordpress.org/support/topic/dynamic-select-get-option-values-from-shortcode/)
* Update: sanitizing and escaping filters now accept `none` as value for `$type` to bypass. Use with caution.
* Major: modified function names
* Major: deprecated `dynamictext` and `dynamichidden` form tags in favor of `dynamic_text` and `dynamic_hidden`. For more information, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) = 4.0.1 =
* Feature: introduced `dynamic_email` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-email/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dynamic_url` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-url/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Fix: addressed bug that prevented translation for cache compatibility description
* Feature: introduced `dynamic_tel` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-tel/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dynamic_number` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-number/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) = 4.0.0 =
* Feature: introduced `dynamic_range` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-range/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dynamic_textarea` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-textarea/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Major: modified function names
* Feature: introduced `dynamic_select` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Major: deprecated `dynamictext` and `dynamichidden` form tags in favor of `dynamic_text` and `dynamic_hidden`. For more information, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dynamic_radio` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-radio/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Feature: introduced `dynamic_email` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-email/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dynamic_date` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-date/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Feature: introduced `dynamic_url` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-url/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dynamic_submit` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-submit/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Feature: introduced `dynamic_tel` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-tel/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dtx_hide_blank` form tag attribute for `dynamic_select`. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Feature: introduced `dynamic_number` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-number/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dtx_disable_blank` form tag attribute for `dynamic_select`. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Feature: introduced `dynamic_range` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-range/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: added mail validation for `dynamic_email` and `dynamic_hidden` for backend configuration. For more information, see the [FAQ](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/frequently-asked-questions/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Feature: introduced `dynamic_textarea` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-textarea/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: added the Akismet feature to DTX text, email, and URL form tags. * Feature: introduced `dynamic_select` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Update: adjusted how queued values were sent for cache compatibility mode to allow for multiline values in textareas * Feature: introduced `dynamic_radio` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-radio/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Removed unused utility functions * Feature: introduced `dynamic_date` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-date/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dynamic_submit` form tag. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-submit/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
= 3.5.4 = * Feature: introduced `dtx_hide_blank` form tag attribute for `dynamic_select`. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: introduced `dtx_disable_blank` form tag attribute for `dynamic_select`. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tags/dynamic-select/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Fix: Updated JavaScript to prevent cacheable fields from making unnecessary AJAX requests * Feature: added mail validation for `dynamic_email` and `dynamic_hidden` for backend configuration. For more information, see the [FAQ](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/frequently-asked-questions/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: added the Akismet feature to DTX text, email, and URL form tags.
= 3.5.3 = * Update: adjusted how queued values were sent for cache compatibility mode to allow for multiline values in textareas
* Removed unused utility functions
* Update: removed the use of sessions, [see support thread](https://wordpress.org/support/topic/add-option-to-disable-session-data/)
= 3.5.4 =
= 3.5.2 =
* Fix: Updated JavaScript to prevent cacheable fields from making unnecessary AJAX requests
* Fix: Updated the `CF7_URL` shortcode to only use `network_home_url()` for multisite installs that do not use subdomains, and use `home_url()` for all others to [maybe address this support thread](https://wordpress.org/support/topic/cf7_url-return-only-domain-and-not-subdomain/)
* Fix: Removed a lingering debug call = 3.5.3 =
= 3.5.1 = * Update: removed the use of sessions, [see support thread](https://wordpress.org/support/topic/add-option-to-disable-session-data/)
* Fix: fixed bug so tag generator for dynamic fields work on "Add New Contact Form" page of Contact Form 7 = 3.5.2 =
* Updated: Updated text in tag generator for cache compatible checkbox and added link to documentation
* Fix: Updated the `CF7_URL` shortcode to only use `network_home_url()` for multisite installs that do not use subdomains, and use `home_url()` for all others to [maybe address this support thread](https://wordpress.org/support/topic/cf7_url-return-only-domain-and-not-subdomain/)
= 3.5.0 = * Fix: Removed a lingering debug call
* Feature: Added the `dtx_pageload` form tag attribute for cache compatibility. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tag-attribute-after-page-load/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) = 3.5.1 =
* Fix: Updated to be compatible with WordPress version 6.3
* Fix: Addressed a bug where `scheme` in `CF7_URL part='scheme'` was incorrectly sanitizing as URL instead of text * Fix: fixed bug so tag generator for dynamic fields work on "Add New Contact Form" page of Contact Form 7
* Fix: Fixed `wp_kses()` in tag generator that stripped out link opening in new tab * Updated: Updated text in tag generator for cache compatible checkbox and added link to documentation
* Update: `CF7_get_current_var` utilizes PHP session variables where appropriate
* Update: All JavaScript assets will load with the `defer` strategy in the footer in [WordPress 6.3](https://make.wordpress.org/core/2023/07/14/registering-scripts-with-async-and-defer-attributes-in-wordpress-6-3/) = 3.5.0 =
= 3.4.0 = * Feature: Added the `dtx_pageload` form tag attribute for cache compatibility. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/form-tag-attribute-after-page-load/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Fix: Updated to be compatible with WordPress version 6.3
* Feature: Feature: Added the `CF7_get_current_var` shortcode, [see support thread for user request](https://wordpress.org/support/topic/wrong-page-title-7/). For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-current-variables/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Fix: Addressed a bug where `scheme` in `CF7_URL part='scheme'` was incorrectly sanitizing as URL instead of text
* Fix: Updated the `CF7_URL` shortcode to no longer check for ports since that's handled in `network_home_url()` function, [see support thread](https://wordpress.org/support/topic/version-3-3-0-breaking/) * Fix: Fixed `wp_kses()` in tag generator that stripped out link opening in new tab
* Update: `CF7_get_current_var` utilizes PHP session variables where appropriate
= 3.3.0 = * Update: All JavaScript assets will load with the `defer` strategy in the footer in [WordPress 6.3](https://make.wordpress.org/core/2023/07/14/registering-scripts-with-async-and-defer-attributes-in-wordpress-6-3/)
* Feature: Added the `CF7_get_cookie` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-cookie/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) = 3.4.0 =
* Feature: Added the `CF7_get_taxonomy` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-taxonomy/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: Added the `CF7_get_theme_option` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-theme-option/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme) * Feature: Feature: Added the `CF7_get_current_var` shortcode, [see support thread for user request](https://wordpress.org/support/topic/wrong-page-title-7/). For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-current-variables/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: Added `wpcf7dtx_sanitize` filter that sanitizes attribute values in built-in shortcodes * Fix: Updated the `CF7_URL` shortcode to no longer check for ports since that's handled in `network_home_url()` function, [see support thread](https://wordpress.org/support/topic/version-3-3-0-breaking/)
* Feature: Added `wpcf7dtx_escape` filter that escapes values in built-in shortcodes
* Feature: Added `wpcf7dtx_allow_protocols` filter to customize allowed protocols in escaping URLs in built-in shortcodes = 3.3.0 =
* Fix: Updated how plugin gets dynamic value in form tags, now uses `wpcf7dtx_get_dynamic()` function
* Fix: Added case-insensitive ID in `CF7_get_post_var` * Feature: Added the `CF7_get_cookie` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-cookie/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Fix: Sanitizes post variable keys as keys in `wpcf7dtx_get_post_var()` * Feature: Added the `CF7_get_taxonomy` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-taxonomy/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Fix: Updated `wpcf7dtx_get_post_id()` to pull from "the loop" if `$post` is unavailable and now used consistently across built-in shortcodes * Feature: Added the `CF7_get_theme_option` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-theme-option/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Fix: Updated tag markup to be compatible with Contact Form 7 version 5.6 Beta for successful form validation, [see support thread](https://wordpress.org/support/topic/required-field-no-error-is-output-when-validating-when-field-is-empty/) * Feature: Added `wpcf7dtx_sanitize` filter that sanitizes attribute values in built-in shortcodes
* Fix: Updated the `CF7_URL` shortcode to use `network_home_url()`, [see support thread](https://wordpress.org/support/topic/current-url-not-working/) * Feature: Added `wpcf7dtx_escape` filter that escapes values in built-in shortcodes
* Fix: Updated GUID function to return appropriately escaped values * Feature: Added `wpcf7dtx_allow_protocols` filter to customize allowed protocols in escaping URLs in built-in shortcodes
* Fix: Updated all existing built-in shortcodes to use the the sanitizing, escaping, and obfuscating shortcodes, [see support thread](https://wordpress.org/support/topic/cant-get-obfuscate-to-work/) * Fix: Updated how plugin gets dynamic value in form tags, now uses `wpcf7dtx_get_dynamic()` function
* Fix: Marked compatible with WordPress core version 6.2. * Fix: Added case-insensitive ID in `CF7_get_post_var`
* Fix: Sanitizes post variable keys as keys in `wpcf7dtx_get_post_var()`
= 3.2 = * Fix: Updated `wpcf7dtx_get_post_id()` to pull from "the loop" if `$post` is unavailable and now used consistently across built-in shortcodes
* Fix: Updated tag markup to be compatible with Contact Form 7 version 5.6 Beta for successful form validation, [see support thread](https://wordpress.org/support/topic/required-field-no-error-is-output-when-validating-when-field-is-empty/)
* Feature: Add optional 'part' parameter to CF7_URL shortcode to retrieve Host, Query, or Path from current URL * Fix: Updated the `CF7_URL` shortcode to use `network_home_url()`, [see support thread](https://wordpress.org/support/topic/current-url-not-working/)
* Updated minimum PHP requirement to 7.4 moving forward * Fix: Updated GUID function to return appropriately escaped values
* Update branding assets * Fix: Updated all existing built-in shortcodes to use the the sanitizing, escaping, and obfuscating shortcodes, [see support thread](https://wordpress.org/support/topic/cant-get-obfuscate-to-work/)
* Update Tested Up To to 6.1.1 * Fix: Marked compatible with WordPress core version 6.2.
* Plugin will now be jointly maintained by [SevenSpark](https://sevenspark.com/) and [AuRise Creative](https://aurisecreative.com)
= 3.2 =
= 3.1.3 =
* Feature: Add optional 'part' parameter to CF7_URL shortcode to retrieve Host, Query, or Path from current URL
* Fix: Fixed the syntax error that reappeared in 3.1.2. * Updated minimum PHP requirement to 7.4 moving forward
* Update branding assets
= 3.1.2 = * Update Tested Up To to 6.1.1
* Plugin will now be jointly maintained by [SevenSpark](https://sevenspark.com/) and [AuRise Creative](https://aurisecreative.com)
**Release Date: January 27, 2023**
= 3.1.3 =
* Fix: updated the text domain to match the plugin slug
* Fix: updated all of the translated strings to match * Fix: Fixed the syntax error that reappeared in 3.1.2.
= 3.1.1 = = 3.1.2 =
**Release Date: January 26, 2023** **Release Date: January 27, 2023**
* Fix: Fixed the syntax error: Parse error: syntax error, unexpected `)` in /wp-content/plugins/contact-form-7-dynamic-text extension/includes/admin.php on line 212 * Fix: updated the text domain to match the plugin slug
* Fix: updated all of the translated strings to match
= 3.1.0 =
= 3.1.1 =
**Release Date: January 25, 2023**
**Release Date: January 26, 2023**
* Feature: Added the `CF7_get_attachment` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-media-attachment/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: Added the `CF7_guid` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-guid/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme). * Fix: Fixed the syntax error: Parse error: syntax error, unexpected `)` in /wp-content/plugins/contact-form-7-dynamic-text extension/includes/admin.php on line 212
* Feature: Added the dynamic placeholder option to the dynamic form tags that allows you to specify dynamic or static placeholder content while also setting dynamic values. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-attribute-placeholder/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Feature: Added a "required" dynamic hidden tag (e.g., `[dynamichidden* ...]`). It is identical to the original dynamic hidden tag (as in the field is not actually validated as required because it is hidden); it just doesn't break your website if you use it. This feature was requested by a user. = 3.1.0 =
* Feature: Added the `obfuscate` attribute to all included shortcodes
**Release Date: January 25, 2023**
= 3.0.0 =
* Feature: Added the `CF7_get_attachment` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-media-attachment/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
**Release Date: January 17, 2023** * Feature: Added the `CF7_guid` shortcode. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-shortcode-guid/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme).
* Feature: Added the dynamic placeholder option to the dynamic form tags that allows you to specify dynamic or static placeholder content while also setting dynamic values. For usage details, see the [knowledge base](https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/shortcodes/dtx-attribute-placeholder/?utm_source=wordpress.org&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=readme)
* Major: Plugin was adopted by AuRise Creative * Feature: Added a "required" dynamic hidden tag (e.g., `[dynamichidden* ...]`). It is identical to the original dynamic hidden tag (as in the field is not actually validated as required because it is hidden); it just doesn't break your website if you use it. This feature was requested by a user.
* Major: All functions use the `wpcf7dtx_` prefix * Feature: Added the `obfuscate` attribute to all included shortcodes
* Feature: Added a `post_id` key for the `CF7_get_post_var` shortcode so you can specify a different post
* Feature: Updated the `CF7_get_current_user` shortcode to be able to pull data from user metadata too = 3.0.0 =
* Feature: Added the "obfuscate" option to `CF7_get_custom_field` shortcode
* Feature: Added the "placeholder" checkbox option to the `dynamictext` tag **Release Date: January 17, 2023**
* Fix: Added additional validation for post ID input
* Fix: Added additional validation for the `key` attribute in the `CF7_GET` and `CF7_POST` shortcodes * Major: Plugin was adopted by AuRise Creative
* Fix: Shortcode keys are normalized into lowercase before processing * Major: All functions use the `wpcf7dtx_` prefix
* Security: Sanitizing URLs for the `CF7_URL` and `CF7_referrer` shortcode outputs * Feature: Added a `post_id` key for the `CF7_get_post_var` shortcode so you can specify a different post
* Feature/Security: Added a `allowed_protocols` attribute to the `CF7_URL` and `CF7_referrer` shortcodes that defaults to `http,https` * Feature: Updated the `CF7_get_current_user` shortcode to be able to pull data from user metadata too
* Feature: Added the "obfuscate" option to `CF7_get_custom_field` shortcode
= 2.0.3 = * Feature: Added the "placeholder" checkbox option to the `dynamictext` tag
* Fix: Added additional validation for post ID input
* Security: [Fix Reflected XSS](https://web.archive.org/web/20230121180428/https://sevenspark.com/docs/cf7-dtx-security-2019-07-24) * Fix: Added additional validation for the `key` attribute in the `CF7_GET` and `CF7_POST` shortcodes
* Fix: Shortcode keys are normalized into lowercase before processing
= 2.0.2.1 = * Security: Sanitizing URLs for the `CF7_URL` and `CF7_referrer` shortcode outputs
* Feature/Security: Added a `allowed_protocols` attribute to the `CF7_URL` and `CF7_referrer` shortcodes that defaults to `http,https`
* Update changelog properly for 2.0.2 changes:
= 2.0.3 =
= 2.0.2 =
* Security: [Fix Reflected XSS](https://web.archive.org/web/20230121180428/https://sevenspark.com/docs/cf7-dtx-security-2019-07-24)
* Update deprecated `get_currentuserinfo()` function to `wp_get_current_user()`
* Update deprecated functions from `WPCF7_add_shortcode` to `WPCF7_add_formtag` and class from `WPCF7_Shortcode` to `WPCF7_FormTag` to comply with CF7 4.6 changes = 2.0.2.1 =
= 2.0.1 = * Update changelog properly for 2.0.2 changes:
* Hook change to guarantee the plugin only runs when Contact Form 7 is present in the admin (avoids errors if Contact Form 7 is disabled, or if there is a plugin sequencing issue) = 2.0.2 =
= 2.0 = * Update deprecated `get_currentuserinfo()` function to `wp_get_current_user()`
* Update deprecated functions from `WPCF7_add_shortcode` to `WPCF7_add_formtag` and class from `WPCF7_Shortcode` to `WPCF7_FormTag` to comply with CF7 4.6 changes
* Complete rewrite for Compatibility with Contact Form 7 v4
= 2.0.1 =
= 1.2 =
* Hook change to guarantee the plugin only runs when Contact Form 7 is present in the admin (avoids errors if Contact Form 7 is disabled, or if there is a plugin sequencing issue)
* Compatibility update for Contact Form 7 v3.9
= 2.0 =
= 1.1.0.2 =
* Complete rewrite for Compatibility with Contact Form 7 v4
* Updated to work with Contact Form 7 v3.7.x
= 1.2 =
= 1.1.0.1 =
* Compatibility update for Contact Form 7 v3.9
* Removed undefined variable warning
= 1.1.0.2 =
= 1.1 =
* Updated to work with Contact Form 7 v3.7.x
* Updated for compatibility with Contact Form 7 v3.6
* Added Referrer shortcode = 1.1.0.1 =
= 1.0.4.2 = * Removed undefined variable warning
* Fixed a bug that created repeating square brackets around dynamic text values in cases where the form doesn't validate and JavaScript is deactivated. = 1.1 =
= 1.0.4.1 = * Updated for compatibility with Contact Form 7 v3.6
* Added Referrer shortcode
* Removed trailing whitespace to fix "Headers already sent" errors
= 1.0.4.2 =
= 1.0.4 =
* Fixed a bug that created repeating square brackets around dynamic text values in cases where the form doesn't validate and JavaScript is deactivated.
* Added Current User Info shortcode
* Added Post Custom Field shortcode (with obfuscation support) = 1.0.4.1 =
* Added Hidden Field capability
* Removed trailing whitespace to fix "Headers already sent" errors
= 1.0.3 =
= 1.0.4 =
* Added $_POST shortcode
* Added current post/page variable shortcode * Added Current User Info shortcode
* Added current URL shortcode * Added Post Custom Field shortcode (with obfuscation support)
* Added Hidden Field capability
= 1.0.2 =
= 1.0.3 =
* Fixed administrative control panel dependency issue
* Added $_POST shortcode
= 1.0.1 = * Added current post/page variable shortcode
* Added current URL shortcode
* Fixed dependency issue.
= 1.0.2 =
* Fixed administrative control panel dependency issue
= 1.0.1 =
* Fixed dependency issue.

View File

@@ -4,7 +4,7 @@
* Plugin Name: Contact Form 7 - Dynamic Text Extension * Plugin Name: Contact Form 7 - Dynamic Text Extension
* Plugin URI: https://sevenspark.com/goods/contact-form-7-dynamic-text-extension * Plugin URI: https://sevenspark.com/goods/contact-form-7-dynamic-text-extension
* Description: This plugin extends Contact Form 7 by adding dynamic form fields that accept any shortcode to generate default values and placeholder text. Requires Contact Form 7. * Description: This plugin extends Contact Form 7 by adding dynamic form fields that accept any shortcode to generate default values and placeholder text. Requires Contact Form 7.
* Version: 4.1.0 * Version: 4.2.0
* Author: SevenSpark, AuRise Creative * Author: SevenSpark, AuRise Creative
* Author URI: https://sevenspark.com * Author URI: https://sevenspark.com
* License: GPL2 * License: GPL2
@@ -14,8 +14,8 @@
*/ */
/* /*
Copyright 2010-2023 Chris Mavricos, SevenSpark <https://sevenspark.com> Copyright 2010-2024 Chris Mavricos, SevenSpark <https://sevenspark.com>
Copyright 2022-2023 Tessa Watkins, AuRise Creative <https://aurisecreative.com> Copyright 2022-2024 Tessa Watkins, AuRise Creative <https://aurisecreative.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2, as it under the terms of the GNU General Public License, version 2, as
@@ -32,7 +32,7 @@
*/ */
// Define current version // Define current version
define('WPCF7DTX_VERSION', '4.1.0'); define('WPCF7DTX_VERSION', '4.2.0');
// Define root directory // Define root directory
defined('WPCF7DTX_DIR') || define('WPCF7DTX_DIR', __DIR__); defined('WPCF7DTX_DIR') || define('WPCF7DTX_DIR', __DIR__);
@@ -40,6 +40,8 @@ defined('WPCF7DTX_DIR') || define('WPCF7DTX_DIR', __DIR__);
// Define root file // Define root file
defined('WPCF7DTX_FILE') || define('WPCF7DTX_FILE', __FILE__); defined('WPCF7DTX_FILE') || define('WPCF7DTX_FILE', __FILE__);
define( 'WPCF7DTX_DATA_ACCESS_KB_URL', 'https://sevenspark.com/docs/contact-form-7-dynamic-text-extension/allow-data-access' );
/** /**
* Initialise Plugin * Initialise Plugin
* *

View File

@@ -1,5 +1,9 @@
<?php <?php
// Include the Settings Page & Update Check
include_once( 'admin/settings.php' );
include_once( 'admin/update-check.php' );
/** /**
* Admin Scripts and Styles * Admin Scripts and Styles
* *

View File

@@ -0,0 +1,770 @@
<?php
/**
* Class CF7DTX_Plugin_Settings
*
* Configure the plugin settings page.
*/
class CF7DTX_Plugin_Settings {
/**
* Capability required by the user to access the My Plugin menu entry.
*
* @var string $capability
*/
private $capability = 'manage_options';
private $sections;
private $fields;
private $num_forms_to_scan = 20;
/**
* The Plugin Settings constructor.
*/
function __construct($sections, $fields) {
add_action( 'admin_init', [$this, 'settings_init'] );
add_action( 'admin_menu', [$this, 'options_page'] );
$this->sections = $sections;
$this->fields = $fields;
}
/**
* Register the settings and all fields.
*/
function settings_init() : void {
// Register a new setting this page.
register_setting( 'cf7dtx_settings', 'cf7dtx_settings' );
foreach( $this->sections as $section_id => $section ){
// Register a new section.
add_settings_section(
$section_id,
$section['title'],
[$this, 'render_section'],
'cf7dtx_settings',
);
}
/* Register All The Fields. */
foreach( $this->fields as $field ) {
// Register a new field in the main section.
add_settings_field(
$field['id'], /* ID for the field. Only used internally. To set the HTML ID attribute, use $args['label_for']. */
$field['label'], /* Label for the field. */
[$this, 'render_field'], /* The name of the callback function. */
'cf7dtx_settings', /* The menu page on which to display this field. */
$field['section'], /* The section of the settings page in which to show the box. */
[
'label_for' => $field['id'], /* The ID of the field. */
'class' => 'cf7dtx_row', /* The class of the field. */
'field' => $field, /* Custom data for the field. */
]
);
}
}
/**
* Add a subpage to the WordPress Settings menu.
*/
function options_page() : void {
add_submenu_page(
'wpcf7', /* Parent Menu Slug */
'Contact Form 7 - Dynamic Text Extension', /* Page Title */
'Dynamic Text Extension', /* Menu Title */
$this->capability, /* Capability */
'cf7dtx_settings', /* Menu Slug */
[$this, 'render_options_page'], /* Callback */
);
}
/**
* Render the settings page.
*/
function render_options_page() : void {
// check user capabilities
if ( ! current_user_can( $this->capability ) ) {
return;
}
if( isset( $_GET['dismiss-access-keys-notice'] )){
wpcf7dtx_set_update_access_scan_check_status('notice_dismissed');
?>
<div class="notice notice-success dtx-notice">
<p><?php _e('Notice Dismissed. You can run the scan any time from the CF7 DTX settings page', 'contact-form-7-dynamic-text-extension'); ?></p>
<p><?php $this->render_back_to_settings_button(); ?></p>
</div>
<?php
return;
}
if( isset( $_GET['scan-meta-keys'] )){
if( isset( $_POST['save-allows'] )){
$r = $this->handle_save_allows();
?>
<div class="wrap">
<h1><?php _e('DTX: Keys Added To Allow List', 'contact-form-7-dynamic-text-extension'); ?></h1>
<?php $this->render_allow_keys_submission($r); ?>
</div>
<?php
}
else{
$offset = isset( $_GET['offset'] ) ? $_GET['offset'] : 0;
$results = wpcf7dtx_scan_forms_for_access_keys( $this->num_forms_to_scan, $offset );
?>
<div class="wrap">
<h1><?php _e('DTX: Form Shortcode Scan Results', 'contact-form-7-dynamic-text-extension'); ?></h1>
<?php $this->render_scan_results($results); ?>
</div>
<?php
}
}
else{
// add error/update messages
// check if the user have submitted the settings
// WordPress will add the "settings-updated" $_GET parameter to the url
if ( isset( $_GET['settings-updated'] ) ) {
// add settings saved message with the class of "updated"
add_settings_error( 'cf7dtx_messages', 'cf7dtx_message', __( 'Settings Saved', 'contact-form-7-dynamic-text-extension' ), 'updated' );
}
// show error/update messages
settings_errors( 'cf7dtx_messages' );
?>
<div class="wrap">
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
<form action="options.php" method="post">
<?php
/* output security fields for the registered setting "cf7dtx" */
settings_fields( 'cf7dtx_settings' );
/* output setting sections and their fields */
/* (sections are registered for "cf7dtx", each field is registered to a specific section) */
do_settings_sections( 'cf7dtx_settings' );
/* output save settings button */
submit_button( 'Save Settings' );
?>
</form>
<a href="<?php echo wpcf7dtx_get_admin_scan_screen_url(); ?>">Scan Forms for Post Meta and User Data Keys</a>
</div>
<?php
}
}
/**
* Render a settings field.
*
* @param array $args Args to configure the field.
*/
function render_field( array $args ) : void {
$field = $args['field'];
// Get the value of the setting we've registered with register_setting()
$options = get_option( 'cf7dtx_settings' );
switch ( $field['type'] ) {
case "text": {
?>
<input
type="text"
id="<?php echo esc_attr( $field['id'] ); ?>"
name="cf7dtx_settings[<?php echo esc_attr( $field['id'] ); ?>]"
value="<?php echo isset( $options[ $field['id'] ] ) ? esc_attr( $options[ $field['id'] ] ) : ''; ?>"
>
<p class="description">
<?php esc_html_e( $field['description'], 'cf7dtx_settings' ); ?>
</p>
<?php
break;
}
case "checkbox": {
?>
<input
type="checkbox"
id="<?php echo esc_attr( $field['id'] ); ?>"
name="cf7dtx_settings[<?php echo esc_attr( $field['id'] ); ?>]"
value="1"
<?php echo isset( $options[ $field['id'] ] ) ? ( checked( $options[ $field['id'] ], 1, false ) ) : ( '' ); ?>
>
<p class="description">
<?php esc_html_e( $field['description'], 'cf7dtx_settings' ); ?>
</p>
<?php
break;
}
case "textarea": {
?>
<textarea
id="<?php echo esc_attr( $field['id'] ); ?>"
name="cf7dtx_settings[<?php echo esc_attr( $field['id'] ); ?>]"
style="width:400px; height:200px;"
><?php echo isset( $options[ $field['id'] ] ) ? esc_attr( $options[ $field['id'] ] ) : ''; ?></textarea>
<p class="description">
<?php esc_html_e( $field['description'], 'cf7dtx_settings' ); ?>
</p>
<?php
break;
}
case "select": {
?>
<select
id="<?php echo esc_attr( $field['id'] ); ?>"
name="cf7dtx_settings[<?php echo esc_attr( $field['id'] ); ?>]"
>
<?php foreach( $field['options'] as $key => $option ) { ?>
<option value="<?php echo $key; ?>"
<?php echo isset( $options[ $field['id'] ] ) ? ( selected( $options[ $field['id'] ], $key, false ) ) : ( '' ); ?>
>
<?php echo $option; ?>
</option>
<?php } ?>
</select>
<p class="description">
<?php esc_html_e( $field['description'], 'cf7dtx_settings' ); ?>
</p>
<?php
break;
}
case "password": {
?>
<input
type="password"
id="<?php echo esc_attr( $field['id'] ); ?>"
name="cf7dtx_settings[<?php echo esc_attr( $field['id'] ); ?>]"
value="<?php echo isset( $options[ $field['id'] ] ) ? esc_attr( $options[ $field['id'] ] ) : ''; ?>"
>
<p class="description">
<?php esc_html_e( $field['description'], 'cf7dtx_settings' ); ?>
</p>
<?php
break;
}
case "wysiwyg": {
wp_editor(
isset( $options[ $field['id'] ] ) ? $options[ $field['id'] ] : '',
$field['id'],
array(
'textarea_name' => 'cf7dtx_settings[' . $field['id'] . ']',
'textarea_rows' => 5,
)
);
break;
}
case "email": {
?>
<input
type="email"
id="<?php echo esc_attr( $field['id'] ); ?>"
name="cf7dtx_settings[<?php echo esc_attr( $field['id'] ); ?>]"
value="<?php echo isset( $options[ $field['id'] ] ) ? esc_attr( $options[ $field['id'] ] ) : ''; ?>"
>
<p class="description">
<?php esc_html_e( $field['description'], 'cf7dtx_settings' ); ?>
</p>
<?php
break;
}
case "url": {
?>
<input
type="url"
id="<?php echo esc_attr( $field['id'] ); ?>"
name="cf7dtx_settings[<?php echo esc_attr( $field['id'] ); ?>]"
value="<?php echo isset( $options[ $field['id'] ] ) ? esc_attr( $options[ $field['id'] ] ) : ''; ?>"
>
<p class="description">
<?php esc_html_e( $field['description'], 'cf7dtx_settings' ); ?>
</p>
<?php
break;
}
case "color": {
?>
<input
type="color"
id="<?php echo esc_attr( $field['id'] ); ?>"
name="cf7dtx_settings[<?php echo esc_attr( $field['id'] ); ?>]"
value="<?php echo isset( $options[ $field['id'] ] ) ? esc_attr( $options[ $field['id'] ] ) : ''; ?>"
>
<p class="description">
<?php esc_html_e( $field['description'], 'cf7dtx_settings' ); ?>
</p>
<?php
break;
}
case "date": {
?>
<input
type="date"
id="<?php echo esc_attr( $field['id'] ); ?>"
name="cf7dtx_settings[<?php echo esc_attr( $field['id'] ); ?>]"
value="<?php echo isset( $options[ $field['id'] ] ) ? esc_attr( $options[ $field['id'] ] ) : ''; ?>"
>
<p class="description">
<?php esc_html_e( $field['description'], 'cf7dtx_settings' ); ?>
</p>
<?php
break;
}
}
}
/**
* Render a section on a page, with an ID and a text label.
*
* @since 1.0.0
*
* @param array $args {
* An array of parameters for the section.
*
* @type string $id The ID of the section.
* }
*/
function render_section( array $args ) : void {
?>
<p id="<?php echo esc_attr( $args['id'] ); ?>"><?php echo $this->sections[$args['id']]['description']; ?></p>
<?php
}
function render_scan_results( $results ){
// No forms are using the shortcodes in question
if( !count($results['forms']) ){
wpcf7dtx_set_update_access_scan_check_status( 'intervention_not_required' );
echo '<div class="notice notice-success dtx-notice"><p>'.__('Scan complete. No keys detected.', 'contact-form-7-dynamic-text-extension').'</p></div>';
$this->render_back_to_settings_button();
return;
}
// Check if we need to scan another batch
if( $results['forms_scanned'] === $this->num_forms_to_scan ){
$offset = isset( $_GET['offset'] ) ? $_GET['offset'] : 0;
$next_offset = $offset + $this->num_forms_to_scan;
echo '<div class="notice notice-warning dtx-notice"><p>';
echo sprintf(
__( '%1$s forms scanned. There may be more forms to scan.', 'contact-form-7-dynamic-text-extension' ),
$results['forms_scanned'],
);
echo ' ';
echo '<a href="'.wpcf7dtx_get_admin_scan_screen_url($next_offset).'">'.sprintf(
__( 'Scan %1$s more forms', 'contact-form-7-dynamic-text-extension' ),
$this->num_forms_to_scan
).'</a>';
echo '</p></div>';
}
$settings = wpcf7dtx_get_settings();
$already_allowed_meta_keys = wpcf7dtx_parse_allowed_keys(wpcf7dtx_array_has_key('post_meta_allow_keys', $settings));
$already_allowed_user_keys = wpcf7dtx_parse_allowed_keys(wpcf7dtx_array_has_key('user_data_allow_keys', $settings));
// Check the results ahead of time to see if all of the keys are already in the allow list - if so, nothing to do
$forms = $results['forms'];
$all_keys_allowed = true;
foreach( $forms as $form_id => $r ){
if( count($r['meta_keys'])){
foreach( $r['meta_keys'] as $key ){
if( !in_array( $key, $already_allowed_meta_keys ) ){
$all_keys_allowed = false;
break;
}
}
if( $all_keys_allowed === false ) break;
}
if( count($r['user_keys'])){
foreach( $r['user_keys'] as $key ){
if( !in_array( $key, $already_allowed_user_keys ) ){
$all_keys_allowed = false;
break;
}
}
if( $all_keys_allowed === false ) break;
}
}
if( $all_keys_allowed ){
wpcf7dtx_set_update_access_scan_check_status( 'intervention_completed' );
}
?>
<style>
.postbox,
.dtx-notice{
max-width:600px;
box-sizing:border-box;
}
.postbox-header{
padding:1em;
}
.postbox-header h2{
font-size:14px;
margin:0;
}
.key-disabled{
opacity:.8;
}
</style>
<div>
<?php if( $all_keys_allowed ): ?>
<div class="notice notice-success dtx-notice">
<p><?php
echo sprintf(
__('Scan of %1$s forms complete. All keys detected are already on allow list. No action necessary for these forms.', 'contact-form-7-dynamic-text-extension'),
$results['forms_scanned'],
); ?></p>
</div>
<?php else: ?>
<div class="notice notice-error dtx-notice" style="width:600px; box-sizing:border-box;">
<p><strong><?php _e('Shortcodes accessing potentially sensitive Post Meta or User Data were detected in the forms listed below.', 'contact-form-7-dynamic-text-extension'); ?></strong></p>
<p><?php _e('Only keys on the allow list will return their value when accessed. Attempting to access keys that are not on the allow list via DTX shortcodes will return an empty string and throw a warning message.', 'contact-form-7-dynamic-text-extension'); ?></p>
<p><?php _e('Review the keys below and confirm that you want to allow access, then select meta and/or user keys to add them to the relevant allow list. Any keys for sensitive data should be removed by editing your contact form.', 'contact-form-7-dynamic-text-extension'); ?></p>
<p><?php _e('Note that keys which are already in the allow list are displayed but marked as already selected.', 'contact-form-7-dynamic-text-extension'); ?></p>
<p><a href="<?php echo WPCF7DTX_DATA_ACCESS_KB_URL; ?>" target="_blank"><?php _e('More Information', 'contact-form-7-dynamic-text-extension' ); ?></a></p>
</div>
<?php endif; ?>
<form action="admin.php?page=cf7dtx_settings&scan-meta-keys" method="post">
<?php
settings_fields( 'cf7dtx_settings' );
foreach( $results['forms'] as $form_id => $r ){
?>
<div class="postbox" >
<div class="postbox-header">
<h2><?php echo $r['title']; ?></h2>
<a href="<?php echo $r['admin_url'];?>" target="_blank">View form</a>
</div>
<div class="inside">
<?php if( count($r['meta_keys']) ): ?>
<h4>Meta Keys</h3>
<div>
<?php foreach( $r['meta_keys'] as $key ){
$already_allowed = in_array( $key, $already_allowed_meta_keys );
$name = "dtx_meta_key/$key";
?>
<div>
<label <?php if( $already_allowed ) echo 'class="key-disabled" title="Already in Allow List"'; ?>>
<input
name="<?php echo $name;?>"
id="<?php echo $name;?>"
type="checkbox"
value="1"
<?php if( $already_allowed ) echo 'checked="checked" disabled'; ?> />
<?php echo $key; ?>
</label>
</div>
<?php
}
?>
</div>
<?php endif; ?>
<?php if( count($r['user_keys']) ): ?>
<h4>User Data Keys</h3>
<div>
<?php foreach( $r['user_keys'] as $key ){
$name = "dtx_user_key/$key";
$already_allowed = in_array( $key, $already_allowed_user_keys );
?>
<div>
<label <?php if( $already_allowed ) echo 'class="key-disabled" title="Already in Allow List"'; ?>>
<input
name="<?php echo $name; ?>"
id="<?php echo $name; ?>"
type="checkbox"
value="1"
<?php if( $already_allowed ) echo 'checked="checked" disabled'; ?> />
<?php echo $key; ?>
</label>
</div>
<?php
}
?>
</div>
<?php endif; ?>
</div>
</div>
<?php
}
?>
<?php if( !$all_keys_allowed ) submit_button( __('Add Selected Keys to Allow Lists', 'contact-form-7-dynamic-text-extension'), 'primary', 'save-allows' ); ?>
</form>
<?php $this->render_back_to_settings_button(); ?>
</div>
<?php
}
function handle_save_allows(){
$user_keys = [];
$meta_keys = [];
// Find saved keys
foreach( $_POST as $key => $val ){
if( str_starts_with( $key, 'dtx_meta_key' ) ){
$parts = explode( '/', $key);
$meta_keys[] = $parts[1];
}
else if( str_starts_with( $key, 'dtx_user_key' )){
$parts = explode( '/', $key);
$user_keys[] = $parts[1];
}
}
// Add those keys in options
$settings = wpcf7dtx_get_settings();
// Meta Data
if( count( $meta_keys ) ){
// Get already saved values
$post_meta_allow_keys = isset( $settings['post_meta_allow_keys'] ) ? wpcf7dtx_parse_allowed_keys($settings['post_meta_allow_keys']) : [];
// Merge with new values
$new = array_unique( array_merge( $post_meta_allow_keys, $meta_keys ));
$settings['post_meta_allow_keys'] = implode( PHP_EOL, $new );
}
// User Data
if( count( $user_keys ) ){
// Get already saved values
$user_data_allow_keys = isset( $settings['user_data_allow_keys'] ) ? wpcf7dtx_parse_allowed_keys($settings['user_data_allow_keys']) : [];
// Merge with new values
$new = array_unique( array_merge( $user_data_allow_keys, $user_keys ));
$settings['user_data_allow_keys'] = implode( PHP_EOL, $new );
}
// Update with new settings
wpcf7dtx_update_settings( $settings );
// Mark as intervention complete
wpcf7dtx_set_update_access_scan_check_status( 'intervention_completed' );
return [
'user' => $user_keys,
'meta' => $meta_keys,
];
}
function render_allow_keys_submission( $r ){
?>
<?php if( count($r['meta'])): ?>
<p><?php _e('Meta Keys Added','contact-form-7-dynamic-text-extension'); ?>: <?php echo implode(', ',$r['meta']); ?></p>
<?php endif; ?>
<?php if( count( $r['user'])): ?>
<p><?php _e('User Data Keys Added','contact-form-7-dynamic-text-extension'); ?>: <?php echo implode(', ', $r['user']); ?></p>
<?php endif; ?>
<?php if( !count($r['meta']) && !count($r['user'])): ?>
<p><?php _e('No Keys Selected', 'contact-form-7-dynamic-text-extension'); ?></p>
<?php endif; ?>
<?php
$this->render_back_to_settings_button();
}
function render_back_to_settings_button(){
?>
<a href="<?php echo wpcf7dtx_get_admin_settings_screen_url(); ?>">&laquo; <?php _e('Back to Settings', 'contact-form-7-dynamic-text-extension'); ?></a>
<?php
}
}
$sections = [
'post_meta_access' => [
'title' => __('Post Meta Access', 'contact-form-7-dynamic-text-extension'),
'description' => __('Control which post metadata the CF7 DTX shortcodes (CF7_get_custom_field) can access. By default, all metadata is protected, so you can open up access through these settings. Keep in mind that users with Contributor+ credentials can add shortcodes and therefore access this data, so make sure not to expose anything sensitive.').
' <a href="'.WPCF7DTX_DATA_ACCESS_KB_URL.'" target="_blank">'. __('More Information', 'contact-form-7-dynamic-text-extension' ).'</a>',
],
'user_data_access' => [
'title' => __('User Data Access', 'contact-form-7-dynamic-text-extension'),
'description' => __('Control which user data the CF7 DTX shortcodes (CF7_get_current_user) can access. By default, all user data is protected, so you can open up access through these settings. Keep in mind that users with Contributor+ credentials can add shortcodes and therefore access this data, so make sure not to expose anything sensitive.').
' <a href="'.WPCF7DTX_DATA_ACCESS_KB_URL.'" target="_blank">'. __('More Information', 'contact-form-7-dynamic-text-extension' ).'</a>',
],
];
/**
* Array of fields that should be displayed in the settings page.
*
* @var array $fields
*/
$fields = [
[
'id' => 'post_meta_allow_keys',
'label' => __('Meta Key Allow List', 'contact-form-7-dynamic-text-extension'),
'description' => __('Allow access to these specific post metadata keys. Enter one per line.', 'contact-form-7-dynamic-text-extension'),
'type' => 'textarea',
'section' => 'post_meta_access',
],
[
'id' => 'post_meta_allow_all',
'label' => __('Allow Access to All Post Metadata', 'contact-form-7-dynamic-text-extension'),
'description' => __('**Use with caution.** Should only be enabled if all authorized users with editor privileges (Contributor+) are trusted and should have access to this data. All metadata from any post (including custom post types) will be accessible via the CF7_get_custom_field shortcode. If in doubt, use the Allow List to allow only specific keys.', 'contact-form-7-dynamic-text-extension'),
'type' => 'select',
'options' => [
'disabled' => __( 'Disabled - Only Allow Access to Meta Key Allow List', 'contact-form-7-dynamic-text-extension' ),
'enabled' => __( 'Enabled - Allow Access to All Post Metadata', 'contact-form-7-dynamic-text-extension' ),
],
'section' => 'post_meta_access',
],
[
'id' => 'user_data_allow_keys',
'label' => __('User Data Key Allow List', 'contact-form-7-dynamic-text-extension'),
'description' => __('Allow access to these specific user data keys. Enter one per line.', 'contact-form-7-dynamic-text-extension'),
'type' => 'textarea',
'section' => 'user_data_access',
],
[
'id' => 'user_data_allow_all',
'label' => __('Allow Access to All User Data', 'contact-form-7-dynamic-text-extension'),
'description' => __('**Use with caution.** Should only be enabled if all authorized users with editor privileges (Contributor+) are trusted and should have access to this data. All of the current user\'s data fields will be accessible via the CF7_get_current_user shortcode. If in doubt, use the Allow List to allow only specific keys.', 'contact-form-7-dynamic-text-extension'),
'type' => 'select',
'options' => [
'disabled' => __( 'Disabled - Only Allow Access to User Data Key Allow List', 'contact-form-7-dynamic-text-extension' ),
'enabled' => __( 'Enabled - Allow Access to User Data', 'contact-form-7-dynamic-text-extension' ),
],
'section' => 'user_data_access',
],
];
new CF7DTX_Plugin_Settings($sections, $fields);
function wpcf7dtx_get_admin_scan_screen_url($offset=0){
$path = 'admin.php?page=cf7dtx_settings&scan-meta-keys';
if( $offset ){
$path.= '&offset='.$offset;
}
return admin_url($path);
}
function wpcf7dtx_get_admin_settings_screen_url(){
return admin_url('admin.php?page=cf7dtx_settings');
}
/**
* Search all CF7 forms for
*/
function wpcf7dtx_scan_forms_for_access_keys( $num, $offset=0){
$found = [
'forms' => [],
];
$forms = [];
if( function_exists('wpcf7_contact_form') ){
$cf7forms = get_posts([
'post_type' => 'wpcf7_contact_form',
// 'numberposts' => $numposts, // sanity check
'posts_per_page' => $num,
'offset' => $offset,
]);
$found['forms_scanned'] = count($cf7forms);
// Loop through forms
foreach( $cf7forms as $form ){
// Search for the custom fields shortcode
if( str_contains($form->post_content, 'CF7_get_custom_field') ||
str_contains($form->post_content, 'CF7_get_current_user')
){
$cf7 = wpcf7_contact_form( $form->ID );
$forms[$form->ID] = [
'title' => $cf7->title(),
'meta_keys' => [],
'user_keys' => [],
'admin_url' => admin_url( "admin.php?page=wpcf7&post={$form->ID}&action=edit" ),
];
$tags = $cf7->scan_form_tags();
// Check each tag
foreach( $tags as $tag ){
// Find dynamic tags
if( str_starts_with( $tag->type, 'dynamic' ) ){
// Check each value
foreach( $tag->values as $val ){
// Find CF7_get_custom_field
if( str_starts_with( $val, 'CF7_get_custom_field' )){
// Parse out the shortcode atts
$atts = shortcode_parse_atts($val);
if( $atts ){
// Grab the meta key
$meta_key = $atts['key'];
// Add meta key to the list
if( $meta_key ){
$forms[$form->ID]['meta_keys'][] = $meta_key;
}
}
}
// Find CF7_get_current_user
if( str_starts_with( $val, 'CF7_get_current_user' )){
// Parse out the shortcode atts
$atts = shortcode_parse_atts($val);
if( $atts ){
// Grab user data key
$key = $atts['key'];
if( $key ){
$forms[$form->ID]['user_keys'][] = $key;
}
}
}
}
}
}
}
}
}
$found['forms'] = $forms;
return $found;
}

View File

@@ -0,0 +1,97 @@
<?php
add_action( 'plugins_loaded', 'wpcf7dtx_update_check' );
function wpcf7dtx_update_check(){
if( WPCF7DTX_VERSION !== get_option( 'cf7dtx_version', '' ) ){
// Update the database version with the current plugin version
update_option( 'cf7dtx_version', WPCF7DTX_VERSION );
// Run the update handler
add_action('admin_init', 'wpcf7dtx_update');
}
}
function wpcf7dtx_update(){
// v4.2.0 will scan for meta and user keys that should be allow-listed and display an admin alert
wpcf7dtx_v4_2_0_access_scan_check();
// Future update processes would go here
}
/*** 4.2.0 - Security Access ***/
function wpcf7dtx_v4_2_0_access_scan_check(){
$op = 'cf7dtx_v4_2_0_access_scan_check_status';
$status = get_option( $op, '' );
// Status values:
// intervention_required - show a notice to the admin
// intervention_not_required - we can ignore
// intervention_completed - no need to show notice any longer
// notice_dismissed - alert was dismissed by user
// If we've never checked before
if( $status === '' ){
// Run a scan - 20 by default. If they have more than 20 forms, we'll alert regardless.
// For less than 20 forms, we'll only alert if we detect an issue
$num_to_scan = 20;
$r = wpcf7dtx_scan_forms_for_access_keys( $num_to_scan );
$found = count($r['forms']);
$scanned = $r['forms_scanned'];
// If keys were found, or if we scanned the max number (so there are likely more to be scanned)
if( $found || $scanned === $num_to_scan ){
// We'll show a notice to the user
$status = 'intervention_required';
}
else{
// No keys need to be allow-listed, no need to show the user a list
$status = 'intervention_not_required';
}
wpcf7dtx_set_update_access_scan_check_status( $status );
}
}
add_action('admin_notices', 'wpcf7dtx_access_keys_notice');
/**
* Display an admin notice if there are unresolved issues with accessing disallowed keys via DTX shortcodes
*/
function wpcf7dtx_access_keys_notice(){
// Don't show this notice on the Scan Results screen to avoid confusion
if( isset($_GET['page']) && $_GET['page'] === 'cf7dtx_settings' && ( isset( $_GET['scan-meta-keys']) || isset($_GET['dismiss-access-keys-notice']))) return;
// If this user is not an administrator, don't do anything. Only admins should see this.
$user = wp_get_current_user();
if ( !in_array( 'administrator', (array) $user->roles ) ) return;
// If the status doesn't require intervention, don't do anything
$status = get_option( 'cf7dtx_v4_2_0_access_scan_check_status', '' );
if( $status !== 'intervention_required' ){
return;
}
?>
<div class="notice notice-error">
<p>
<?php _e('CF7 DTX: Shortcode data access requires allow-listing.', 'contact-form-7-dynamic-text-extension'); ?>
<a href="<?php echo wpcf7dtx_get_admin_settings_screen_url(); ?>"><?php _e('Edit Settings', 'contact-form-7-dynamic-text-extension' ); ?></a>
|
<a href="<?php echo wpcf7dtx_get_admin_scan_screen_url(); ?>"><?php _e('Scan &amp; Resolve', 'contact-form-7-dynamic-text-extension' ); ?></a>
|
<a href="<?php echo WPCF7DTX_DATA_ACCESS_KB_URL; ?>" target="_blank"><?php _e('More Information', 'contact-form-7-dynamic-text-extension' ); ?></a>
<?php if( isset($_GET['page']) && $_GET['page'] === 'cf7dtx_settings' ): ?>
| <a href="<?php echo admin_url('admin.php?page=cf7dtx_settings&dismiss-access-keys-notice'); ?>"><?php _e('Dismiss', 'contact-form-7-dynamic-text-extension' ); ?></a>
<?php endif; ?>
</p>
</div>
<?php
}
function wpcf7dtx_set_update_access_scan_check_status( $status ){
update_option( 'cf7dtx_v4_2_0_access_scan_check_status', $status );
}

View File

@@ -214,6 +214,14 @@ function wpcf7dtx_get_custom_field($atts = array())
'post_id' => '', 'post_id' => '',
'obfuscate' => '' 'obfuscate' => ''
), array_change_key_case((array)$atts, CASE_LOWER))); ), array_change_key_case((array)$atts, CASE_LOWER)));
// If this key can't be accessed
if( !wpcf7dtx_post_meta_key_access_is_allowed( $key ) ){
// Trigger a warning if a denied key is in use
wpcf7dtx_access_denied_alert( $key, 'post_meta' );
return '';
}
$post_id = wpcf7dtx_get_post_id($post_id); $post_id = wpcf7dtx_get_post_id($post_id);
$key = apply_filters('wpcf7dtx_sanitize', $key, 'text'); $key = apply_filters('wpcf7dtx_sanitize', $key, 'text');
if ($post_id && $key) { if ($post_id && $key) {
@@ -343,6 +351,14 @@ function wpcf7dtx_get_current_user($atts = array())
'obfuscate' => '' 'obfuscate' => ''
), array_change_key_case((array)$atts, CASE_LOWER))); ), array_change_key_case((array)$atts, CASE_LOWER)));
if (is_user_logged_in()) { if (is_user_logged_in()) {
// If this key can't be accessed
if( !wpcf7dtx_user_data_access_is_allowed( $key ) ){
// Trigger a warning if a denied key is in use
wpcf7dtx_access_denied_alert( $key, 'user_data' );
return '';
}
$user = wp_get_current_user(); $user = wp_get_current_user();
return apply_filters('wpcf7dtx_escape', $user->get($key), $obfuscate); return apply_filters('wpcf7dtx_escape', $user->get($key), $obfuscate);
} }

View File

@@ -661,3 +661,216 @@ function wpcf7dtx_array_has_key($key, $array = array(), $default = '')
} }
return $default; return $default;
} }
/**
* Check if admin has allowed access to a specific post meta key
*
* @since 4.2.0
*
* @param string $meta_key The post meta key to test
*
* @return bool True if this key can be accessed, false otherwise
*/
function wpcf7dtx_post_meta_key_access_is_allowed($meta_key)
{
// Get the DTX Settings
$settings = wpcf7dtx_get_settings();get_option('cf7dtx_settings', []);
// Has access to all metadata been enabled?
if( isset($settings['post_meta_allow_all']) && $settings['post_meta_allow_all'] === 'enabled' ){
return true;
}
// If not, check the Allow List
$allowed_keys;
// No key list from settings
if( !isset($settings['post_meta_allow_keys'] ) || !is_string($settings['post_meta_allow_keys'])){
$allowed_keys = [];
}
// Extract allowed keys from setting text area
else{
// $allowed_keys = preg_split('/\r\n|\r|\n/', $settings['post_meta_allow_keys']);
$allowed_keys = wpcf7dtx_parse_allowed_keys( $settings['post_meta_allow_keys'] );
}
// Allow custom filters
$allowed_keys = apply_filters( 'wpcf7dtx_post_meta_key_allow_list', $allowed_keys );
// Check if the key is in the allow list
if( in_array( $meta_key, $allowed_keys ) ){
return true; // The key is allowed
}
// Everything is disallowed by default
return false;
}
/**
* Check if admin has allowed access to a specific user data
*
* @since 4.2.0
*
* @param string $key The user data key to test
*
* @return bool True if this key can be accessed, false otherwise
*/
function wpcf7dtx_user_data_access_is_allowed( $key )
{
// Get the DTX Settings
$settings = wpcf7dtx_get_settings(); //get_option('cf7dtx_settings', []);
// Has access to all metadata been enabled?
if( isset($settings['user_data_allow_all']) && $settings['user_data_allow_all'] === 'enabled' ){
return true;
}
// If not, check the Allow List
$allowed_keys;
// No key list from settings
if( !isset($settings['user_data_allow_keys'] ) || !is_string($settings['user_data_allow_keys'])){
$allowed_keys = [];
}
// Extract allowed keys from setting text area
else{
// $allowed_keys = preg_split('/\r\n|\r|\n/', $settings['user_data_allow_keys']);
$allowed_keys = wpcf7dtx_parse_allowed_keys($settings['user_data_allow_keys']);
}
// Allow custom filters
$allowed_keys = apply_filters( 'wpcf7dtx_user_data_key_allow_list', $allowed_keys );
// Check if the key is in the allow list
if( in_array( $key, $allowed_keys ) ){
return true; // The key is allowed
}
// Everything is disallowed by default
return false;
}
/**
* Take the string saved in the options array from the allow list textarea and parse it into an array by newlines.
* Also strip whitespace
*
* @param string $allowlist The string of allowed keys stored in the DB
*
* @return array Array of allowed keys
*/
function wpcf7dtx_parse_allowed_keys( $allowlist ){
// Split by newlines
$keys = wpcf7dtx_split_newlines( $allowlist );
// Trim whitespace
$keys = array_map( 'trim' , $keys );
return $keys;
}
/**
* Used to parse strings stored in the database that are from text areas with one element per line into an array of strings
*
* @param string $str The multi-line string to be parsed into an array
*
* @return array Array of parsed strings
*/
function wpcf7dtx_split_newlines( $str ){
return preg_split('/\r\n|\r|\n/', $str);
}
/**
* Gets the CF7 DTX settings field from the WP options table. Returns an empty array if option has not previously been set
*
* @return array The settings array
*/
function wpcf7dtx_get_settings(){
return get_option('cf7dtx_settings', []);
}
/**
* Updates the CF7 DTX settings in the WP options table
*
* @param array $settings The settings array
*
*/
function wpcf7dtx_update_settings($settings){
update_option( 'cf7dtx_settings', $settings );
}
/**
* Outputs a useful PHP Warning message to users on how to allow-list denied meta and user keys
*
* @param string $key The post meta or user key to which access is currently denied
* @param string $type Either 'post_meta' or 'user_data', used to display an appropriate message to the user
*/
function wpcf7dtx_access_denied_alert( $key, $type ){
// Only check on the front end
if( is_admin() || wp_doing_ajax() || wp_is_json_request() ) return;
$shortcode = '';
$list_name = '';
switch( $type ){
case 'post_meta':
$shortcode = 'CF7_get_custom_field';
$list_name = __('Meta Key Allow List', 'contact-form-7-dynamic-text-extension');
break;
case 'user_data':
$shortcode = 'CF7_get_current_user';
$list_name = __('User Data Key Allow List', 'contact-form-7-dynamic-text-extension');
break;
default:
}
$settings_page_url = admin_url('admin.php?page=cf7dtx_settings');
$msg = sprintf(
__('CF7 DTX: Access denied to key: "%1$s" in dynamic contact form shortcode: [%2$s]. Please add this key to the %3$s at %4$s','contact-form-7-dynamic-text-extension'),
$key,
$shortcode,
$list_name,
$settings_page_url
);
trigger_error( $msg, E_USER_WARNING );
}
/**
* Helper function to output array and object data
*/
/*
function dtxpretty ($var, $print=true, $privobj=false) {
$type = gettype($var);
if( $privobj && $type === 'object' ){
$p = '<pre>'.print_r($var, true).'</pre>';
}
else {
$p = '<pre>'.$type . ' ' . json_encode(
$var,
JSON_UNESCAPED_SLASHES |
JSON_UNESCAPED_UNICODE |
JSON_PRETTY_PRINT |
JSON_PARTIAL_OUTPUT_ON_ERROR |
JSON_INVALID_UTF8_SUBSTITUTE
).'</pre>';
}
if( $print ) {
echo $p;
}
return $p;
}
*/

View File

@@ -1,233 +1,369 @@
<?php <?php
/** /**
* Add Frontend Validation Messages * Add Frontend Validation Messages
* *
* @since 4.0.0 * @since 4.0.0
* *
* @param array An associative array of messages * @param array An associative array of messages
* *
* @return array A modified associative array of messages * @return array A modified associative array of messages
*/ */
function wpcf7dtx_messages($messages) function wpcf7dtx_messages($messages)
{ {
return array_merge($messages, array( return array_merge($messages, array(
'dtx_invalid_email' => array( 'dtx_invalid_email' => array(
'description' => __('There is a field with an invalid email address', 'contact-form-7-dynamic-text-extension'), 'description' => __('There is a field with an invalid email address', 'contact-form-7-dynamic-text-extension'),
'default' => __('Please enter a valid email address.', 'contact-form-7-dynamic-text-extension') 'default' => __('Please enter a valid email address.', 'contact-form-7-dynamic-text-extension')
), ),
'dtx_invalid_tel' => array( 'dtx_invalid_tel' => array(
'description' => __('There is a field with an invalid phone number', 'contact-form-7-dynamic-text-extension'), 'description' => __('There is a field with an invalid phone number', 'contact-form-7-dynamic-text-extension'),
'default' => __('Please enter a valid phone number.', 'contact-form-7-dynamic-text-extension') 'default' => __('Please enter a valid phone number.', 'contact-form-7-dynamic-text-extension')
), ),
'dtx_invalid_number' => array( 'dtx_invalid_number' => array(
'description' => __('There is a field with an invalid number', 'contact-form-7-dynamic-text-extension'), 'description' => __('There is a field with an invalid number', 'contact-form-7-dynamic-text-extension'),
'default' => __('Please enter a valid number.', 'contact-form-7-dynamic-text-extension') 'default' => __('Please enter a valid number.', 'contact-form-7-dynamic-text-extension')
), ),
'dtx_invalid_date' => array( 'dtx_invalid_date' => array(
'description' => __('There is a field with an invalid date', 'contact-form-7-dynamic-text-extension'), 'description' => __('There is a field with an invalid date', 'contact-form-7-dynamic-text-extension'),
'default' => __('Please enter a valid date.', 'contact-form-7-dynamic-text-extension') 'default' => __('Please enter a valid date.', 'contact-form-7-dynamic-text-extension')
), ),
)); ));
} }
add_filter('wpcf7_messages', 'wpcf7dtx_messages'); add_filter('wpcf7_messages', 'wpcf7dtx_messages');
/** /**
* Validate DTX Form Fields * Add DTX Error Code to Config Validator
* *
* Frontend validation for DTX form tags * @since 5.0.0
* *
* @param WPCF7_Validation $result the current validation result object * @param array $error_codes A sequential array of available error codes in Contact Form 7.
* @param WPCF7_FormTag $tag the current form tag being filtered for validation *
* * @return array A modified sequential array of available error codes in Contact Form 7.
* @return WPCF7_Validation a possibly modified validation result object */
*/ function wpcf7dtx_config_validator_available_error_codes($error_codes)
function wpcf7dtx_validation_filter($result, $tag) {
{ $dtx_errors = array('dtx_disallowed');
$type = str_replace(array('dynamic_', 'dynamic'), '', $tag->basetype); return array_merge($error_codes, $dtx_errors);
if (empty($tag->name) || in_array($type, array('hidden', 'submit', 'reset'))) { }
return $result; // Bail early for tags without names or if a specific type add_filter('wpcf7_config_validator_available_error_codes', 'wpcf7dtx_config_validator_available_error_codes');
}
/**
// Get the value * Validate DTX Form Fields
$user_value = wpcf7dtx_array_has_key($tag->name, $_POST); *
if (is_array($user_value)) { * Frontend validation for DTX form tags
$selection_count = count($user_value); *
if (!wpcf7_form_tag_supports($tag->type, 'selectable-values')) { * @param WPCF7_Validation $result the current validation result object
// Field passed selectable values when it's doesn't support them * @param WPCF7_FormTag $tag the current form tag being filtered for validation
$result->invalidate($tag, wpcf7_get_message('validation_error')); *
return $result; * @return WPCF7_Validation a possibly modified validation result object
} elseif ($selection_count > 1) { */
if (!wpcf7_form_tag_supports($tag->type, 'multiple-controls-container')) { function wpcf7dtx_validation_filter($result, $tag)
// Field passed multiple values when it's doesn't support them {
$result->invalidate($tag, wpcf7_get_message('validation_error')); $type = str_replace(array('dynamic_', 'dynamic'), '', $tag->basetype);
return $result; if (empty($tag->name) || in_array($type, array('hidden', 'submit', 'reset'))) {
} return $result; // Bail early for tags without names or if a specific type
foreach ($user_value as $selection) { }
// Validate each selected choice
$result = wpcf7dtx_validate_value($result, sanitize_textarea_field(strval($selection)), $tag, $type); // Get the value
if (!$result->is_valid($tag->name)) { $user_value = wpcf7dtx_array_has_key($tag->name, $_POST);
return $result; // Return early if any are invalid if (is_array($user_value)) {
} $selection_count = count($user_value);
} if (!wpcf7_form_tag_supports($tag->type, 'selectable-values')) {
return $result; // Field passed selectable values when it's doesn't support them
} $result->invalidate($tag, wpcf7_get_message('validation_error'));
$user_value = sanitize_text_field(strval(implode(' ', $user_value))); return $result;
} elseif ($type == 'textarea') { } elseif ($selection_count > 1) {
$user_value = sanitize_textarea_field(strval($user_value)); if (!wpcf7_form_tag_supports($tag->type, 'multiple-controls-container')) {
} else { // Field passed multiple values when it's doesn't support them
$user_value = sanitize_text_field(strval($user_value)); $result->invalidate($tag, wpcf7_get_message('validation_error'));
} return $result;
// Validate and return }
return wpcf7dtx_validate_value($result, $user_value, $tag, $type); foreach ($user_value as $selection) {
} // Validate each selected choice
$result = wpcf7dtx_validate_value($result, sanitize_textarea_field(strval($selection)), $tag, $type);
if (!$result->is_valid($tag->name)) {
/** return $result; // Return early if any are invalid
* Validate Single Value }
* }
* @param WPCF7_Validation $result the current validation result object return $result;
* @param string $value the current value being validated, sanitized }
* @param WPCF7_FormTag $tag the current form tag being filtered for validation $user_value = sanitize_text_field(strval(implode(' ', $user_value)));
* @param string $type Optional. The type of the current form tag. Default is blank for lookup. } elseif ($type == 'textarea') {
* $user_value = sanitize_textarea_field(strval($user_value));
* @return WPCF7_Validation a possibly modified validation result object } else {
*/ $user_value = sanitize_text_field(strval($user_value));
function wpcf7dtx_validate_value($result, $value, $tag, $type = '') }
{ // Validate and return
$type = $type ? $type : str_replace(array('dynamic_', 'dynamic'), '', $tag->basetype); return wpcf7dtx_validate_value($result, $user_value, $tag, $type);
}
// Validate required fields for value
if ($tag->is_required() && empty($value)) {
$result->invalidate($tag, wpcf7_get_message('invalid_required')); /**
return $result; * Validate Single Value
} *
* @param WPCF7_Validation $result the current validation result object
// Validate value by type * @param string $value the current value being validated, sanitized
if (!empty($value)) { * @param WPCF7_FormTag $tag the current form tag being filtered for validation
switch ($type) { * @param string $type Optional. The type of the current form tag. Default is blank for lookup.
case 'email': *
if (!wpcf7_is_email($value)) { * @return WPCF7_Validation a possibly modified validation result object
$result->invalidate($tag, wpcf7_get_message('dtx_invalid_email')); */
return $result; function wpcf7dtx_validate_value($result, $value, $tag, $type = '')
} {
break; $type = $type ? $type : str_replace(array('dynamic_', 'dynamic'), '', $tag->basetype);
case 'tel':
if (!wpcf7_is_tel($value)) { // Validate required fields for value
$result->invalidate($tag, wpcf7_get_message('dtx_invalid_tel')); if ($tag->is_required() && empty($value)) {
return $result; $result->invalidate($tag, wpcf7_get_message('invalid_required'));
} return $result;
break; }
case 'number':
case 'range': // Validate value by type
if (!wpcf7_is_number($value)) { if (!empty($value)) {
$result->invalidate($tag, wpcf7_get_message('dtx_invalid_number')); switch ($type) {
return $result; case 'email':
} if (!wpcf7_is_email($value)) {
break; $result->invalidate($tag, wpcf7_get_message('dtx_invalid_email'));
case 'date': return $result;
if (!wpcf7_is_date($value)) { }
$result->invalidate($tag, wpcf7_get_message('dtx_invalid_date')); break;
return $result; case 'tel':
} if (!wpcf7_is_tel($value)) {
break; $result->invalidate($tag, wpcf7_get_message('dtx_invalid_tel'));
} return $result;
}
// Finish validating text-based inputs break;
$maxlength = $tag->get_maxlength_option(); case 'number':
$minlength = $tag->get_minlength_option(); case 'range':
if ($maxlength && $minlength && $maxlength < $minlength) { if (!wpcf7_is_number($value)) {
$maxlength = $minlength = null; $result->invalidate($tag, wpcf7_get_message('dtx_invalid_number'));
} return $result;
$code_units = wpcf7_count_code_units($value); }
if (false !== $code_units) { break;
if ($maxlength && $maxlength < $code_units) { case 'date':
$result->invalidate($tag, wpcf7_get_message('invalid_too_long')); if (!wpcf7_is_date($value)) {
return $result; $result->invalidate($tag, wpcf7_get_message('dtx_invalid_date'));
} elseif ($minlength && $code_units < $minlength) { return $result;
$result->invalidate($tag, wpcf7_get_message('invalid_too_short')); }
return $result; break;
} }
}
} // Finish validating text-based inputs
$maxlength = $tag->get_maxlength_option();
return $result; $minlength = $tag->get_minlength_option();
} if ($maxlength && $minlength && $maxlength < $minlength) {
$maxlength = $minlength = null;
/** }
* Backend Mail Configuration Validation $code_units = wpcf7_count_code_units($value);
* if (false !== $code_units) {
* Validate dynamic form tags used in mail configuration. if ($maxlength && $maxlength < $code_units) {
* $result->invalidate($tag, wpcf7_get_message('invalid_too_long'));
* @since 4.0.0 return $result;
* } elseif ($minlength && $code_units < $minlength) {
* @param WPCF7_ConfigValidator $result->invalidate($tag, wpcf7_get_message('invalid_too_short'));
* return $result;
* @return void }
*/ }
function wpcf7dtx_validate($validator) }
{
if (!$validator->is_valid()) { return $result;
$contact_form = null; }
$form_tags = null;
foreach ($validator->collect_error_messages() as $component => $errors) { /**
$components = explode('.', $component); * Backend Mail Configuration Validation
if (count($components) === 2 && strpos($components[0], 'mail') === 0 && in_array($components[1], array('sender', 'recipient', 'additional_headers'))) { *
foreach ($errors as $error) { * Validate dynamic form tags used in mail configuration.
// Focus on email fields that flag the invalid mailbox syntax warning, have to test link because code isn't sent and message could be in any language *
if (strpos(wpcf7dtx_array_has_key('link', $error), 'invalid-mailbox-syntax') !== false) { * @since 4.0.0
if (is_null($contact_form)) { *
$contact_form = $validator->contact_form(); * @param WPCF7_ConfigValidator
} *
if (is_null($form_tags)) { * @return void
$form_tags = wpcf7_scan_form_tags(); */
} function wpcf7dtx_validate($validator)
$raw_value = $contact_form->prop($components[0])[$components[1]]; {
foreach ($form_tags as $tag) { // Check for sensitive form tags
if (!empty($tag->name)) { $manager = WPCF7_FormTagsManager::get_instance();
// Check if this form tag is in the raw value $contact_form = $validator->contact_form();
$form_tag = '[' . $tag->name . ']'; $form = $contact_form->prop('form');
if (strpos($raw_value, $form_tag) !== false && in_array($tag->basetype, array_keys(wpcf7dtx_config()))) { if (wpcf7_autop_or_not()) {
$validator->remove_error($component, 'invalid_mailbox_syntax'); // Remove error, this is ours to handle now $form = $manager->replace_with_placeholders($form);
$utm_source = urlencode(home_url()); $form = wpcf7_autop($form);
if (!in_array($tag->basetype, array('dynamic_hidden', 'dynamic_email'))) { $form = $manager->restore_from_placeholders($form);
$validator->add_error($component, 'invalid_mailbox_syntax', array( }
'message' => __('Only email, dynamic email, hidden, or dynamic hidden form tags can be used for email addresses.', 'contact-form-7-dynamic-text-extension'), $form = $manager->replace_all($form);
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-invalid_mailbox_syntax#valid-form-tags', $utm_source)) $tags = $manager->get_scanned_tags();
)); foreach ($tags as $tag) {
} else { /** @var WPCF7_FormTag $tag */
$dynamic_value = wpcf7dtx_get_dynamic(false, $tag); // Get the dynamic value of this tag
if (empty($dynamic_value) && $tag->basetype == 'dynamic_hidden') { // Only validate DTX formtags
$validator->add_error($component, 'maybe_empty', array( if (in_array($tag->basetype, array_merge(
'message' => __('The dynamic hidden form tag must have a default value.', 'contact-form-7-dynamic-text-extension'), array('dynamictext', 'dynamichidden'), // Deprecated DTX form tags
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-maybe_empty#maybe-empty', $utm_source)) array_keys(wpcf7dtx_config()) // DTX form tags
)); ))) {
} elseif (empty($dynamic_value) && !$tag->is_required()) { // Check value for sensitive data
$validator->add_error($component, 'maybe_empty', array( $default = $tag->get_option('defaultvalue', '', true);
'message' => __('The dynamic form tag must be required or have a default value.', 'contact-form-7-dynamic-text-extension'), if (!$default) {
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-maybe_empty#maybe-empty', $utm_source)) $default = $tag->get_default_option(strval(reset($tag->values)));
)); }
} elseif (!empty($dynamic_value)) { if (
if (!wpcf7_is_email($dynamic_value)) { !empty($value = trim(wpcf7_get_hangover($tag->name, $default))) && // Has value
$validator->add_error($component, 'invalid_mailbox_syntax', array( ($result = wpcf7dtx_validate_sensitive_value($value))['status'] // Has sensitive data
'message' => __('The default dynamic value does not result in a valid email address.', 'contact-form-7-dynamic-text-extension'), ) {
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-invalid_mailbox_syntax#invalid-email-address', $utm_source)) $validator->add_error('form.body', 'dtx_disallowed', array(
)); 'message' => sprintf(
} elseif ($component[1] == 'sender' && !wpcf7_is_email_in_site_domain($dynamic_value)) { __('[%1$s %2$s]: Access to key "%3$s" in shortcode "%4$s" is disallowed by default. To allow access, add "%3$s" to the %5$s Allow List.', 'contact-form-7-dynamic-text-extension'),
$validator->add_error($component, 'email_not_in_site_domain', array( esc_html($tag->basetype),
'message' => __('The dynamic email address for the sender does not belong to the site domain.', 'contact-form-7-dynamic-text-extension'), esc_html($tag->name),
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-email_not_in_site_domain#invalid-site-domain', $utm_source)) esc_html($result['key']),
)); esc_html($result['shortcode']),
} esc_html($result['shortcode'] == 'CF7_get_current_user' ? __('User Data Key', 'contact-form-7-dynamic-text-extension') : __('Meta Key', 'contact-form-7-dynamic-text-extension'))
} ),
} 'link' => wpcf7dtx_get_admin_settings_screen_url()
} ));
} }
}
} // Check placeholder for sensitive data
} if (
} ($tag->has_option('placeholder') || $tag->has_option('watermark')) && // Using placeholder
} !empty($placeholder = trim(html_entity_decode(urldecode($tag->get_option('placeholder', '', true)), ENT_QUOTES))) && // Has value
} ($result = wpcf7dtx_validate_sensitive_value($placeholder))['status'] // Has sensitive data
} ) {
add_action('wpcf7_config_validator_validate', 'wpcf7dtx_validate'); $validator->add_error('form.body', 'dtx_disallowed', array(
'message' => sprintf(
__('[%1$s %2$s]: Access to key "%3$s" in shortcode "%4$s" is disallowed by default. To allow access, add "%3$s" to the %5$s Allow List.', 'contact-form-7-dynamic-text-extension'),
esc_html($tag->basetype),
esc_html($tag->name),
esc_html($result['key']),
esc_html($result['shortcode']),
esc_html($result['shortcode'] == 'CF7_get_current_user' ? __('User Data Key', 'contact-form-7-dynamic-text-extension') : __('Meta Key', 'contact-form-7-dynamic-text-extension'))
),
'link' => wpcf7dtx_get_admin_settings_screen_url()
));
}
}
}
// Validate email address
if (!$validator->is_valid()) {
$contact_form = null;
$form_tags = null;
foreach ($validator->collect_error_messages() as $component => $errors) {
$components = explode('.', $component);
if (count($components) === 2 && strpos($components[0], 'mail') === 0 && in_array($components[1], array('sender', 'recipient', 'additional_headers'))) {
foreach ($errors as $error) {
// Focus on email fields that flag the invalid mailbox syntax warning, have to test link because code isn't sent and message could be in any language
if (strpos(wpcf7dtx_array_has_key('link', $error), 'invalid-mailbox-syntax') !== false) {
if (is_null($contact_form)) {
$contact_form = $validator->contact_form();
}
if (is_null($form_tags)) {
$form_tags = wpcf7_scan_form_tags();
}
$raw_value = $contact_form->prop($components[0])[$components[1]];
foreach ($form_tags as $tag) {
if (!empty($tag->name)) {
// Check if this form tag is in the raw value
$form_tag = '[' . $tag->name . ']';
if (strpos($raw_value, $form_tag) !== false && in_array($tag->basetype, array_keys(wpcf7dtx_config()))) {
$validator->remove_error($component, 'invalid_mailbox_syntax'); // Remove error, this is ours to handle now
$utm_source = urlencode(home_url());
if (!in_array($tag->basetype, array('dynamic_hidden', 'dynamic_email'))) {
$validator->add_error($component, 'invalid_mailbox_syntax', array(
'message' => __('Only email, dynamic email, hidden, or dynamic hidden form tags can be used for email addresses.', 'contact-form-7-dynamic-text-extension'),
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-invalid_mailbox_syntax#valid-form-tags', $utm_source))
));
} else {
$dynamic_value = wpcf7dtx_get_dynamic(false, $tag); // Get the dynamic value of this tag
if (empty($dynamic_value) && $tag->basetype == 'dynamic_hidden') {
$validator->add_error($component, 'maybe_empty', array(
'message' => __('The dynamic hidden form tag must have a default value.', 'contact-form-7-dynamic-text-extension'),
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-maybe_empty#maybe-empty', $utm_source))
));
} elseif (empty($dynamic_value) && !$tag->is_required()) {
$validator->add_error($component, 'maybe_empty', array(
'message' => __('The dynamic form tag must be required or have a default value.', 'contact-form-7-dynamic-text-extension'),
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-maybe_empty#maybe-empty', $utm_source))
));
} elseif (!empty($dynamic_value)) {
if (!wpcf7_is_email($dynamic_value)) {
$validator->add_error($component, 'invalid_mailbox_syntax', array(
'message' => __('The default dynamic value does not result in a valid email address.', 'contact-form-7-dynamic-text-extension'),
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-invalid_mailbox_syntax#invalid-email-address', $utm_source))
));
} elseif ($component[1] == 'sender' && !wpcf7_is_email_in_site_domain($dynamic_value)) {
$validator->add_error($component, 'email_not_in_site_domain', array(
'message' => __('The dynamic email address for the sender does not belong to the site domain.', 'contact-form-7-dynamic-text-extension'),
'link' => esc_url(sprintf('https://aurisecreative.com/docs/contact-form-7-dynamic-text-extension/configuration-errors/?utm_source=%s&utm_medium=link&utm_campaign=contact-form-7-dynamic-text-extension&utm_content=config-error-email_not_in_site_domain#invalid-site-domain', $utm_source))
));
}
}
}
}
}
}
}
}
}
}
}
}
add_action('wpcf7_config_validator_validate', 'wpcf7dtx_validate');
/**
* Validate Field Value for Sensitive Data
*
* @since 5.0.0
*
* @see https://developer.wordpress.org/reference/functions/get_bloginfo/#description
*
* @param string $content The string to validate.
*
* @return array An associative array with keys `status` (bool), `shortcode` (string), and `key` (string).
* The value of `status` is true if the content is a shortcode that is attempting to access sensitive data. False
* otherwise. The value of `shortcode` is the the shortcode that is making the attempt if `status` is true. The
* value of `key` is the shortcode's `key` attribute of the attempt being made if `status` is true.
*/
function wpcf7dtx_validate_sensitive_value($content)
{
$r = array(
'status' => false,
'shortcode' => '',
'key' => ''
);
// Parse the attributes. [0] is the shortcode name. ['key'] is the key attribute
$atts = shortcode_parse_atts($content);
// If we can't extract the atts, or the shortcode or `key` is not an att, don't validate
if( !is_array($atts) || !array_key_exists('key', $atts) || !array_key_exists('0', $atts) ) return $r;
// Find the key and shortcode in question
$key = sanitize_text_field($atts['key']);
$shortcode = sanitize_text_field($atts['0']);
// If the shortcode or key value does not exist, don't validate
if( empty($shortcode) || empty($key) ) return $r;
$allowed = true;
switch( $shortcode ){
case 'CF7_get_custom_field':
$allowed = wpcf7dtx_post_meta_key_access_is_allowed( $key );
break;
case 'CF7_get_current_user':
$allowed = wpcf7dtx_user_data_access_is_allowed( $key );
break;
default:
}
if( !$allowed ){
$r['status'] = true;
$r['shortcode'] = $shortcode;
$r['key'] = $key;
}
return $r;
}

View File

@@ -2,8 +2,8 @@
Contributors: sevenspark, tessawatkinsllc Contributors: sevenspark, tessawatkinsllc
Donate link: https://just1voice.com/donate/ Donate link: https://just1voice.com/donate/
Tags: Contact Form 7, autofill, prepopulate, input, form field, contact form, text, hidden, input, dynamic, GET, POST, title, slug, auto-fill, pre-populate Tags: Contact Form 7, autofill, prepopulate, input, form field, contact form, text, hidden, input, dynamic, GET, POST, title, slug, auto-fill, pre-populate
Tested up to: 6.3 Tested up to: 6.4.2
Stable tag: 4.1.0 Stable tag: 4.2.0
This plugin provides additional form tags for the Contact Form 7 plugin. It allows dynamic generation of content for text-based input fields like text, hidden, and email, checkboxes, radio buttons, and drop-down selections using any shortcode. This plugin provides additional form tags for the Contact Form 7 plugin. It allows dynamic generation of content for text-based input fields like text, hidden, and email, checkboxes, radio buttons, and drop-down selections using any shortcode.
@@ -198,6 +198,8 @@ Learn more and see examples from [the DTX Knowledge base](https://aurisecreative
Retrieve custom fields from the current post/page. Just set the custom field as the key in the shortcode. Retrieve custom fields from the current post/page. Just set the custom field as the key in the shortcode.
Note: You must add any meta keys that you want to allow access to to the allow list in your admin panel > Contact > Dynamic Text Extension > Meta Key Allow List. [More Information](https://sevenspark.com/docs/contact-form-7-dynamic-text-extension/allow-data-access)
The dynamic value input becomes: `CF7_get_custom_field key='my_custom_field'` The dynamic value input becomes: `CF7_get_custom_field key='my_custom_field'`
And the tag looks like this: `[dynamictext dynamicname "CF7_get_custom_field key='my_custom_field'"]` And the tag looks like this: `[dynamictext dynamicname "CF7_get_custom_field key='my_custom_field'"]`
@@ -238,6 +240,8 @@ Get data about the current logged-in user.
Dynamic value: `CF7_get_current_user key='user_displayname'` Dynamic value: `CF7_get_current_user key='user_displayname'`
CF7 Tag: `[dynamictext dynamicname "CF7_get_current_user"]` CF7 Tag: `[dynamictext dynamicname "CF7_get_current_user"]`
Note: You must add any user keys that you want to allow access to to the allow list in your admin panel > Contact > Dynamic Text Extension > User Data Key Allow List. [More Information](https://sevenspark.com/docs/contact-form-7-dynamic-text-extension/allow-data-access)
Valid values for `key` include: Valid values for `key` include:
* `ID` * `ID`
@@ -376,11 +380,18 @@ Please check out the [FAQ on our website](https://aurisecreative.com/docs/contac
== Upgrade Notice == == Upgrade Notice ==
= 4.1.0 = = 4.2.0 =
Extend functionality without losing your work! Extend functionality without losing your work!
== Changelog == == Changelog ==
= 4.2.0 =
* Security Update: ** Please be sure to review this doc, as you may need to adjust the settings: https://sevenspark.com/docs/contact-form-7-dynamic-text-extension/allow-data-access **
* Feature: Added Settings Screen with Allow Lists
* Feature: Added Form Scanner
* Feature: Added Allow List key validation in CF7 Form Validator
= 4.1.0 = = 4.1.0 =
* Feature: Looks for a `dtx.php` file in the `wp_content` directory to maybe load custom shortcodes, [see support thread](https://wordpress.org/support/topic/how-to-avoid-custom-shortcodes-being-overwritten-on-updates/) * Feature: Looks for a `dtx.php` file in the `wp_content` directory to maybe load custom shortcodes, [see support thread](https://wordpress.org/support/topic/how-to-avoid-custom-shortcodes-being-overwritten-on-updates/)

View File

@@ -39,6 +39,9 @@ class WPSEO_Expose_Shortlinks implements WPSEO_WordPress_Integration {
'shortlinks.upsell.sidebar.keyphrase_distribution' => 'https://yoa.st/keyphrase-distribution-sidebar', 'shortlinks.upsell.sidebar.keyphrase_distribution' => 'https://yoa.st/keyphrase-distribution-sidebar',
'shortlinks.upsell.sidebar.word_complexity' => 'https://yoa.st/word-complexity-sidebar', 'shortlinks.upsell.sidebar.word_complexity' => 'https://yoa.st/word-complexity-sidebar',
'shortlinks.upsell.sidebar.internal_linking_suggestions' => 'https://yoa.st/internal-linking-suggestions-sidebar', 'shortlinks.upsell.sidebar.internal_linking_suggestions' => 'https://yoa.st/internal-linking-suggestions-sidebar',
'shortlinks.upsell.sidebar.highlighting_seo_analysis' => 'https://yoa.st/highlighting-seo-analysis',
'shortlinks.upsell.sidebar.highlighting_readability_analysis' => 'https://yoa.st/highlighting-readability-analysis',
'shortlinks.upsell.sidebar.highlighting_inclusive_analysis' => 'https://yoa.st/highlighting-inclusive-analysis',
'shortlinks.upsell.metabox.news' => 'https://yoa.st/get-news-metabox', 'shortlinks.upsell.metabox.news' => 'https://yoa.st/get-news-metabox',
'shortlinks.upsell.metabox.go_premium' => 'https://yoa.st/pe-premium-page', 'shortlinks.upsell.metabox.go_premium' => 'https://yoa.st/pe-premium-page',
'shortlinks.upsell.metabox.focus_keyword_synonyms_button' => 'https://yoa.st/keyword-synonyms-popup', 'shortlinks.upsell.metabox.focus_keyword_synonyms_button' => 'https://yoa.st/keyword-synonyms-popup',

View File

@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
* *
* @var string * @var string
*/ */
const CURRENT_RELEASE = '17.1.3'; const CURRENT_RELEASE = '17.4.0';
/** /**
* The minimally supported version of Gutenberg by the plugin. * The minimally supported version of Gutenberg by the plugin.
* *
* @var string * @var string
*/ */
const MINIMUM_SUPPORTED = '17.1.3'; const MINIMUM_SUPPORTED = '17.4.0';
/** /**
* Holds the current version. * Holds the current version.

View File

@@ -53,13 +53,42 @@ class WPSEO_Premium_Upsell_Admin_Block {
$url = WPSEO_Shortlinker::get( 'https://yoa.st/17h' ); $url = WPSEO_Shortlinker::get( 'https://yoa.st/17h' );
$arguments = [ $arguments = [
'<strong>' . esc_html__( 'Use AI', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Quickly create titles & meta descriptions', 'wordpress-seo' ), sprintf(
'<strong>' . esc_html__( 'No more dead links', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Easy redirect manager', 'wordpress-seo' ), /* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
'<strong>' . esc_html__( 'Superfast internal linking suggestions', 'wordpress-seo' ) . '</strong>', esc_html__( '%1$sAI%2$s: Better SEO titles and meta descriptions, faster.', 'wordpress-seo' ),
'<strong>' . esc_html__( 'Social media preview', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Facebook & Twitter', 'wordpress-seo' ), '<strong>',
'<strong>' . esc_html__( 'Multiple keyphrases', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Increase your SEO reach', 'wordpress-seo' ), '</strong>'
'<strong>' . esc_html__( 'SEO Workouts', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Get guided in routine SEO tasks', 'wordpress-seo' ), ),
'<strong>' . esc_html__( '24/7 email support', 'wordpress-seo' ) . '</strong>', sprintf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$sMultiple keywords%2$s: Rank higher for more searches.', 'wordpress-seo' ),
'<strong>',
'</strong>'
),
sprintf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$sSuper fast%2$s internal linking suggestions.', 'wordpress-seo' ),
'<strong>',
'</strong>'
),
sprintf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$sNo more broken links%2$s: Automatic redirect manager.', 'wordpress-seo' ),
'<strong>',
'</strong>'
),
sprintf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$sAppealing social previews%2$s people actually want to click on.', 'wordpress-seo' ),
'<strong>',
'</strong>'
),
sprintf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$s24/7 support%2$s: Also on evenings and weekends.', 'wordpress-seo' ),
'<strong>',
'</strong>'
),
'<strong>' . esc_html__( 'No ads!', 'wordpress-seo' ) . '</strong>', '<strong>' . esc_html__( 'No ads!', 'wordpress-seo' ) . '</strong>',
]; ];
@@ -68,7 +97,7 @@ class WPSEO_Premium_Upsell_Admin_Block {
$class = $this->get_html_class(); $class = $this->get_html_class();
/* translators: %s expands to Yoast SEO Premium */ /* translators: %s expands to Yoast SEO Premium */
$button_text = YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ? \esc_html__( 'Claim your 30% off now!', 'wordpress-seo' ) : sprintf( esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' ); $button_text = YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ? \esc_html__( 'Claim your 30% off now!', 'wordpress-seo' ) : sprintf( esc_html__( 'Explore %s now!', 'wordpress-seo' ), 'Yoast SEO Premium' );
/* translators: Hidden accessibility text. */ /* translators: Hidden accessibility text. */
$button_text .= '<span class="screen-reader-text">' . esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>' . $button_text .= '<span class="screen-reader-text">' . esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>' .
'<span aria-hidden="true" class="yoast-button-upsell__caret"></span>'; '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';

View File

@@ -31,11 +31,11 @@ $extensions = [
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zt' ), 'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zt' ),
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zs' ), 'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zs' ),
'title' => 'Local SEO', 'title' => 'Local SEO',
'display_title' => __( 'Maximize your visibility for local searches', 'wordpress-seo' ), 'display_title' => __( 'Stand out for local searches', 'wordpress-seo' ),
'desc' => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ), 'desc' => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ),
'image' => plugins_url( 'images/local_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ), 'image' => plugins_url( 'images/local_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
'benefits' => [ 'benefits' => [
__( 'Attract more local customers to your website and physical store', 'wordpress-seo' ), __( 'Attract more customers to your site and physical store', 'wordpress-seo' ),
__( 'Automatically get technical SEO best practices for local businesses', 'wordpress-seo' ), __( 'Automatically get technical SEO best practices for local businesses', 'wordpress-seo' ),
__( 'Easily add maps, address finders, and opening hours to your content', 'wordpress-seo' ), __( 'Easily add maps, address finders, and opening hours to your content', 'wordpress-seo' ),
__( 'Optimize your business for multiple locations', 'wordpress-seo' ), __( 'Optimize your business for multiple locations', 'wordpress-seo' ),
@@ -45,14 +45,14 @@ $extensions = [
'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zx/' ), 'buyUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zx/' ),
'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zw/' ), 'infoUrl' => WPSEO_Shortlinker::get( 'https://yoa.st/zw/' ),
'title' => 'Video SEO', 'title' => 'Video SEO',
'display_title' => __( 'Drive more traffic to your videos', 'wordpress-seo' ), 'display_title' => __( 'Drive more views to your videos', 'wordpress-seo' ),
'desc' => __( 'Optimize your videos to show them off in search results and get more clicks!', 'wordpress-seo' ), 'desc' => __( 'Optimize your videos to show them off in search results and get more clicks!', 'wordpress-seo' ),
'image' => plugins_url( 'images/video_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ), 'image' => plugins_url( 'images/video_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
'benefits' => [ 'benefits' => [
__( 'Know that Google discovers your videos', 'wordpress-seo' ), __( 'Automatically get technical SEO best practices for video content', 'wordpress-seo' ),
__( 'Load pages faster that include videos', 'wordpress-seo' ), __( 'Make sure your videos load quickly for users', 'wordpress-seo' ),
__( 'Make your videos responsive for all screen sizes', 'wordpress-seo' ), __( 'Make your videos responsive for all screen sizes', 'wordpress-seo' ),
__( 'Get XML video sitemaps', 'wordpress-seo' ), __( 'Optimize your video previews & thumbnails', 'wordpress-seo' ),
], ],
], ],
WPSEO_Addon_Manager::NEWS_SLUG => [ WPSEO_Addon_Manager::NEWS_SLUG => [
@@ -66,7 +66,7 @@ $extensions = [
__( 'Optimize your site for Google News', 'wordpress-seo' ), __( 'Optimize your site for Google News', 'wordpress-seo' ),
__( 'Ping Google on the publication of a new post', 'wordpress-seo' ), __( 'Ping Google on the publication of a new post', 'wordpress-seo' ),
__( 'Add all necessary schema.org markup', 'wordpress-seo' ), __( 'Add all necessary schema.org markup', 'wordpress-seo' ),
__( 'Get XML news sitemaps', 'wordpress-seo' ), __( 'Get XML sitemaps', 'wordpress-seo' ),
], ],
], ],
]; ];
@@ -82,11 +82,12 @@ if ( YoastSEO()->helpers->woocommerce->is_active() ) {
'desc' => sprintf( __( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ), 'Yoast SEO' ), 'desc' => sprintf( __( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ), 'Yoast SEO' ),
'image' => plugins_url( 'images/woo_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ), 'image' => plugins_url( 'images/woo_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
'benefits' => [ 'benefits' => [
__( 'Write product pages that rank with the enhanced SEO analysis', 'wordpress-seo' ), __( 'Write product pages that rank using the SEO analysis', 'wordpress-seo' ),
__( 'Increase clicks of Google search with rich results', 'wordpress-seo' ), __( 'Increase Google clicks with rich results', 'wordpress-seo' ),
__( 'Add global identifiers for variable products', 'wordpress-seo' ), __( 'Add global identifiers for variable products', 'wordpress-seo' ),
/* translators: %1$s expands to Yoast SEO, %2$s expands to WooCommerce */ /* translators: %1$s expands to Yoast SEO, %2$s expands to WooCommerce */
sprintf( __( 'Seamless integration between %1$s and %2$s', 'wordpress-seo' ), 'Yoast SEO', 'WooCommerce' ), sprintf( __( 'Seamless integration between %1$s and %2$s', 'wordpress-seo' ), 'Yoast SEO', 'WooCommerce' ),
__( 'Turn more visitors into customers!', 'wordpress-seo' ),
], ],
'buy_button' => 'WooCommerce SEO', 'buy_button' => 'WooCommerce SEO',
]; ];
@@ -107,9 +108,9 @@ $extensions['yoast-seo-plugin-subscription'] = [
'desc' => '', 'desc' => '',
'image' => plugins_url( 'images/plugin_subscription.svg?v=' . WPSEO_VERSION, WPSEO_FILE ), 'image' => plugins_url( 'images/plugin_subscription.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
'benefits' => [ 'benefits' => [
__( 'Get all 5 Yoast plugins for WordPress with a big discount', 'wordpress-seo' ), __( 'Get all 5 Yoast plugins for WordPress at a big discount', 'wordpress-seo' ),
__( 'Reach new customers that live near your business', 'wordpress-seo' ), __( 'Reach new customers who live near your business', 'wordpress-seo' ),
__( 'Drive more traffic with your videos', 'wordpress-seo' ), __( 'Drive more views to your videos', 'wordpress-seo' ),
__( 'Rank higher in Google\'s news carousel', 'wordpress-seo' ), __( 'Rank higher in Google\'s news carousel', 'wordpress-seo' ),
__( 'Drive more traffic to your online store', 'wordpress-seo' ), __( 'Drive more traffic to your online store', 'wordpress-seo' ),
@@ -152,14 +153,7 @@ if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-202
<section class="yoast-seo-premium-extension"> <section class="yoast-seo-premium-extension">
<?php echo $premium_sale_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Output is already escaped ?> <?php echo $premium_sale_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Output is already escaped ?>
<h2> <h2>
<?php <?php esc_html_e( 'Rank higher in search results', 'wordpress-seo' ); ?>
printf(
/* translators: 1: expands to Yoast SEO Premium */
esc_html__( 'Drive more traffic to your site with %1$s', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$premium_extension['title']
);
?>
<img alt="" width="100" height="100" src="<?php echo esc_url( $premium_extension['image'] ); ?>"/> <img alt="" width="100" height="100" src="<?php echo esc_url( $premium_extension['image'] ); ?>"/>
</h2> </h2>
<?php <?php
@@ -167,36 +161,64 @@ if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-202
?> ?>
<ul class="yoast-seo-premium-benefits yoast-list--usp"> <ul class="yoast-seo-premium-benefits yoast-list--usp">
<li class="yoast-seo-premium-benefits__item"> <li class="yoast-seo-premium-benefits__item">
<span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Be more efficient in creating content', 'wordpress-seo' ); ?></span> <?php
<span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Use AI to create high-quality titles and meta descriptions for posts and pages', 'wordpress-seo' ); ?></span> printf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$sAI%2$s: Better SEO titles and meta descriptions, faster.', 'wordpress-seo' ),
'<strong>',
'</strong>'
);
?>
</li> </li>
<li class="yoast-seo-premium-benefits__item"> <li class="yoast-seo-premium-benefits__item">
<span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Reach bigger audiences', 'wordpress-seo' ); ?></span> <?php
<span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Optimize a single post for synonyms and related keyphrases and get extra checks with the Premium SEO analysis', 'wordpress-seo' ); ?></span> printf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$sMultiple keywords%2$s: Rank higher for more searches.', 'wordpress-seo' ),
'<strong>',
'</strong>'
);
?>
</li> </li>
<li class="yoast-seo-premium-benefits__item"> <li class="yoast-seo-premium-benefits__item">
<span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Save time on doing SEO', 'wordpress-seo' ); ?></span> <?php
<span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'The Yoast SEO workouts guide you through important routine SEO tasks', 'wordpress-seo' ); ?></span> printf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$sSuper fast%2$s internal linking suggestions.', 'wordpress-seo' ),
'<strong>',
'</strong>'
);
?>
</li> </li>
<li class="yoast-seo-premium-benefits__item"> <li class="yoast-seo-premium-benefits__item">
<span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Improve your internal linking structure', 'wordpress-seo' ); ?></span> <?php
<span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Get tools that tell you where and how to improve internal linking', 'wordpress-seo' ); ?></span> printf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$sNo more broken links%2$s: Automatic redirect manager.', 'wordpress-seo' ),
'<strong>',
'</strong>'
);
?>
</li> </li>
<li class="yoast-seo-premium-benefits__item"> <li class="yoast-seo-premium-benefits__item">
<span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Reduce your site\'s carbon footprint', 'wordpress-seo' ); ?></span> <?php
<span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Save energy by reducing the crawlability of your site without hurting your rankings!', 'wordpress-seo' ); ?></span> printf(
/* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
esc_html__( '%1$sAppealing social previews%2$s people actually want to click on.', 'wordpress-seo' ),
'<strong>',
'</strong>'
);
?>
</li> </li>
<li class="yoast-seo-premium-benefits__item"> <li class="yoast-seo-premium-benefits__item">
<span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Prevents 404s', 'wordpress-seo' ); ?></span> <?php
<span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Easily create and manage redirects when you move or delete content', 'wordpress-seo' ); ?></span> printf(
</li> /* translators: %1$s expands to a strong opening tag, %2$s expands to a strong closing tag. */
<li class="yoast-seo-premium-benefits__item"> esc_html__( '%1$s24/7 support%2$s: Also on evenings and weekends.', 'wordpress-seo' ),
<span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Stand out on social media', 'wordpress-seo' ); ?></span> '<strong>',
<span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Check what your Facebook or Twitter post will look like before posting them', 'wordpress-seo' ); ?></span> '</strong>'
</li> );
<li class="yoast-seo-premium-benefits__item"> ?>
<span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Premium support', 'wordpress-seo' ); ?></span>
<span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Gain access to our 24/7 support team', 'wordpress-seo' ); ?></span>
</li> </li>
</ul> </ul>
<?php endif; ?> <?php endif; ?>
@@ -252,14 +274,7 @@ if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-202
<a target="_blank" href="<?php echo esc_url( $premium_extension['infoUrl'] ); ?>" class="yoast-link--more-info"> <a target="_blank" href="<?php echo esc_url( $premium_extension['infoUrl'] ); ?>" class="yoast-link--more-info">
<?php <?php
printf( esc_html_e( 'Explore now', 'wordpress-seo' );
/* translators: Text between 1: and 2: will only be shown to screen readers. 3: expands to the product name. */
esc_html__( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
'<span class="screen-reader-text">',
'</span>',
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$premium_extension['title']
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped. // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message; echo $new_tab_message;
?> ?>
@@ -267,7 +282,7 @@ if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-202
<?php endif; ?> <?php endif; ?>
<?php if ( ! $has_valid_premium_subscription ) { ?> <?php if ( ! $has_valid_premium_subscription ) { ?>
<p> <p>
<small class="yoast-money-back-guarantee"><?php esc_html_e( 'With 30-day money-back guarantee. No questions asked.', 'wordpress-seo' ); ?></small> <small class="yoast-money-back-guarantee"><?php esc_html_e( 'With a 30-day money-back guarantee. No questions asked.', 'wordpress-seo' ); ?></small>
</p> </p>
<?php } ?> <?php } ?>
</section> </section>
@@ -277,14 +292,11 @@ if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-202
<section class="yoast-promo-extensions"> <section class="yoast-promo-extensions">
<h2> <h2>
<?php <?php
$yoast_outrank_copy = sprintf( esc_html__( 'Outrank your competitors even further', 'wordpress-seo' ) );
$yoast_outrank_copy = '<span class="yoast-heading-highlight">' . $yoast_outrank_copy . '</span>';
printf( printf(
/* translators: 1: expands to Outrank your competitors even further, 2: expands to Yoast SEO */ /* translators: %1$s expands to a span opening tag, %2$s expands to a span closing tag, %3$s expands to Yoast SEO */
esc_html__( '%1$s with %2$s extensions', 'wordpress-seo' ), esc_html__( '%1$sOutrank your competitors even further%2$s with these %3$s plugins', 'wordpress-seo' ),
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $yoast_seo_extensions is properly escaped. '<span class="yoast-heading-highlight">',
$yoast_outrank_copy, '</span>',
'Yoast SEO' 'Yoast SEO'
); );
?> ?>
@@ -365,14 +377,7 @@ if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-202
<a target="_blank" class="yoast-link--more-info" href="<?php echo esc_url( $extension['infoUrl'] ); ?>"> <a target="_blank" class="yoast-link--more-info" href="<?php echo esc_url( $extension['infoUrl'] ); ?>">
<?php <?php
printf( esc_html_e( 'Explore now', 'wordpress-seo' );
/* translators: Text between 1: and 2: will only be shown to screen readers. 3: expands to the product name, e.g. "News SEO" or "all the Yoast Plugins" */
esc_html__( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
'<span class="screen-reader-text">',
'</span>',
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
$extension['title']
);
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped. // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
echo $new_tab_message; echo $new_tab_message;
?> ?>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
(window.webpackJsonp_wordpress_seo=window.webpackJsonp_wordpress_seo||[]).push([[42],{315:function(t,s,e){"use strict";e.r(s),e.d(s,"scopeCss",(function(){return S}));const o=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",r=new RegExp("(-shadowcsshost"+o,"gim"),c=new RegExp("(-shadowcsscontext"+o,"gim"),n=new RegExp("(-shadowcssslotted"+o,"gim"),l=/-shadowcsshost-no-combinator([^\s]*)/,a=[/::shadow/g,/::content/g],i=/-shadowcsshost/gim,h=/:host/gim,p=/::slotted/gim,d=/:host-context/gim,u=/\/\*\s*[\s\S]*?\*\//g,g=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g,m=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,w=/([{}])/g,f=(t,s)=>{const e=_(t);let o=0;return e.escapedString.replace(m,(...t)=>{const r=t[2];let c="",n=t[4],l="";n&&n.startsWith("{%BLOCK%")&&(c=e.blocks[o++],n=n.substring("%BLOCK%".length+1),l="{");const a=s({selector:r,content:c});return`${t[1]}${a.selector}${t[3]}${l}${a.content}${n}`})},_=t=>{const s=t.split(w),e=[],o=[];let r=0,c=[];for(let t=0;t<s.length;t++){const n=s[t];"}"===n&&r--,r>0?c.push(n):(c.length>0&&(o.push(c.join("")),e.push("%BLOCK%"),c=[]),e.push(n)),"{"===n&&r++}return c.length>0&&(o.push(c.join("")),e.push("%BLOCK%")),{escapedString:e.join(""),blocks:o}},x=(t,s,e)=>t.replace(s,(...t)=>{if(t[2]){const s=t[2].split(","),o=[];for(let r=0;r<s.length;r++){const c=s[r].trim();if(!c)break;o.push(e("-shadowcsshost-no-combinator",c,t[3]))}return o.join(",")}return"-shadowcsshost-no-combinator"+t[3]}),$=(t,s,e)=>t+s.replace("-shadowcsshost","")+e,b=(t,s,e)=>s.indexOf("-shadowcsshost")>-1?$(t,s,e):t+s+e+", "+s+" "+t+e,O=(t,s,e,o,r)=>f(t,t=>{let r=t.selector,c=t.content;return"@"!==t.selector[0]?r=((t,s,e,o)=>t.split(",").map(t=>o&&t.indexOf("."+o)>-1?t.trim():((t,s)=>!(t=>(t=t.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),new RegExp("^("+t+")([>\\s~+[.,{:][\\s\\S]*)?$","m")))(s).test(t))(t,s)?((t,s,e)=>{const o="."+(s=s.replace(/\[is=([^\]]*)\]/g,(t,...s)=>s[0])),r=t=>{let r=t.trim();if(!r)return"";if(t.indexOf("-shadowcsshost-no-combinator")>-1)r=((t,s,e)=>{if(i.lastIndex=0,i.test(t)){const s="."+e;return t.replace(l,(t,e)=>e.replace(/([^:]*)(:*)(.*)/,(t,e,o,r)=>e+s+o+r)).replace(i,s+" ")}return s+" "+t})(t,s,e);else{const s=t.replace(i,"");if(s.length>0){const t=s.match(/([^:]*)(:*)(.*)/);t&&(r=t[1]+o+t[2]+t[3])}}return r},c=(t=>{const s=[];let e,o=0;return e=(t=t.replace(/(\[[^\]]*\])/g,(t,e)=>{const r=`__ph-${o}__`;return s.push(e),o++,r})).replace(/(:nth-[-\w]+)(\([^)]+\))/g,(t,e,r)=>{const c=`__ph-${o}__`;return s.push(r),o++,e+c}),{content:e,placeholders:s}})(t);let n,a="",h=0;const p=/( |>|\+|~(?!=))\s*/g;let d=!((t=c.content).indexOf("-shadowcsshost-no-combinator")>-1);for(;null!==(n=p.exec(t));){const s=n[1],e=t.slice(h,n.index).trim();d=d||e.indexOf("-shadowcsshost-no-combinator")>-1,a+=`${d?r(e):e} ${s} `,h=p.lastIndex}const u=t.substring(h);return d=d||u.indexOf("-shadowcsshost-no-combinator")>-1,a+=d?r(u):u,g=c.placeholders,a.replace(/__ph-(\d+)__/g,(t,s)=>g[+s]);var g})(t,s,e).trim():t.trim()).join(", "))(t.selector,s,e,o):(t.selector.startsWith("@media")||t.selector.startsWith("@supports")||t.selector.startsWith("@page")||t.selector.startsWith("@document"))&&(c=O(t.content,s,e,o)),{selector:r.replace(/\s{2,}/g," ").trim(),content:c}}),S=(t,s,e)=>{const o=s+"-h",l=s+"-s",i=t.match(g)||[];t=(t=>t.replace(u,""))(t);const m=[];if(e){const s=t=>{const s=`/*!@___${m.length}___*/`,e=`/*!@${t.selector}*/`;return m.push({placeholder:s,comment:e}),t.selector=s+t.selector,t};t=f(t,t=>"@"!==t.selector[0]?s(t):t.selector.startsWith("@media")||t.selector.startsWith("@supports")||t.selector.startsWith("@page")||t.selector.startsWith("@document")?(t.content=f(t.content,s),t):t)}const w=((t,s,e,o,l)=>{const i=((t,s)=>{const e="."+s+" > ",o=[];return t=t.replace(n,(...t)=>{if(t[2]){const s=t[2].trim(),r=t[3],c=e+s+r;let n="";for(let s=t[4]-1;s>=0;s--){const e=t[5][s];if("}"===e||","===e)break;n=e+n}const l=n+c,a=`${n.trimRight()}${c.trim()}`;if(l.trim()!==a.trim()){const t=`${a}, ${l}`;o.push({orgSelector:l,updatedSelector:t})}return c}return"-shadowcsshost-no-combinator"+t[3]}),{selectors:o,cssText:t}})(t=(t=>x(t,c,b))(t=(t=>x(t,r,$))(t=t.replace(d,"-shadowcsscontext").replace(h,"-shadowcsshost").replace(p,"-shadowcssslotted"))),o);return t=(t=>a.reduce((t,s)=>t.replace(s," "),t))(t=i.cssText),s&&(t=O(t,s,e,o)),{cssText:(t=(t=t.replace(/-shadowcsshost-no-combinator/g,"."+e)).replace(/>\s*\*\s+([^{, ]+)/gm," $1 ")).trim(),slottedSelectors:i.selectors}})(t,s,o,l);return t=[w.cssText,...i].join("\n"),e&&m.forEach(({placeholder:s,comment:e})=>{t=t.replace(s,e)}),w.slottedSelectors.forEach(s=>{t=t.replace(s.orgSelector,s.updatedSelector)}),t}}}]); (window.webpackJsonp_wordpress_seo=window.webpackJsonp_wordpress_seo||[]).push([[42],{319:function(t,s,e){"use strict";e.r(s),e.d(s,"scopeCss",(function(){return S}));const o=")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)",r=new RegExp("(-shadowcsshost"+o,"gim"),c=new RegExp("(-shadowcsscontext"+o,"gim"),n=new RegExp("(-shadowcssslotted"+o,"gim"),l=/-shadowcsshost-no-combinator([^\s]*)/,a=[/::shadow/g,/::content/g],i=/-shadowcsshost/gim,h=/:host/gim,p=/::slotted/gim,d=/:host-context/gim,u=/\/\*\s*[\s\S]*?\*\//g,g=/\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g,m=/(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g,w=/([{}])/g,f=(t,s)=>{const e=_(t);let o=0;return e.escapedString.replace(m,(...t)=>{const r=t[2];let c="",n=t[4],l="";n&&n.startsWith("{%BLOCK%")&&(c=e.blocks[o++],n=n.substring("%BLOCK%".length+1),l="{");const a=s({selector:r,content:c});return`${t[1]}${a.selector}${t[3]}${l}${a.content}${n}`})},_=t=>{const s=t.split(w),e=[],o=[];let r=0,c=[];for(let t=0;t<s.length;t++){const n=s[t];"}"===n&&r--,r>0?c.push(n):(c.length>0&&(o.push(c.join("")),e.push("%BLOCK%"),c=[]),e.push(n)),"{"===n&&r++}return c.length>0&&(o.push(c.join("")),e.push("%BLOCK%")),{escapedString:e.join(""),blocks:o}},x=(t,s,e)=>t.replace(s,(...t)=>{if(t[2]){const s=t[2].split(","),o=[];for(let r=0;r<s.length;r++){const c=s[r].trim();if(!c)break;o.push(e("-shadowcsshost-no-combinator",c,t[3]))}return o.join(",")}return"-shadowcsshost-no-combinator"+t[3]}),$=(t,s,e)=>t+s.replace("-shadowcsshost","")+e,b=(t,s,e)=>s.indexOf("-shadowcsshost")>-1?$(t,s,e):t+s+e+", "+s+" "+t+e,O=(t,s,e,o,r)=>f(t,t=>{let r=t.selector,c=t.content;return"@"!==t.selector[0]?r=((t,s,e,o)=>t.split(",").map(t=>o&&t.indexOf("."+o)>-1?t.trim():((t,s)=>!(t=>(t=t.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),new RegExp("^("+t+")([>\\s~+[.,{:][\\s\\S]*)?$","m")))(s).test(t))(t,s)?((t,s,e)=>{const o="."+(s=s.replace(/\[is=([^\]]*)\]/g,(t,...s)=>s[0])),r=t=>{let r=t.trim();if(!r)return"";if(t.indexOf("-shadowcsshost-no-combinator")>-1)r=((t,s,e)=>{if(i.lastIndex=0,i.test(t)){const s="."+e;return t.replace(l,(t,e)=>e.replace(/([^:]*)(:*)(.*)/,(t,e,o,r)=>e+s+o+r)).replace(i,s+" ")}return s+" "+t})(t,s,e);else{const s=t.replace(i,"");if(s.length>0){const t=s.match(/([^:]*)(:*)(.*)/);t&&(r=t[1]+o+t[2]+t[3])}}return r},c=(t=>{const s=[];let e,o=0;return e=(t=t.replace(/(\[[^\]]*\])/g,(t,e)=>{const r=`__ph-${o}__`;return s.push(e),o++,r})).replace(/(:nth-[-\w]+)(\([^)]+\))/g,(t,e,r)=>{const c=`__ph-${o}__`;return s.push(r),o++,e+c}),{content:e,placeholders:s}})(t);let n,a="",h=0;const p=/( |>|\+|~(?!=))\s*/g;let d=!((t=c.content).indexOf("-shadowcsshost-no-combinator")>-1);for(;null!==(n=p.exec(t));){const s=n[1],e=t.slice(h,n.index).trim();d=d||e.indexOf("-shadowcsshost-no-combinator")>-1,a+=`${d?r(e):e} ${s} `,h=p.lastIndex}const u=t.substring(h);return d=d||u.indexOf("-shadowcsshost-no-combinator")>-1,a+=d?r(u):u,g=c.placeholders,a.replace(/__ph-(\d+)__/g,(t,s)=>g[+s]);var g})(t,s,e).trim():t.trim()).join(", "))(t.selector,s,e,o):(t.selector.startsWith("@media")||t.selector.startsWith("@supports")||t.selector.startsWith("@page")||t.selector.startsWith("@document"))&&(c=O(t.content,s,e,o)),{selector:r.replace(/\s{2,}/g," ").trim(),content:c}}),S=(t,s,e)=>{const o=s+"-h",l=s+"-s",i=t.match(g)||[];t=(t=>t.replace(u,""))(t);const m=[];if(e){const s=t=>{const s=`/*!@___${m.length}___*/`,e=`/*!@${t.selector}*/`;return m.push({placeholder:s,comment:e}),t.selector=s+t.selector,t};t=f(t,t=>"@"!==t.selector[0]?s(t):t.selector.startsWith("@media")||t.selector.startsWith("@supports")||t.selector.startsWith("@page")||t.selector.startsWith("@document")?(t.content=f(t.content,s),t):t)}const w=((t,s,e,o,l)=>{const i=((t,s)=>{const e="."+s+" > ",o=[];return t=t.replace(n,(...t)=>{if(t[2]){const s=t[2].trim(),r=t[3],c=e+s+r;let n="";for(let s=t[4]-1;s>=0;s--){const e=t[5][s];if("}"===e||","===e)break;n=e+n}const l=n+c,a=`${n.trimRight()}${c.trim()}`;if(l.trim()!==a.trim()){const t=`${a}, ${l}`;o.push({orgSelector:l,updatedSelector:t})}return c}return"-shadowcsshost-no-combinator"+t[3]}),{selectors:o,cssText:t}})(t=(t=>x(t,c,b))(t=(t=>x(t,r,$))(t=t.replace(d,"-shadowcsscontext").replace(h,"-shadowcsshost").replace(p,"-shadowcssslotted"))),o);return t=(t=>a.reduce((t,s)=>t.replace(s," "),t))(t=i.cssText),s&&(t=O(t,s,e,o)),{cssText:(t=(t=t.replace(/-shadowcsshost-no-combinator/g,"."+e)).replace(/>\s*\*\s+([^{, ]+)/gm," $1 ")).trim(),slottedSelectors:i.selectors}})(t,s,o,l);return t=[w.cssText,...i].join("\n"),e&&m.forEach(({placeholder:s,comment:e})=>{t=t.replace(s,e)}),w.slottedSelectors.forEach(s=>{t=t.replace(s.orgSelector,s.updatedSelector)}),t}}}]);

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=313)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},2:function(e,t){e.exports=window.yoast.propTypes},20:function(e,t){e.exports=window.wp.components},3:function(e,t){e.exports=window.React},313:function(e,t,n){"use strict";n.r(t);var o=n(0),a=n(2),r=n.n(a),s=n(9),l=n(1),c=n(8),i=n.n(c),d=n(35),u=n(96);const p=i.a.div` !function(e){var t={};function n(o){if(t[o])return t[o].exports;var a=t[o]={i:o,l:!1,exports:{}};return e[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(o,a,function(t){return e[t]}.bind(null,a));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=317)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},101:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o,a,r=n(3);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function l(e){return r.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 425 456.27","aria-hidden":"true"},e),o||(o=r.createElement("path",{d:"M73 405.26a66.79 66.79 0 01-6.54-1.7 64.75 64.75 0 01-6.28-2.31c-1-.42-2-.89-3-1.37-1.49-.72-3-1.56-4.77-2.56-1.5-.88-2.71-1.64-3.83-2.39-.9-.61-1.8-1.26-2.68-1.92a70.154 70.154 0 01-5.08-4.19 69.21 69.21 0 01-8.4-9.17c-.92-1.2-1.68-2.25-2.35-3.24a70.747 70.747 0 01-3.44-5.64 68.29 68.29 0 01-8.29-32.55V142.13a68.26 68.26 0 018.29-32.55c1-1.92 2.21-3.82 3.44-5.64s2.55-3.58 4-5.27a69.26 69.26 0 0114.49-13.25C50.37 84.19 52.27 83 54.2 82A67.59 67.59 0 0173 75.09a68.75 68.75 0 0113.75-1.39h169.66L263 55.39H86.75A86.84 86.84 0 000 142.13v196.09A86.84 86.84 0 0086.75 425h11.32v-18.35H86.75A68.75 68.75 0 0173 405.26zM368.55 60.85l-1.41-.53-6.41 17.18 1.41.53a68.06 68.06 0 018.66 4c1.93 1 3.82 2.2 5.65 3.43A69.19 69.19 0 01391 98.67c1.4 1.68 2.72 3.46 3.95 5.27s2.39 3.72 3.44 5.64a68.29 68.29 0 018.29 32.55v264.52H233.55l-.44.76c-3.07 5.37-6.26 10.48-9.49 15.19L222 425h203V142.13a87.2 87.2 0 00-56.45-81.28z"})),a||(a=r.createElement("path",{d:"M119.8 408.28v46c28.49-1.12 50.73-10.6 69.61-29.58 19.45-19.55 36.17-50 52.61-96L363.94 1.9H305l-98.25 272.89-48.86-153h-54l71.7 184.18a75.67 75.67 0 010 55.12c-7.3 18.68-20.25 40.66-55.79 47.19z",stroke:"#000",strokeMiterlimit:10,strokeWidth:3.81})))}},2:function(e,t){e.exports=window.yoast.propTypes},20:function(e,t){e.exports=window.wp.components},3:function(e,t){e.exports=window.React},31:function(e,t,n){"use strict";n.d(t,"b",(function(){return i}));var o=n(10),a=n.n(o),r=n(0),s=n(2),l=n.n(s),c=n(20);const i="yoast yoast-gutenberg-modal",d=e=>{const{title:t,className:n,showYoastIcon:o,additionalClassName:s,...l}=e,i=o?Object(r.createElement)("span",{className:"yoast-icon"}):null;return Object(r.createElement)(c.Modal,a()({title:t,className:`${n} ${s}`,icon:i},l),e.children)};d.propTypes={title:l.a.string,className:l.a.string,showYoastIcon:l.a.bool,children:l.a.oneOfType([l.a.node,l.a.arrayOf(l.a.node)]),additionalClassName:l.a.string},d.defaultProps={title:"Yoast SEO",className:i,showYoastIcon:!0,children:null,additionalClassName:""},t.a=d},317:function(e,t,n){"use strict";n.r(t);var o=n(0),a=n(2),r=n.n(a),s=n(9),l=n(1),c=n(8),i=n.n(c),d=n(31),u=n(101);const p=i.a.div`
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: 8px; gap: 8px;
`,f=e=>{const[t,n]=Object(o.useState)(!0);function a(){n(!1)}const r=Object(l.sprintf)(/* translators: %s expands to Yoast */ `,f=e=>{const[t,n]=Object(o.useState)(!0);function a(){n(!1)}const r=Object(l.sprintf)(/* translators: %s expands to Yoast */
Object(l.__)("%s SEO installation","wordpress-seo"),"Yoast");let c,i=Object(l.__)("the following addons","wordpress-seo");return 1===e.addons.length&&(i=e.addons[0]),1!==e.addons.length&&(c=Object(o.createElement)("ul",{className:"ul-disc"},e.addons.map((e,t)=>Object(o.createElement)("li",{key:"addon-"+t},e)))),t?Object(o.createElement)(d.a,{title:r,onRequestClose:a,icon:Object(o.createElement)(u.a,null),isDismissible:!1},Object(o.createElement)("p",null,Object(l.sprintf)(/* translators: %s expands to Yoast SEO Premium */ Object(l.__)("%s SEO installation","wordpress-seo"),"Yoast");let c,i=Object(l.__)("the following addons","wordpress-seo");return 1===e.addons.length&&(i=e.addons[0]),1!==e.addons.length&&(c=Object(o.createElement)("ul",{className:"ul-disc"},e.addons.map((e,t)=>Object(o.createElement)("li",{key:"addon-"+t},e)))),t?Object(o.createElement)(d.a,{title:r,onRequestClose:a,icon:Object(o.createElement)(u.a,null),isDismissible:!1},Object(o.createElement)("p",null,Object(l.sprintf)(/* translators: %s expands to Yoast SEO Premium */
Object(l.__)("Please confirm below that you would like to install %s on this site.","wordpress-seo"),i)),c,Object(o.createElement)(p,null,Object(o.createElement)(s.Button,{onClick:a,id:"close-addon-installation-dialog"},Object(l.__)("Cancel","wordpress-seo")),Object(o.createElement)(s.Button,{onClick:function(){window.location.href="admin.php?page=wpseo_licenses&action=install&nonce="+e.nonce},id:"continue-addon-installation-dialog",className:"yoast-button--primary"},Object(l.__)("Install and activate","wordpress-seo")))):null};f.propTypes={nonce:r.a.string.isRequired,addons:r.a.array},f.defaultProps={addons:[]};var m=f;const b=document.createElement("div");b.setAttribute("id","wpseo-app-element"),document.getElementById("extensions").append(b),Object(o.render)(Object(o.createElement)(m,{nonce:wpseoAddonInstallationL10n.nonce,addons:wpseoAddonInstallationL10n.addons}),b)},35:function(e,t,n){"use strict";n.d(t,"b",(function(){return i}));var o=n(10),a=n.n(o),r=n(0),s=n(2),l=n.n(s),c=n(20);const i="yoast yoast-gutenberg-modal",d=e=>{const{title:t,className:n,showYoastIcon:o,additionalClassName:s,...l}=e,i=o?Object(r.createElement)("span",{className:"yoast-icon"}):null;return Object(r.createElement)(c.Modal,a()({title:t,className:`${n} ${s}`,icon:i},l),e.children)};d.propTypes={title:l.a.string,className:l.a.string,showYoastIcon:l.a.bool,children:l.a.oneOfType([l.a.node,l.a.arrayOf(l.a.node)]),additionalClassName:l.a.string},d.defaultProps={title:"Yoast SEO",className:i,showYoastIcon:!0,children:null,additionalClassName:""},t.a=d},8:function(e,t){e.exports=window.yoast.styledComponents},9:function(e,t){e.exports=window.yoast.componentsNew},96:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o,a,r=n(3);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function l(e){return r.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 425 456.27","aria-hidden":"true"},e),o||(o=r.createElement("path",{d:"M73 405.26a66.79 66.79 0 01-6.54-1.7 64.75 64.75 0 01-6.28-2.31c-1-.42-2-.89-3-1.37-1.49-.72-3-1.56-4.77-2.56-1.5-.88-2.71-1.64-3.83-2.39-.9-.61-1.8-1.26-2.68-1.92a70.154 70.154 0 01-5.08-4.19 69.21 69.21 0 01-8.4-9.17c-.92-1.2-1.68-2.25-2.35-3.24a70.747 70.747 0 01-3.44-5.64 68.29 68.29 0 01-8.29-32.55V142.13a68.26 68.26 0 018.29-32.55c1-1.92 2.21-3.82 3.44-5.64s2.55-3.58 4-5.27a69.26 69.26 0 0114.49-13.25C50.37 84.19 52.27 83 54.2 82A67.59 67.59 0 0173 75.09a68.75 68.75 0 0113.75-1.39h169.66L263 55.39H86.75A86.84 86.84 0 000 142.13v196.09A86.84 86.84 0 0086.75 425h11.32v-18.35H86.75A68.75 68.75 0 0173 405.26zM368.55 60.85l-1.41-.53-6.41 17.18 1.41.53a68.06 68.06 0 018.66 4c1.93 1 3.82 2.2 5.65 3.43A69.19 69.19 0 01391 98.67c1.4 1.68 2.72 3.46 3.95 5.27s2.39 3.72 3.44 5.64a68.29 68.29 0 018.29 32.55v264.52H233.55l-.44.76c-3.07 5.37-6.26 10.48-9.49 15.19L222 425h203V142.13a87.2 87.2 0 00-56.45-81.28z"})),a||(a=r.createElement("path",{d:"M119.8 408.28v46c28.49-1.12 50.73-10.6 69.61-29.58 19.45-19.55 36.17-50 52.61-96L363.94 1.9H305l-98.25 272.89-48.86-153h-54l71.7 184.18a75.67 75.67 0 010 55.12c-7.3 18.68-20.25 40.66-55.79 47.19z",stroke:"#000",strokeMiterlimit:10,strokeWidth:3.81})))}}}); Object(l.__)("Please confirm below that you would like to install %s on this site.","wordpress-seo"),i)),c,Object(o.createElement)(p,null,Object(o.createElement)(s.Button,{onClick:a,id:"close-addon-installation-dialog"},Object(l.__)("Cancel","wordpress-seo")),Object(o.createElement)(s.Button,{onClick:function(){window.location.href="admin.php?page=wpseo_licenses&action=install&nonce="+e.nonce},id:"continue-addon-installation-dialog",className:"yoast-button--primary"},Object(l.__)("Install and activate","wordpress-seo")))):null};f.propTypes={nonce:r.a.string.isRequired,addons:r.a.array},f.defaultProps={addons:[]};var m=f;const b=document.createElement("div");b.setAttribute("id","wpseo-app-element"),document.getElementById("extensions").append(b),Object(o.render)(Object(o.createElement)(m,{nonce:wpseoAddonInstallationL10n.nonce,addons:wpseoAddonInstallationL10n.addons}),b)},8:function(e,t){e.exports=window.yoast.styledComponents},9:function(e,t){e.exports=window.yoast.componentsNew}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=260)}({260:function(e,t){self.window=self;const n=["wp-inert-polyfill","wp-polyfill-inert"];self.onmessage=e=>{let{data:t}=e;if(!t||!t.dependencies)return;!function(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n.includes(t)||(self.importScripts(e[t]),"lodash"===t&&(self.lodash=_.noConflict())))}(t.dependencies),t.translations&&function(e){for(const[n,r]of e){var t=r.locale_data[n]||r.locale_data.messages;t[""].domain=n,self.wp.i18n.setLocaleData(t,n)}}(t.translations);const r=self.yoast.Researcher.default;new self.yoast.analysis.AnalysisWebWorker(self,new r).register()}}}); !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=264)}({264:function(e,t){self.window=self;const n=["wp-inert-polyfill","wp-polyfill-inert"];self.onmessage=e=>{let{data:t}=e;if(!t||!t.dependencies)return;!function(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n.includes(t)||(self.importScripts(e[t]),"lodash"===t&&(self.lodash=_.noConflict())))}(t.dependencies),t.translations&&function(e){for(const[n,r]of e){var t=r.locale_data[n]||r.locale_data.messages;t[""].domain=n,self.wp.i18n.setLocaleData(t,n)}}(t.translations);const r=self.yoast.Researcher.default;new self.yoast.analysis.AnalysisWebWorker(self,new r).register()}}});

View File

@@ -1 +1 @@
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=261)}({261:function(e,t){!function(e,t){window.wpseoApi={get:function(e,t,n,o){this.request("GET",e,t,n,o)},post:function(e,t,n,o){this.request("POST",e,t,n,o)},put:function(e,t,n,o){this.request("PUT",e,t,n,o)},patch:function(e,t,n,o){this.request("PATCH",e,t,n,o)},delete:function(e,t,n,o){this.request("DELETE",e,t,n,o)},request:function(n,o,r,u,i){"function"==typeof r&&void 0===i&&(i=u,u=r,r={}),"POST"!==n&&"GET"!==n&&(r._method=n,n="POST"),e.ajax({url:t.root+"yoast/v1/"+o,method:n,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",t.nonce)},data:r}).done(u).fail(i)}}}(jQuery,wpApiSettings)}}); !function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=265)}({265:function(e,t){!function(e,t){window.wpseoApi={get:function(e,t,n,o){this.request("GET",e,t,n,o)},post:function(e,t,n,o){this.request("POST",e,t,n,o)},put:function(e,t,n,o){this.request("PUT",e,t,n,o)},patch:function(e,t,n,o){this.request("PATCH",e,t,n,o)},delete:function(e,t,n,o){this.request("DELETE",e,t,n,o)},request:function(n,o,r,u,i){"function"==typeof r&&void 0===i&&(i=u,u=r,r={}),"POST"!==n&&"GET"!==n&&(r._method=n,n="POST"),e.ajax({url:t.root+"yoast/v1/"+o,method:n,beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",t.nonce)},data:r}).done(u).fail(i)}}}(jQuery,wpApiSettings)}});

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
!function(e){var n={};function t(s){if(n[s])return n[s].exports;var i=n[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,s){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:s})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(s,i,function(n){return e[n]}.bind(null,i));return s},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=262)}({21:function(e,n){e.exports=window.jQuery},262:function(e,n,t){"use strict";t.r(n);var s,i=t(21),o=t.n(i);s=function(e){var n=e.find("[class^=wpseo-new]").first().attr("class"),t="#"+n+"-",s=t.replace("new","existing"),i=e.find("th[id^=col_existing_yoast]").first().text().replace("Existing ",""),a=n.replace("-new-","_save_"),r="wpseo_save_all_"+e.attr("class").split("wpseo_bulk_")[1],l=a.replace("wpseo_save_",""),u={newClass:"."+n,newId:t,existingId:s},c={submit_new:function(e){c.submitNew(e)},submitNew:function(e){var n,t=u.newId+e,s=u.existingId+e;n="select-one"===o()(u.newId+e).prop("type")?o()(t).find(":selected").text():o()(t).val();var r=o()(s).html();if(n===r)o()(t).val("");else{if(""===n&&!window.confirm("Are you sure you want to remove the existing "+i+"?"))return void o()(t).val("");var l={action:a,_ajax_nonce:wpseoBulkEditorNonce,wpseo_post_id:e,new_value:n,existing_value:r};o.a.post(ajaxurl,l,c.handleResponse)}},submit_all:function(e){c.submitAll(e)},submitAll:function(e){e.preventDefault();var n={action:r,_ajax_nonce:wpseoBulkEditorNonce,send:!1,items:{},existingItems:{}};o()(u.newClass).each((function(){var e=o()(this).data("id"),t=o()(this).val(),s=o()(u.existingId+e).html();""!==t&&(t===s?o()(u.newId+e).val(""):(n.send=!0,n.items[e]=t,n.existingItems[e]=s))})),n.send&&o.a.post(ajaxurl,n,c.handleResponses)},handle_response:function(e,n){c.handleResponse(e,n)},handleResponse:function(e,n){if("success"===n){var t=e;if("string"==typeof t&&(t=JSON.parse(t)),t instanceof Array)o.a.each(t,(function(){c.handleResponse(this,n)}));else if("success"===t.status){var s=t["new_"+l];o()(u.existingId+t.post_id).text(s.replace(/\\(?!\\)/g,"")),o()(u.newId+t.post_id).val("")}}},handle_responses:function(e,n){c.handleResponses(e,n)},handleResponses:function(e,n){var t=o.a.parseJSON(e);o.a.each(t,(function(){c.handleResponse(this,n)}))},set_events:function(){c.setEvents()},setEvents:function(){e.find(".wpseo-save").click((function(e){var n=o()(this).data("id");e.preventDefault(),c.submitNew(n,this)})),e.find(".wpseo-save-all").click(c.submitAll),e.find(u.newClass).keydown((function(e){if(13===e.which){e.preventDefault();var n=o()(this).data("id");c.submitNew(n,this)}}))}};return c},window.bulk_editor=s,window.bulkEditor=s,o()(document).ready((function(){o()('table[class*="wpseo_bulk"]').each((function(e,n){var t=o()(n);s(t).setEvents()}))}))}}); !function(e){var n={};function t(s){if(n[s])return n[s].exports;var i=n[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,t),i.l=!0,i.exports}t.m=e,t.c=n,t.d=function(e,n,s){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:s})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(t.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var i in e)t.d(s,i,function(n){return e[n]}.bind(null,i));return s},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=266)}({22:function(e,n){e.exports=window.jQuery},266:function(e,n,t){"use strict";t.r(n);var s,i=t(22),o=t.n(i);s=function(e){var n=e.find("[class^=wpseo-new]").first().attr("class"),t="#"+n+"-",s=t.replace("new","existing"),i=e.find("th[id^=col_existing_yoast]").first().text().replace("Existing ",""),a=n.replace("-new-","_save_"),r="wpseo_save_all_"+e.attr("class").split("wpseo_bulk_")[1],l=a.replace("wpseo_save_",""),u={newClass:"."+n,newId:t,existingId:s},c={submit_new:function(e){c.submitNew(e)},submitNew:function(e){var n,t=u.newId+e,s=u.existingId+e;n="select-one"===o()(u.newId+e).prop("type")?o()(t).find(":selected").text():o()(t).val();var r=o()(s).html();if(n===r)o()(t).val("");else{if(""===n&&!window.confirm("Are you sure you want to remove the existing "+i+"?"))return void o()(t).val("");var l={action:a,_ajax_nonce:wpseoBulkEditorNonce,wpseo_post_id:e,new_value:n,existing_value:r};o.a.post(ajaxurl,l,c.handleResponse)}},submit_all:function(e){c.submitAll(e)},submitAll:function(e){e.preventDefault();var n={action:r,_ajax_nonce:wpseoBulkEditorNonce,send:!1,items:{},existingItems:{}};o()(u.newClass).each((function(){var e=o()(this).data("id"),t=o()(this).val(),s=o()(u.existingId+e).html();""!==t&&(t===s?o()(u.newId+e).val(""):(n.send=!0,n.items[e]=t,n.existingItems[e]=s))})),n.send&&o.a.post(ajaxurl,n,c.handleResponses)},handle_response:function(e,n){c.handleResponse(e,n)},handleResponse:function(e,n){if("success"===n){var t=e;if("string"==typeof t&&(t=JSON.parse(t)),t instanceof Array)o.a.each(t,(function(){c.handleResponse(this,n)}));else if("success"===t.status){var s=t["new_"+l];o()(u.existingId+t.post_id).text(s.replace(/\\(?!\\)/g,"")),o()(u.newId+t.post_id).val("")}}},handle_responses:function(e,n){c.handleResponses(e,n)},handleResponses:function(e,n){var t=o.a.parseJSON(e);o.a.each(t,(function(){c.handleResponse(this,n)}))},set_events:function(){c.setEvents()},setEvents:function(){e.find(".wpseo-save").click((function(e){var n=o()(this).data("id");e.preventDefault(),c.submitNew(n,this)})),e.find(".wpseo-save-all").click(c.submitAll),e.find(u.newClass).keydown((function(e){if(13===e.which){e.preventDefault();var n=o()(this).data("id");c.submitNew(n,this)}}))}};return c},window.bulk_editor=s,window.bulkEditor=s,o()(document).ready((function(){o()('table[class*="wpseo_bulk"]').each((function(e,n){var t=o()(n);s(t).setEvents()}))}))}});

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
!function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=263)}({263:function(e,r){jQuery(document).ready((function(){jQuery("#allow_search_cleanup input[type='radio']").on("change",(function(){"on"===jQuery("#allow_search_cleanup input[type='radio']:checked").val()?(jQuery("#allow_search_cleanup_emoji").prop("disabled",!1),jQuery("#allow_search_cleanup_patterns").prop("disabled",!1)):(jQuery("#allow_search_cleanup_emoji").prop("disabled",!0),jQuery("#allow_search_cleanup_patterns").prop("disabled",!0),jQuery("#allow_search_cleanup_emoji-off").prop("checked",!0),jQuery("#allow_search_cleanup_patterns-off").prop("checked",!0))})).trigger("change")}))}}); !function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=267)}({267:function(e,r){jQuery(document).ready((function(){jQuery("#allow_search_cleanup input[type='radio']").on("change",(function(){"on"===jQuery("#allow_search_cleanup input[type='radio']:checked").val()?(jQuery("#allow_search_cleanup_emoji").prop("disabled",!1),jQuery("#allow_search_cleanup_patterns").prop("disabled",!1)):(jQuery("#allow_search_cleanup_emoji").prop("disabled",!0),jQuery("#allow_search_cleanup_patterns").prop("disabled",!0),jQuery("#allow_search_cleanup_emoji-off").prop("checked",!0),jQuery("#allow_search_cleanup_patterns-off").prop("checked",!0))})).trigger("change")}))}});

View File

@@ -1 +1 @@
!function(e){var t={};function s(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,s),r.l=!0,r.exports}s.m=e,s.c=t,s.d=function(e,t,o){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(s.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(o,r,function(t){return e[t]}.bind(null,r));return o},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=264)}({0:function(e,t){e.exports=window.wp.element},11:function(e,t){e.exports=window.yoast.helpers},16:function(e,t){e.exports=window.yoast.styleGuide},175:function(e,t){e.exports=window.yoast.analysisReport},264:function(e,t,s){"use strict";s.r(t);var o=s(0),r=s(9),n=s(16),i=s(175),a=s(11);class c extends o.Component{constructor(){super(),this.state={statistics:null,feed:null,isDataFetched:!1}}componentDidMount(){const e=jQuery("#wpseo-dashboard-overview-hide");e.is(":checked")&&this.fetchData(),e.on("click",()=>{this.fetchData()})}fetchData(){this.state.isDataFetched||(this.getStatistics(),this.getFeed(),this.setState({isDataFetched:!0}))}static getColorFromScore(e){return n.colors["$color_"+e]||n.colors.$color_grey}getStatistics(){wpseoApi.get("statistics",e=>{const t={};e&&e.seo_scores&&(t.seoScores=e.seo_scores.map(e=>({value:parseInt(e.count,10),color:c.getColorFromScore(e.seo_rank),html:`<a href="${e.link}">${e.label}</a>`})),t.header=jQuery(`<div>${e.header}</div>`).text(),this.setState({statistics:t}))})}getFeed(){Object(a.getPostFeed)("https://yoast.com/feed/widget/?wp_version="+wpseoDashboardWidgetL10n.wp_version+"&php_version="+wpseoDashboardWidgetL10n.php_version,2).then(e=>{e.items=e.items.map(e=>(e.description=jQuery(`<div>${e.description}</div>`).text(),e.description=e.description.replace(`The post ${e.title} appeared first on Yoast.`,"").trim(),e)),this.setState({feed:e})}).catch(e=>console.log(e))}getSeoAssessment(){return null===this.state.statistics?null:Object(o.createElement)(i.SiteSEOReport,{key:"yoast-seo-posts-assessment",seoAssessmentText:this.state.statistics.header,seoAssessmentItems:this.state.statistics.seoScores})}getYoastFeed(){return null===this.state.feed?null:Object(o.createElement)(r.ArticleList,{className:"wordpress-feed",key:"yoast-seo-blog-feed",title:wpseoDashboardWidgetL10n.feed_header,feed:this.state.feed,footerLinkText:wpseoDashboardWidgetL10n.feed_footer})}render(){const e=[this.getSeoAssessment(),this.getYoastFeed()].filter(e=>null!==e);return 0===e.length?null:Object(o.createElement)("div",null,e)}}const d=document.getElementById("yoast-seo-dashboard-widget");d&&Object(o.render)(Object(o.createElement)(c,null),d)},9:function(e,t){e.exports=window.yoast.componentsNew}}); !function(e){var t={};function s(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,s),r.l=!0,r.exports}s.m=e,s.c=t,s.d=function(e,t,o){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(s.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)s.d(o,r,function(t){return e[t]}.bind(null,r));return o},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=268)}({0:function(e,t){e.exports=window.wp.element},11:function(e,t){e.exports=window.yoast.helpers},17:function(e,t){e.exports=window.yoast.styleGuide},179:function(e,t){e.exports=window.yoast.analysisReport},268:function(e,t,s){"use strict";s.r(t);var o=s(0),r=s(9),n=s(17),i=s(179),a=s(11);class c extends o.Component{constructor(){super(),this.state={statistics:null,feed:null,isDataFetched:!1}}componentDidMount(){const e=jQuery("#wpseo-dashboard-overview-hide");e.is(":checked")&&this.fetchData(),e.on("click",()=>{this.fetchData()})}fetchData(){this.state.isDataFetched||(this.getStatistics(),this.getFeed(),this.setState({isDataFetched:!0}))}static getColorFromScore(e){return n.colors["$color_"+e]||n.colors.$color_grey}getStatistics(){wpseoApi.get("statistics",e=>{const t={};e&&e.seo_scores&&(t.seoScores=e.seo_scores.map(e=>({value:parseInt(e.count,10),color:c.getColorFromScore(e.seo_rank),html:`<a href="${e.link}">${e.label}</a>`})),t.header=jQuery(`<div>${e.header}</div>`).text(),this.setState({statistics:t}))})}getFeed(){Object(a.getPostFeed)("https://yoast.com/feed/widget/?wp_version="+wpseoDashboardWidgetL10n.wp_version+"&php_version="+wpseoDashboardWidgetL10n.php_version,2).then(e=>{e.items=e.items.map(e=>(e.description=jQuery(`<div>${e.description}</div>`).text(),e.description=e.description.replace(`The post ${e.title} appeared first on Yoast.`,"").trim(),e)),this.setState({feed:e})}).catch(e=>console.log(e))}getSeoAssessment(){return null===this.state.statistics?null:Object(o.createElement)(i.SiteSEOReport,{key:"yoast-seo-posts-assessment",seoAssessmentText:this.state.statistics.header,seoAssessmentItems:this.state.statistics.seoScores})}getYoastFeed(){return null===this.state.feed?null:Object(o.createElement)(r.ArticleList,{className:"wordpress-feed",key:"yoast-seo-blog-feed",title:wpseoDashboardWidgetL10n.feed_header,feed:this.state.feed,footerLinkText:wpseoDashboardWidgetL10n.feed_footer})}render(){const e=[this.getSeoAssessment(),this.getYoastFeed()].filter(e=>null!==e);return 0===e.length?null:Object(o.createElement)("div",null,e)}}const d=document.getElementById("yoast-seo-dashboard-widget");d&&Object(o.render)(Object(o.createElement)(c,null),d)},9:function(e,t){e.exports=window.yoast.componentsNew}});

View File

@@ -1 +1 @@
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=265)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},249:function(e,t){e.exports=window.wp.serverSideRender},265:function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(98),s=r(1),i=r(249),u=r.n(i);Object(o.registerBlockType)("yoast-seo/breadcrumbs",{title:Object(s.__)("Yoast Breadcrumbs","wordpress-seo"),icon:"admin-links",category:"yoast-internal-linking-blocks",description:Object(s.__)("Adds the Yoast SEO breadcrumbs to your template or content.","wordpress-seo"),keywords:[Object(s.__)("seo","wordpress-seo"),Object(s.__)("breadcrumbs","wordpress-seo"),Object(s.__)("internal linking","wordpress-seo"),Object(s.__)("site structure","wordpress-seo")],example:{attributes:{}},edit:function(e){return Object(n.createElement)(u.a,{block:"yoast-seo/breadcrumbs",attributes:e.attributes})},save:function(){return null}})},98:function(e,t){e.exports=window.wp.blocks}}); !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=269)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},102:function(e,t){e.exports=window.wp.blocks},253:function(e,t){e.exports=window.wp.serverSideRender},269:function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(102),s=r(1),i=r(253),u=r.n(i);Object(o.registerBlockType)("yoast-seo/breadcrumbs",{title:Object(s.__)("Yoast Breadcrumbs","wordpress-seo"),icon:"admin-links",category:"yoast-internal-linking-blocks",description:Object(s.__)("Adds the Yoast SEO breadcrumbs to your template or content.","wordpress-seo"),keywords:[Object(s.__)("seo","wordpress-seo"),Object(s.__)("breadcrumbs","wordpress-seo"),Object(s.__)("internal linking","wordpress-seo"),Object(s.__)("site structure","wordpress-seo")],example:{attributes:{}},edit:function(e){return Object(n.createElement)(u.a,{block:"yoast-seo/breadcrumbs",attributes:e.attributes})},save:function(){return null}})}});

View File

@@ -1 +1 @@
!function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=266)}({21:function(t,e){t.exports=window.jQuery},266:function(t,e,o){"use strict";o.r(e);var n,r=o(21);(n=o.n(r).a)(".yoast-column-header-has-tooltip").each((function(){n(this).closest("th").find("a").addClass("yoast-tooltip yoast-tooltip-alt yoast-tooltip-n yoast-tooltip-multiline").attr("data-label",n(this).data("tooltip-text")).attr("aria-label",n(this).text())}))}}); !function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=270)}({22:function(t,e){t.exports=window.jQuery},270:function(t,e,o){"use strict";o.r(e);var n,r=o(22);(n=o.n(r).a)(".yoast-column-header-has-tooltip").each((function(){n(this).closest("th").find("a").addClass("yoast-tooltip yoast-tooltip-alt yoast-tooltip-n yoast-tooltip-multiline").attr("data-label",n(this).data("tooltip-text")).attr("aria-label",n(this).text())}))}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
!function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=306)}({0:function(e,t){e.exports=window.wp.element},2:function(e,t){e.exports=window.yoast.propTypes},306:function(e,t,o){"use strict";o.r(t);var n=o(0);const r=Object(n.createContext)("location"),i=r.Provider,u=r.Consumer;var c=o(2),a=o.n(c);const l={},s=Object(n.createContext)(l),d=e=>{let{children:t,context:o={}}=e;return Object(n.createElement)(s.Provider,{value:{...l,...o}},t)};d.propTypes={children:a.a.node.isRequired,context:a.a.object};var f=d;window.yoast=window.yoast||{},window.yoast.externals=window.yoast.externals||{},window.yoast.externals.contexts={LocationContext:r,LocationProvider:i,LocationConsumer:u,RootContext:s,Root:f,useRootContext:()=>Object(n.useContext)(s)}}}); !function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=310)}({0:function(e,t){e.exports=window.wp.element},2:function(e,t){e.exports=window.yoast.propTypes},310:function(e,t,o){"use strict";o.r(t);var n=o(0);const r=Object(n.createContext)("location"),i=r.Provider,u=r.Consumer;var c=o(2),a=o.n(c);const l={},s=Object(n.createContext)(l),d=e=>{let{children:t,context:o={}}=e;return Object(n.createElement)(s.Provider,{value:{...l,...o}},t)};d.propTypes={children:a.a.node.isRequired,context:a.a.object};var f=d;window.yoast=window.yoast||{},window.yoast.externals=window.yoast.externals||{},window.yoast.externals.contexts={LocationContext:r,LocationProvider:i,LocationConsumer:u,RootContext:s,Root:f,useRootContext:()=>Object(n.useContext)(s)}}});

Some files were not shown because too many files have changed in this diff Show More