").addClass("val remove-slashes").html(_.escape(t)):e("
").addClass("val").attr({href:_.escape(l+c(t)),target:"_blank"}).html(_.escape(t)))).append(e(" ").addClass("column-new").append(this.prepareNewUrl(r,o)))},this.handleError=function(e,t){e.addValidationError(t.message,t.fields),"warning"===t.type&&u.dialog(wpseoPremiumStrings.error_saving_redirect,t.message,t.type)},this.addRedirect=function(){var t=new o.default(e(".wpseo-new-redirect-form")),r=new n.default(t,h);if(!1===r.validate())return!1;var i=r.getFormValues();return u.post({action:"wpseo_add_redirect_"+h,ajax_nonce:e(".wpseo_redirects_ajax_nonce").val(),redirect:{origin:encodeURIComponent(i.origin),target:encodeURIComponent(i.target),type:i.type},ignore_warning:g},function(i){if(i.error)return u.handleError(r,i.error),!0;t.getOriginField().val(""),t.getTargetField().val(""),u.find(".no-items").remove();var o=u.createRedirectRow(i.origin,i.target,i.type,i.info);e("form#"+h).find("#the-list").prepend(o),u.openDialog(wpseoPremiumStrings.redirect_added)}),!0},this.updateRedirect=function(){var t=new o.default(p.getForm()),r=new n.default(t,h);if(!1===r.validate())return!1;var i=r.getFormValues(),s=p.getRow(),a=this.rowCells(s);return u.post({action:"wpseo_update_redirect_"+h,ajax_nonce:e(".wpseo_redirects_ajax_nonce").val(),old_redirect:{origin:encodeURIComponent(a.origin.html()),target:encodeURIComponent(a.target.html()),type:encodeURIComponent(a.type.html())},new_redirect:{origin:encodeURIComponent(i.origin),target:encodeURIComponent(i.target),type:encodeURIComponent(i.type)},ignore_warning:g},function(t){if(t.error)return u.handleError(r,t.error),!0;if(a.origin.html(_.escape(t.origin)),"regex"!==h&&a.origin.attr("href",_.escape(l+t.origin)),a.target.html(_.escape(t.target)),410===t.type||451===t.type)a.target.replaceWith(e("").addClass("val remove-slashes"));else{var i="/"===t.target?"val remove-slashes":"val";a.target.replaceWith(e("
").addClass(i).attr({href:_.escape(l+c(t.target)),target:"_blank"}).html(_.escape(t.target)))}a.type.html(_.escape(t.type)),p.remove(),u.openDialog(wpseoPremiumStrings.redirect_updated)}),!0},this.deleteRedirect=function(t){var r=this,o=this.rowCells(t),n=o.origin.text(),s=o.target.text(),a=o.type.html();(0,i.wpseoDeleteRedirect)(n,s,a,h).then(function(r){t.fadeTo("fast",0).slideUp(function(){e(this).remove()}),u.openDialog(r)}).catch(function(e){r.dialog(e.title,e.message,"error")})},this.setup=function(){var t=void 0;e("body").append(''),e(window).on("beforeunload",function(){if(e("#the-list").find("#inline-edit").length>0)return wpseoPremiumStrings.unsaved_redirects}),e(".redirect-table-tab").on("change","select[name=wpseo_redirects_type]",function(t){var r=parseInt(e(t.target).val(),10),o=e(t.target).closest(".wpseo_redirect_form").find(".wpseo_redirect_target_holder");jQuery.inArray(r,i.ALLOW_EMPTY_TARGET)>-1?e(o).hide():e(o).show()}),e(".wpseo-new-redirect-form").on("click",".button-primary",function(){return f=function(){u.addRedirect()},u.addRedirect(),m=e(this),!1}).on("keypress","input",function(e){e.which===d&&(f=function(){u.addRedirect()},e.preventDefault(),u.addRedirect())}),e(".wp-list-table").on("click",".redirect-edit",function(r){t=e(r.target).closest("tr"),r.preventDefault(),u.editRow(t),m=e(this)}).on("click",".redirect-delete",function(r){t=e(r.target).closest("tr"),r.preventDefault(),u.deleteRedirect(t),m=e("#cb-select-all-1")}).on("keypress","input",function(e){e.which===d&&(f=function(){u.updateRedirect()},e.preventDefault(),u.updateRedirect())}).on("click",".save",function(){(f=function(){u.updateRedirect()})()}).on("click",".cancel",function(){f=null,p.remove(),t.find(".redirect-edit").trigger("focus")})},u.setup()},e(function(){e.each(e(".redirect-table-tab"),function(t,r){e(r).wpseoRedirects(e(r).attr("id"))})})}(jQuery)},156:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){this.form=e};i.prototype.getOriginField=function(){return this.form.find("input[name=wpseo_redirects_origin]")},i.prototype.getTargetField=function(){return this.form.find("input[name=wpseo_redirects_target]")},i.prototype.getTypeField=function(){return this.form.find("select[name=wpseo_redirects_type]")},i.prototype.clearErrorMessage=function(){this.form.find(".wpseo_redirect_form .form_error").remove()},i.prototype.setErrorMessage=function(e){this.form.find(".wpseo_redirect_form").prepend('")},i.prototype.removeRowHighlights=function(){this.form.find(".redirect_form_row").removeClass("field_error")},i.prototype.highLightRowErrors=function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:null;this.form.setErrorMessage(e),void 0!==t&&this.form.highLightRowErrors(t)},o.prototype.getFormValues=function(){var e={origin:this.form.getOriginField().val().toString(),target:this.form.getTargetField().val().toString(),type:this.form.getTypeField().val().toString()};return jQuery.inArray(parseInt(e.type,10),i.ALLOW_EMPTY_TARGET)>-1&&(e.target=""),e},t.default=o},158:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){this.row=null,this.quickEditRow=null,this.templateQuickEdit=wp.template("redirects-inline-edit")};i.prototype.setup=function(e,t){this.row=e,this.quickEditRow=jQuery(this.templateQuickEdit({origin:_.unescape(t.origin.html()),target:_.unescape(t.target.html()),type:parseInt(t.type.html(),10),suffix:jQuery("#the-list").find("tr").index(e)}))},i.prototype.getRow=function(){return this.row},i.prototype.getForm=function(){return this.quickEditRow},i.prototype.show=function(){this.row.addClass("hidden"),this.quickEditRow.insertAfter(this.row).show(400,function(){jQuery(this).find(":input").first().trigger("focus")})},i.prototype.remove=function(){this.row.removeClass("hidden"),this.quickEditRow.remove()},t.default=i},24:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ALLOW_EMPTY_TARGET=void 0,t.wpseoDeleteRedirect=o,t.wpseoUndoRedirectForObject=n,t.wpseoRemoveNotification=s,t.wpseoUndoRedirect=function(e,t,r,i,n){o(e,t,r).then(function(e){!0===e.success&&s(n)})},t.wpseoUndoRedirectByObjectId=function(e,t,r){n(e,t).then(function(e){!0===e.success&&s(r)})},t.wpseoCreateRedirect=function(e,t,r,i){var o="";if(410!==parseInt(t,10)&&""===(o=window.prompt(wpseoPremiumStrings.enter_new_url.replace("%s",e))))return void window.alert(wpseoPremiumStrings.error_new_url);jQuery.post(ajaxurl,{action:"wpseo_add_redirect_plain",ajax_nonce:r,redirect:{origin:e,target:o,type:t}},function(e){var r=jQuery(i).closest(".yoast-notification");if(jQuery(r).removeClass("updated").removeClass("error"),jQuery(r).find(".redirect_error").remove(),e.error)jQuery(r).addClass("error").prepend(''+e.error.message+"
");else{var o="";o=(o=410===parseInt(t,10)?_.escape(wpseoPremiumStrings.redirect_saved_no_target):wpseoPremiumStrings.redirect_saved.replace("%2$s",""+_.escape(e.target)+"")).replace("%1$s",""+_.escape(e.origin)+""),jQuery(r).addClass("updated").html(""+o+"
")}},"json")};var i=function(e){return e&&e.__esModule?e:{default:e}}(r(10));t.ALLOW_EMPTY_TARGET=[410,451];function o(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"plain";return(0,i.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/delete",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{origin:e,target:t,type:r,format:o}})}function n(e,t){return(0,i.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/undo-for-object",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{obj_id:e,obj_type:t}})}function s(e){jQuery(e).closest(".yoast-notification").fadeOut("slow")}}},[[155,0]]]);
\ No newline at end of file
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-custom-fields-plugin-2200.min.js b/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-custom-fields-plugin-2200.min.js
deleted file mode 100644
index c0c2cec6..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-custom-fields-plugin-2200.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(window.yoastPremiumWebpackJsonp=window.yoastPremiumWebpackJsonp||[]).push([[4],{159:function(t,s,e){"use strict";!function(){var t=function(){YoastSEO.app.registerPlugin("YoastCustomFieldsPlugin",{status:"loading"}),this.customFields={},this.updateCustomFields(),this.declareReady()};t.prototype.declareReady=function(){YoastSEO.app.pluginReady("YoastCustomFieldsPlugin"),YoastSEO.app.registerModification("content",this.addCustomFields.bind(this),"YoastCustomFieldsPlugin")},t.prototype.declareReloaded=function(){YoastSEO.app.pluginReloaded("YoastCustomFieldsPlugin")},t.prototype.addCustomFields=function(t){for(var s in this.customFields)t+=" ",t+=this.customFields[s];return t},t.prototype.updateCustomFields=function(){var t={};jQuery("#the-list > tr:visible").each(function(s,e){var o=jQuery("#"+e.id+"-key").val();-1!==YoastCustomFieldsPluginL10.custom_field_names.indexOf(o)&&(t[o]=jQuery("#"+e.id+"-value").val())}),this.customFields=t,this.declareReloaded(),this.bindCustomFields()},t.prototype.bindCustomFields=function(){var t=_.debounce(this.updateCustomFields.bind(this),500,!0);jQuery("#the-list .button + .update_meta").off("click.wpseoCustomFields").on("click.wpseoCustomFields",t),jQuery("#the-list").off("wpListDelEnd.wpseoCustomFields").on("wpListDelEnd.wpseoCustomFields",t),jQuery("#the-list").off("wpListAddEnd.wpseoCustomFields").on("wpListAddEnd.wpseoCustomFields",t),jQuery("#the-list textarea").off("input.wpseoCustomFields").on("input.wpseoCustomFields",t)},"undefined"!=typeof YoastSEO&&void 0!==YoastSEO.app?new t:jQuery(window).on("YoastSEO:ready",function(){new t})}()}},[[159,0]]]);
\ No newline at end of file
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-draft-js-plugins-2200.min.js b/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-draft-js-plugins-2200.min.js
deleted file mode 100644
index c973912b..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-draft-js-plugins-2200.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(window.yoastPremiumWebpackJsonp=window.yoastPremiumWebpackJsonp||[]).push([[9],{13:function(e,t){e.exports=window.wp.components},168:function(e,t,o){"use strict";var i=o(13),n=o(3),s=o(21),m=function(e){return e&&e.__esModule?e:{default:e}}(o(4));var a=function(e){var t=e.pluginList,o=e.fieldId;if(window.yoast.draftJsEmoji){window.yoast.draftJsEmoji.defaultTheme.customClassesSet||(window.yoast.draftJsEmoji.defaultTheme.emojiSelectButton="emoji-select-button",window.yoast.draftJsEmoji.defaultTheme.emojiSelectButtonPressed="emoji-select-button emoji-select-button-pressed",window.yoast.draftJsEmoji.defaultTheme.emojiSelectPopover+=" emoji-select-popover",window.yoast.draftJsEmoji.defaultTheme.emojiSelectPopoverNav+=" emoji-select-popover-nav",window.yoast.draftJsEmoji.defaultTheme.emojiSuggestionsEntry+=" emoji-suggestion-item-wrapper",window.yoast.draftJsEmoji.defaultTheme.emojiSuggestionsEntryFocused+=" emoji-suggestion-item-wrapper",window.yoast.draftJsEmoji.defaultTheme.emojiSuggestionsEntryText+=" emoji-suggestion-item-text",window.yoast.draftJsEmoji.defaultTheme.emojiSelectPopoverGroupItem+=" single-emoji",window.yoast.draftJsEmoji.defaultTheme.emojiSuggestions+=" emoji-suggestions",window.yoast.draftJsEmoji.defaultTheme.customClassesSet=!0);var s=t.emojiPlugin,m=s.EmojiSelect,a=s.EmojiSuggestions;return wp.element.createElement(n.Fragment,null,wp.element.createElement(i.Fill,{name:"PluginComponent-"+o},wp.element.createElement(m,{closeOnEmojiSelect:!0})),wp.element.createElement(a,null))}return wp.element.createElement(n.Fragment,null)};a.propTypes={pluginList:m.default.object.isRequired,fieldId:m.default.string.isRequired};var r=function(){return wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1.5"},wp.element.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))};(0,s.addFilter)("yoast.replacementVariableEditor.additionalPlugins","yoast/yoast-seo-premium/EmojiSelect",function(e,t,o){return wp.element.createElement(a,{key:o+"-emoji",pluginList:t,fieldId:o})},Number.MAX_SAFE_INTEGER),(0,s.addFilter)("yoast.replacementVariableEditor.pluginList","yoast/yoast-seo-premium/EmojiSelectLoad",function(e){return window.yoast.draftJsEmoji&&!e.emojiPlugin&&(e.emojiPlugin=window.yoast.draftJsEmoji.createEmojiPlugin({selectButtonContent:wp.element.createElement(r,null),useNativeArt:!0,theme:window.yoast.draftJsEmoji.defaultTheme})),e},Number.MAX_SAFE_INTEGER)},21:function(e,t){e.exports=window.wp.hooks},3:function(e,t){e.exports=window.wp.element},4:function(e,t){e.exports=window.yoast.propTypes}},[[168,0]]]);
\ No newline at end of file
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-elementor-2200.min.js b/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-elementor-2200.min.js
deleted file mode 100644
index 29adfb8d..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-elementor-2200.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(window.yoastPremiumWebpackJsonp=window.yoastPremiumWebpackJsonp||[]).push([[14],[function(e,t){e.exports=React},function(e,t){e.exports=window.lodash},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.yoast.propTypes},function(e,t){e.exports=window.wp.data},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.STORE_NAME_EDITOR={free:"yoast-seo/editor",premium:"yoast-seo-premium/editor"},t.ASYNC_ACTION_NAMES={request:"request",success:"success",error:"error"},t.ASYNC_ACTION_STATUS={idle:"idle",loading:"loading",success:"success",error:"error"},t.VIDEO_FLOW={showPlay:"showPlay",askPermission:"askPermission",isPlaying:"isPlaying"}},function(e,t){e.exports=window.yoast.reduxJsToolkit},function(e,t){e.exports=window.yoast.analysis},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.yoast.componentsNew},,function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.yoast.styledComponents},,function(e,t){e.exports=window.yoast.helpers},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(29);Object.defineProperty(t,"adminUrlActions",{enumerable:!0,get:function(){return r.adminUrlActions}}),Object.defineProperty(t,"adminUrlReducer",{enumerable:!0,get:function(){return r.adminUrlReducer}}),Object.defineProperty(t,"getInitialAdminUrlState",{enumerable:!0,get:function(){return r.getInitialAdminUrlState}}),Object.defineProperty(t,"ADMIN_URL_NAME",{enumerable:!0,get:function(){return r.ADMIN_URL_NAME}}),Object.defineProperty(t,"adminUrlSelectors",{enumerable:!0,get:function(){return r.adminUrlSelectors}});var o=n(30);Object.defineProperty(t,"getInitialHasAiGeneratorConsentState",{enumerable:!0,get:function(){return o.getInitialHasAiGeneratorConsentState}}),Object.defineProperty(t,"hasAiGeneratorConsentReducer",{enumerable:!0,get:function(){return o.hasAiGeneratorConsentReducer}}),Object.defineProperty(t,"hasAiGeneratorConsentActions",{enumerable:!0,get:function(){return o.hasAiGeneratorConsentActions}}),Object.defineProperty(t,"hasAiGeneratorConsentControls",{enumerable:!0,get:function(){return o.hasAiGeneratorConsentControls}}),Object.defineProperty(t,"HAS_AI_GENERATOR_CONSENT_NAME",{enumerable:!0,get:function(){return o.HAS_AI_GENERATOR_CONSENT_NAME}}),Object.defineProperty(t,"hasAiGeneratorConsentSelectors",{enumerable:!0,get:function(){return o.hasAiGeneratorConsentSelectors}});var i=n(31);Object.defineProperty(t,"pluginUrlSelectors",{enumerable:!0,get:function(){return i.pluginUrlSelectors}}),Object.defineProperty(t,"getInitialPluginUrlState",{enumerable:!0,get:function(){return i.getInitialPluginUrlState}}),Object.defineProperty(t,"PLUGIN_URL_NAME",{enumerable:!0,get:function(){return i.PLUGIN_URL_NAME}}),Object.defineProperty(t,"pluginUrlReducer",{enumerable:!0,get:function(){return i.pluginUrlReducer}}),Object.defineProperty(t,"pluginUrlActions",{enumerable:!0,get:function(){return i.pluginUrlActions}});var s=n(32);Object.defineProperty(t,"linkParamsSelectors",{enumerable:!0,get:function(){return s.linkParamsSelectors}}),Object.defineProperty(t,"getInitialLinkParamsState",{enumerable:!0,get:function(){return s.getInitialLinkParamsState}}),Object.defineProperty(t,"LINK_PARAMS_NAME",{enumerable:!0,get:function(){return s.LINK_PARAMS_NAME}}),Object.defineProperty(t,"linkParamsReducer",{enumerable:!0,get:function(){return s.linkParamsReducer}}),Object.defineProperty(t,"linkParamsActions",{enumerable:!0,get:function(){return s.linkParamsActions}});var a=n(33);Object.defineProperty(t,"WISTIA_EMBED_PERMISSION_NAME",{enumerable:!0,get:function(){return a.WISTIA_EMBED_PERMISSION_NAME}}),Object.defineProperty(t,"wistiaEmbedPermissionActions",{enumerable:!0,get:function(){return a.wistiaEmbedPermissionActions}}),Object.defineProperty(t,"getInitialWistiaEmbedPermissionState",{enumerable:!0,get:function(){return a.getInitialWistiaEmbedPermissionState}}),Object.defineProperty(t,"wistiaEmbedPermissionSelectors",{enumerable:!0,get:function(){return a.wistiaEmbedPermissionSelectors}}),Object.defineProperty(t,"wistiaEmbedPermissionControls",{enumerable:!0,get:function(){return a.wistiaEmbedPermissionControls}}),Object.defineProperty(t,"wistiaEmbedPermissionReducer",{enumerable:!0,get:function(){return a.wistiaEmbedPermissionReducer}})},,function(e,t){e.exports=window.wp.url},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.hooks},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t){e.exports=window.yoast.styleGuide},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ALLOW_EMPTY_TARGET=void 0,t.wpseoDeleteRedirect=o,t.wpseoUndoRedirectForObject=i,t.wpseoRemoveNotification=s,t.wpseoUndoRedirect=function(e,t,n,r,i){o(e,t,n).then(function(e){!0===e.success&&s(i)})},t.wpseoUndoRedirectByObjectId=function(e,t,n){i(e,t).then(function(e){!0===e.success&&s(n)})},t.wpseoCreateRedirect=function(e,t,n,r){var o="";if(410!==parseInt(t,10)&&""===(o=window.prompt(wpseoPremiumStrings.enter_new_url.replace("%s",e))))return void window.alert(wpseoPremiumStrings.error_new_url);jQuery.post(ajaxurl,{action:"wpseo_add_redirect_plain",ajax_nonce:n,redirect:{origin:e,target:o,type:t}},function(e){var n=jQuery(r).closest(".yoast-notification");if(jQuery(n).removeClass("updated").removeClass("error"),jQuery(n).find(".redirect_error").remove(),e.error)jQuery(n).addClass("error").prepend(''+e.error.message+"
");else{var o="";o=(o=410===parseInt(t,10)?_.escape(wpseoPremiumStrings.redirect_saved_no_target):wpseoPremiumStrings.redirect_saved.replace("%2$s",""+_.escape(e.target)+"")).replace("%1$s",""+_.escape(e.origin)+""),jQuery(n).addClass("updated").html(""+o+"
")}},"json")};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(10));t.ALLOW_EMPTY_TARGET=[410,451];function o(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"plain";return(0,r.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/delete",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{origin:e,target:t,type:n,format:o}})}function i(e,t){return(0,r.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/undo-for-object",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{obj_id:e,obj_type:t}})}function s(e){jQuery(e).closest(".yoast-notification").fadeOut("slow")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=a(n(0)),i=a(n(38)),s=a(n(41));function a(e){return e&&e.__esModule?e:{default:e}}var u=void 0;function l(e,t){var n,s,a,c,d,p,f,m,y=[],g={};for(p=0;p "+u);if("componentClose"===d.type)throw new Error("Missing opening component token: `"+d.value+"`");if("componentOpen"===d.type){n=t[d.value],a=p;break}y.push(t[d.value])}else y.push(d.value);return n&&(c=function(e,t){var n,r,o=t[e],i=0;for(r=e+1;r2&&void 0!==arguments[2]?arguments[2]:"assets/images"},function(e,t){return t}],function(e,t,n){return[(0,o.trimEnd)(e,"/"),(0,o.trim)(t,"/"),(0,o.trimStart)(n,"/")].join("/")});t.pluginUrlActions=s.actions,t.pluginUrlReducer=s.reducer},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linkParamsReducer=t.linkParamsActions=t.linkParamsSelectors=t.getInitialLinkParamsState=t.LINK_PARAMS_NAME=void 0;var r=n(8),o=n(19),i=n(1),s=t.LINK_PARAMS_NAME="linkParams",a=(0,r.createSlice)({name:s,initialState:{},reducers:{setLinkParams:function(e,t){return t.payload}}}),u=(t.getInitialLinkParamsState=a.getInitialState,t.linkParamsSelectors={selectLinkParam:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,i.get)(e,s+"."+t,n)},selectLinkParams:function(e){return(0,i.get)(e,s,{})}});u.selectLink=(0,r.createSelector)([u.selectLinkParams,function(e,t){return t}],function(e,t){return(0,o.addQueryArgs)(t,e)});t.linkParamsActions=a.actions,t.linkParamsReducer=a.reducer},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wistiaEmbedPermissionReducer=t.wistiaEmbedPermissionControls=t.wistiaEmbedPermissionActions=t.wistiaEmbedPermissionSelectors=t.getInitialWistiaEmbedPermissionState=t.WISTIA_EMBED_PERMISSION_NAME=void 0;var r=Object.assign||function(e){for(var t=1;t",lasttranslator:"Yoast Translate Team "},repository:{type:"git",url:"https://github.com/Yoast/wordpress-seo-premium"},scripts:{test:"jest",build:"NODE_ENV=production webpack --config ./config/webpack/webpack.config.dev.js --progress --display-error-details","build:css":"cross-env NODE_ENV=production postcss assets/css/dist/*.css --verbose --replace","build:css:dev":"cross-env NODE_ENV=development postcss assets/css/dist/*.css --verbose --replace",start:"webpack-dev-server --config ./config/webpack/webpack.config.dev.js --progress --env.environment=development --port=8081","webpack-analyze-bundle":"cross-env BUNDLE_ANALYZER=1 NODE_ENV=production webpack --config ./config/webpack/webpack.config.prod.js --progress",postinstall:"patch-package"},devDependencies:{"@draft-js-plugins/emoji":"^4.6.1","@tailwindcss/forms":"^0.5.3","@testing-library/jest-dom":"^6.1.3","@testing-library/react":"^14.0.0","@testing-library/react-hooks":"^8.0.1","@types/react":"^18.2.46","@types/wordpress__blocks":"^12.5.13","@wordpress/babel-plugin-makepot":"^2.0.1","@wordpress/block-editor":"^12.16.0","@wordpress/dependency-extraction-webpack-plugin":"^2.9.0","@yoast/components":"link:vendor/yoast/wordpress-seo/packages/components","@yoast/feature-flag":"^0.5.2","@yoast/grunt-plugin-tasks":"^2.4","@yoast/helpers":"link:vendor/yoast/wordpress-seo/packages/helpers","@yoast/postcss-preset":"link:vendor/yoast/wordpress-seo/packages/postcss-preset","@yoast/style-guide":"link:vendor/yoast/wordpress-seo/packages/style-guide","@yoast/tailwindcss-preset":"link:vendor/yoast/wordpress-seo/packages/tailwindcss-preset","babel-cli":"^6.26.0","babel-core":"^6.13.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.13.2","babel-preset-react":"^6.11.1","case-sensitive-paths-webpack-plugin":"^2.1.2","cross-env":"^7.0.2","css-loader":"3.6.0",dotenv:"^8.2.0",envify:"^3.4.1",eslint:"^6.6.0","find-with-regex":"~1.0.2","grunt-git":"^1.0.14","grunt-po2json":"^0.3.0","grunt-webpack":"^3.1.3",jest:"^23.3.0","jest-styled-components":"^7.0.3","patch-package":"^6.4.7",postcss:"^8.4.24","postcss-cli":"^10.1.0","postinstall-postinstall":"^2.1.0","prop-types":"^15.7.2","readline-sync":"^1.4.10","style-loader":"2.0.0","styled-components":"^5.3.6",tailwindcss:"^3.3.2","ts-loader":"^8.0.17",typescript:"^4.2.2",webpack:"^4.20.2","webpack-bundle-analyzer":"^4.2.0","webpack-cli":"^3.1.2","webpack-dev-server":"^3.1.14"},dependencies:{"@headlessui/react":"^1.6.5","@heroicons/react":"^1.0.6","@reduxjs/toolkit":"^1.9.5","@yoast/social-metadata-previews":"link:vendor/yoast/wordpress-seo/packages/social-metadata-previews","a11y-speak":"github:yoast/a11y-speak","babel-loader":"^7.1.5","babel-plugin-dynamic-import-webpack":"^1.1.0","babel-polyfill":"^6.16.0",classnames:"^2.3.2","concat-map":"^0.0.1","grunt-glotpress":"https://github.com/Yoast/grunt-glotpress.git#translationspress","interpolate-components":"^1.1.0",lodash:"^4.7.0","react-json-view":"^1.21.3","react-select":"^5.8.0",sassdash:"^0.9.0",yoastseo:"link:vendor/yoast/wordpress-seo/packages/yoastseo"},resolutions:{yoastseo:"link:vendor/yoast/wordpress-seo/packages/yoastseo","../yoastseo":"link:vendor/yoast/wordpress-seo/packages/yoastseo","@yoast/search-metadata-previews":"link:vendor/yoast/wordpress-seo/packages/search-metadata-previews","@yoast/ui-library":"link:vendor/yoast/wordpress-seo/packages/ui-library"},browserslist:["extends @yoast/browserslist-config"],yoast:{pluginVersion:"22.0"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compressWordsForLinking=function(e){var t={};return e.forEach(function(e){t[e.getStem()]=e.getOccurrences()}),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.determineMorphologyRequestUrl=function(e){var t={en:"v5",de:"v10",es:"v10",fr:"v11",it:"v10",nl:"v9",ru:"v10",id:"v9",pt:"v9",pl:"v9",ar:"v9",sv:"v1",he:"v1",hu:"v2",nb:"v1",tr:"v1",cs:"v1",sk:"v1",el:"v1",ja:"v1"};if(!Object.keys(t).includes(e))return!1;return"https://my.yoast.com/api/downloads/file/morphology-"+e+"-"+t[e]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return"enabled"===window.wpseoPremiumMetaboxData.data.linkSuggestionsEnabled&&window.wpseoPremiumMetaboxData.data.linkSuggestionsAvailable}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUnindexedWarning=void 0;var r=Object.assign||function(e){for(var t=1;tn&&(t.length=n),wp.element.createElement(m,null,wp.element.createElement("p",null,g," ",i),wp.element.createElement("p",null,o.metaMessage),t.map(function(e,t){return wp.element.createElement(d.default,r({key:t},e))}))};b.propTypes={suggestions:i.default.array.isRequired,maxSuggestions:i.default.number,customMessages:i.default.object,location:i.default.string},b.defaultProps={maxSuggestions:10,customMessages:{lengthMessage:"",metaMessage:""},location:""};var _=function(){window.open("admin.php?page=wpseo_tools&start-indexation=true","yoastSeoAnalyzeProminentWords")},k=function(e){var t="";return e.hasWordsForLinking||(t=(0,u.__)("Once you add a bit more copy, we'll give you a list of related content here to which you could link in your post.","wordpress-seo-premium")),{lengthMessage:t,metaMessage:function(e,t,n){switch(!0){case n&&!t&&""===e:return(0,u.__)("Add a title to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&t&&""===e:return(0,u.__)("Add a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&!t&&""===e:return(0,u.__)("Add a title and a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium");case n&&!t&&""!==e:return(0,u.__)("Also, add a title to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&t&&""!==e:return(0,u.__)("Also, add a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&!t&&""!==e:return(0,u.__)("Also, add a title and a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium")}}(t,e.hasTitle,e.hasMetaDescription)}},E=t.getUnindexedWarning=function(){var e=(0,u.__)("We need to optimize your site’s SEO data so we can offer you the best %1$slinking suggestions%2$s.\n\n%3$sStart SEO Data optimization%4$s","wordpress-seo-premium");return e=(e=(e=(e=(e=e.replace("%1$s","{{a}}")).replace("%2$s","{{/a}}")).replace("%3$s","{{startAnalysis}}")).replace("%4$s","{{/startAnalysis}}")).replace("\n\n","{{br /}}{{br /}}"),e=(0,a.default)({mixedString:e,components:{a:wp.element.createElement("a",{href:wpseoAdminL10n["shortlinks.notification_internal_link"],target:"_blank"}),startAnalysis:wp.element.createElement("button",{type:"button",className:"button",onClick:_}),br:wp.element.createElement("br",null)}}),wp.element.createElement("div",{className:"notice notice-warning notice-alt wpseo-notice-breakout-inside yoast-links-suggestions-notice"},wp.element.createElement("p",null,e))},S=function(e){if((0,o.useEffect)(function(){return e.suggester.subscribe(),function(){e.suggester.unsubscribe()}},[]),e.isLoading)return wp.element.createElement("div",{className:"yoast-link-suggestions"},wp.element.createElement("p",null,(0,u.__)("It takes a few seconds to show you a list of related content to which you could link. The suggestions will be shown here as soon as we have them.","wordpress-seo-premium")));w||((w=new ClipboardJS(".yoast-link-suggestion__copy")).on("success",v),w.on("error",h));var t=null;e.showUnindexedWarning&&(t=E());var n=r({},e.messageData,{hasWordsForLinking:Array.isArray(e.wordsForLinking)&&e.wordsForLinking.length>0}),i=k(n);return wp.element.createElement("div",{className:"yoast-link-suggestions"},t,wp.element.createElement(b,{suggestions:e.suggestions,customMessages:i,location:e.location}))};S.propTypes={suggester:i.default.object,suggestions:i.default.array.isRequired,wordsForLinking:i.default.array,messageData:i.default.object,isLoading:i.default.bool.isRequired,showUnindexedWarning:i.default.bool,location:i.default.string},S.defaultProps={suggester:null,showUnindexedWarning:!1,messageData:{hasMetaDescription:!1,hasTitle:!1},wordsForLinking:[],location:""},t.default=S},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});l(n(0));var r=l(n(4)),o=l(n(14)),i=n(2),s=n(23),a=n(11),u=n(16);function l(e){return e&&e.__esModule?e:{default:e}}var c=o.default.div.withConfig({displayName:"LinkSuggestion__LinkSuggestionWrapper",componentId:"sc-1gewdgc-0"})(["display:flex;align-items:normal;min-height:40px;margin:10px 0 5px;"]),d=(0,u.createSvgIconComponent)({copy:{viewbox:"0 0 448 512",path:"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"},check:{viewbox:"0 0 512 512",path:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}),p=o.default.div.withConfig({displayName:"LinkSuggestion__LinkSuggestionDivider",componentId:"sc-1gewdgc-1"})(["background-color:#e5e5e5;width:100%;height:1px;"]),f=o.default.button.withConfig({displayName:"LinkSuggestion__LinkSuggestionIcon",componentId:"sc-1gewdgc-2"})(["box-sizing:border-box;flex:0 0 30px;height:30px;width:30px;background-color:",";border-radius:5px;cursor:pointer;outline:none;border:1px solid ",";margin-left:3px;&:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,0.8);}"],function(e){return e.iconBackground},function(e){return e.iconBorder});f.props={iconBackground:r.default.string,iconBorder:r.default.string},f.defaultProps={iconBackground:s.colors.$color_button,iconBorder:s.colors.$color_button_border};var m=o.default.div.withConfig({displayName:"LinkSuggestion__LinkContainer",componentId:"sc-1gewdgc-3"})(["flex:auto;"]),y=(0,u.makeOutboundLink)(o.default.a.withConfig({displayName:"LinkSuggestion__Link",componentId:"sc-1gewdgc-4"})(["text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;max-height:40px;margin-bottom:4px;-webkit-box-orient:vertical;overflow:hidden;padding:0 0 4px;"])),g=o.default.div.withConfig({displayName:"LinkSuggestion__BadgesWrapper",componentId:"sc-1gewdgc-5"})(["flex-wrap:wrap;display:flex;flex-direction:row;justify-content:unset;margin-top:4px;"]),w=o.default.span.withConfig({displayName:"LinkSuggestion__Badge",componentId:"sc-1gewdgc-6"})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;padding:3px 8px;font-size:0.85em;background-color:#f3f4f5;border-radius:2px;margin-bottom:4px;margin-right:4px;text-transform:lowercase;"]),v=function(e){var t=e.badges;return wp.element.createElement(g,null,t.map(function(e,t){return wp.element.createElement(w,{key:t},e)}))};v.propTypes={badges:r.default.array.isRequired};var h=function(e){var t=e.value,n=e.url,r=e.isActive,o=e.labels,u=(0,i.__)("Copy link","wordpress-seo-premium"),l=(0,i.sprintf)((0,i.__)("Copy link to suggested article: %s","wordpress-seo-premium"),t),g="copy",w=s.colors.$color_black,h=s.colors.$color_button,b="#979797";return r&&(g="check",w=s.colors.$color_alert_success_text,h=s.colors.$color_alert_success_background,b=s.colors.$color_alert_success_background),wp.element.createElement("div",null,wp.element.createElement(p,null),wp.element.createElement(c,{className:"yoast-link-suggestion__wrapper"},wp.element.createElement(m,{className:"yoast-link-suggestion__container"},wp.element.createElement(y,{href:n},t),wp.element.createElement(v,{badges:o})),wp.element.createElement(f,{type:"button",className:"yoast-link-suggestion__copy yoast-tooltip yoast-tooltip-alt yoast-tooltip-s",onBlur:function(e){e.nativeEvent.target.setAttribute("aria-label",l),e.nativeEvent.target.setAttribute("data-label",u)},"data-clipboard-text":n,"aria-label":l,"data-label":u,iconBackground:h,iconBorder:b},wp.element.createElement(d,{icon:g,color:w}),wp.element.createElement(a.ScreenReaderText,null,u))))};h.propTypes={value:r.default.string.isRequired,url:r.default.string.isRequired,isActive:r.default.bool,labels:r.default.array.isRequired},h.defaultProps={isActive:!1},t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.SET_PROMINENT_WORDS="SET_PROMINENT_WORDS",o=t.SET_TEXT_FORMALITY_LEVEL="SET_TEXT_FORMALITY_LEVEL";t.setProminentWords=function(e){return{type:r,payload:e}},t.setTextFormalityLevel=function(e){return{type:o,payload:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setRedirectNotification=function(e){return{type:r,redirectData:e}},t.closeRedirectNotification=function(){return{type:o}};var r=t.SET_REDIRECT_NOTIFICATION="SET_REDIRECT_NOTIFICATION",o=t.CLOSE_REDIRECT_NOTIFICATION="CLOSE_REDIRECT_NOTIFICATION"},,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n"," "),{a:wp.element.createElement("a",{href:t,target:"_blank"})}))))};a.propTypes={link:r.default.string.isRequired},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(0,window.yoast.editorModules.analysis.getContentLocale)().split("_")[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("undefined"==typeof YoastSEO||void 0===YoastSEO.analysis||void 0===YoastSEO.analysis.worker)return;var r=YoastSEO.analysis.worker;r.loadScript(e).then(function(){return r.loadScript(t)}).then(function(){return r.sendMessage("initialize",{options:n},"YoastSEOPremium")})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("undefined"==typeof YoastSEO||void 0===YoastSEO.analysis||void 0===YoastSEO.analysis.worker)return;var n=YoastSEO.analysis.worker;n.loadScript(e).then(function(){return n.loadScript(t)}).then((0,r.dispatch)("yoast-seo/editor").runAnalysis)};var r=n(5)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(45),i=n(1),s=n(9);var a=function(){var e=(0,r.dispatch)("yoast-seo-premium/editor"),t=e.setProminentWords,n=e.setTextFormalityLevel,a=(0,i.get)(window,"YoastSEO.analysis.worker.runResearch",i.noop),u=(0,i.get)(window,"YoastSEO.analysis.collectData",!1);return function(){var e=u?s.Paper.parse(u()):null;a("getProminentWordsForInsights",e).then(function(e){var t=e.result;return(0,i.reduce)(t,function(e,t){return[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t
","",e),{span:wp.element.createElement(u,null)})},[e]);return wp.element.createElement("div",null,t.length<50&&wp.element.createElement("div",null,wp.element.createElement("p",null,(0,o.__)("Once you add a bit more copy, we'll be able to tell you the formality level of your text.","wordpress-seo"))),t.length>=50&&wp.element.createElement("div",null,wp.element.createElement("p",null,n)))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(n(56));t.default=(0,r.withSelect)(function(e){var t=e("yoast-seo-premium/editor"),n=t.getLinkSuggestions,r=t.getWordsForLinking,o=t.getLinkSuggestionsMessageData,i=t.linkSuggestionsAreLoading,s=t.linkSuggestionsAreUnindexed;return{suggestions:n(),wordsForLinking:r(),messageData:o(),isLoading:i(),showUnindexedWarning:s()}})(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(n(86));t.default=(0,r.withSelect)(function(e){var t=e("yoast-seo-premium/editor"),n=t.getMetaboxWarningIsLoading,r=t.getMetaboxWarning;return{isLoading:n(),warning:r()}})(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n191&&t.push((0,o.__)("Your keyphrase is too long. It can be a maximum of 191 characters.","wordpress-seo-premium")),t}(t),N=wp.element.createElement(p,{href:wpseoAdminL10n["shortlinks.focus_keyword_info"],className:"dashicons"},wp.element.createElement("span",{className:"screen-reader-text"},(0,o.__)("Help on choosing the perfect keyphrase","wordpress-seo-premium"))),I=wp.element.createElement(p,{href:wpseoAdminL10n["shortlinks.keyword_synonyms_info"],className:"dashicons"},wp.element.createElement("span",{className:"screen-reader-text"},(0,o.__)("Help on keyphrase synonyms","wordpress-seo-premium")));return wp.element.createElement(y,null,function(e){var s="metabox"===e?w:g;return wp.element.createElement(s,{title:M,subTitle:L,prefixIcon:j,prefixIconCollapsed:j,id:"yoast-additional-keyphrase-collapsible-"+R+"-"+e},wp.element.createElement(v,{id:a?"yoast-keyword-input-add-"+e:"yoast-keyword-input-"+R+"-"+e,keyword:t,onChange:n,onFocusKeyword:_,onRemoveKeyword:a?null:O,onBlurKeyword:k,label:(0,o.__)("Keyphrase","wordpress-seo-premium"),helpLink:N,hasError:T.length>0,errorMessages:T}),!a&&wp.element.createElement(r.Fragment,null,wp.element.createElement(u.SynonymsInput,{id:"yoast-synonyms-input-"+R+"-"+e,showLabel:!0,label:(0,o.__)("Synonyms","wordpress-seo-premium"),onChange:b,onBlur:S,onFocus:E,value:c,helpLink:I}),wp.element.createElement(h,null,(0,o.__)("Analysis results","wordpress-seo-premium")),wp.element.createElement(m,{showLanguageNotice:!1,marksButtonClassName:"yoast-tooltip yoast-tooltip-w",editButtonClassName:"yoast-tooltip yoast-tooltip-w",marksButtonStatus:P,results:i,keywordKey:R,location:e})))})}b.propTypes={keyword:s.default.string.isRequired,onChange:s.default.func.isRequired,synonyms:s.default.string,onChangeSynonyms:s.default.func,onRemoveKeyword:s.default.func.isRequired,onFocusKeyword:s.default.func.isRequired,onBlurKeyword:s.default.func.isRequired,onBlurSynonym:s.default.func.isRequired,onFocusSynonym:s.default.func.isRequired,analysis:s.default.array,isAddKeyword:s.default.bool,score:s.default.number,marksButtonStatus:s.default.string,keywordKey:s.default.string.isRequired},b.defaultProps={synonyms:"",onChangeSynonyms:i.noop,analysis:[],isAddKeyword:!1,score:0,marksButtonStatus:"enabled"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(20),i=function(e){return e&&e.__esModule?e:{default:e}}(n(92));var s=window.yoast.editorModules.containers.SEMrushRelatedKeyphrases;t.default=(0,o.compose)([(0,r.withSelect)(function(e){return{keyphrase:e("yoast-seo/editor").getFocusKeyphrase(),relatedKeyphrases:e("yoast-seo-premium/editor").getKeywords(),renderAction:function(e,t){return wp.element.createElement(i.default,{relatedKeyphrase:e,relatedKeyphrases:t})}}})])(s)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEMrushRelatedKeyphraseControls=void 0;var r=function(){function e(e,t){for(var n=0;n=4}},{key:"addKeyphraseToList",value:function(){""===this.getAssociatedKeyphraseKey(this.props.relatedKeyphrases,this.props.relatedKeyphrase)&&this.props.addKeyphrase(this.props.relatedKeyphrase)}},{key:"removeKeyphraseFromList",value:function(){var e=this.getAssociatedKeyphraseKey(this.props.relatedKeyphrases,this.props.relatedKeyphrase);""!==e&&this.props.removeKeyphrase(e)}},{key:"componentDidUpdate",value:function(e){var t=this.keyphraseExists(this.props.relatedKeyphrases,this.props.relatedKeyphrase),n=this.keyphraseExists(e.relatedKeyphrases,e.relatedKeyphrase);t&&!n&&this.removeLinkRef.current.focus(),!t&&n&&this.addButtonRef.current.focus()}},{key:"render",value:function(){var e=this.props.relatedKeyphrase,t=this.props.relatedKeyphrases;return t&&this.keyphraseExists(t,e)?wp.element.createElement(i.Fragment,null,wp.element.createElement("span",{className:"yoast-modal__settings-saved"},(0,s.__)("Added!","wordpress-seo-premium")),wp.element.createElement(l.default,{ref:this.removeLinkRef,onRemove:this.removeKeyphraseFromList})):wp.element.createElement(c.default,{buttonRef:this.addButtonRef,disabled:this.relatedKeyphrasesLimitReached(),onAdd:this.addKeyphraseToList})}}]),t}();p.propTypes={relatedKeyphrase:u.default.string,relatedKeyphrases:u.default.array,addKeyphrase:u.default.func.isRequired,removeKeyphrase:u.default.func.isRequired},p.defaultProps={relatedKeyphrase:"",relatedKeyphrases:[]},t.SEMrushRelatedKeyphraseControls=p,t.default=(0,o.withDispatch)(function(e){var t=e("yoast-seo-premium/editor");return{addKeyphrase:t.addRelatedKeyword,removeKeyphrase:t.removeRelatedKeyword}})(p)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(3);t.default=(0,o.forwardRef)(function(e,t){return wp.element.createElement("button",{ref:t,className:"yoast-remove",onClick:e.onRemove},(0,r.__)("Remove","wordpress-seo-premium"))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(n(4)),i=n(11);var s=function(e){return wp.element.createElement(i.NewButton,{variant:"secondary",small:!0,buttonRef:e.buttonRef,onClick:e.onAdd,disabled:e.disabled},(0,r.__)("Add as related keyphrase","wordpress-seo-premium"))};s.propTypes={buttonRef:o.default.object,onAdd:o.default.func.isRequired,disabled:o.default.bool},s.defaultProps={buttonRef:null,disabled:!1},t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(20),i=n(11);t.default=(0,o.compose)([(0,r.withSelect)(function(e){return{value:(0,e("yoast-seo-premium/editor").getSynonyms)()}}),(0,r.withDispatch)(function(e){var t=e("yoast-seo/editor").setMarkerPauseStatus,n=e("yoast-seo-premium/editor").setSynonyms;return{onChange:function(e){n(e.target.value)},onFocus:function(){t(!0)},onBlur:function(){t(!1)}}})])(i.SynonymsInput)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=t.type,r=t.payload;switch(n){case o.SET_PROMINENT_WORDS:return r;default:return e}},textFormalityLevel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments[1],n=t.type,r=t.payload;switch(n){case o.SET_TEXT_FORMALITY_LEVEL:return r;default:return e}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(28),o={suggestions:[],messageData:{hasMetaDescription:!1,hasTitle:!1},wordsForLinking:null,isLoading:!0,showUnindexedWarning:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case r.LOAD_LINK_SUGGESTIONS:return Object.assign({},e,{isLoading:!0});case r.SET_LINK_SUGGESTIONS:return Object.assign({},e,{suggestions:t.linkSuggestions||[],isLoading:!1,showUnindexedWarning:t.showUnindexedWarning});case r.SET_MESSAGE_DATA:return Object.assign({},e,{messageData:{hasMetaDescription:t.messageData.hasMetaDescription,hasTitle:t.messageData.hasTitle},wordsForLinking:t.messageData.prominentWords});case r.SET_WORDS_FOR_LINKING:return Object.assign({},e,{wordsForLinking:t.wordsForLinking});default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(47),o={isLoading:!1,warning:[]};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case r.LOAD_MORPHOLOGY_DATA:return Object.assign({},e,{isLoading:!0});case r.LOAD_MORPHOLOGY_DATA_ERROR:return Object.assign({},e,{isLoading:!1,warning:t.message});default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.default=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isProminentWordsAvailable:(0,r.get)(window,"wpseoPremiumMetaboxData.data.isProminentWordsAvailable",!1)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:i,t=arguments[1];switch(t.type){case o.SET_REDIRECT_NOTIFICATION:return r({},e,{redirectData:t.redirectData,isOpen:!0});case o.CLOSE_REDIRECT_NOTIFICATION:return r({},e,{redirectData:{},isOpen:!1});default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];return{availableKeys:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments[1],n=void 0;switch(t.type){case i.SET_RELATED_KEYWORDS:return n=u.length-t.keywords.length,(0,o.takeRight)(e,n);case i.ADD_RELATED_KEYWORD:return(0,o.tail)(e);case i.REMOVE_RELATED_KEYWORD:return[t.key].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1],n=arguments[2];switch(t.type){case i.SET_RELATED_KEYWORDS:return(0,o.fromPairs)(t.keywords.map(function(e,t){var n=u[t];return[n,r({},e,{key:n})]}));case i.ADD_RELATED_KEYWORD:return r({},e,s({},n,{key:n,keyword:t.keyword}));case i.REMOVE_RELATED_KEYWORD:return(0,o.pickBy)(e,function(e){return e.key!==t.key});case i.CHANGE_RELATED_KEYWORD:return r({},e,s({},t.key,r({},e[t.key],{keyword:t.keyword})));case i.SET_RELATED_KEYWORD_RESULTS:return e[t.key]&&e[t.key].keyword===t.keyword?r({},e,s({},t.key,r({},e[t.key],{results:t.results,score:t.score}))):e;case i.SET_RELATED_KEYWORD_SYNONYMS:return r({},e,s({},t.key,r({},e[t.key],{synonyms:t.synonyms})))}return e}(e.keywords,t,(0,o.head)(e.availableKeys))}};var o=n(1),i=n(35);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a={},u=["a","b","c","d"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1];if(t.type===r.SET_SYNONYMS)return t.synonyms;return e};var r=n(48)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(107);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(108);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(109);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var s=n(110);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var a=n(111);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var u=n(112);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}})});var l=n(113);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTextFormalityLevel=t.getProminentWords=void 0;var r=n(1),o=[];t.getProminentWords=function(e){return(0,r.get)(e,"insights.prominentWords",o)},t.getTextFormalityLevel=function(e){return(0,r.get)(e,"insights.textFormalityLevel",null)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLinkSuggestions=function(e){return(0,r.get)(e,["linkSuggestions","suggestions"],o)},t.linkSuggestionsAreLoading=function(e){return(0,r.get)(e,["linkSuggestions","isLoading"],!0)},t.linkSuggestionsAreUnindexed=function(e){return(0,r.get)(e,["linkSuggestions","showUnindexedWarning"],!1)},t.getWordsForLinking=function(e){return(0,r.get)(e,["linkSuggestions","wordsForLinking"],null)},t.getLinkSuggestionsMessageData=function(e){return(0,r.get)(e,["linkSuggestions","messageData"],{hasMetaDescription:!1,hasTitle:!1})};var r=n(1),o=[]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMetaboxWarningIsLoading=function(e){return(0,r.get)(e,"metaboxWarning.isLoading",!0)},t.getMetaboxWarning=function(e){return(0,r.get)(e,"metaboxWarning.warning","")};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPreferences=t.getPreference=void 0;var r=n(1);t.getPreference=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,r.get)(e,"preferences."+t,n)},t.getPreferences=function(e){return e.preferences}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRedirectData=function(e){return(0,r.get)(e,"redirectNotification.redirectData",{})},t.getIsRedirectNotificationOpen=function(e){return(0,r.get)(e,"redirectNotification.isOpen",!1)};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getKeywordData=function(e,t){return(0,r.get)(e,["relatedKeywords","keywords",t],{keyword:"",analysis:[],score:0,synonyms:""})},t.getKeywords=function(e){return Object.values((0,r.get)(e,["relatedKeywords","keywords"],{}))},t.getFirstAvailableKey=function(e){return(0,r.head)((0,r.get)(e,["relatedKeywords","availableKeys"],[]))||""};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSynonyms=function(e){return(0,r.get)(e,["synonyms"],"")};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n0){var r=e.formatLinkSuggestions(e.linkSuggestions);e.setLinkingSuggestionsOnStore(r)}})}},{key:"markUsedLinks",value:function(e){var t=this.usedLinks||[];return e.forEach(function(e){e.active=t.includes(e.link)}),e}}],[{key:"mapSuggestionsForStore",value:function(e){return e.map(function(e){return{value:e.title,url:e.link,isActive:e.active,labels:e.labels}})}}]),e}();t.default=a},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(5),o=n(21),i=n(45),s=n(1),a=k(n(202)),u=k(n(203)),l=k(n(205)),c=k(n(206)),d=k(n(209)),p=k(n(214)),f=k(n(217)),m=k(n(79)),y=k(n(80)),g=k(n(81)),w=k(n(82)),v=k(n(96)),h=k(n(114)),b=n(17),_=n(218);function k(e){return e&&e.__esModule?e:{default:e}}(0,window.yoast.editorModules.helpers.i18n.setTextdomainL10n)("wordpress-seo-premium","wpseoPremiumJSL10n");(0,o.addAction)("yoast.elementor.loaded","yoast/yoast-seo-premium/initializeElementorIntegration",function e(){if((0,r.dispatch)("yoast-seo/editor"))try{(0,i.enableFeatures)(window.wpseoFeaturesL10n),function(){var e=(0,v.default)();e.dispatch(b.pluginUrlActions.setPluginUrl((0,s.get)(window,"wpseoPremiumMetaboxData.data.pluginUrl","")));var t=(0,a.default)(e);(0,f.default)(e),(0,c.default)(e),(0,l.default)(),(0,d.default)(e,t),(0,u.default)(),(0,p.default)(),(0,w.default)();var n=new h.default;e.subscribe(function(){n.persist(e.getState())})}(),function(e){window.YoastSEO.analysis.worker.initialize({translations:e})}(window.wpseoPremiumJSL10n),(0,i.isFeatureEnabled)("TEXT_FORMALITY")&&(0,g.default)(window.wpseoPremiumMetaboxData.data.commonsScriptUrl,window.wpseoPremiumMetaboxData.data.textFormalityScriptUrl),(0,y.default)(window.wpseoPremiumMetaboxData.data.commonsScriptUrl,window.wpseoPremiumMetaboxData.data.premiumAssessmentsScriptUrl,{isTitleAssessmentAvailable:!0,isTextAlignmentAssessmentAvailable:!1,language:(0,m.default)()}),(0,o.addAction)("yoast.analysis.applyMarks","yoast/yoast-seo-premium/applyMarksElementor",_.applyMarksElementor)}catch(e){console.error(e)}else setTimeout(e,100)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!u)return null;var t=e.dispatch.bind(e);return t((0,i.loadLinkSuggestions)()),new s.default({dispatch:t,rootUrl:(0,r.get)(window,"wpseoPremiumMetaboxData.data.restApi.root",""),nonce:(0,r.get)(window,"wpseoPremiumMetaboxData.data.restApi.nonce",""),currentObjectId:(0,r.get)(window,"wpseoPremiumMetaboxData.data.currentObjectId",0),currentObjectType:(0,r.get)(window,"wpseoPremiumMetaboxData.data.currentObjectType","post"),showUnindexedWarning:(0,r.get)(window,"wpseoPremiumMetaboxData.data.linkSuggestionsUnindexed",!1),maxWordsToSave:(0,r.get)(window,"wpseoPremiumMetaboxData.data.perIndexableLimit",20)})};var r=n(1),o=a(n(46)),i=n(28),s=a(n(115));function a(e){return e&&e.__esModule?e:{default:e}}var u=(0,o.default)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=a().split("_")[0],t=(0,o.get)(window,"wpseoPremiumMetaboxData.data.licensedURL","");if(!i.helpers.getLanguagesWithWordFormSupport().includes(e))return;if(""===t)return;var n=new s.default({siteUrl:t,language:e,setError:u});(0,r.dispatch)("yoast-seo-premium/editor").loadMorphologyData(),n.injectMorphologyData()};var r=n(5),o=n(1),i=n(9),s=function(e){return e&&e.__esModule?e:{default:e}}(n(204));var a=window.yoast.editorModules.analysis.getContentLocale,u=function(e){(0,r.dispatch)("yoast-seo-premium/editor").setLoadMorphologyDataError(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[];try{return JSON.parse(e)}catch(e){return t}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n=t&&e.getPositionEnd() "+u);if("componentClose"===d.type)throw new Error("Missing opening component token: `"+d.value+"`");if("componentOpen"===d.type){n=t[d.value],a=p;break}y.push(t[d.value])}else y.push(d.value);return n&&(c=function(e,t){var n,r,o=t[e],s=0;for(r=e+1;r2&&void 0!==arguments[2]?arguments[2]:"assets/images"},function(e,t){return t}],function(e,t,n){return[(0,o.trimEnd)(e,"/"),(0,o.trim)(t,"/"),(0,o.trimStart)(n,"/")].join("/")});t.pluginUrlActions=i.actions,t.pluginUrlReducer=i.reducer},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.linkParamsReducer=t.linkParamsActions=t.linkParamsSelectors=t.getInitialLinkParamsState=t.LINK_PARAMS_NAME=void 0;var r=n(8),o=n(19),s=n(1),i=t.LINK_PARAMS_NAME="linkParams",a=(0,r.createSlice)({name:i,initialState:{},reducers:{setLinkParams:function(e,t){return t.payload}}}),u=(t.getInitialLinkParamsState=a.getInitialState,t.linkParamsSelectors={selectLinkParam:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,s.get)(e,i+"."+t,n)},selectLinkParams:function(e){return(0,s.get)(e,i,{})}});u.selectLink=(0,r.createSelector)([u.selectLinkParams,function(e,t){return t}],function(e,t){return(0,o.addQueryArgs)(t,e)});t.linkParamsActions=a.actions,t.linkParamsReducer=a.reducer},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wistiaEmbedPermissionReducer=t.wistiaEmbedPermissionControls=t.wistiaEmbedPermissionActions=t.wistiaEmbedPermissionSelectors=t.getInitialWistiaEmbedPermissionState=t.WISTIA_EMBED_PERMISSION_NAME=void 0;var r=Object.assign||function(e){for(var t=1;t",lasttranslator:"Yoast Translate Team "},repository:{type:"git",url:"https://github.com/Yoast/wordpress-seo-premium"},scripts:{test:"jest",build:"NODE_ENV=production webpack --config ./config/webpack/webpack.config.dev.js --progress --display-error-details","build:css":"cross-env NODE_ENV=production postcss assets/css/dist/*.css --verbose --replace","build:css:dev":"cross-env NODE_ENV=development postcss assets/css/dist/*.css --verbose --replace",start:"webpack-dev-server --config ./config/webpack/webpack.config.dev.js --progress --env.environment=development --port=8081","webpack-analyze-bundle":"cross-env BUNDLE_ANALYZER=1 NODE_ENV=production webpack --config ./config/webpack/webpack.config.prod.js --progress",postinstall:"patch-package"},devDependencies:{"@draft-js-plugins/emoji":"^4.6.1","@tailwindcss/forms":"^0.5.3","@testing-library/jest-dom":"^6.1.3","@testing-library/react":"^14.0.0","@testing-library/react-hooks":"^8.0.1","@types/react":"^18.2.46","@types/wordpress__blocks":"^12.5.13","@wordpress/babel-plugin-makepot":"^2.0.1","@wordpress/block-editor":"^12.16.0","@wordpress/dependency-extraction-webpack-plugin":"^2.9.0","@yoast/components":"link:vendor/yoast/wordpress-seo/packages/components","@yoast/feature-flag":"^0.5.2","@yoast/grunt-plugin-tasks":"^2.4","@yoast/helpers":"link:vendor/yoast/wordpress-seo/packages/helpers","@yoast/postcss-preset":"link:vendor/yoast/wordpress-seo/packages/postcss-preset","@yoast/style-guide":"link:vendor/yoast/wordpress-seo/packages/style-guide","@yoast/tailwindcss-preset":"link:vendor/yoast/wordpress-seo/packages/tailwindcss-preset","babel-cli":"^6.26.0","babel-core":"^6.13.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.13.2","babel-preset-react":"^6.11.1","case-sensitive-paths-webpack-plugin":"^2.1.2","cross-env":"^7.0.2","css-loader":"3.6.0",dotenv:"^8.2.0",envify:"^3.4.1",eslint:"^6.6.0","find-with-regex":"~1.0.2","grunt-git":"^1.0.14","grunt-po2json":"^0.3.0","grunt-webpack":"^3.1.3",jest:"^23.3.0","jest-styled-components":"^7.0.3","patch-package":"^6.4.7",postcss:"^8.4.24","postcss-cli":"^10.1.0","postinstall-postinstall":"^2.1.0","prop-types":"^15.7.2","readline-sync":"^1.4.10","style-loader":"2.0.0","styled-components":"^5.3.6",tailwindcss:"^3.3.2","ts-loader":"^8.0.17",typescript:"^4.2.2",webpack:"^4.20.2","webpack-bundle-analyzer":"^4.2.0","webpack-cli":"^3.1.2","webpack-dev-server":"^3.1.14"},dependencies:{"@headlessui/react":"^1.6.5","@heroicons/react":"^1.0.6","@reduxjs/toolkit":"^1.9.5","@yoast/social-metadata-previews":"link:vendor/yoast/wordpress-seo/packages/social-metadata-previews","a11y-speak":"github:yoast/a11y-speak","babel-loader":"^7.1.5","babel-plugin-dynamic-import-webpack":"^1.1.0","babel-polyfill":"^6.16.0",classnames:"^2.3.2","concat-map":"^0.0.1","grunt-glotpress":"https://github.com/Yoast/grunt-glotpress.git#translationspress","interpolate-components":"^1.1.0",lodash:"^4.7.0","react-json-view":"^1.21.3","react-select":"^5.8.0",sassdash:"^0.9.0",yoastseo:"link:vendor/yoast/wordpress-seo/packages/yoastseo"},resolutions:{yoastseo:"link:vendor/yoast/wordpress-seo/packages/yoastseo","../yoastseo":"link:vendor/yoast/wordpress-seo/packages/yoastseo","@yoast/search-metadata-previews":"link:vendor/yoast/wordpress-seo/packages/search-metadata-previews","@yoast/ui-library":"link:vendor/yoast/wordpress-seo/packages/ui-library"},browserslist:["extends @yoast/browserslist-config"],yoast:{pluginVersion:"22.0"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compressWordsForLinking=function(e){var t={};return e.forEach(function(e){t[e.getStem()]=e.getOccurrences()}),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.determineMorphologyRequestUrl=function(e){var t={en:"v5",de:"v10",es:"v10",fr:"v11",it:"v10",nl:"v9",ru:"v10",id:"v9",pt:"v9",pl:"v9",ar:"v9",sv:"v1",he:"v1",hu:"v2",nb:"v1",tr:"v1",cs:"v1",sk:"v1",el:"v1",ja:"v1"};if(!Object.keys(t).includes(e))return!1;return"https://my.yoast.com/api/downloads/file/morphology-"+e+"-"+t[e]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return"enabled"===window.wpseoPremiumMetaboxData.data.linkSuggestionsEnabled&&window.wpseoPremiumMetaboxData.data.linkSuggestionsAvailable}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUnindexedWarning=void 0;var r=Object.assign||function(e){for(var t=1;tn&&(t.length=n),wp.element.createElement(m,null,wp.element.createElement("p",null,g," ",s),wp.element.createElement("p",null,o.metaMessage),t.map(function(e,t){return wp.element.createElement(d.default,r({key:t},e))}))};b.propTypes={suggestions:s.default.array.isRequired,maxSuggestions:s.default.number,customMessages:s.default.object,location:s.default.string},b.defaultProps={maxSuggestions:10,customMessages:{lengthMessage:"",metaMessage:""},location:""};var _=function(){window.open("admin.php?page=wpseo_tools&start-indexation=true","yoastSeoAnalyzeProminentWords")},k=function(e){var t="";return e.hasWordsForLinking||(t=(0,u.__)("Once you add a bit more copy, we'll give you a list of related content here to which you could link in your post.","wordpress-seo-premium")),{lengthMessage:t,metaMessage:function(e,t,n){switch(!0){case n&&!t&&""===e:return(0,u.__)("Add a title to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&t&&""===e:return(0,u.__)("Add a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&!t&&""===e:return(0,u.__)("Add a title and a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium");case n&&!t&&""!==e:return(0,u.__)("Also, add a title to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&t&&""!==e:return(0,u.__)("Also, add a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium");case!n&&!t&&""!==e:return(0,u.__)("Also, add a title and a metadescription to your post for the best internal linking suggestions.","wordpress-seo-premium")}}(t,e.hasTitle,e.hasMetaDescription)}},E=t.getUnindexedWarning=function(){var e=(0,u.__)("We need to optimize your site’s SEO data so we can offer you the best %1$slinking suggestions%2$s.\n\n%3$sStart SEO Data optimization%4$s","wordpress-seo-premium");return e=(e=(e=(e=(e=e.replace("%1$s","{{a}}")).replace("%2$s","{{/a}}")).replace("%3$s","{{startAnalysis}}")).replace("%4$s","{{/startAnalysis}}")).replace("\n\n","{{br /}}{{br /}}"),e=(0,a.default)({mixedString:e,components:{a:wp.element.createElement("a",{href:wpseoAdminL10n["shortlinks.notification_internal_link"],target:"_blank"}),startAnalysis:wp.element.createElement("button",{type:"button",className:"button",onClick:_}),br:wp.element.createElement("br",null)}}),wp.element.createElement("div",{className:"notice notice-warning notice-alt wpseo-notice-breakout-inside yoast-links-suggestions-notice"},wp.element.createElement("p",null,e))},S=function(e){if((0,o.useEffect)(function(){return e.suggester.subscribe(),function(){e.suggester.unsubscribe()}},[]),e.isLoading)return wp.element.createElement("div",{className:"yoast-link-suggestions"},wp.element.createElement("p",null,(0,u.__)("It takes a few seconds to show you a list of related content to which you could link. The suggestions will be shown here as soon as we have them.","wordpress-seo-premium")));w||((w=new ClipboardJS(".yoast-link-suggestion__copy")).on("success",v),w.on("error",h));var t=null;e.showUnindexedWarning&&(t=E());var n=r({},e.messageData,{hasWordsForLinking:Array.isArray(e.wordsForLinking)&&e.wordsForLinking.length>0}),s=k(n);return wp.element.createElement("div",{className:"yoast-link-suggestions"},t,wp.element.createElement(b,{suggestions:e.suggestions,customMessages:s,location:e.location}))};S.propTypes={suggester:s.default.object,suggestions:s.default.array.isRequired,wordsForLinking:s.default.array,messageData:s.default.object,isLoading:s.default.bool.isRequired,showUnindexedWarning:s.default.bool,location:s.default.string},S.defaultProps={suggester:null,showUnindexedWarning:!1,messageData:{hasMetaDescription:!1,hasTitle:!1},wordsForLinking:[],location:""},t.default=S},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});l(n(0));var r=l(n(4)),o=l(n(14)),s=n(2),i=n(23),a=n(11),u=n(16);function l(e){return e&&e.__esModule?e:{default:e}}var c=o.default.div.withConfig({displayName:"LinkSuggestion__LinkSuggestionWrapper",componentId:"sc-1gewdgc-0"})(["display:flex;align-items:normal;min-height:40px;margin:10px 0 5px;"]),d=(0,u.createSvgIconComponent)({copy:{viewbox:"0 0 448 512",path:"M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"},check:{viewbox:"0 0 512 512",path:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"}}),p=o.default.div.withConfig({displayName:"LinkSuggestion__LinkSuggestionDivider",componentId:"sc-1gewdgc-1"})(["background-color:#e5e5e5;width:100%;height:1px;"]),f=o.default.button.withConfig({displayName:"LinkSuggestion__LinkSuggestionIcon",componentId:"sc-1gewdgc-2"})(["box-sizing:border-box;flex:0 0 30px;height:30px;width:30px;background-color:",";border-radius:5px;cursor:pointer;outline:none;border:1px solid ",";margin-left:3px;&:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,0.8);}"],function(e){return e.iconBackground},function(e){return e.iconBorder});f.props={iconBackground:r.default.string,iconBorder:r.default.string},f.defaultProps={iconBackground:i.colors.$color_button,iconBorder:i.colors.$color_button_border};var m=o.default.div.withConfig({displayName:"LinkSuggestion__LinkContainer",componentId:"sc-1gewdgc-3"})(["flex:auto;"]),y=(0,u.makeOutboundLink)(o.default.a.withConfig({displayName:"LinkSuggestion__Link",componentId:"sc-1gewdgc-4"})(["text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;max-height:40px;margin-bottom:4px;-webkit-box-orient:vertical;overflow:hidden;padding:0 0 4px;"])),g=o.default.div.withConfig({displayName:"LinkSuggestion__BadgesWrapper",componentId:"sc-1gewdgc-5"})(["flex-wrap:wrap;display:flex;flex-direction:row;justify-content:unset;margin-top:4px;"]),w=o.default.span.withConfig({displayName:"LinkSuggestion__Badge",componentId:"sc-1gewdgc-6"})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center;padding:3px 8px;font-size:0.85em;background-color:#f3f4f5;border-radius:2px;margin-bottom:4px;margin-right:4px;text-transform:lowercase;"]),v=function(e){var t=e.badges;return wp.element.createElement(g,null,t.map(function(e,t){return wp.element.createElement(w,{key:t},e)}))};v.propTypes={badges:r.default.array.isRequired};var h=function(e){var t=e.value,n=e.url,r=e.isActive,o=e.labels,u=(0,s.__)("Copy link","wordpress-seo-premium"),l=(0,s.sprintf)((0,s.__)("Copy link to suggested article: %s","wordpress-seo-premium"),t),g="copy",w=i.colors.$color_black,h=i.colors.$color_button,b="#979797";return r&&(g="check",w=i.colors.$color_alert_success_text,h=i.colors.$color_alert_success_background,b=i.colors.$color_alert_success_background),wp.element.createElement("div",null,wp.element.createElement(p,null),wp.element.createElement(c,{className:"yoast-link-suggestion__wrapper"},wp.element.createElement(m,{className:"yoast-link-suggestion__container"},wp.element.createElement(y,{href:n},t),wp.element.createElement(v,{badges:o})),wp.element.createElement(f,{type:"button",className:"yoast-link-suggestion__copy yoast-tooltip yoast-tooltip-alt yoast-tooltip-s",onBlur:function(e){e.nativeEvent.target.setAttribute("aria-label",l),e.nativeEvent.target.setAttribute("data-label",u)},"data-clipboard-text":n,"aria-label":l,"data-label":u,iconBackground:h,iconBorder:b},wp.element.createElement(d,{icon:g,color:w}),wp.element.createElement(a.ScreenReaderText,null,u))))};h.propTypes={value:r.default.string.isRequired,url:r.default.string.isRequired,isActive:r.default.bool,labels:r.default.array.isRequired},h.defaultProps={isActive:!1},t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.SET_PROMINENT_WORDS="SET_PROMINENT_WORDS",o=t.SET_TEXT_FORMALITY_LEVEL="SET_TEXT_FORMALITY_LEVEL";t.setProminentWords=function(e){return{type:r,payload:e}},t.setTextFormalityLevel=function(e){return{type:o,payload:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setRedirectNotification=function(e){return{type:r,redirectData:e}},t.closeRedirectNotification=function(){return{type:o}};var r=t.SET_REDIRECT_NOTIFICATION="SET_REDIRECT_NOTIFICATION",o=t.CLOSE_REDIRECT_NOTIFICATION="CLOSE_REDIRECT_NOTIFICATION"},,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n",""),{a:wp.element.createElement("a",{href:t,target:"_blank"})}))))};a.propTypes={link:r.default.string.isRequired},t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(0,window.yoast.editorModules.analysis.getContentLocale)().split("_")[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("undefined"==typeof YoastSEO||void 0===YoastSEO.analysis||void 0===YoastSEO.analysis.worker)return;var r=YoastSEO.analysis.worker;r.loadScript(e).then(function(){return r.loadScript(t)}).then(function(){return r.sendMessage("initialize",{options:n},"YoastSEOPremium")})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if("undefined"==typeof YoastSEO||void 0===YoastSEO.analysis||void 0===YoastSEO.analysis.worker)return;var n=YoastSEO.analysis.worker;n.loadScript(e).then(function(){return n.loadScript(t)}).then((0,r.dispatch)("yoast-seo/editor").runAnalysis)};var r=n(5)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(45),s=n(1),i=n(9);var a=function(){var e=(0,r.dispatch)("yoast-seo-premium/editor"),t=e.setProminentWords,n=e.setTextFormalityLevel,a=(0,s.get)(window,"YoastSEO.analysis.worker.runResearch",s.noop),u=(0,s.get)(window,"YoastSEO.analysis.collectData",!1);return function(){var e=u?i.Paper.parse(u()):null;a("getProminentWordsForInsights",e).then(function(e){var t=e.result;return(0,s.reduce)(t,function(e,t){return[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t","",e),{span:wp.element.createElement(u,null)})},[e]);return wp.element.createElement("div",null,t.length<50&&wp.element.createElement("div",null,wp.element.createElement("p",null,(0,o.__)("Once you add a bit more copy, we'll be able to tell you the formality level of your text.","wordpress-seo"))),t.length>=50&&wp.element.createElement("div",null,wp.element.createElement("p",null,n)))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(n(56));t.default=(0,r.withSelect)(function(e){var t=e("yoast-seo-premium/editor"),n=t.getLinkSuggestions,r=t.getWordsForLinking,o=t.getLinkSuggestionsMessageData,s=t.linkSuggestionsAreLoading,i=t.linkSuggestionsAreUnindexed;return{suggestions:n(),wordsForLinking:r(),messageData:o(),isLoading:s(),showUnindexedWarning:i()}})(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=function(e){return e&&e.__esModule?e:{default:e}}(n(86));t.default=(0,r.withSelect)(function(e){var t=e("yoast-seo-premium/editor"),n=t.getMetaboxWarningIsLoading,r=t.getMetaboxWarning;return{isLoading:n(),warning:r()}})(o.default)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n191&&t.push((0,o.__)("Your keyphrase is too long. It can be a maximum of 191 characters.","wordpress-seo-premium")),t}(t),x=wp.element.createElement(p,{href:wpseoAdminL10n["shortlinks.focus_keyword_info"],className:"dashicons"},wp.element.createElement("span",{className:"screen-reader-text"},(0,o.__)("Help on choosing the perfect keyphrase","wordpress-seo-premium"))),N=wp.element.createElement(p,{href:wpseoAdminL10n["shortlinks.keyword_synonyms_info"],className:"dashicons"},wp.element.createElement("span",{className:"screen-reader-text"},(0,o.__)("Help on keyphrase synonyms","wordpress-seo-premium")));return wp.element.createElement(y,null,function(e){var i="metabox"===e?w:g;return wp.element.createElement(i,{title:M,subTitle:L,prefixIcon:T,prefixIconCollapsed:T,id:"yoast-additional-keyphrase-collapsible-"+P+"-"+e},wp.element.createElement(v,{id:a?"yoast-keyword-input-add-"+e:"yoast-keyword-input-"+P+"-"+e,keyword:t,onChange:n,onFocusKeyword:_,onRemoveKeyword:a?null:O,onBlurKeyword:k,label:(0,o.__)("Keyphrase","wordpress-seo-premium"),helpLink:x,hasError:j.length>0,errorMessages:j}),!a&&wp.element.createElement(r.Fragment,null,wp.element.createElement(u.SynonymsInput,{id:"yoast-synonyms-input-"+P+"-"+e,showLabel:!0,label:(0,o.__)("Synonyms","wordpress-seo-premium"),onChange:b,onBlur:S,onFocus:E,value:c,helpLink:N}),wp.element.createElement(h,null,(0,o.__)("Analysis results","wordpress-seo-premium")),wp.element.createElement(m,{showLanguageNotice:!1,marksButtonClassName:"yoast-tooltip yoast-tooltip-w",editButtonClassName:"yoast-tooltip yoast-tooltip-w",marksButtonStatus:A,results:s,keywordKey:P,location:e})))})}b.propTypes={keyword:i.default.string.isRequired,onChange:i.default.func.isRequired,synonyms:i.default.string,onChangeSynonyms:i.default.func,onRemoveKeyword:i.default.func.isRequired,onFocusKeyword:i.default.func.isRequired,onBlurKeyword:i.default.func.isRequired,onBlurSynonym:i.default.func.isRequired,onFocusSynonym:i.default.func.isRequired,analysis:i.default.array,isAddKeyword:i.default.bool,score:i.default.number,marksButtonStatus:i.default.string,keywordKey:i.default.string.isRequired},b.defaultProps={synonyms:"",onChangeSynonyms:s.noop,analysis:[],isAddKeyword:!1,score:0,marksButtonStatus:"enabled"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(20),s=function(e){return e&&e.__esModule?e:{default:e}}(n(92));var i=window.yoast.editorModules.containers.SEMrushRelatedKeyphrases;t.default=(0,o.compose)([(0,r.withSelect)(function(e){return{keyphrase:e("yoast-seo/editor").getFocusKeyphrase(),relatedKeyphrases:e("yoast-seo-premium/editor").getKeywords(),renderAction:function(e,t){return wp.element.createElement(s.default,{relatedKeyphrase:e,relatedKeyphrases:t})}}})])(i)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEMrushRelatedKeyphraseControls=void 0;var r=function(){function e(e,t){for(var n=0;n=4}},{key:"addKeyphraseToList",value:function(){""===this.getAssociatedKeyphraseKey(this.props.relatedKeyphrases,this.props.relatedKeyphrase)&&this.props.addKeyphrase(this.props.relatedKeyphrase)}},{key:"removeKeyphraseFromList",value:function(){var e=this.getAssociatedKeyphraseKey(this.props.relatedKeyphrases,this.props.relatedKeyphrase);""!==e&&this.props.removeKeyphrase(e)}},{key:"componentDidUpdate",value:function(e){var t=this.keyphraseExists(this.props.relatedKeyphrases,this.props.relatedKeyphrase),n=this.keyphraseExists(e.relatedKeyphrases,e.relatedKeyphrase);t&&!n&&this.removeLinkRef.current.focus(),!t&&n&&this.addButtonRef.current.focus()}},{key:"render",value:function(){var e=this.props.relatedKeyphrase,t=this.props.relatedKeyphrases;return t&&this.keyphraseExists(t,e)?wp.element.createElement(s.Fragment,null,wp.element.createElement("span",{className:"yoast-modal__settings-saved"},(0,i.__)("Added!","wordpress-seo-premium")),wp.element.createElement(l.default,{ref:this.removeLinkRef,onRemove:this.removeKeyphraseFromList})):wp.element.createElement(c.default,{buttonRef:this.addButtonRef,disabled:this.relatedKeyphrasesLimitReached(),onAdd:this.addKeyphraseToList})}}]),t}();p.propTypes={relatedKeyphrase:u.default.string,relatedKeyphrases:u.default.array,addKeyphrase:u.default.func.isRequired,removeKeyphrase:u.default.func.isRequired},p.defaultProps={relatedKeyphrase:"",relatedKeyphrases:[]},t.SEMrushRelatedKeyphraseControls=p,t.default=(0,o.withDispatch)(function(e){var t=e("yoast-seo-premium/editor");return{addKeyphrase:t.addRelatedKeyword,removeKeyphrase:t.removeRelatedKeyword}})(p)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(3);t.default=(0,o.forwardRef)(function(e,t){return wp.element.createElement("button",{ref:t,className:"yoast-remove",onClick:e.onRemove},(0,r.__)("Remove","wordpress-seo-premium"))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=function(e){return e&&e.__esModule?e:{default:e}}(n(4)),s=n(11);var i=function(e){return wp.element.createElement(s.NewButton,{variant:"secondary",small:!0,buttonRef:e.buttonRef,onClick:e.onAdd,disabled:e.disabled},(0,r.__)("Add as related keyphrase","wordpress-seo-premium"))};i.propTypes={buttonRef:o.default.object,onAdd:o.default.func.isRequired,disabled:o.default.bool},i.defaultProps={buttonRef:null,disabled:!1},t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(20),s=n(11);t.default=(0,o.compose)([(0,r.withSelect)(function(e){return{value:(0,e("yoast-seo-premium/editor").getSynonyms)()}}),(0,r.withDispatch)(function(e){var t=e("yoast-seo/editor").setMarkerPauseStatus,n=e("yoast-seo-premium/editor").setSynonyms;return{onChange:function(e){n(e.target.value)},onFocus:function(){t(!0)},onBlur:function(){t(!1)}}})])(s.SynonymsInput)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=t.type,r=t.payload;switch(n){case o.SET_PROMINENT_WORDS:return r;default:return e}},textFormalityLevel:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments[1],n=t.type,r=t.payload;switch(n){case o.SET_TEXT_FORMALITY_LEVEL:return r;default:return e}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(28),o={suggestions:[],messageData:{hasMetaDescription:!1,hasTitle:!1},wordsForLinking:null,isLoading:!0,showUnindexedWarning:!1};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case r.LOAD_LINK_SUGGESTIONS:return Object.assign({},e,{isLoading:!0});case r.SET_LINK_SUGGESTIONS:return Object.assign({},e,{suggestions:t.linkSuggestions||[],isLoading:!1,showUnindexedWarning:t.showUnindexedWarning});case r.SET_MESSAGE_DATA:return Object.assign({},e,{messageData:{hasMetaDescription:t.messageData.hasMetaDescription,hasTitle:t.messageData.hasTitle},wordsForLinking:t.messageData.prominentWords});case r.SET_WORDS_FOR_LINKING:return Object.assign({},e,{wordsForLinking:t.wordsForLinking});default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(47),o={isLoading:!1,warning:[]};t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,t=arguments[1];switch(t.type){case r.LOAD_MORPHOLOGY_DATA:return Object.assign({},e,{isLoading:!0});case r.LOAD_MORPHOLOGY_DATA_ERROR:return Object.assign({},e,{isLoading:!1,warning:t.message});default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.default=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isProminentWordsAvailable:(0,r.get)(window,"wpseoPremiumMetaboxData.data.isProminentWordsAvailable",!1)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments[1];switch(t.type){case o.SET_REDIRECT_NOTIFICATION:return r({},e,{redirectData:t.redirectData,isOpen:!0});case o.CLOSE_REDIRECT_NOTIFICATION:return r({},e,{redirectData:{},isOpen:!1});default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];return{availableKeys:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments[1],n=void 0;switch(t.type){case s.SET_RELATED_KEYWORDS:return n=u.length-t.keywords.length,(0,o.takeRight)(e,n);case s.ADD_RELATED_KEYWORD:return(0,o.tail)(e);case s.REMOVE_RELATED_KEYWORD:return[t.key].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&void 0!==arguments[0]?arguments[0]:a,t=arguments[1],n=arguments[2];switch(t.type){case s.SET_RELATED_KEYWORDS:return(0,o.fromPairs)(t.keywords.map(function(e,t){var n=u[t];return[n,r({},e,{key:n})]}));case s.ADD_RELATED_KEYWORD:return r({},e,i({},n,{key:n,keyword:t.keyword}));case s.REMOVE_RELATED_KEYWORD:return(0,o.pickBy)(e,function(e){return e.key!==t.key});case s.CHANGE_RELATED_KEYWORD:return r({},e,i({},t.key,r({},e[t.key],{keyword:t.keyword})));case s.SET_RELATED_KEYWORD_RESULTS:return e[t.key]&&e[t.key].keyword===t.keyword?r({},e,i({},t.key,r({},e[t.key],{results:t.results,score:t.score}))):e;case s.SET_RELATED_KEYWORD_SYNONYMS:return r({},e,i({},t.key,r({},e[t.key],{synonyms:t.synonyms})))}return e}(e.keywords,t,(0,o.head)(e.availableKeys))}};var o=n(1),s=n(35);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a={},u=["a","b","c","d"]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1];if(t.type===r.SET_SYNONYMS)return t.synonyms;return e};var r=n(48)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(107);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(108);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var s=n(109);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var i=n(110);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var a=n(111);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var u=n(112);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}})});var l=n(113);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTextFormalityLevel=t.getProminentWords=void 0;var r=n(1),o=[];t.getProminentWords=function(e){return(0,r.get)(e,"insights.prominentWords",o)},t.getTextFormalityLevel=function(e){return(0,r.get)(e,"insights.textFormalityLevel",null)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLinkSuggestions=function(e){return(0,r.get)(e,["linkSuggestions","suggestions"],o)},t.linkSuggestionsAreLoading=function(e){return(0,r.get)(e,["linkSuggestions","isLoading"],!0)},t.linkSuggestionsAreUnindexed=function(e){return(0,r.get)(e,["linkSuggestions","showUnindexedWarning"],!1)},t.getWordsForLinking=function(e){return(0,r.get)(e,["linkSuggestions","wordsForLinking"],null)},t.getLinkSuggestionsMessageData=function(e){return(0,r.get)(e,["linkSuggestions","messageData"],{hasMetaDescription:!1,hasTitle:!1})};var r=n(1),o=[]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMetaboxWarningIsLoading=function(e){return(0,r.get)(e,"metaboxWarning.isLoading",!0)},t.getMetaboxWarning=function(e){return(0,r.get)(e,"metaboxWarning.warning","")};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPreferences=t.getPreference=void 0;var r=n(1);t.getPreference=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,r.get)(e,"preferences."+t,n)},t.getPreferences=function(e){return e.preferences}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRedirectData=function(e){return(0,r.get)(e,"redirectNotification.redirectData",{})},t.getIsRedirectNotificationOpen=function(e){return(0,r.get)(e,"redirectNotification.isOpen",!1)};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getKeywordData=function(e,t){return(0,r.get)(e,["relatedKeywords","keywords",t],{keyword:"",analysis:[],score:0,synonyms:""})},t.getKeywords=function(e){return Object.values((0,r.get)(e,["relatedKeywords","keywords"],{}))},t.getFirstAvailableKey=function(e){return(0,r.head)((0,r.get)(e,["relatedKeywords","availableKeys"],[]))||""};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSynonyms=function(e){return(0,r.get)(e,["synonyms"],"")};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n0){var r=e.formatLinkSuggestions(e.linkSuggestions);e.setLinkingSuggestionsOnStore(r)}})}},{key:"markUsedLinks",value:function(e){var t=this.usedLinks||[];return e.forEach(function(e){e.active=t.includes(e.link)}),e}}],[{key:"mapSuggestionsForStore",value:function(e){return e.map(function(e){return{value:e.title,url:e.link,isActive:e.active,labels:e.labels}})}}]),e}();t.default=a},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(r=(i=a.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,s=e}finally{try{!r&&a.return&&a.return()}finally{if(o)throw s}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=n(13),s=n(3),i=n(2),a=n(45),u=n(1),l=x(n(4)),c=n(14),d=x(n(78)),p=x(n(46)),f=x(n(79)),m=x(n(80)),y=x(n(81)),g=x(n(82)),w=x(n(83)),v=n(28),h=n(47),b=n(35),_=n(48),k=x(n(84)),E=x(n(85)),S=x(n(87)),O=x(n(91)),A=x(n(95)),P=x(n(96)),R=x(n(114)),M=x(n(115)),L=x(n(167)),T=x(n(70)),j=n(17);function x(e){return e&&e.__esModule?e:{default:e}}var N=window.yoast.editorModules.helpers.isBlockEditor,I=window.yoast.editorModules.helpers.i18n.setTextdomainL10n,D=window.yoast.editorModules.components.SidebarItem,K=window.yoast.editorModules.components.higherorder.withYoastSidebarPriority,C=window.yoast.editorModules.analysis.getL10nObject,U=window.yoast.editorModules.components.HelpLink,F=window.yoast.editorModules.components.TopLevelProviders,W=window.yoast.editorModules.components.SidebarCollapsible,Y=window.yoast.editorModules.components.MetaboxCollapsible,G=(0,u.get)(window,"wpseoPremiumMetaboxData.data",{});I("wordpress-seo-premium","wpseoPremiumJSL10n");var B=function(){return!!wpseoScriptData.isTerm},q=function(){return G.seoAnalysisEnabled},z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{return JSON.parse(e)}catch(e){return t}},V=K(function(e){var t=e.store,n=e.theme,r=e.location;return wp.element.createElement(F,{store:t,theme:n,location:r},wp.element.createElement(S.default,null))});V.propTypes={store:l.default.object.isRequired,theme:l.default.object.isRequired,renderPriority:l.default.number.isRequired};var H=function(e){var t=e.theme,n=wp.element.createElement(U,{href:wpseoAdminL10n["shortlinks.keyword_synonyms_info"],className:"dashicons"},wp.element.createElement("span",{className:"screen-reader-text"},(0,i.__)("Help on keyphrase synonyms","wordpress-seo-premium")));return wp.element.createElement(c.ThemeProvider,{theme:t},wp.element.createElement(s.Fragment,null,wp.element.createElement(o.Fill,{name:"yoast-synonyms-metabox"},wp.element.createElement(A.default,{id:"synonyms-input-metabox",label:(0,i.__)("Keyphrase synonyms","wordpress-seo-premium"),helpLink:n})),wp.element.createElement(o.Fill,{name:"yoast-synonyms-sidebar"},wp.element.createElement(A.default,{id:"synonyms-input-sidebar",label:(0,i.__)("Keyphrase synonyms","wordpress-seo-premium"),helpLink:n}))))};H.propTypes={theme:l.default.object.isRequired};var $=K(function(e){var t=e.theme;return wp.element.createElement(c.ThemeProvider,{theme:t},wp.element.createElement(E.default,null))}),Q=function(e){var t=(0,f.default)();if(yoast.analysis.helpers.getLanguagesWithWordFormSupport().includes(t)){var n=e.dispatch.bind(e);n((0,h.loadMorphologyData)());new L.default({siteUrl:G.licensedURL,language:t,setError:function(e){n((0,h.setLoadMorphologyDataError)(e))}}).injectMorphologyData()}},J=function(e){var t=e.dispatch.bind(e);t((0,v.loadLinkSuggestions)());var n=new M.default({dispatch:t,rootUrl:(0,u.get)(G,"restApi.root",""),nonce:(0,u.get)(G,"restApi.nonce",""),currentObjectId:G.currentObjectId,currentObjectType:G.currentObjectType,showUnindexedWarning:G.linkSuggestionsUnindexed,maxWordsToSave:G.perIndexableLimit});return YoastSEO.analysis.linkSuggester=n,function(e){var t=document.getElementById("yoast_internal_linking");if(t){jQuery(t).addClass("closed");var n=function(e){var n=e.children,o=(0,s.useState)(jQuery(t).hasClass("closed")),i=r(o,2),a=i[0],u=i[1];return(0,s.useEffect)(function(){var e=function(){u(jQuery(t).hasClass("closed"))};return jQuery(t).find("div.postbox-header").on("click",e),function(){jQuery(t).find("div.postbox-header").off("click",e)}},[]),jQuery(t).find("button.handlediv").on("click",function(){u(jQuery(t).hasClass("closed"))}),wp.element.createElement(s.Fragment,null,!a&&n)};n.propTypes={children:l.default.node.isRequired},(0,s.render)(wp.element.createElement(n,null,wp.element.createElement(k.default,{suggester:e,location:"classic-sidebar"})),t.getElementsByClassName("inside")[0])}}(n),n},X=function(){var e=(0,P.default)();e.dispatch(j.pluginUrlActions.setPluginUrl((0,u.get)(window,"wpseoPremiumMetaboxData.data.pluginUrl",""))),function(e){var t=e.dispatch,n=B()?"hidden_wpseo":"yoast_wpseo",r=document.getElementById(n+"_focuskeywords"),o=document.getElementById(n+"_keywordsynonyms"),s=z(r.value),i=z(o.value),a=i.shift()||"",u=s.map(function(e,t){var n=i[t];return{keyword:e.keyword,score:e.score,synonyms:n}});t((0,b.setRelatedKeywords)(u)),t((0,_.setSynonyms)(a))}(e);var t=e.getState(),n=t.synonyms,r=T.default.getRelevantData(t);(0,g.default)();var l=null;(0,p.default)()&&(l=J(e));var c=new R.default,f=new T.default;q()&&jQuery(window).on("YoastSEO:numericScore",function(){f.analyze(e.getState(),e.dispatch)}),e.subscribe(function(){var t=e.getState();n!==t.synonyms&&(n=t.synonyms,YoastSEO.app.refresh()),c.persist(t);var o=T.default.getRelevantData(t);T.default.shouldAnalyze(o,r)&&(r=o,f.analyze(t,e.dispatch))}),YoastSEO.app.registerCustomDataCallback(function(){return{synonyms:e.getState().synonyms}}),function(e,t){var n={isRtl:C().isRtl};N()?(0,wp.plugins.registerPlugin)("yoast-seo-premium",{render:function(){return wp.element.createElement(s.Fragment,null,wp.element.createElement(o.Fill,{name:"YoastSidebar"},wp.element.createElement($,{key:"warning-premium",renderPriority:1,store:e,theme:n}),q()&&wp.element.createElement(V,{key:"related-keywords",renderPriority:22,store:e,theme:n,location:"sidebar"}),(0,p.default)()&&t&&wp.element.createElement(D,{key:"link-suggestions",renderPriority:24},wp.element.createElement(F,{store:e,theme:n,location:"sidebar"},wp.element.createElement(W,{id:"yoast-linking-suggestions-collapsible-sidebar",title:(0,i.__)("Internal linking suggestions","wordpress-seo-premium")},wp.element.createElement(k.default,{suggester:t,location:"block-sidebar"}))))),wp.element.createElement(o.Fill,{name:"YoastMetabox"},q()&&wp.element.createElement(V,{key:"related-keywords",renderPriority:21,store:e,theme:n,location:"metabox"}),wp.element.createElement($,{renderPriority:1,store:e,theme:n}),(0,p.default)()&&t&&wp.element.createElement(D,{key:"link-suggestions",renderPriority:25},wp.element.createElement(F,{store:e,theme:n,location:"metabox"},wp.element.createElement(Y,{id:"yoast-linking-suggestions-collapsible-metabox",title:(0,i.__)("Internal linking suggestions","wordpress-seo-premium")},wp.element.createElement(k.default,{suggester:t,location:"block-metabox"}))))),wp.element.createElement(H,{store:e,theme:n}),wp.element.createElement(o.Fill,{name:"YoastRelatedKeyphrases"},wp.element.createElement(O.default,null)),(0,a.isFeatureEnabled)("TEXT_FORMALITY")&&wp.element.createElement(o.Fill,{name:"YoastTextFormalityMetabox"},wp.element.createElement(w.default,null)),(0,a.isFeatureEnabled)("TEXT_FORMALITY")&&wp.element.createElement(o.Fill,{name:"YoastTextFormalitySidebar"},wp.element.createElement(w.default,null)),!!G.workoutsUrl&&wp.element.createElement(d.default,{link:G.workoutsUrl}))}}):YoastSEO._registerReactComponent("yoast-seo-premium",function(){return wp.element.createElement(s.Fragment,null,wp.element.createElement(o.Fill,{name:"YoastMetabox"},q()&&wp.element.createElement(V,{key:"related-keywords",renderPriority:21,store:e,theme:n,location:"metabox"}),wp.element.createElement($,{key:"warning-premium",renderPriority:1,store:e,theme:n}),(0,p.default)()&&t&&!B()&&wp.element.createElement(D,{key:"link-suggestions",renderPriority:25},wp.element.createElement(F,{store:e,theme:n,location:"metabox"},wp.element.createElement(Y,{id:"yoast-linking-suggestions-collapsible-classic-metabox",title:(0,i.__)("Internal linking suggestions","wordpress-seo-premium")},wp.element.createElement(k.default,{suggester:t,location:"classic-metabox"}))))),wp.element.createElement(H,{store:e,theme:n}),wp.element.createElement(o.Fill,{name:"YoastRelatedKeyphrases"},wp.element.createElement(O.default,{store:e})),(0,a.isFeatureEnabled)("TEXT_FORMALITY")&&wp.element.createElement(o.Fill,{name:"YoastTextFormalityMetabox"},wp.element.createElement(w.default,null)),!!G.workoutsUrl&&wp.element.createElement(d.default,{link:G.workoutsUrl}))})}(e,l),Q(e),YoastSEO.app.refresh()};window.jQuery(function(){window.jQuery(window).on("YoastSEO:ready",function(){if(window.wpseoPremiumMetaboxData)try{X(),function(e){YoastSEO.analysis.worker.initialize({translations:e})}(window.wpseoPremiumJSL10n),(0,a.isFeatureEnabled)("TEXT_FORMALITY")&&(0,y.default)(window.wpseoPremiumMetaboxData.data.commonsScriptUrl,window.wpseoPremiumMetaboxData.data.textFormalityScriptUrl),(0,m.default)(window.wpseoPremiumMetaboxData.data.commonsScriptUrl,window.wpseoPremiumMetaboxData.data.premiumAssessmentsScriptUrl,{isTitleAssessmentAvailable:window.wpseoPremiumMetaboxData.data.isTitleAssessmentAvailable,isTextAlignmentAssessmentAvailable:N(),language:(0,f.default)()})}catch(e){console.error(e)}})})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n-1&&i()})})},24:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ALLOW_EMPTY_TARGET=void 0,t.wpseoDeleteRedirect=r,t.wpseoUndoRedirectForObject=i,t.wpseoRemoveNotification=d,t.wpseoUndoRedirect=function(e,t,o,n,i){r(e,t,o).then(function(e){!0===e.success&&d(i)})},t.wpseoUndoRedirectByObjectId=function(e,t,o){i(e,t).then(function(e){!0===e.success&&d(o)})},t.wpseoCreateRedirect=function(e,t,o,n){var r="";if(410!==parseInt(t,10)&&""===(r=window.prompt(wpseoPremiumStrings.enter_new_url.replace("%s",e))))return void window.alert(wpseoPremiumStrings.error_new_url);jQuery.post(ajaxurl,{action:"wpseo_add_redirect_plain",ajax_nonce:o,redirect:{origin:e,target:r,type:t}},function(e){var o=jQuery(n).closest(".yoast-notification");if(jQuery(o).removeClass("updated").removeClass("error"),jQuery(o).find(".redirect_error").remove(),e.error)jQuery(o).addClass("error").prepend(''+e.error.message+"
");else{var r="";r=(r=410===parseInt(t,10)?_.escape(wpseoPremiumStrings.redirect_saved_no_target):wpseoPremiumStrings.redirect_saved.replace("%2$s",""+_.escape(e.target)+"")).replace("%1$s",""+_.escape(e.origin)+""),jQuery(o).addClass("updated").html(""+r+"
")}},"json")};var n=function(e){return e&&e.__esModule?e:{default:e}}(o(10));t.ALLOW_EMPTY_TARGET=[410,451];function r(e,t,o){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"plain";return(0,n.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/delete",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{origin:e,target:t,type:o,format:r}})}function i(e,t){return(0,n.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/undo-for-object",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{obj_id:e,obj_type:t}})}function d(e){jQuery(e).closest(".yoast-notification").fadeOut("slow")}}},[[160,0]]]);
\ No newline at end of file
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-redirect-notifications-2200.min.js b/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-redirect-notifications-2200.min.js
deleted file mode 100644
index 27cccc80..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-redirect-notifications-2200.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(window.yoastPremiumWebpackJsonp=window.yoastPremiumWebpackJsonp||[]).push([[6],{10:function(e,t){e.exports=window.wp.apiFetch},161:function(e,t,o){"use strict";var r=o(24);window.wpseoUndoRedirect=r.wpseoUndoRedirect,window.wpseoUndoRedirectByObjectId=r.wpseoUndoRedirectByObjectId,window.wpseoCreateRedirect=r.wpseoCreateRedirect,window.wpseoDeleteRedirect=r.wpseoDeleteRedirect,window.wpseoRemoveNotification=r.wpseoRemoveNotification},24:function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ALLOW_EMPTY_TARGET=void 0,t.wpseoDeleteRedirect=i,t.wpseoUndoRedirectForObject=n,t.wpseoRemoveNotification=s,t.wpseoUndoRedirect=function(e,t,o,r,n){i(e,t,o).then(function(e){!0===e.success&&s(n)})},t.wpseoUndoRedirectByObjectId=function(e,t,o){n(e,t).then(function(e){!0===e.success&&s(o)})},t.wpseoCreateRedirect=function(e,t,o,r){var i="";if(410!==parseInt(t,10)&&""===(i=window.prompt(wpseoPremiumStrings.enter_new_url.replace("%s",e))))return void window.alert(wpseoPremiumStrings.error_new_url);jQuery.post(ajaxurl,{action:"wpseo_add_redirect_plain",ajax_nonce:o,redirect:{origin:e,target:i,type:t}},function(e){var o=jQuery(r).closest(".yoast-notification");if(jQuery(o).removeClass("updated").removeClass("error"),jQuery(o).find(".redirect_error").remove(),e.error)jQuery(o).addClass("error").prepend(''+e.error.message+"
");else{var i="";i=(i=410===parseInt(t,10)?_.escape(wpseoPremiumStrings.redirect_saved_no_target):wpseoPremiumStrings.redirect_saved.replace("%2$s",""+_.escape(e.target)+"")).replace("%1$s",""+_.escape(e.origin)+""),jQuery(o).addClass("updated").html(""+i+"
")}},"json")};var r=function(e){return e&&e.__esModule?e:{default:e}}(o(10));t.ALLOW_EMPTY_TARGET=[410,451];function i(e,t,o){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"plain";return(0,r.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/delete",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{origin:e,target:t,type:o,format:i}})}function n(e,t){return(0,r.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/undo-for-object",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{obj_id:e,obj_type:t}})}function s(e){jQuery(e).closest(".yoast-notification").fadeOut("slow")}}},[[161,0]]]);
\ No newline at end of file
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-redirect-notifications-gutenberg-2200.min.js b/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-redirect-notifications-gutenberg-2200.min.js
deleted file mode 100644
index 6b1a2e73..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/wp-seo-premium-redirect-notifications-gutenberg-2200.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(window.yoastPremiumWebpackJsonp=window.yoastPremiumWebpackJsonp||[]).push([[7],{0:function(e,t){e.exports=React},10:function(e,t){e.exports=window.wp.apiFetch},13:function(e,t){e.exports=window.wp.components},16:function(e,t){e.exports=window.yoast.helpers},162:function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{default:e}}(n(163));wp.plugins.registerPlugin("yoast-redirect-notification",{render:r.default})},163:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n'+e.error.message+"");else{var o="";o=(o=410===parseInt(t,10)?_.escape(wpseoPremiumStrings.redirect_saved_no_target):wpseoPremiumStrings.redirect_saved.replace("%2$s",""+_.escape(e.target)+"")).replace("%1$s",""+_.escape(e.origin)+""),jQuery(n).addClass("updated").html(""+o+"
")}},"json")};var r=function(e){return e&&e.__esModule?e:{default:e}}(n(10));t.ALLOW_EMPTY_TARGET=[410,451];function o(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"plain";return(0,r.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/delete",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{origin:e,target:t,type:n,format:o}})}function i(e,t){return(0,r.default)({method:"POST",url:wpApiSettings.root+"yoast/v1/redirects/undo-for-object",headers:{"X-WP-Nonce":wpApiSettings.nonce},data:{obj_id:e,obj_type:t}})}function a(e){jQuery(e).closest(".yoast-notification").fadeOut("slow")}},25:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=s(n(0)),i=s(n(38)),a=s(n(41));function s(e){return e&&e.__esModule?e:{default:e}}var c=void 0;function u(e,t){var n,a,s,l,p,d,f,m,h=[],y={};for(d=0;d "+c);if("componentClose"===p.type)throw new Error("Missing opening component token: `"+p.value+"`");if("componentOpen"===p.type){n=t[p.value],s=d;break}h.push(t[p.value])}else h.push(p.value);return n&&(l=function(e,t){var n,r,o=t[e],i=0;for(r=e+1;r",lasttranslator:"Yoast Translate Team "},repository:{type:"git",url:"https://github.com/Yoast/wordpress-seo-premium"},scripts:{test:"jest",build:"NODE_ENV=production webpack --config ./config/webpack/webpack.config.dev.js --progress --display-error-details","build:css":"cross-env NODE_ENV=production postcss assets/css/dist/*.css --verbose --replace","build:css:dev":"cross-env NODE_ENV=development postcss assets/css/dist/*.css --verbose --replace",start:"webpack-dev-server --config ./config/webpack/webpack.config.dev.js --progress --env.environment=development --port=8081","webpack-analyze-bundle":"cross-env BUNDLE_ANALYZER=1 NODE_ENV=production webpack --config ./config/webpack/webpack.config.prod.js --progress",postinstall:"patch-package"},devDependencies:{"@draft-js-plugins/emoji":"^4.6.1","@tailwindcss/forms":"^0.5.3","@testing-library/jest-dom":"^6.1.3","@testing-library/react":"^14.0.0","@testing-library/react-hooks":"^8.0.1","@types/react":"^18.2.46","@types/wordpress__blocks":"^12.5.13","@wordpress/babel-plugin-makepot":"^2.0.1","@wordpress/block-editor":"^12.16.0","@wordpress/dependency-extraction-webpack-plugin":"^2.9.0","@yoast/components":"link:vendor/yoast/wordpress-seo/packages/components","@yoast/feature-flag":"^0.5.2","@yoast/grunt-plugin-tasks":"^2.4","@yoast/helpers":"link:vendor/yoast/wordpress-seo/packages/helpers","@yoast/postcss-preset":"link:vendor/yoast/wordpress-seo/packages/postcss-preset","@yoast/style-guide":"link:vendor/yoast/wordpress-seo/packages/style-guide","@yoast/tailwindcss-preset":"link:vendor/yoast/wordpress-seo/packages/tailwindcss-preset","babel-cli":"^6.26.0","babel-core":"^6.13.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-plugin-transform-react-jsx":"^6.24.1","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.13.2","babel-preset-react":"^6.11.1","case-sensitive-paths-webpack-plugin":"^2.1.2","cross-env":"^7.0.2","css-loader":"3.6.0",dotenv:"^8.2.0",envify:"^3.4.1",eslint:"^6.6.0","find-with-regex":"~1.0.2","grunt-git":"^1.0.14","grunt-po2json":"^0.3.0","grunt-webpack":"^3.1.3",jest:"^23.3.0","jest-styled-components":"^7.0.3","patch-package":"^6.4.7",postcss:"^8.4.24","postcss-cli":"^10.1.0","postinstall-postinstall":"^2.1.0","prop-types":"^15.7.2","readline-sync":"^1.4.10","style-loader":"2.0.0","styled-components":"^5.3.6",tailwindcss:"^3.3.2","ts-loader":"^8.0.17",typescript:"^4.2.2",webpack:"^4.20.2","webpack-bundle-analyzer":"^4.2.0","webpack-cli":"^3.1.2","webpack-dev-server":"^3.1.14"},dependencies:{"@headlessui/react":"^1.6.5","@heroicons/react":"^1.0.6","@reduxjs/toolkit":"^1.9.5","@yoast/social-metadata-previews":"link:vendor/yoast/wordpress-seo/packages/social-metadata-previews","a11y-speak":"github:yoast/a11y-speak","babel-loader":"^7.1.5","babel-plugin-dynamic-import-webpack":"^1.1.0","babel-polyfill":"^6.16.0",classnames:"^2.3.2","concat-map":"^0.0.1","grunt-glotpress":"https://github.com/Yoast/grunt-glotpress.git#translationspress","interpolate-components":"^1.1.0",lodash:"^4.7.0","react-json-view":"^1.21.3","react-select":"^5.8.0",sassdash:"^0.9.0",yoastseo:"link:vendor/yoast/wordpress-seo/packages/yoastseo"},resolutions:{yoastseo:"link:vendor/yoast/wordpress-seo/packages/yoastseo","../yoastseo":"link:vendor/yoast/wordpress-seo/packages/yoastseo","@yoast/search-metadata-previews":"link:vendor/yoast/wordpress-seo/packages/search-metadata-previews","@yoast/ui-library":"link:vendor/yoast/wordpress-seo/packages/ui-library"},browserslist:["extends @yoast/browserslist-config"],yoast:{pluginVersion:"22.0"}}},53:function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.compressWordsForLinking=function(e){var s={};return e.forEach(function(e){s[e.getStem()]=e.getOccurrences()}),s}},54:function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.determineMorphologyRequestUrl=function(e){var s={en:"v5",de:"v10",es:"v10",fr:"v11",it:"v10",nl:"v9",ru:"v10",id:"v9",pt:"v9",pl:"v9",ar:"v9",sv:"v1",he:"v1",hu:"v2",nb:"v1",tr:"v1",cs:"v1",sk:"v1",el:"v1",ja:"v1"};if(!Object.keys(s).includes(e))return!1;return"https://my.yoast.com/api/downloads/file/morphology-"+e+"-"+s[e]}},9:function(e,s){e.exports=window.yoast.analysis}},[[149,0]]]);
\ No newline at end of file
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/yoast-premium-social-metadata-previews-2200.min.js b/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/yoast-premium-social-metadata-previews-2200.min.js
deleted file mode 100644
index 82538c85..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/yoast-premium-social-metadata-previews-2200.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(window.yoastPremiumWebpackJsonp=window.yoastPremiumWebpackJsonp||[]).push([[2],{13:function(e,a){e.exports=window.wp.components},151:function(e,a,i){"use strict";var t=i(152),l=i(13),r=i(3),n=c(i(153)),o=c(i(154));function c(e){return e&&e.__esModule?e:{default:e}}var s=window.yoast.editorModules.helpers.isBlockEditor,u=function(){return wp.element.createElement(r.Fragment,null,wp.element.createElement(l.Fill,{name:"YoastFacebookPremiumMetabox"},function(e){return wp.element.createElement(n.default,e)}),wp.element.createElement(l.Fill,{name:"YoastFacebookPremiumModal"},function(e){return wp.element.createElement(n.default,e)}),wp.element.createElement(l.Fill,{name:"YoastTwitterPremiumMetabox"},function(e){return wp.element.createElement(o.default,e)}),wp.element.createElement(l.Fill,{name:"YoastTwitterPremiumModal"},function(e){return wp.element.createElement(o.default,e)}))};jQuery(window).on("YoastSEO:ready",function(){s()?(0,t.registerPlugin)("yoast-seo-premium-social-previews",{render:u}):YoastSEO._registerReactComponent("yoast-seo-premium-social-previews",u)})},152:function(e,a){e.exports=window.wp.plugins},153:function(e,a,i){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var t=i(2),l=i(34),r=function(e){return e&&e.__esModule?e:{default:e}}(i(4));var n=window.yoast.editorModules.helpers.replacementVariableHelpers.applyReplaceUsingPlugin,o=function(e){var a=e.recommendedReplacementVariables,i=e.replacementVariables,r=e.description,o=e.descriptionInputPlaceholder,c=e.title,s=e.titleInputPlaceholder,u=e.onSelectImageClick,d=e.onRemoveImageClick,m=e.onDescriptionChange,p=e.onTitleChange,g=e.onReplacementVariableSearchChange,f=e.imageWarnings,w=e.imageUrl,b=e.imageFallbackUrl,P=e.isPremium,h=e.siteUrl,v=e.descriptionPreviewFallback,R=e.titlePreviewFallback,k=e.location,C=e.activeMetaTabId,I=e.alt,F=(0,t.__)("Social share preview","wordpress-seo-premium");return wp.element.createElement(l.SocialPreviewEditor,{socialMediumName:"Social",isPremium:P,recommendedReplacementVariables:a,replacementVariables:i,description:r,descriptionInputPlaceholder:o,descriptionPreviewFallback:v,title:c,titleInputPlaceholder:s,titlePreviewFallback:R,onSelectImageClick:u,onRemoveImageClick:d,onDescriptionChange:m,onTitleChange:p,imageWarnings:f,imageUrl:w,imageFallbackUrl:b,siteUrl:h,applyReplacementVariables:n,onReplacementVariableSearchChange:g,socialPreviewLabel:F,idSuffix:k,activeMetaTabId:C,alt:I})};o.propTypes={recommendedReplacementVariables:r.default.array.isRequired,replacementVariables:r.default.array.isRequired,description:r.default.string,title:r.default.string,onSelectImageClick:r.default.func.isRequired,onRemoveImageClick:r.default.func.isRequired,onDescriptionChange:r.default.func.isRequired,onTitleChange:r.default.func.isRequired,onReplacementVariableSearchChange:r.default.func,imageWarnings:r.default.array,imageUrl:r.default.string.isRequired,imageFallbackUrl:r.default.string.isRequired,isPremium:r.default.bool.isRequired,siteUrl:r.default.string,descriptionInputPlaceholder:r.default.string,titleInputPlaceholder:r.default.string,descriptionPreviewFallback:r.default.string,titlePreviewFallback:r.default.string,location:r.default.string,activeMetaTabId:r.default.string,alt:r.default.string},o.defaultProps={imageWarnings:[],title:null,titleInputPlaceholder:"",description:null,descriptionInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",siteUrl:"",location:"",activeMetaTabId:"",alt:"",onReplacementVariableSearchChange:null},a.default=o},154:function(e,a,i){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var t=i(2),l=i(34),r=function(e){return e&&e.__esModule?e:{default:e}}(i(4));var n=window.yoast.editorModules.helpers.replacementVariableHelpers.applyReplaceUsingPlugin,o=function(e){var a=e.recommendedReplacementVariables,i=e.replacementVariables,r=e.description,o=e.descriptionInputPlaceholder,c=e.title,s=e.titleInputPlaceholder,u=e.onSelectImageClick,d=e.onRemoveImageClick,m=e.onDescriptionChange,p=e.onTitleChange,g=e.onReplacementVariableSearchChange,f=e.imageWarnings,w=e.imageUrl,b=e.imageFallbackUrl,P=e.isPremium,h=e.isLarge,v=e.siteUrl,R=e.descriptionPreviewFallback,k=e.titlePreviewFallback,C=e.location,I=e.alt,F=(0,t.__)("Twitter share preview","wordpress-seo-premium");return wp.element.createElement(l.SocialPreviewEditor,{socialMediumName:"Twitter",isPremium:P,recommendedReplacementVariables:a,replacementVariables:i,description:r,descriptionInputPlaceholder:o,descriptionPreviewFallback:R,title:c,titleInputPlaceholder:s,titlePreviewFallback:k,onSelectImageClick:u,onRemoveImageClick:d,onDescriptionChange:m,onTitleChange:p,onReplacementVariableSearchChange:g,imageWarnings:f,imageUrl:w,imageFallbackUrl:b,isLarge:h,siteUrl:v,applyReplacementVariables:n,socialPreviewLabel:F,idSuffix:C,alt:I})};o.propTypes={recommendedReplacementVariables:r.default.array.isRequired,replacementVariables:r.default.array.isRequired,description:r.default.string,title:r.default.string,onSelectImageClick:r.default.func.isRequired,onRemoveImageClick:r.default.func.isRequired,onDescriptionChange:r.default.func.isRequired,onTitleChange:r.default.func.isRequired,onReplacementVariableSearchChange:r.default.func,imageWarnings:r.default.array,imageUrl:r.default.string,imageFallbackUrl:r.default.string,isPremium:r.default.bool.isRequired,isLarge:r.default.bool,siteUrl:r.default.string,descriptionInputPlaceholder:r.default.string,titleInputPlaceholder:r.default.string,descriptionPreviewFallback:r.default.string,titlePreviewFallback:r.default.string,location:r.default.string,alt:r.default.string},o.defaultProps={imageWarnings:[],title:null,description:null,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",descriptionPreviewFallback:"",titleInputPlaceholder:"",titlePreviewFallback:"",imageUrl:"",imageFallbackUrl:"",location:"",alt:"",onReplacementVariableSearchChange:null},a.default=o},2:function(e,a){e.exports=window.wp.i18n},3:function(e,a){e.exports=window.wp.element},34:function(e,a){e.exports=window.yoast.socialMetadataPreviews},4:function(e,a){e.exports=window.yoast.propTypes}},[[151,0]]]);
\ No newline at end of file
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/yoast/social-metadata-previews-2200.min.js b/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/yoast/social-metadata-previews-2200.min.js
deleted file mode 100644
index 622a1fe1..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/assets/js/dist/yoast/social-metadata-previews-2200.min.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e){var t={};function i(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,i),a.l=!0,a.exports}i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(o,a,function(t){return e[t]}.bind(null,a));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=10)}([function(e,t){e.exports=window.yoast.styledComponents},function(e,t){e.exports=React},function(e,t){e.exports=window.yoast.propTypes},function(e,t){e.exports=window.yoast.socialMetadataForms},function(e,t){e.exports=window.lodash},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(1),a=p(o),r=p(i(2)),n=p(i(0)),s=p(i(12)),l=p(i(13)),d=i(15),c=p(d),u=p(i(16));function p(e){return e&&e.__esModule?e:{default:e}}const h=e=>{switch(e){case"landscape":return"527px";case"square":case"portrait":return"369px";default:return"476px"}},f=n.default.div.withConfig({displayName:"FacebookPreview__FacebookPreviewWrapper",componentId:"sc-1nwbyjh-0"})(["box-sizing:border-box;display:flex;flex-direction:",";background-color:#f2f3f5;max-width:527px;"],e=>"landscape"===e.mode?"column":"row"),m=n.default.div.withConfig({displayName:"FacebookPreview__FacebookTextWrapper",componentId:"sc-1nwbyjh-1"})(["box-sizing:border-box;background-color:#f2f3f5;margin:0;padding:10px 12px;position:relative;border-bottom:",";border-top:",";border-right:",";border:",";display:flex;flex-direction:column;flex-grow:1;justify-content:",";font-size:12px;overflow:hidden;"],e=>"landscape"===e.mode?"":"1px solid #dddfe2",e=>"landscape"===e.mode?"":"1px solid #dddfe2",e=>"landscape"===e.mode?"":"1px solid #dddfe2",e=>"landscape"===e.mode?"1px solid #dddfe2":"",e=>"landscape"===e.mode?"flex-start":"center");class g extends o.Component{constructor(e){super(e),this.state={imageMode:null,maxLineCount:0,descriptionLineCount:0},this.facebookTitleRef=a.default.createRef(),this.onImageLoaded=this.onImageLoaded.bind(this),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}onImageLoaded(e){this.setState({imageMode:e})}getTitleLineCount(){return this.facebookTitleRef.current.offsetHeight/d.facebookTitleLineHeight}maybeSetMaxLineCount(){var e=this.state;const t=e.imageMode,i=e.maxLineCount,o="landscape"===t?2:5;o!==i&&this.setState({maxLineCount:o})}maybeSetDescriptionLineCount(){var e=this.state;const t=e.descriptionLineCount,i=e.maxLineCount,o=e.imageMode,a=this.getTitleLineCount();let r=i-a;"portrait"===o&&(r=5===a?0:4),r!==t&&this.setState({descriptionLineCount:r})}componentDidUpdate(){this.maybeSetMaxLineCount(),this.maybeSetDescriptionLineCount()}render(){var e=this.state;const t=e.imageMode,i=e.maxLineCount,o=e.descriptionLineCount;return a.default.createElement(f,{id:"facebookPreview",mode:t},a.default.createElement(l.default,{src:this.props.imageUrl||this.props.imageFallbackUrl,alt:this.props.alt,onImageLoaded:this.onImageLoaded,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),a.default.createElement(m,{mode:t},a.default.createElement(s.default,{siteUrl:this.props.siteUrl,mode:t}),a.default.createElement(c.default,{ref:this.facebookTitleRef,onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle,lineCount:i},this.props.title),o>0&&a.default.createElement(u.default,{maxWidth:h(t),onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription,lineCount:o},this.props.description)))}}g.propTypes={siteUrl:r.default.string.isRequired,title:r.default.string.isRequired,description:r.default.string,imageUrl:r.default.string,imageFallbackUrl:r.default.string,alt:r.default.string,onSelect:r.default.func,onImageClick:r.default.func,onMouseHover:r.default.func},g.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{}},t.default=g},function(e,t){e.exports=window.wp.i18n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocialImage=void 0;var o=n(i(2)),a=n(i(1)),r=n(i(0));function n(e){return e&&e.__esModule?e:{default:e}}const s=r.default.img.withConfig({displayName:"SocialImage__StyledImage",componentId:"sc-1m76ywa-0"})(["&&{max-width:","px;height:","px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);max-width:none;}"],e=>e.width,e=>e.height),l=r.default.img.withConfig({displayName:"SocialImage__StyledLandscapeImage",componentId:"sc-1m76ywa-1"})(["&&{height:100%;position:absolute;width:100%;object-fit:cover;}"]),d=r.default.div.withConfig({displayName:"SocialImage__WrapperDiv",componentId:"sc-1m76ywa-2"})(["padding-bottom:","%;"],e=>e.aspectRatio),c=t.SocialImage=(e=>{const t=e.imageProps,i=e.width,o=e.height;return"landscape"===e.imageMode?a.default.createElement(d,{aspectRatio:t.aspectRatio},a.default.createElement(l,{src:t.src,alt:t.alt})):a.default.createElement(s,{src:t.src,alt:t.alt,width:i,height:o,imageProperties:t})});c.propTypes={imageProps:o.default.shape({src:o.default.string.isRequired,alt:o.default.string.isRequired,aspectRatio:o.default.number.isRequired}).isRequired,width:o.default.number.isRequired,height:o.default.number.isRequired,imageMode:o.default.string},c.defaultProps={imageMode:"landscape"}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retrieveExpectedDimensions=a,t.calculateImageRatios=r,t.calculateLargestDimensions=n,t.calculateImageDimensions=s,t.determineImageProperties=l,t.handleImage=async function(e,t,i=!1){try{const o=await l(e,t,i);return{imageProperties:o,status:"loaded"}}catch(e){return{imageProperties:null,status:"errored"}}};var o=i(3);function a(e){return"Twitter"===e?o.TWITTER_IMAGE_SIZES:o.FACEBOOK_IMAGE_SIZES}function r(e,t,i){return"landscape"===i?{widthRatio:t.width/e.landscapeWidth,heightRatio:t.height/e.landscapeHeight}:"portrait"===i?{widthRatio:t.width/e.portraitWidth,heightRatio:t.height/e.portraitHeight}:{widthRatio:t.width/e.squareWidth,heightRatio:t.height/e.squareHeight}}function n(e,t){return t.widthRatio<=t.heightRatio?{width:Math.round(e.width/t.widthRatio),height:Math.round(e.height/t.widthRatio)}:{width:Math.round(e.width/t.heightRatio),height:Math.round(e.height/t.heightRatio)}}function s(e,t,i){if("square"===i){if(t.width===t.height)return{width:e.squareWidth,height:e.squareHeight};return n(t,r(e,t,i))}return n(t,r(e,t,i))}async function l(e,t,i=!1){const r=await function(e){return new Promise((t,i)=>{const o=new Image;o.onload=(()=>{t({width:o.width,height:o.height})}),o.onerror=i,o.src=e})}(e);let n=i?"landscape":"square";"Facebook"===t&&(n=(0,o.determineFacebookImageMode)(r));const l=s(a(t),r,n);return{mode:n,height:l.height,width:l.width}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(1),a=p(o),r=p(i(2)),n=p(i(0)),s=p(i(17)),l=p(i(18)),d=p(i(19)),c=p(i(20)),u=p(i(21));function p(e){return e&&e.__esModule?e:{default:e}}const h=n.default.div.withConfig({displayName:"TwitterPreview__TwitterPreviewWrapper",componentId:"sc-16lhv3o-0"})(['font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",sans-serif;font-size:15px;font-weight:400;line-height:20px;max-width:507px;border:1px solid #E1E8ED;box-sizing:border-box;border-radius:14px;color:#292F33;background:#FFFFFF;text-overflow:ellipsis;display:flex;&:hover{background:#f5f8fa;border:1px solid rgba(136,153,166,.5);}']),f=(0,n.default)(h).withConfig({displayName:"TwitterPreview__LargeTwitterPreviewWrapper",componentId:"sc-16lhv3o-1"})(["flex-direction:column;max-height:370px;"]),m=(0,n.default)(h).withConfig({displayName:"TwitterPreview__SmallTwitterPreviewWrapper",componentId:"sc-16lhv3o-2"})(["flex-direction:row;height:125px;"]);class g extends o.Component{constructor(e){super(e),this.onImageEnter=this.props.onMouseHover.bind(this,"image"),this.onTitleEnter=this.props.onMouseHover.bind(this,"title"),this.onDescriptionEnter=this.props.onMouseHover.bind(this,"description"),this.onLeave=this.props.onMouseHover.bind(this,""),this.onSelectTitle=this.props.onSelect.bind(this,"title"),this.onSelectDescription=this.props.onSelect.bind(this,"description")}render(){var e=this.props;const t=e.isLarge,i=e.imageUrl,o=e.imageFallbackUrl,r=e.alt,n=e.title,p=e.description,h=e.siteUrl,g=t?f:m;return a.default.createElement(g,{id:"twitterPreview"},a.default.createElement(l.default,{src:i||o,alt:r,isLarge:t,onImageClick:this.props.onImageClick,onMouseEnter:this.onImageEnter,onMouseLeave:this.onLeave}),a.default.createElement(d.default,null,a.default.createElement(s.default,{siteUrl:h}),a.default.createElement(c.default,{onMouseEnter:this.onTitleEnter,onMouseLeave:this.onLeave,onClick:this.onSelectTitle},n),a.default.createElement(u.default,{onMouseEnter:this.onDescriptionEnter,onMouseLeave:this.onLeave,onClick:this.onSelectDescription},p)))}}g.propTypes={siteUrl:r.default.string.isRequired,title:r.default.string.isRequired,description:r.default.string,isLarge:r.default.bool,imageUrl:r.default.string,imageFallbackUrl:r.default.string,alt:r.default.string,onSelect:r.default.func,onImageClick:r.default.func,onMouseHover:r.default.func},g.defaultProps={description:"",alt:"",imageUrl:"",imageFallbackUrl:"",onSelect:()=>{},onImageClick:()=>{},onMouseHover:()=>{},isLarge:!0},t.default=g},function(e,t,i){"use strict";window.yoast=window.yoast||{},window.yoast.socialMetadataPreviews=i(11)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(5);Object.defineProperty(t,"FacebookPreview",{enumerable:!0,get:function(){return s(o).default}});var a=i(9);Object.defineProperty(t,"TwitterPreview",{enumerable:!0,get:function(){return s(a).default}});var r=i(22);Object.defineProperty(t,"SocialPreviewEditor",{enumerable:!0,get:function(){return s(r).default}});var n=i(25);function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"TWITTER_IMAGE_SIZES",{enumerable:!0,get:function(){return n.TWITTER_IMAGE_SIZES}}),Object.defineProperty(t,"FACEBOOK_IMAGE_SIZES",{enumerable:!0,get:function(){return n.FACEBOOK_IMAGE_SIZES}}),Object.defineProperty(t,"determineFacebookImageMode",{enumerable:!0,get:function(){return n.determineFacebookImageMode}})},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(1),a=s(o),r=s(i(0)),n=s(i(2));function s(e){return e&&e.__esModule?e:{default:e}}const l=r.default.p.withConfig({displayName:"FacebookSiteUrl__FacebookSiteUrlWrapper",componentId:"sc-109exs2-0"})(["color:#606770;flex-shrink:0;font-size:12px;line-height:16px;overflow:hidden;padding:0;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap;margin:0;position:",";"],e=>"landscape"===e.mode?"relative":"static"),d=e=>{const t=e.siteUrl;return a.default.createElement(o.Fragment,null,a.default.createElement("span",{className:"screen-reader-text"},t),a.default.createElement(l,{"aria-hidden":"true"},a.default.createElement("span",null,t)))};d.propTypes={siteUrl:n.default.string.isRequired},t.default=d},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(1),a=h(o),r=h(i(0)),n=h(i(2)),s=i(6),l=i(4),d=i(3),c=i(14),u=i(7),p=i(8);function h(e){return e&&e.__esModule?e:{default:e}}const f=r.default.div.withConfig({displayName:"FacebookImage__FacebookImageContainer",componentId:"sc-n8g3py-0"})(["position:relative;",";overflow:hidden;background-color:",";"],e=>"landscape"===e.mode?`max-width: ${e.dimensions.width}`:`min-width: ${e.dimensions.width}; height: ${e.dimensions.height}`,c.colors.$color_white),m=r.default.div.withConfig({displayName:"FacebookImage__PlaceholderImage",componentId:"sc-n8g3py-1"})(["box-sizing:border-box;max-width:","px;height:","px;background-color:",";border-style:dashed;border-width:1px;color:#006DAC;background-color:#f1f1f1;display:flex;justify-content:center;align-items:center;text-decoration:underline;font-size:14px;cursor:pointer;"],d.FACEBOOK_IMAGE_SIZES.landscapeWidth,d.FACEBOOK_IMAGE_SIZES.landscapeHeight,c.colors.$color_grey);class g extends o.Component{constructor(e){super(e),this.state={imageProperties:null,status:"loading"},this.socialMedium="Facebook",this.handleFacebookImage=this.handleFacebookImage.bind(this),this.setState=this.setState.bind(this)}async handleFacebookImage(){try{const e=await(0,p.handleImage)(this.props.src,this.socialMedium);this.setState(e),this.props.onImageLoaded(e.imageProperties.mode||"landscape")}catch(e){this.setState(e),this.props.onImageLoaded("landscape")}}componentDidUpdate(e){e.src!==this.props.src&&this.handleFacebookImage()}componentDidMount(){this.handleFacebookImage()}retrieveContainerDimensions(e){switch(e){case"square":return{height:d.FACEBOOK_IMAGE_SIZES.squareHeight+"px",width:d.FACEBOOK_IMAGE_SIZES.squareWidth+"px"};case"portrait":return{height:d.FACEBOOK_IMAGE_SIZES.portraitHeight+"px",width:d.FACEBOOK_IMAGE_SIZES.portraitWidth+"px"};case"landscape":return{height:d.FACEBOOK_IMAGE_SIZES.landscapeHeight+"px",width:d.FACEBOOK_IMAGE_SIZES.landscapeWidth+"px"}}}render(){var e=this.state;const t=e.imageProperties,i=e.status;if("loading"===i||""===this.props.src||"errored"===i)return a.default.createElement(m,{onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},(0,s.__)("Select image","wordpress-seo"));const o=this.retrieveContainerDimensions(t.mode);return a.default.createElement(f,{mode:t.mode,dimensions:o,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave,onClick:this.props.onImageClick},a.default.createElement(u.SocialImage,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:d.FACEBOOK_IMAGE_SIZES.aspectRatio},width:t.width,height:t.height,imageMode:t.mode}))}}g.propTypes={src:n.default.string,alt:n.default.string,onImageLoaded:n.default.func,onImageClick:n.default.func,onMouseEnter:n.default.func,onMouseLeave:n.default.func},g.defaultProps={src:"",alt:"",onImageLoaded:l.noop,onImageClick:l.noop,onMouseEnter:l.noop,onMouseLeave:l.noop},t.default=g},function(e,t){e.exports=window.yoast.styleGuide},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.facebookTitleLineHeight=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(i(0));const a=t.facebookTitleLineHeight=20,r=o.default.span.withConfig({displayName:"FacebookTitle",componentId:"sc-1cm5c6b-0"})(["line-height:","px;min-height:","px;color:#1d2129;font-weight:600;overflow:hidden;font-size:16px;margin:3px 0 0;letter-spacing:normal;white-space:normal;flex-shrink:0;cursor:pointer;display:-webkit-box;-webkit-line-clamp:",";-webkit-box-orient:vertical;overflow:hidden;"],a,a,e=>e.lineCount);t.default=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=function(e){return e&&e.__esModule?e:{default:e}}(i(0)).default.p.withConfig({displayName:"FacebookDescription",componentId:"sc-ulm5bh-0"})(["line-height:","px;min-height:","px;color:#606770;font-size:14px;padding:0;text-overflow:ellipsis;margin:3px 0 0 0;display:-webkit-box;cursor:pointer;-webkit-line-clamp:",";-webkit-box-orient:vertical;overflow:hidden;@media all and ( max-width:"," ){display:none;}"],16,16,e=>e.lineCount,e=>e.maxWidth);t.default=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(1)),a=n(i(0)),r=n(i(2));function n(e){return e&&e.__esModule?e:{default:e}}const s=a.default.div.withConfig({displayName:"TwitterSiteUrl__TwitterSiteUrlWrapper",componentId:"sc-y2m51b-0"})(["text-transform:lowercase;color:rgb(83,100,113);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;fill:currentcolor;display:flex;flex-direction:row;align-items:flex-end;"]),l=e=>o.default.createElement(s,null,o.default.createElement("span",null,e.siteUrl));l.propTypes={siteUrl:r.default.string.isRequired},t.default=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(6),a=i(3),r=i(4),n=u(i(2)),s=u(i(1)),l=u(i(0)),d=i(8),c=i(7);function u(e){return e&&e.__esModule?e:{default:e}}const p=(e,t=!0)=>e?`\n\t\t\tmax-width: ${a.TWITTER_IMAGE_SIZES.landscapeWidth}px;\n\t\t\t${t?"border-bottom: 1px solid #E1E8ED;":""}\n\t\t\tborder-radius: 14px 14px 0 0;\n\t\t\t`:`\n\t\twidth: ${a.TWITTER_IMAGE_SIZES.squareWidth}px;\n\t\t${t?"border-right: 1px solid #E1E8ED;":""}\n\t\tborder-radius: 14px 0 0 14px;\n\t\t`,h=l.default.div.withConfig({displayName:"TwitterImage__TwitterImageContainer",componentId:"sc-y3dnut-0"})(["position:relative;box-sizing:content-box;overflow:hidden;background-color:#e1e8ed;flex-shrink:0;",""],e=>p(e.isLarge)),f=l.default.div.withConfig({displayName:"TwitterImage__BaseImage",componentId:"sc-y3dnut-1"})(["display:flex;justify-content:center;align-items:center;box-sizing:border-box;max-width:100%;margin:0;padding:1em;text-align:center;font-size:1rem;",""],e=>p(e.isLarge,!1)),m=(0,l.default)(f).withConfig({displayName:"TwitterImage__PlaceholderImage",componentId:"sc-y3dnut-2"})([""," border-top-left-radius:14px;",":14px;border-style:dashed;border-width:1px;color:#006DAC;background-color:#f1f1f1;text-decoration:underline;font-size:14px;cursor:pointer;"],e=>e.isLarge&&`height: ${a.TWITTER_IMAGE_SIZES.landscapeHeight}px;`,e=>e.isLarge?"border-top-right-radius":"border-bottom-left-radius");class g extends s.default.Component{constructor(e){super(e),this.state={status:"loading"},this.socialMedium="Twitter",this.handleTwitterImage=this.handleTwitterImage.bind(this),this.setState=this.setState.bind(this)}async handleTwitterImage(){if(null===this.props.src)return;const e=await(0,d.handleImage)(this.props.src,this.socialMedium,this.props.isLarge);this.setState(e)}componentDidUpdate(e){e.src!==this.props.src&&this.handleTwitterImage()}componentDidMount(){this.handleTwitterImage()}render(){var e=this.state;const t=e.status,i=e.imageProperties;return"loading"===t||""===this.props.src||"errored"===t?s.default.createElement(m,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},(0,o.__)("Select image","wordpress-seo")):s.default.createElement(h,{isLarge:this.props.isLarge,onClick:this.props.onImageClick,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave},s.default.createElement(c.SocialImage,{imageProps:{src:this.props.src,alt:this.props.alt,aspectRatio:a.TWITTER_IMAGE_SIZES.aspectRatio},width:i.width,height:i.height,imageMode:i.mode}))}}t.default=g,g.propTypes={isLarge:n.default.bool.isRequired,src:n.default.string,alt:n.default.string,onImageClick:n.default.func,onMouseEnter:n.default.func,onMouseLeave:n.default.func},g.defaultProps={src:"",alt:"",onMouseEnter:r.noop,onImageClick:r.noop,onMouseLeave:r.noop}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(1)),a=n(i(0)),r=n(i(2));function n(e){return e&&e.__esModule?e:{default:e}}const s=a.default.div.withConfig({displayName:"TwitterTextWrapper__Wrapper",componentId:"sc-nrtc3w-0"})(["display:flex;flex-direction:column;padding:12px;justify-content:center;margin:0;box-sizing:border-box;flex:auto;min-width:0px;gap:2px;> *{line-height:20px;min-height:20px;font-size:15px;}"]),l=e=>o.default.createElement(s,null,e.children);l.propTypes={children:r.default.array.isRequired},t.default=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=function(e){return e&&e.__esModule?e:{default:e}}(i(0)).default.p.withConfig({displayName:"TwitterTitle",componentId:"sc-2h4g0v-0"})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0;color:rgb(15,20,25);cursor:pointer;"]);t.default=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(3);const a=function(e){return e&&e.__esModule?e:{default:e}}(i(0)).default.p.withConfig({displayName:"TwitterDescription",componentId:"sc-1kv12fr-0"})(["max-height:55px;overflow:hidden;text-overflow:ellipsis;margin:0;color:rgb(83,100,113);display:-webkit-box;cursor:pointer;-webkit-line-clamp:2;-webkit-box-orient:vertical;@media all and ( max-width:","px ){display:none;}"],o.TWITTER_IMAGE_SIZES.landscapeWidth);t.default=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(23),a=i(1),r=u(a),n=u(i(2)),s=i(3),l=u(i(5)),d=u(i(9)),c=i(24);function u(e){return e&&e.__esModule?e:{default:e}}class p extends a.Component{constructor(e){super(e),this.state={activeField:"",hoveredField:""},this.SocialPreview="Social"===e.socialMediumName?l.default:d.default,this.setHoveredField=this.setHoveredField.bind(this),this.setActiveField=this.setActiveField.bind(this),this.setEditorRef=this.setEditorRef.bind(this),this.setEditorFocus=this.setEditorFocus.bind(this)}setHoveredField(e){e!==this.state.hoveredField&&this.setState({hoveredField:e})}setActiveField(e){e!==this.state.activeField&&this.setState({activeField:e},()=>this.setEditorFocus(e))}setEditorFocus(e){switch(e){case"title":this.titleEditorRef.focus();break;case"description":this.descriptionEditorRef.focus()}}setEditorRef(e,t){switch(e){case"title":this.titleEditorRef=t;break;case"description":this.descriptionEditorRef=t}}render(){var e=this.props;const t=e.onDescriptionChange,i=e.onTitleChange,a=e.onSelectImageClick,n=e.onRemoveImageClick,l=e.socialMediumName,d=e.imageWarnings,c=e.siteUrl,u=e.description,p=e.descriptionInputPlaceholder,h=e.descriptionPreviewFallback,f=e.imageUrl,m=e.imageFallbackUrl,g=e.alt,b=e.title,w=e.titleInputPlaceholder,v=e.titlePreviewFallback,I=e.replacementVariables,E=e.recommendedReplacementVariables,x=e.applyReplacementVariables,_=e.onReplacementVariableSearchChange,M=e.isPremium,y=e.isLarge,S=e.socialPreviewLabel,C=e.idSuffix,k=e.activeMetaTabId,T=x({title:b||v,description:u||h});return r.default.createElement(r.default.Fragment,null,S&&r.default.createElement(o.SimulatedLabel,null,S),r.default.createElement(this.SocialPreview,{onMouseHover:this.setHoveredField,onSelect:this.setActiveField,onImageClick:a,siteUrl:c,title:T.title,description:T.description,imageUrl:f,imageFallbackUrl:m,alt:g,isLarge:y,activeMetaTabId:k}),r.default.createElement(s.SocialMetadataPreviewForm,{onDescriptionChange:t,socialMediumName:l,title:b,titleInputPlaceholder:w,onRemoveImageClick:n,imageSelected:!!f,imageUrl:f,onTitleChange:i,onSelectImageClick:a,description:u,descriptionInputPlaceholder:p,imageWarnings:d,replacementVariables:I,recommendedReplacementVariables:E,onReplacementVariableSearchChange:_,onMouseHover:this.setHoveredField,hoveredField:this.state.hoveredField,onSelect:this.setActiveField,activeField:this.state.activeField,isPremium:M,setEditorRef:this.setEditorRef,idSuffix:C}))}}p.propTypes={title:n.default.string.isRequired,onTitleChange:n.default.func.isRequired,description:n.default.string.isRequired,onDescriptionChange:n.default.func.isRequired,imageUrl:n.default.string.isRequired,imageFallbackUrl:n.default.string.isRequired,onSelectImageClick:n.default.func.isRequired,onRemoveImageClick:n.default.func.isRequired,socialMediumName:n.default.string.isRequired,alt:n.default.string,isPremium:n.default.bool,imageWarnings:n.default.array,isLarge:n.default.bool,siteUrl:n.default.string,descriptionInputPlaceholder:n.default.string,titleInputPlaceholder:n.default.string,descriptionPreviewFallback:n.default.string,titlePreviewFallback:n.default.string,replacementVariables:c.replacementVariablesShape,recommendedReplacementVariables:c.recommendedReplacementVariablesShape,applyReplacementVariables:n.default.func,onReplacementVariableSearchChange:n.default.func,socialPreviewLabel:n.default.string,idSuffix:n.default.string,activeMetaTabId:n.default.string},p.defaultProps={imageWarnings:[],recommendedReplacementVariables:[],replacementVariables:[],isPremium:!1,isLarge:!0,siteUrl:"",descriptionInputPlaceholder:"",titleInputPlaceholder:"",descriptionPreviewFallback:"",titlePreviewFallback:"",alt:"",applyReplacementVariables:e=>e,onReplacementVariableSearchChange:null,socialPreviewLabel:"",idSuffix:"",activeMetaTabId:""},t.default=p},function(e,t){e.exports=window.yoast.componentsNew},function(e,t){e.exports=window.yoast.replacementVariableEditor},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FACEBOOK_IMAGE_SIZES=t.TWITTER_IMAGE_SIZES=void 0,t.determineFacebookImageMode=function(e){(0,o.logOnce)("@yoast/social-metadata-previews/determineFacebookImageMode","[@yoast/social-metadata-previews] 'determineFacebookImageMode' is deprecated and will be removed in the future, please use this from @yoast/social-metadata-forms instead.");const t=a.largeThreshold;if(e.height>e.width)return"portrait";if(e.width(0,o.logOnce)(`@yoast/social-metadata-previews/TWITTER_IMAGE_SIZES/${e}/${t}`,`[@yoast/social-metadata-previews] "TWITTER_IMAGE_SIZES.${t}" is deprecated and will be removed in the future, `+"please use this from @yoast/social-metadata-forms instead."));const a=t.FACEBOOK_IMAGE_SIZES=(0,o.createObjectWrapper)({squareWidth:158,squareHeight:158,landscapeWidth:527,landscapeHeight:273,portraitWidth:158,portraitHeight:237,aspectRatio:52.2,largeThreshold:{width:446,height:233}},(e,t)=>(0,o.logOnce)(`@yoast/social-metadata-previews/FACEBOOK_IMAGE_SIZES/${e}/${t}`,`[@yoast/social-metadata-previews] "FACEBOOK_IMAGE_SIZES.${t}" is deprecated and will be removed in the future, `+"please use this from @yoast/social-metadata-forms instead."))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createObjectWrapper=t.logOnce=void 0;var o=i(4);const a={};t.logOnce=((e,t,{log:i=console.warn}={})=>{a[e]||(a[e]=!0,i(t))}),t.createObjectWrapper=((e,t=o.noop)=>{const i={};for(const o in e)Object.hasOwn(e,o)&&Object.defineProperty(i,o,{set:i=>{e[o]=i,t("set",o,i)},get:()=>(t("get",o),e[o])});return i})}]);
\ No newline at end of file
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/blocks/siblings-block.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/blocks/siblings-block.php
deleted file mode 100644
index 26636271..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/blocks/siblings-block.php
+++ /dev/null
@@ -1,84 +0,0 @@
-indexable_repository = $indexable_repository;
- }
-
- /**
- * Presents the block output.
- *
- * @param array $attributes The block attributes.
- *
- * @return string The block output.
- */
- public function present( $attributes ) {
- $post_parent_id = \wp_get_post_parent_id( null );
- if ( $post_parent_id === false || $post_parent_id === 0 ) {
- return '';
- }
- $indexables = $this->indexable_repository->get_subpages_by_post_parent(
- $post_parent_id,
- [ \get_the_ID() ]
- );
-
- $links = \array_map(
- static function ( Indexable $indexable ) {
- return [
- 'title' => $indexable->breadcrumb_title,
- 'permalink' => $indexable->permalink,
- ];
- },
- $indexables
- );
-
- if ( empty( $links ) ) {
- return '';
- }
-
- $class_name = 'yoast-url-list';
- if ( ! empty( $attributes['className'] ) ) {
- $class_name .= ' ' . \esc_attr( $attributes['className'] );
- }
-
- $presenter = new Url_List_Presenter( $links, $class_name );
-
- return $presenter->present();
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/blocks/subpages-block.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/blocks/subpages-block.php
deleted file mode 100644
index cb886ae9..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/blocks/subpages-block.php
+++ /dev/null
@@ -1,77 +0,0 @@
-indexable_repository = $indexable_repository;
- }
-
- /**
- * Presents the block output.
- *
- * @param array $attributes The block attributes.
- *
- * @return string The block output.
- */
- public function present( $attributes ) {
- $indexables = $this->indexable_repository->get_subpages_by_post_parent( \get_the_ID() );
-
- $links = \array_map(
- static function ( Indexable $indexable ) {
- return [
- 'title' => $indexable->breadcrumb_title,
- 'permalink' => $indexable->permalink,
- ];
- },
- $indexables
- );
-
- if ( empty( $links ) ) {
- return '';
- }
-
- $class_name = 'yoast-url-list';
- if ( ! empty( $attributes['className'] ) ) {
- $class_name .= ' ' . \esc_attr( $attributes['className'] );
- }
-
- $presenter = new Url_List_Presenter( $links, $class_name );
-
- return $presenter->present();
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/custom-fields-plugin.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/custom-fields-plugin.php
deleted file mode 100644
index bc02110e..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/custom-fields-plugin.php
+++ /dev/null
@@ -1,115 +0,0 @@
-localize_script() );
- }
-
- /**
- * Loads the custom fields translations.
- *
- * @return array The fields to localize.
- */
- public function localize_script() {
- return [
- 'custom_field_names' => $this->get_custom_field_names(),
- ];
- }
-
- /**
- * Retrieve all custom field names set in SEO ->
- *
- * @return array The custom field names.
- */
- protected function get_custom_field_names() {
- $custom_field_names = [];
-
- $post = $this->get_post();
-
- if ( ! is_object( $post ) ) {
- return $custom_field_names;
- }
-
- $options = $this->get_titles_from_options();
- $target_option = 'page-analyse-extra-' . $post->post_type;
-
- if ( array_key_exists( $target_option, $options ) ) {
- $custom_field_names = explode( ',', $options[ $target_option ] );
- }
-
- return $custom_field_names;
- }
-
- /**
- * Retrieves post data given a post ID or the global.
- *
- * @codeCoverageIgnore Method relies on dependencies.
- *
- * @return WP_Post|array|null Returns a post if found, otherwise returns an empty array.
- */
- protected function get_post() {
- // phpcs:disable WordPress.Security.NonceVerification.Recommended -- Reason: We are not controlling the request.
- if ( isset( $_GET['post'] ) && is_string( $_GET['post'] ) ) {
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are casting the unsafe value to an integer.
- $post_id = (int) wp_unslash( $_GET['post'] );
- if ( $post_id > 0 ) {
- return get_post( $post_id );
- }
- }
- // phpcs:enable WordPress.Security.NonceVerification.Recommended
-
- if ( isset( $GLOBALS['post'] ) ) {
- return $GLOBALS['post'];
- }
-
- return [];
- }
-
- /**
- * Retrieves the value of the WPSEO_Titles option.
- *
- * @codeCoverageIgnore Method relies on the options.
- *
- * @return array The value from WPSEO_Titles option.
- */
- protected function get_titles_from_options() {
- $option_name = WPSEO_Options::get_option_instance( 'wpseo_titles' )->option_name;
-
- return get_option( $option_name, [] );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-csv.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-csv.php
deleted file mode 100644
index e50c0965..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-csv.php
+++ /dev/null
@@ -1,228 +0,0 @@
-columns = array_filter( $columns, 'is_string' );
- }
-
- /**
- * Echoes the CSV headers
- *
- * @return void
- */
- public function print_headers() {
- // phpcs:ignore WordPress.Security.EscapeOutput -- Correctly escaped in get_headers() method below.
- echo $this->get_headers();
- }
-
- /**
- * Echoes a formatted row.
- *
- * @param array $row Row to add to the export.
- *
- * @return void
- */
- public function print_row( $row ) {
- echo $this->format( $row );
- }
-
- /**
- * Returns the CSV headers based on the queried columns.
- *
- * @return string The headers in CSV format.
- */
- protected function get_headers() {
- $header_columns = [
- 'title' => esc_html__( 'title', 'wordpress-seo-premium' ),
- 'url' => esc_html__( 'url', 'wordpress-seo-premium' ),
- 'readability_score' => esc_html__( 'readability score', 'wordpress-seo-premium' ),
- 'keywords' => esc_html__( 'keyphrase', 'wordpress-seo-premium' ),
- 'keywords_score' => esc_html__( 'keyphrase score', 'wordpress-seo-premium' ),
- 'seo_title' => esc_html__( 'seo title', 'wordpress-seo-premium' ),
- 'meta_description' => esc_html__( 'meta description', 'wordpress-seo-premium' ),
- ];
-
- $csv = $this->sanitize_csv_column( esc_html__( 'ID', 'wordpress-seo-premium' ) );
- $csv .= ',' . $this->sanitize_csv_column( esc_html_x( 'type', 'post_type of a post or the taxonomy of a term', 'wordpress-seo-premium' ) );
-
- foreach ( $this->columns as $column ) {
- if ( array_key_exists( $column, $header_columns ) ) {
- $csv .= ',' . $this->sanitize_csv_column( $header_columns[ $column ] );
- }
- }
-
- return $csv . PHP_EOL;
- }
-
- /**
- * Formats a WPSEO_Export_Keywords_Query result as a CSV line.
- * In case of multiple keywords it will return multiple lines.
- *
- * @param array $result A result as returned from WPSEO_Export_Keywords_Query::get_data.
- *
- * @return string A line of CSV, beginning with EOL.
- */
- protected function format( array $result ) {
- // If our input is malformed return an empty string.
- if ( ! array_key_exists( 'ID', $result ) || ! array_key_exists( 'type', $result ) ) {
- return '';
- }
-
- // Ensure we have arrays in the keywords.
- $result['keywords'] = $this->get_array_from_result( $result, 'keywords' );
- $result['keywords_score'] = $this->get_array_from_result( $result, 'keywords_score' );
-
- $csv = '';
-
- // Add at least one row plus additional ones if we have more keywords.
- $keywords = max( 1, count( $result['keywords'] ) );
- for ( $keywords_index = 0; $keywords_index < $keywords; $keywords_index++ ) {
- // Add static columns.
- $csv .= $this->sanitize_csv_column( $result['ID'] );
- $csv .= ',' . $this->sanitize_csv_column( $result['type'] );
-
- // Add dynamic columns.
- foreach ( $this->columns as $column ) {
- $csv .= $this->get_csv_column_from_result( $result, $column, $keywords_index );
- }
-
- $csv .= PHP_EOL;
- }
-
- return $csv;
- }
-
- /**
- * Returns a CSV column, including comma, from the result object based on the specified key
- *
- * @param array $result The result object.
- * @param string $key The key of the value to get the CSV column for.
- * @param int $keywords_index The number keyword to output.
- *
- * @return string CSV formatted column.
- */
- protected function get_csv_column_from_result( array $result, $key, $keywords_index ) {
- if ( in_array( $key, [ 'title', 'url', 'seo_title', 'meta_description', 'readability_score' ], true ) ) {
- return $this->get_csv_string_column_from_result( $result, $key );
- }
-
- if ( in_array( $key, [ 'keywords', 'keywords_score' ], true ) ) {
- return $this->get_csv_array_column_from_result( $result, $key, $keywords_index );
- }
-
- return '';
- }
-
- /**
- * Returns an array from the result object.
- *
- * @param array $result The result object.
- * @param string $key The key of the array to retrieve.
- *
- * @return array Contents of the key in the object.
- */
- protected function get_array_from_result( array $result, $key ) {
- if ( array_key_exists( $key, $result ) && is_array( $result[ $key ] ) ) {
- return $result[ $key ];
- }
-
- return [];
- }
-
- /**
- * Returns a CSV column, including comma, from the result object by the specified key.
- * Expects the value to be a string.
- *
- * @param array $result The result object to get the CSV column from.
- * @param string $key The key of the value to get the CSV column for.
- *
- * @return string A CSV formatted column.
- */
- protected function get_csv_string_column_from_result( array $result, $key ) {
- if ( array_key_exists( $key, $result ) ) {
- return ',' . $this->sanitize_csv_column( $result[ $key ] );
- }
-
- return ',';
- }
-
- /**
- * Returns a CSV column, including comma, from the result object by the specified key.
- * Expects the value to be inside an array.
- *
- * @param array $result The result object to get the CSV column from.
- * @param string $key The key of the array to get the CSV column for.
- * @param int $index The index of the value in the array.
- *
- * @return string A CSV formatted column.
- */
- protected function get_csv_array_column_from_result( array $result, $key, $index ) {
- // If the array has an element at $index.
- if ( $index < count( $result[ $key ] ) ) {
- return ',' . $this->sanitize_csv_column( $result[ $key ][ $index ] );
- }
-
- return ',';
- }
-
- /**
- * Sanitizes a value to be output as a CSV value.
- *
- * @param string $value The value to sanitize.
- *
- * @return string The sanitized value.
- */
- protected function sanitize_csv_column( $value ) {
- // Return an empty string if value is null.
- if ( $value === null ) {
- return '';
- }
-
- // Convert non-string values to strings.
- if ( ! is_string( $value ) ) {
- $value = var_export( $value, true );
- }
-
- // Replace all whitespace with spaces because Excel can't deal with newlines and tabs even if escaped.
- $value = preg_replace( '/\s/', ' ', $value );
-
- // Escape double quotes.
- $value = str_replace( '"', '""', $value );
-
- // Return the value enclosed in double quotes.
- return '"' . $value . '"';
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-post-presenter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-post-presenter.php
deleted file mode 100644
index f415c2d5..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-post-presenter.php
+++ /dev/null
@@ -1,230 +0,0 @@
-columns = array_filter( $columns, 'is_string' );
- }
-
- /**
- * Creates a presentable result by modifying and adding the requested fields.
- *
- * @param array $result The result to modify.
- *
- * @return array The modified result or an empty array if the result is considered invalid.
- */
- public function present( array $result ) {
- if ( ! $this->validate_result( $result ) ) {
- return [];
- }
-
- foreach ( $this->columns as $column ) {
- $result = $this->prepare_column_result( $result, $column );
- }
-
- $result['type'] = $result['post_type'];
- unset( $result['post_type'] );
-
- return $result;
- }
-
- /**
- * Prepares the passed result to make it more presentable.
- *
- * @param array $result The result to modify.
- * @param string $column The requested column.
- *
- * @return array The prepared result.
- */
- protected function prepare_column_result( array $result, $column ) {
- switch ( $column ) {
- case 'title':
- // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals -- Using WP native filter.
- $result['title'] = apply_filters( 'the_title', $result['post_title'], $result['ID'] );
- unset( $result['post_title'] );
- break;
- case 'url':
- $result['url'] = get_permalink( $result['ID'] );
- break;
- case 'readability_score':
- $result['readability_score'] = WPSEO_Rank::from_numeric_score( (int) $result['readability_score'] )->get_label();
- break;
- case 'keywords':
- $result = $this->convert_result_keywords( $result );
- break;
- }
-
- return $result;
- }
-
- /**
- * Returns whether a result to present is a valid result.
- *
- * @param array $result The result to validate.
- *
- * @return bool True for a value valid result.
- */
- protected function validate_result( array $result ) {
- // If there is no ID then it's not valid.
- if ( ! array_key_exists( 'ID', $result ) ) {
- return false;
- }
-
- // If a title is requested but not present then it's not valid.
- if ( $this->column_is_present( 'title' ) && $this->has_title( $result ) === false ) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Determines if the result contains a valid title.
- *
- * @param array $result The result array to check for a title.
- *
- * @return bool Whether or not a title is valid.
- */
- protected function has_title( $result ) {
- if ( ! is_array( $result ) || ! array_key_exists( 'post_title', $result ) ) {
- return false;
- }
-
- return is_string( $result['post_title'] );
- }
-
- /**
- * Determines if the wanted column exists within the $this->columns class variable.
- *
- * @param string $column The column to search for.
- *
- * @return bool Whether or not the column exists.
- */
- protected function column_is_present( $column ) {
- if ( ! is_string( $column ) ) {
- return false;
- }
-
- return in_array( $column, $this->columns, true );
- }
-
- /**
- * Converts the results of the query from strings and JSON string to keyword arrays.
- *
- * @param array $result The result to convert.
- *
- * @return array The converted result.
- */
- protected function convert_result_keywords( array $result ) {
- $result['keywords'] = [];
-
- if ( $this->column_is_present( 'keywords_score' ) ) {
- $result['keywords_score'] = [];
- }
-
- if ( $this->has_primary_keyword( $result ) ) {
- $result['keywords'][] = $result['primary_keyword'];
-
- // Convert multiple keywords from the Premium plugin from json to string arrays.
- $keywords = $this->parse_result_keywords_json( $result, 'other_keywords' );
-
- $other_keywords = wp_list_pluck( $keywords, 'keyword' );
- $result['keywords'] = array_merge( $result['keywords'], $other_keywords );
-
- if ( $this->column_is_present( 'keywords_score' ) ) {
- $result['keywords_score'] = $this->get_result_keywords_scores( $result, $keywords );
- }
- }
-
- // Unset all old variables, if they do not exist nothing will happen.
- unset( $result['primary_keyword'], $result['primary_keyword_score'], $result['other_keywords'] );
-
- return $result;
- }
-
- /**
- * Determines whether there's a valid primary keyword present in the result array.
- *
- * @param array $result The result array to check for the primary_keyword key.
- *
- * @return bool Whether or not a valid primary keyword is present.
- */
- protected function has_primary_keyword( $result ) {
- if ( ! is_array( $result ) || ! array_key_exists( 'primary_keyword', $result ) ) {
- return false;
- }
-
- return is_string( $result['primary_keyword'] ) && ! empty( $result['primary_keyword'] );
- }
-
- /**
- * Parses then keywords JSON string in the result object for the specified key.
- *
- * @param array $result The result object.
- * @param string $key The key containing the JSON.
- *
- * @return array The parsed keywords.
- */
- protected function parse_result_keywords_json( array $result, $key ) {
- if ( empty( $result[ $key ] ) ) {
- return [];
- }
-
- $parsed = json_decode( $result[ $key ], true );
-
- if ( ! $parsed ) {
- return [];
- }
-
- return $parsed;
- }
-
- /**
- * Returns an array of all scores from the result object and the parsed keywords JSON.
- *
- * @param array $result The result object.
- * @param array $keywords The parsed keywords.
- *
- * @return array The keyword scores.
- */
- protected function get_result_keywords_scores( array $result, $keywords ) {
- $scores = [];
-
- $rank = WPSEO_Rank::from_numeric_score( (int) $result['primary_keyword_score'] );
- $scores[] = $rank->get_label();
-
- foreach ( $keywords as $keyword ) {
- if ( isset( $keyword['score'] ) ) {
- $rank = new WPSEO_Rank( $keyword['score'] );
- $scores[] = $rank->get_label();
- }
- }
-
- return $scores;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-post-query.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-post-query.php
deleted file mode 100644
index c1dfabd7..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-post-query.php
+++ /dev/null
@@ -1,183 +0,0 @@
-page_size = max( 1, (int) $page_size );
-
- $this->set_columns( $columns );
- }
-
- /**
- * Constructs the query and executes it, returning an array of objects containing the columns this object was
- * constructed with. Every object will always contain the ID column.
- *
- * @param int $page Paginated page to retrieve.
- *
- * @return array An array of associative arrays containing the keys as requested in the constructor.
- */
- public function get_data( $page = 1 ) {
- global $wpdb;
-
- if ( $this->columns === [] ) {
- return [];
- }
-
- $post_types = WPSEO_Post_Type::get_accessible_post_types();
- if ( empty( $post_types ) ) {
- return [];
- }
-
- // Pages have a starting index of 1, we need to convert to a 0 based offset.
- $offset_multiplier = max( 0, ( $page - 1 ) );
-
- $replacements = [];
- $replacements[] = $wpdb->posts;
- $replacements[] = 'post_status';
- $replacements[] = 'post_type';
- $replacements = array_merge( $replacements, $post_types );
- $replacements[] = $this->page_size;
- $replacements[] = ( $offset_multiplier * $this->page_size );
-
- // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQLPlaceholders.UnsupportedPlaceholder,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Already prepared, and no cache applicable.
- return $wpdb->get_results(
- $wpdb->prepare(
- 'SELECT ' . implode( ', ', $this->selects )
- . ' FROM %i AS posts '
- . implode( ' ', $this->joins )
- . ' WHERE posts.%i = "publish" AND posts.%i IN ('
- . implode( ',', array_fill( 0, count( $post_types ), '%s' ) ) . ')'
- . ' LIMIT %d OFFSET %d',
- $replacements
- ),
- ARRAY_A
- );
- // phpcs:enable
- }
-
- /**
- * Prepares the necessary selects and joins to get all data in a single query.
- *
- * @param array $columns The columns we want our query to return.
- *
- * @return void
- */
- public function set_columns( array $columns ) {
- $this->columns = $columns;
-
- $this->joins = [];
- $this->selects = [ 'posts.ID', 'posts.post_type' ];
-
- if ( in_array( 'title', $this->columns, true ) ) {
- $this->selects[] = 'posts.post_title';
- }
-
- // If we're selecting keywords_score then we always want the keywords as well.
- if ( in_array( 'keywords', $this->columns, true ) || in_array( 'keywords_score', $this->columns, true ) ) {
- $this->add_meta_join( 'primary_keyword', WPSEO_Meta::$meta_prefix . 'focuskw' );
- $this->add_meta_join( 'other_keywords', WPSEO_Meta::$meta_prefix . 'focuskeywords' );
- }
-
- if ( in_array( 'readability_score', $this->columns, true ) ) {
- $this->add_meta_join( 'readability_score', WPSEO_Meta::$meta_prefix . 'content_score' );
- }
-
- if ( in_array( 'keywords_score', $this->columns, true ) ) {
- // Score for other keywords is already in the other_keywords select so only join for the primary_keyword_score.
- $this->add_meta_join( 'primary_keyword_score', WPSEO_Meta::$meta_prefix . 'linkdex' );
- }
-
- if ( in_array( 'seo_title', $this->columns, true ) ) {
- $this->add_meta_join( 'seo_title', WPSEO_Meta::$meta_prefix . 'title' );
- }
-
- if ( in_array( 'meta_description', $this->columns, true ) ) {
- $this->add_meta_join( 'meta_description', WPSEO_Meta::$meta_prefix . 'metadesc' );
- }
- }
-
- /**
- * Returns the page size for the query.
- *
- * @return int Page size that is being used.
- */
- public function get_page_size() {
- return $this->page_size;
- }
-
- /**
- * Adds an aliased join to the $wpdb->postmeta table so that multiple meta values can be selected in a single row.
- *
- * While this function should never be used with user input,
- * all non-word non-digit characters are removed from both params for increased robustness.
- *
- * @param string $alias The alias to use in our query output.
- * @param string $key The meta_key to select.
- *
- * @return void
- */
- protected function add_meta_join( $alias, $key ) {
- global $wpdb;
- $alias = preg_replace( '/[^\w\d]/', '', $alias );
- $key = preg_replace( '/[^\w\d]/', '', $key );
-
- $this->selects[] = $alias . '_join.meta_value AS ' . $alias;
- $this->joins[] = 'LEFT OUTER JOIN ' . $wpdb->prefix . 'postmeta AS ' . $alias . '_join '
- . 'ON ' . $alias . '_join.post_id = posts.ID '
- . 'AND ' . $alias . '_join.meta_key = "' . $key . '"';
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-presenter-interface.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-presenter-interface.php
deleted file mode 100644
index 9d1e1865..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-presenter-interface.php
+++ /dev/null
@@ -1,33 +0,0 @@
-columns = array_filter( $columns, 'is_string' );
- }
-
- /**
- * Creates a presentable result by modifying and adding the requested fields.
- *
- * @param array $result The result to modify.
- *
- * @return array The modified result or an empty array if the result is considered invalid.
- */
- public function present( array $result ) {
- if ( ! $this->validate_result( $result ) ) {
- return [];
- }
-
- $result['ID'] = (int) $result['term_id'];
- unset( $result['term_id'] );
-
- foreach ( $this->columns as $column ) {
- $result = $this->prepare_column_result( $result, $column );
- }
-
- $result['type'] = $result['taxonomy'];
- unset( $result['taxonomy'] );
-
- return $result;
- }
-
- /**
- * Prepares the passed result to make it more presentable.
- *
- * @param array $result The result to modify.
- * @param string $column The requested column.
- *
- * @return array The prepared result.
- */
- protected function prepare_column_result( array $result, $column ) {
- switch ( $column ) {
- case 'keywords':
- $result['keywords'] = $this->get_result_keywords( $result );
- break;
- case 'keywords_score':
- $result['keywords_score'] = $this->get_result_keywords_score( $result );
- break;
- case 'url':
- $result['url'] = get_term_link( $result['ID'], $result['taxonomy'] );
- break;
- case 'title':
- $result['title'] = $result['name'];
- unset( $result['name'] );
- break;
- case 'seo_title':
- $result['seo_title'] = WPSEO_Taxonomy_Meta::get_term_meta( $result['ID'], $result['taxonomy'], 'title' );
- break;
- case 'meta_description':
- $result['meta_description'] = WPSEO_Taxonomy_Meta::get_term_meta( $result['ID'], $result['taxonomy'], 'desc' );
- break;
- case 'readability_score':
- $content_score = WPSEO_Taxonomy_Meta::get_term_meta( $result['ID'], $result['taxonomy'], 'content_score' );
- $result['readability_score'] = WPSEO_Rank::from_numeric_score( (int) $content_score )->get_label();
- break;
- }
-
- return $result;
- }
-
- /**
- * Returns whether a result to present is a valid result.
- *
- * @param array $result The result to validate.
- *
- * @return bool True if the result is validated.
- */
- protected function validate_result( array $result ) {
- // If there is no ID then it's not valid.
- if ( ! array_key_exists( 'term_id', $result ) ) {
- return false;
- }
-
- // If a title is requested but not present then it's not valid.
- if ( $this->column_is_present( 'title' ) && $this->has_title( $result ) === false ) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Determines if the result contains a valid title.
- *
- * @param array $result The result array to check for a title.
- *
- * @return bool Whether or not a title is valid.
- */
- protected function has_title( $result ) {
- if ( ! is_array( $result ) || ! array_key_exists( 'name', $result ) ) {
- return false;
- }
-
- return is_string( $result['name'] );
- }
-
- /**
- * Determines if the wanted column exists within the $this->columns class variable.
- *
- * @param string $column The column to search for.
- *
- * @return bool Whether or not the column exists.
- */
- protected function column_is_present( $column ) {
- if ( ! is_string( $column ) ) {
- return false;
- }
-
- return in_array( $column, $this->columns, true );
- }
-
- /**
- * Gets the result keywords from WPSEO_Taxonomy_Meta.
- *
- * @param array $result The result to get the keywords for.
- *
- * @return array The keywords.
- */
- protected function get_result_keywords( array $result ) {
- $keyword = WPSEO_Taxonomy_Meta::get_term_meta( $result['ID'], $result['taxonomy'], 'focuskw' );
-
- if ( $keyword === false || empty( $keyword ) ) {
- return [];
- }
-
- return [ (string) $keyword ];
- }
-
- /**
- * Gets the result keyword scores from WPSEO_Taxonomy_Meta.
- *
- * @param array $result The result to get the keyword scores for.
- *
- * @return array The keyword scores.
- */
- protected function get_result_keywords_score( array $result ) {
- $keyword_score = WPSEO_Taxonomy_Meta::get_term_meta( $result['ID'], $result['taxonomy'], 'linkdex' );
-
- if ( $keyword_score === false || empty( $keyword_score ) ) {
- return [];
- }
-
- $keyword_score_label = WPSEO_Rank::from_numeric_score( (int) $keyword_score )->get_label();
-
- return [ $keyword_score_label ];
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-term-query.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-term-query.php
deleted file mode 100644
index 8377a01f..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/export/export-keywords-term-query.php
+++ /dev/null
@@ -1,132 +0,0 @@
-page_size = max( 1, (int) $page_size );
- $this->set_columns( $columns );
- }
-
- /**
- * Returns the page size for the query.
- *
- * @return int Page size that is being used.
- */
- public function get_page_size() {
- return $this->page_size;
- }
-
- /**
- * Constructs the query and executes it, returning an array of objects containing the columns this object was constructed with.
- * Every object will always contain the ID column.
- *
- * @param int $page Paginated page to retrieve.
- *
- * @return array An array of associative arrays containing the keys as requested in the constructor.
- */
- public function get_data( $page = 1 ) {
-
- global $wpdb;
-
- if ( $this->columns === [] ) {
- return [];
- }
-
- $taxonomies = get_taxonomies(
- [
- 'public' => true,
- 'show_ui' => true,
- ],
- 'names'
- );
-
- if ( empty( $taxonomies ) ) {
- return [];
- }
-
- // Pages have a starting index of 1, we need to convert to a 0 based offset.
- $offset_multiplier = max( 0, ( $page - 1 ) );
-
- $replacements = [];
- $replacements[] = $wpdb->terms;
- $replacements[] = $wpdb->term_taxonomy;
- $replacements[] = 'term_id';
- $replacements[] = 'term_id';
- $replacements[] = 'taxonomy';
- $replacements = array_merge( $replacements, $taxonomies );
- $replacements[] = $this->page_size;
- $replacements[] = ( $offset_multiplier * $this->page_size );
-
- // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQLPlaceholders.UnsupportedPlaceholder,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Already prepared, and no cache applicable.
- return $wpdb->get_results(
- $wpdb->prepare(
- 'SELECT ' . implode( ', ', $this->selects )
- . ' FROM %i AS terms'
- . ' INNER JOIN %i AS taxonomies'
- . ' ON terms.%i = taxonomies.%i AND taxonomies.%i IN ('
- . implode( ',', array_fill( 0, count( $taxonomies ), '%s' ) ) . ')'
- . ' LIMIT %d OFFSET %d',
- $replacements
- ),
- ARRAY_A
- );
- // phpcs:enable
- }
-
- /**
- * Prepares the necessary selects and joins to get all data in a single query.
- *
- * @param array $columns The columns we want our query to return.
- *
- * @return void
- */
- public function set_columns( array $columns ) {
- $this->columns = $columns;
-
- $this->selects = [ 'terms.term_id', 'taxonomies.taxonomy' ];
-
- if ( in_array( 'title', $this->columns, true ) ) {
- $this->selects[] = 'terms.name';
- }
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/metabox-link-suggestions.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/metabox-link-suggestions.php
deleted file mode 100644
index 1b6d1d03..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/metabox-link-suggestions.php
+++ /dev/null
@@ -1,115 +0,0 @@
-is_block_editor() ) {
- return;
- }
-
- $post_types = $this->get_post_types();
-
- array_map( [ $this, 'add_meta_box' ], $post_types );
- }
-
- /**
- * Returns whether the link suggestions are available for the given post type.
- *
- * @param string $post_type The post type for which to check if the link suggestions are available.
- *
- * @return bool Whether the link suggestions are available for the given post type.
- */
- public function is_available( $post_type ) {
- $allowed_post_types = $this->get_post_types();
-
- return in_array( $post_type, $allowed_post_types, true );
- }
-
- /**
- * Renders the content for the metabox. We leave this empty because we render with React.
- *
- * @return void
- */
- public function render_metabox_content() {
- echo '';
- }
-
- /**
- * Returns all the public post types.
- *
- * @return array The supported post types.
- */
- protected function get_post_types() {
- $prominent_words_support = new WPSEO_Premium_Prominent_Words_Support();
-
- return $prominent_words_support->get_supported_post_types();
- }
-
- /**
- * Returns whether or not the Link Suggestions are enabled.
- *
- * @return bool Whether or not the link suggestions are enabled.
- */
- public function is_enabled() {
- return WPSEO_Options::get( 'enable_link_suggestions', false );
- }
-
- /**
- * Adds a meta box for the given post type.
- *
- * @param string $post_type The post type to add a meta box for.
- *
- * @return void
- */
- protected function add_meta_box( $post_type ) {
- if ( ! $this->is_available( $post_type ) || ! $this->is_enabled() ) {
- return;
- }
-
- if ( ! WPSEO_Premium_Metabox::are_content_endpoints_available() ) {
- return;
- }
-
- add_meta_box(
- 'yoast_internal_linking',
- sprintf(
- /* translators: %s expands to Yoast */
- __( '%s internal linking', 'wordpress-seo-premium' ),
- 'Yoast'
- ),
- [ $this, 'render_metabox_content' ],
- $post_type,
- 'side',
- 'low',
- [
- '__block_editor_compatible_meta_box' => true,
- ]
- );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/multi-keyword.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/multi-keyword.php
deleted file mode 100644
index 1b9d7d74..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/multi-keyword.php
+++ /dev/null
@@ -1,118 +0,0 @@
- 'hidden',
- 'title' => 'focuskeywords',
- ];
- }
-
- return $field_defs;
- }
-
- /**
- * Add field in which we can save multiple keyword synonyms.
- *
- * @param array $field_defs The current fields definitions.
- *
- * @return array Field definitions with our added field.
- */
- public function add_keyword_synonyms_input( $field_defs ) {
- if ( is_array( $field_defs ) ) {
- $field_defs['keywordsynonyms'] = [
- 'type' => 'hidden',
- 'title' => 'keywordsynonyms',
- ];
- }
-
- return $field_defs;
- }
-
- /**
- * Adds a field to the taxonomy metabox in which we can save multiple keywords.
- *
- * @param array $fields The current fields.
- *
- * @return array Fields including our added field.
- */
- public function add_focus_keywords_taxonomy_input( $fields ) {
- if ( is_array( $fields ) ) {
- $fields['focuskeywords'] = [
- 'label' => '',
- 'description' => '',
- 'type' => 'hidden',
- 'options' => '',
- ];
- }
-
- return $fields;
- }
-
- /**
- * Adds a field in which we can save multiple keyword synonyms.
- *
- * @param array $fields The current fields.
- *
- * @return array Fields including our added field.
- */
- public function add_keyword_synonyms_taxonomy_input( $fields ) {
- if ( is_array( $fields ) ) {
- $fields['keywordsynonyms'] = [
- 'label' => '',
- 'description' => '',
- 'type' => 'hidden',
- 'options' => '',
- ];
- }
-
- return $fields;
- }
-
- /**
- * Extends the taxonomy defaults.
- *
- * @param array $defaults The defaults to extend.
- *
- * @return array The extended defaults.
- */
- public function register_taxonomy_metafields( $defaults ) {
- $defaults['wpseo_focuskeywords'] = '';
- $defaults['wpseo_keywordsynonyms'] = '';
-
- return $defaults;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/post-watcher.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/post-watcher.php
deleted file mode 100644
index b99e1663..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/post-watcher.php
+++ /dev/null
@@ -1,603 +0,0 @@
-is_rest_request() && ! $this->post_redirect_can_be_made( $pagenow ) ) {
- return;
- }
-
- // Detect a post slug change.
- add_action( 'post_updated', [ $this, 'detect_slug_change' ], 12, 3 );
-
- // Detect a post trash.
- add_action( 'wp_trash_post', [ $this, 'detect_post_trash' ] );
-
- // Detect a post untrash.
- add_action( 'untrashed_post', [ $this, 'detect_post_untrash' ] );
-
- // Detect a post delete.
- add_action( 'before_delete_post', [ $this, 'detect_post_delete' ] );
- }
-
- /**
- * Registers the page scripts.
- *
- * @codeCoverageIgnore Method used WordPress functions.
- *
- * @param string $current_page The page that is opened at the moment.
- *
- * @return void
- */
- public function page_scripts( $current_page ) {
- // Register the scripts.
- parent::page_scripts( $current_page );
-
- /**
- * If in Gutenberg, always load these scripts.
- */
- if ( WPSEO_Metabox::is_post_edit( $current_page ) && wp_script_is( 'wp-editor', 'enqueued' ) ) {
- /**
- * Filter: 'Yoast\WP\SEO\show_post_redirect_slug_change_notification' - Allows to suppress the block editor notification
- * about automatic redirect creation when the post slug is changed.
- *
- * The middleware used to intercept the redirect creation and trigger the notice can interfere with the API
- * call since it passes the full response on instead of its content. Using this filter, it can be disabled.
- * Notice that this doesn't prevent the actual redirect from being created.
- *
- * @since 21.9
- *
- * @param bool $show_notification Determines if the notification should be displayed.
- */
- $show_notification = apply_filters( 'Yoast\WP\SEO\show_post_redirect_slug_change_notification', true );
-
- if ( $show_notification ) {
- wp_enqueue_script( 'wp-seo-premium-redirect-notifications' );
- wp_enqueue_script( 'wp-seo-premium-redirect-notifications-gutenberg' );
- }
- return;
- }
-
- if ( ! $this->post_redirect_can_be_made( $current_page ) ) {
- return;
- }
-
- if ( WPSEO_Metabox::is_post_overview( $current_page ) ) {
- wp_enqueue_script( 'wp-seo-premium-quickedit-notification' );
- }
-
- if ( WPSEO_Metabox::is_post_edit( $current_page ) ) {
- wp_enqueue_script( 'wp-seo-premium-redirect-notifications' );
- }
- }
-
- /**
- * Detect if the slug changed, hooked into 'post_updated'.
- *
- * @param int $post_id The ID of the post.
- * @param WP_Post $post The post with the new values.
- * @param WP_Post $post_before The post with the previous values.
- *
- * @return bool
- */
- public function detect_slug_change( $post_id, $post, $post_before ) {
- // Bail if this is a multisite installation and the site has been switched.
- if ( is_multisite() && ms_is_switched() ) {
- return false;
- }
-
- if ( ! $this->is_redirect_relevant( $post, $post_before ) ) {
- return false;
- }
-
- $this->remove_colliding_redirect( $post, $post_before );
-
- /**
- * Filter: 'Yoast\WP\SEO\post_redirect_slug_change' - Check if a redirect should be created
- * on post slug change.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param bool $create_redirect Determines if a redirect should be created for this post slug change.
- * @param int $post_id The ID of the post.
- * @param WP_Post $post The current post object.
- * @param WP_Post $previous_post The previous post object.
- */
- $create_redirect = apply_filters( 'Yoast\WP\SEO\post_redirect_slug_change', false, $post_id, $post, $post_before );
-
- if ( $create_redirect === true ) {
- return true;
- }
-
- $old_url = $this->get_target_url( $post_before );
- if ( ! $old_url ) {
- return false;
- }
-
- // If the post URL wasn't public before, or isn't public now, don't even check if we have to redirect.
- if ( ! $this->check_public_post_status( $post_before ) || ! $this->check_public_post_status( $post ) ) {
- return false;
- }
-
- // Get the new URL.
- $new_url = $this->get_target_url( $post_id );
-
- // Maybe we can undo the created redirect.
- $created_redirect = $this->notify_undo_slug_redirect( $old_url, $new_url, $post_id, 'post' );
-
- if ( $created_redirect ) {
- $redirect_info = [
- 'origin' => $created_redirect->get_origin(),
- 'target' => $created_redirect->get_target(),
- 'type' => $created_redirect->get_type(),
- 'format' => $created_redirect->get_format(),
- ];
- update_post_meta( $post_id, '_yoast_post_redirect_info', $redirect_info );
- }
- }
-
- /**
- * Removes a colliding redirect if it is found.
- *
- * @param WP_Post $post The post with the new values.
- * @param WP_Post $post_before The post with the previous values.
- *
- * @return void
- */
- protected function remove_colliding_redirect( $post, $post_before ) {
- $redirect = $this->get_redirect_manager()->get_redirect( $this->get_target_url( $post ) );
- if ( $redirect === false ) {
- return;
- }
-
- if ( $redirect->get_target() !== trim( $this->get_target_url( $post_before ), '/' ) ) {
- return;
- }
-
- $this->get_redirect_manager()->delete_redirects( [ $redirect ] );
- }
-
- /**
- * Determines if redirect is relevant for the provided post.
- *
- * @param WP_Post $post The post with the new values.
- * @param WP_Post $post_before The post with the previous values.
- *
- * @return bool True if a redirect might be relevant.
- */
- protected function is_redirect_relevant( $post, $post_before ) {
- // Check if the post type is enabled for redirects.
- $post_type = get_post_type( $post );
-
- /**
- * Filter: 'Yoast\WP\SEO\redirect_post_type' - Check if a redirect should be created
- * on post slug change for specified post type.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param bool $create_redirect Determines if a redirect should be created for this post type.
- * @param string $post_type The post type that is being checked for.
- */
- $post_type_accessible = apply_filters( 'Yoast\WP\SEO\redirect_post_type', WPSEO_Post_Type::is_post_type_accessible( $post_type ), $post_type );
-
- if ( ! $post_type_accessible ) {
- return false;
- }
-
- // If post is a revision do not create redirect.
- if ( wp_is_post_revision( $post_before ) !== false && wp_is_post_revision( $post ) !== false ) {
- return false;
- }
-
- // There is no slug change.
- if ( $this->get_target_url( $post ) === $this->get_target_url( $post_before ) ) {
- return false;
- }
-
- return true;
- }
-
- /**
- * Checks whether the given post is public or not.
- *
- * @param int|WP_Post $post Post ID or post object.
- *
- * @return bool
- */
- private function check_public_post_status( $post ) {
- $public_post_statuses = [
- 'publish',
- 'static',
- 'private',
- ];
-
- // Need to set $post_id for backward compatibility with the filter, as $post can also be an object now.
- if ( is_int( $post ) ) {
- $post_id = $post;
- }
- else {
- $post_id = $post->ID;
- }
-
- /**
- * Filter: 'Yoast\WP\SEO\public_post_statuses' - Allow changing the statuses that are expected
- * to have caused a URL to be public.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param array $published_post_statuses The statuses that'll be treated as published.
- * @param object $post The post object we're doing the published check for.
- */
- $public_post_statuses = apply_filters( 'Yoast\WP\SEO\public_post_statuses', $public_post_statuses, $post_id );
-
- return ( in_array( get_post_status( $post ), $public_post_statuses, true ) );
- }
-
- /**
- * Offer to create a redirect from the post that is about to get trashed.
- *
- * @param int $post_id The current post ID.
- *
- * @return void
- */
- public function detect_post_trash( $post_id ) {
-
- $url = $this->check_if_redirect_needed( $post_id );
- if ( ! empty( $url ) ) {
-
- $id = 'wpseo_redirect_' . md5( $url );
-
- // Format the message.
- $message = sprintf(
- /* translators: %1$s: Yoast SEO Premium, %2$s: List with actions, %3$s: , %4$s: , %5$s: Slug to post */
- __( '%1$s detected that you moved a post (%5$s) to the trash. You can either: %2$s Don\'t know what to do? %3$sRead this post%4$s.', 'wordpress-seo-premium' ),
- 'Yoast SEO Premium',
- $this->get_delete_action_list( $url, $id ),
- '',
- ' ',
- '' . $url . ''
- );
-
- $this->create_notification( $message, 'trash' );
- }
- }
-
- /**
- * Offer to create a redirect from the post that is about to get restored from the trash.
- *
- * @param int $post_id The current post ID.
- *
- * @return void
- */
- public function detect_post_untrash( $post_id ) {
- $redirect = $this->check_if_redirect_needed( $post_id, true );
-
- if ( $redirect ) {
-
- $id = 'wpseo_undo_redirect_' . md5( $redirect->get_origin() );
-
- // Format the message.
- $message = sprintf(
- /* translators: %1$s: Yoast SEO Premium, %2$s: , %3$s: , %4$s: Slug to post */
- __( '%1$s detected that you restored a post (%4$s) from the trash, for which a redirect was created. %2$sClick here to remove the redirect%3$s', 'wordpress-seo-premium' ),
- 'Yoast SEO Premium',
- 'javascript_undo_redirect( $redirect, $id ) . '\'>',
- ' ',
- '' . $redirect->get_origin() . ''
- );
-
- $this->create_notification( $message, 'untrash' );
- }
- }
-
- /**
- * Offer to create a redirect from the post that is about to get deleted.
- *
- * @param int $post_id The current post ID.
- *
- * @return void
- */
- public function detect_post_delete( $post_id ) {
-
- // We don't want to redirect menu items.
- if ( is_nav_menu_item( $post_id ) ) {
- return;
- }
-
- // When the post comes from the trash or if the post is a revision then skip further execution.
- if ( get_post_status( $post_id ) === 'trash' || wp_is_post_revision( $post_id ) ) {
- return;
- }
-
- // Is a redirect needed.
- $url = $this->check_if_redirect_needed( $post_id );
- if ( ! empty( $url ) ) {
- $this->set_delete_notification( $url );
- }
- }
-
- /**
- * Look up if URL does exists in the current redirects.
- *
- * @param string $url URL to search for.
- *
- * @return bool
- */
- protected function get_redirect( $url ) {
- return $this->get_redirect_manager()->get_redirect( $url );
- }
-
- /**
- * This method checks if a redirect is needed.
- *
- * This method will check if URL as redirect already exists.
- *
- * @param int $post_id The current post ID.
- * @param bool $should_exist Boolean to determine if the URL should be exist as a redirect.
- *
- * @return WPSEO_Redirect|string|bool
- */
- protected function check_if_redirect_needed( $post_id, $should_exist = false ) {
- // If the post type is not public, don't redirect.
- $post_type = get_post_type_object( get_post_type( $post_id ) );
-
- if ( ! $post_type ) {
- return false;
- }
-
- if ( ! in_array( $post_type->name, $this->get_included_automatic_redirection_post_types(), true ) ) {
- return false;
- }
-
- // The post types should be a public one.
- if ( $this->check_public_post_status( $post_id ) ) {
- // Get the right URL.
- $url = $this->get_target_url( $post_id );
-
- // If $url is not a single /, there may be the option to create a redirect.
- if ( $url !== '/' ) {
- // Message should only be shown if there isn't already a redirect.
- $redirect = $this->get_redirect( $url );
-
- if ( is_a( $redirect, 'WPSEO_Redirect' ) && $should_exist ) {
- return $redirect;
- }
- if ( ! is_a( $redirect, 'WPSEO_Redirect' ) && ! $should_exist ) {
- return $url;
- }
- }
- }
- return false;
- }
-
- /**
- * Retrieves the post types to create automatic redirects for.
- *
- * @return array Post types to include to create automatic redirects for.
- */
- protected function get_included_automatic_redirection_post_types() {
- $post_types = WPSEO_Post_Type::get_accessible_post_types();
-
- /**
- * Filter: 'Yoast\WP\SEO\automatic_redirection_post_types' - Post types to create
- * automatic redirects for.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param array $included_post_types Array with the post type names to include to automatic redirection.
- */
- $included_post_types = apply_filters( 'Yoast\WP\SEO\automatic_redirection_post_types', $post_types );
-
- if ( ! is_array( $included_post_types ) ) {
- $included_post_types = [];
- }
-
- return $included_post_types;
- }
-
- /**
- * Retrieves the path of the URL for the supplied post.
- *
- * @param int|WP_Post $post The current post ID.
- *
- * @return string The URL for the supplied post.
- */
- protected function get_target_url( $post ) {
- // Use the correct URL path.
- $url = wp_parse_url( get_permalink( $post ) );
- if ( is_array( $url ) && isset( $url['path'] ) ) {
- return $url['path'];
- }
-
- return '';
- }
-
- /**
- * Get the old URL.
- *
- * @param object $post The post object with the new values.
- * @param object $post_before The post object with the old values.
- *
- * @return bool|string
- */
- protected function get_old_url( $post, $post_before ) {
- $wpseo_old_post_url = $this->get_post_old_post_url();
-
- if ( ! empty( $wpseo_old_post_url ) ) {
- return $wpseo_old_post_url;
- }
-
- // Check if request is inline action and new slug is not old slug, if so set wpseo_post_old_url.
- $action = $this->get_post_action();
-
- $url_before = $this->get_target_url( $post_before );
- if ( ! empty( $action ) && $action === 'inline-save' && $this->get_target_url( $post ) !== $url_before ) {
- return $url_before;
- }
-
- return false;
- }
-
- /**
- * Determines whether we're dealing with a REST request or not.
- *
- * @return bool Whether or not the current request is a REST request.
- */
- private function is_rest_request() {
- return defined( 'REST_REQUEST' ) && REST_REQUEST === true;
- }
-
- /**
- * Returns the undo message for the post.
- *
- * @return string
- */
- protected function get_undo_slug_notification() {
- /* translators: %1$s: Yoast SEO Premium, %2$s and %3$s expand to a link to the admin page. */
- return __(
- '%1$s created a %2$sredirect%3$s from the old post URL to the new post URL.',
- 'wordpress-seo-premium'
- );
- }
-
- /**
- * Returns the delete message for the post.
- *
- * @return string
- */
- protected function get_delete_notification() {
- /* translators: %1$s: Yoast SEO Premium, %2$s: List with actions, %3$s: , %4$s: , %5%s: The removed url. */
- return __(
- '%1$s detected that you deleted a post (%5$s). You can either: %2$s Don\'t know what to do? %3$sRead this post %4$s.',
- 'wordpress-seo-premium'
- );
- }
-
- /**
- * Is the current page valid to make a redirect from.
- *
- * @param string $current_page The currently opened page.
- *
- * @return bool True when a redirect can be made on this page.
- */
- protected function post_redirect_can_be_made( $current_page ) {
- return $this->is_post_page( $current_page ) || $this->is_action_inline_save() || $this->is_nested_pages( $current_page );
- }
-
- /**
- * Is the current page related to a post (edit/overview).
- *
- * @param string $current_page The current opened page.
- *
- * @return bool True when page is a post edit/overview page.
- */
- protected function is_post_page( $current_page ) {
- return ( in_array( $current_page, [ 'edit.php', 'post.php' ], true ) );
- }
-
- /**
- * Is the page in an AJAX-request and is the action "inline save".
- *
- * @return bool True when in an AJAX-request and the action is inline-save.
- */
- protected function is_action_inline_save() {
- return ( wp_doing_ajax() && $this->get_post_action() === 'inline-save' );
- }
-
- /**
- * Checks if current page is loaded by nested pages.
- *
- * @param string $current_page The current page.
- *
- * @return bool True when the current page is nested pages.
- */
- protected function is_nested_pages( $current_page ) {
- // phpcs:disable WordPress.Security.NonceVerification.Recommended -- Reason: We are not controlling the request.
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are strictly comparing only.
- return ( $current_page === 'admin.php' && isset( $_GET['page'] ) && is_string( $_GET['page'] ) && wp_unslash( $_GET['page'] ) === 'nestedpages' );
- // phpcs:enable WordPress.Security.NonceVerification.Recommended.
- }
-
- /**
- * Retrieves wpseo_old_post_url field from the post.
- *
- * @return string|bool
- */
- protected function get_post_old_post_url() {
- // phpcs:disable WordPress.Security.NonceVerification.Missing -- Reason: Seems to be only used in tests.
- if ( isset( $_POST['wpseo_old_post_url'] ) && is_string( $_POST['wpseo_old_post_url'] ) ) {
- return sanitize_text_field( wp_unslash( $_POST['wpseo_old_post_url'] ) );
- }
- // phpcs:enable WordPress.Security.NonceVerification.Missing.
- return false;
- }
-
- /**
- * Retrieves action field from the post.
- *
- * @return string|bool
- */
- protected function get_post_action() {
- // phpcs:disable WordPress.Security.NonceVerification.Recommended -- Reason: We are not controlling the request.
- if ( isset( $_POST['action'] ) && is_string( $_POST['action'] ) ) {
- return sanitize_text_field( wp_unslash( $_POST['action'] ) );
- }
- // phpcs:enable WordPress.Security.NonceVerification.Recommended.
- return false;
- }
-
- /**
- * Display the undo redirect notification
- *
- * @param WPSEO_Redirect $redirect The old URL to the post.
- * @param int $object_id The post or term ID.
- * @param string $object_type The object type: post or term.
- *
- * @return void
- */
- protected function set_undo_slug_notification( WPSEO_Redirect $redirect, $object_id, $object_type ) {
-
- if ( ! $this->is_rest_request() && ! wp_doing_ajax() ) {
- parent::set_undo_slug_notification( $redirect, $object_id, $object_type );
-
- return;
- }
-
- header( 'X-Yoast-Redirect-Created: 1; origin=' . $redirect->get_origin() . '; target=' . $redirect->get_target() . '; type=' . $redirect->get_type() . '; objectId=' . $object_id . '; objectType=' . $object_type );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-asset-js-l10n.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-asset-js-l10n.php
deleted file mode 100644
index f5a63afb..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-asset-js-l10n.php
+++ /dev/null
@@ -1,47 +0,0 @@
- $this->get_translations( 'wordpress-seo-premiumjs' ),
- ];
- wp_localize_script( $script_handle, 'wpseoPremiumJSL10n', $translations );
- }
-
- /**
- * Returns translations necessary for JS files.
- *
- * @param string $component The component to retrieve the translations for.
- * @return object|null The translations in a Jed format for JS files or null
- * if the translation file could not be found.
- */
- protected function get_translations( $component ) {
- $locale = get_user_locale();
-
- $file = plugin_dir_path( WPSEO_PREMIUM_FILE ) . '/languages/' . $component . '-' . $locale . '.json';
- if ( file_exists( $file ) ) {
- $file = file_get_contents( $file );
- if ( is_string( $file ) && $file !== '' ) {
- return json_decode( $file, true );
- }
- }
-
- return null;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-assets.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-assets.php
deleted file mode 100644
index 0cc68e85..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-assets.php
+++ /dev/null
@@ -1,503 +0,0 @@
-get_version();
- $scripts = $this->get_scripts( $version );
- $styles = $this->get_styles( $version );
-
- array_walk( $scripts, [ $this, 'register_script' ] );
- array_walk( $styles, [ $this, 'register_style' ] );
- }
-
- /**
- * Registers the assets for premium.
- *
- * @return void
- */
- public function register_frontend_assets() {
- $version = $this->get_version();
- $scripts = $this->get_frontend_scripts( $version );
-
- array_walk( $scripts, [ $this, 'register_script' ] );
- }
-
- /**
- * Retrieves a flatten version.
- *
- * @codeCoverageIgnore Method uses a dependency.
- *
- * @return string The flatten version.
- */
- protected function get_version() {
- $asset_manager = new WPSEO_Admin_Asset_Manager();
-
- return $asset_manager->flatten_version( WPSEO_PREMIUM_VERSION );
- }
-
- /**
- * Retrieves an array of script to register.
- *
- * @codeCoverageIgnore Returns a simple dataset.
- *
- * @param string $version Current version number.
- *
- * @return array The scripts.
- */
- protected function get_frontend_scripts( $version ) {
- return [
- [
- 'name' => 'yoast-seo-premium-commons',
- 'path' => 'assets/js/dist/',
- 'filename' => 'commons-premium-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [],
- ],
- [
- 'name' => 'yoast-seo-premium-frontend-inspector',
- 'path' => 'assets/js/dist/',
- 'filename' => 'frontend-inspector-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'lodash',
- 'react',
- 'react-dom',
- 'wp-data',
- 'wp-dom-ready',
- 'wp-element',
- 'wp-i18n',
- 'yoast-seo-premium-commons',
- WPSEO_Admin_Asset_Manager::PREFIX . 'frontend-inspector-resources',
- WPSEO_Admin_Asset_Manager::PREFIX . 'prop-types-package',
- WPSEO_Admin_Asset_Manager::PREFIX . 'style-guide',
- WPSEO_Admin_Asset_Manager::PREFIX . 'yoast-components',
- ],
- 'in_footer' => true,
- ],
- ];
- }
-
- /**
- * Retrieves an array of script to register.
- *
- * @codeCoverageIgnore Returns a simple dataset.
- *
- * @param string $version Current version number.
- *
- * @return array The scripts.
- */
- protected function get_scripts( $version ) {
- return [
- [
- 'name' => 'yoast-seo-premium-commons',
- 'path' => 'assets/js/dist/',
- 'filename' => 'commons-premium-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [],
- ],
- [
- 'name' => 'yoast-seo-premium-metabox',
- 'path' => 'assets/js/dist/',
- 'filename' => 'wp-seo-premium-metabox-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'clipboard',
- 'jquery',
- 'regenerator-runtime',
- 'underscore',
- 'wp-api-fetch',
- 'wp-components',
- 'wp-data',
- 'wp-element',
- 'wp-i18n',
- 'wp-util',
- 'yoast-seo-premium-commons',
- WPSEO_Admin_Asset_Manager::PREFIX . 'analysis',
- WPSEO_Admin_Asset_Manager::PREFIX . 'editor-modules',
- WPSEO_Admin_Asset_Manager::PREFIX . 'help-scout-beacon',
- WPSEO_Admin_Asset_Manager::PREFIX . 'search-metadata-previews',
- WPSEO_Admin_Asset_Manager::PREFIX . 'social-metadata-forms',
- WPSEO_Admin_Asset_Manager::PREFIX . 'social-metadata-previews-package',
- WPSEO_Admin_Asset_Manager::PREFIX . 'yoast-components',
- ],
- ],
- [
- 'name' => 'yoast-seo-premium-draft-js-plugins',
- 'path' => 'assets/js/dist/',
- 'filename' => 'wp-seo-premium-draft-js-plugins-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'in_footer' => true,
- 'dependencies' => [
- 'yoast-seo-premium-commons',
- WPSEO_Admin_Asset_Manager::PREFIX . 'search-metadata-previews',
- ],
- ],
- [
- 'name' => 'yoast-seo-premium-workouts',
- 'path' => 'assets/js/dist/',
- 'filename' => 'workouts-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'clipboard',
- 'lodash',
- 'regenerator-runtime',
- 'wp-api-fetch',
- 'wp-a11y',
- 'wp-components',
- 'wp-compose',
- 'wp-data',
- 'wp-dom-ready',
- 'wp-element',
- 'wp-i18n',
- 'yoast-seo-premium-commons',
- WPSEO_Admin_Asset_Manager::PREFIX . 'analysis',
- WPSEO_Admin_Asset_Manager::PREFIX . 'admin-modules',
- WPSEO_Admin_Asset_Manager::PREFIX . 'react-select',
- WPSEO_Admin_Asset_Manager::PREFIX . 'yoast-components',
- ],
- ],
- [
- 'name' => 'yoast-seo-social-metadata-previews-package',
- 'path' => 'assets/js/dist/yoast/',
- 'filename' => 'social-metadata-previews-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'in_footer' => true,
- 'dependencies' => [
- 'lodash',
- 'wp-a11y',
- 'wp-components',
- 'wp-element',
- 'wp-i18n',
- WPSEO_Admin_Asset_Manager::PREFIX . 'analysis',
- WPSEO_Admin_Asset_Manager::PREFIX . 'draft-js',
- WPSEO_Admin_Asset_Manager::PREFIX . 'editor-modules',
- WPSEO_Admin_Asset_Manager::PREFIX . 'helpers',
- WPSEO_Admin_Asset_Manager::PREFIX . 'replacement-variable-editor',
- WPSEO_Admin_Asset_Manager::PREFIX . 'social-metadata-forms',
- WPSEO_Admin_Asset_Manager::PREFIX . 'style-guide',
- WPSEO_Admin_Asset_Manager::PREFIX . 'styled-components',
- WPSEO_Admin_Asset_Manager::PREFIX . 'yoast-components',
- ],
- ],
- [
- 'name' => 'yoast-social-metadata-previews',
- 'path' => 'assets/js/dist/',
- 'filename' => 'yoast-premium-social-metadata-previews-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'in_footer' => true,
- 'dependencies' => [
- 'wp-components',
- 'wp-element',
- 'wp-plugins',
- WPSEO_Admin_Asset_Manager::PREFIX . 'editor-modules',
- WPSEO_Admin_Asset_Manager::PREFIX . 'search-metadata-previews',
- WPSEO_Admin_Asset_Manager::PREFIX . 'social-metadata-previews-package',
- ],
- ],
- [
- 'name' => 'wp-seo-premium-custom-fields-plugin',
- 'path' => 'assets/js/dist/',
- 'filename' => 'wp-seo-premium-custom-fields-plugin-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'jquery',
- 'yoast-seo-premium-commons',
- ],
- ],
- [
- 'name' => 'wp-seo-premium-quickedit-notification',
- 'path' => 'assets/js/dist/',
- 'filename' => 'wp-seo-premium-quickedit-notification-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'jquery',
- 'wp-api',
- 'wp-api-fetch',
- 'yoast-seo-premium-commons',
- ],
- ],
- [
- 'name' => 'wp-seo-premium-redirect-notifications',
- 'path' => 'assets/js/dist/',
- 'filename' => 'wp-seo-premium-redirect-notifications-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'jquery',
- 'wp-api',
- 'wp-api-fetch',
- 'yoast-seo-premium-commons',
- ],
- ],
- [
- 'name' => 'wp-seo-premium-redirect-notifications-gutenberg',
- 'path' => 'assets/js/dist/',
- 'filename' => 'wp-seo-premium-redirect-notifications-gutenberg-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'wp-api-fetch',
- 'wp-components',
- 'wp-element',
- 'wp-i18n',
- 'wp-plugins',
- WPSEO_Admin_Asset_Manager::PREFIX . 'yoast-components',
- ],
- ],
- [
- 'name' => 'wp-seo-premium-dynamic-blocks',
- 'path' => 'assets/js/dist/',
- 'filename' => 'dynamic-blocks-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'lodash',
- 'wp-blocks',
- 'wp-data',
- 'wp-dom-ready',
- 'wp-hooks',
- 'wp-server-side-render',
- ],
- ],
- [
- 'name' => 'wp-seo-premium-blocks',
- 'path' => 'assets/js/dist/',
- 'filename' => 'blocks-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'wp-block-editor',
- 'wp-blocks',
- 'wp-components',
- 'wp-data',
- 'wp-dom-ready',
- 'wp-element',
- 'wp-i18n',
- 'yoast-seo-premium-metabox',
- WPSEO_Admin_Asset_Manager::PREFIX . 'editor-modules',
- WPSEO_Admin_Asset_Manager::PREFIX . 'yoast-components',
- ],
- ],
- [
- 'name' => 'yoast-premium-prominent-words-indexation',
- 'path' => 'assets/js/dist/',
- 'filename' => 'yoast-premium-prominent-words-indexation-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'regenerator-runtime',
- 'yoast-seo-premium-commons',
- WPSEO_Admin_Asset_Manager::PREFIX . 'analysis',
- WPSEO_Admin_Asset_Manager::PREFIX . 'editor-modules',
- WPSEO_Admin_Asset_Manager::PREFIX . 'indexation',
- ],
- ],
- [
- 'name' => 'elementor-premium',
- 'path' => 'assets/js/dist/',
- 'filename' => 'wp-seo-premium-elementor-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'clipboard',
- 'jquery',
- 'regenerator-runtime',
- 'underscore',
- 'wp-api-fetch',
- 'wp-components',
- 'wp-data',
- 'wp-element',
- 'wp-hooks',
- 'wp-i18n',
- 'wp-util',
- 'yoast-seo-premium-commons',
- WPSEO_Admin_Asset_Manager::PREFIX . 'analysis',
- WPSEO_Admin_Asset_Manager::PREFIX . 'editor-modules',
- WPSEO_Admin_Asset_Manager::PREFIX . 'help-scout-beacon',
- WPSEO_Admin_Asset_Manager::PREFIX . 'search-metadata-previews',
- WPSEO_Admin_Asset_Manager::PREFIX . 'social-metadata-forms',
- WPSEO_Admin_Asset_Manager::PREFIX . 'social-metadata-previews-package',
- WPSEO_Admin_Asset_Manager::PREFIX . 'yoast-components',
- ],
- 'footer' => true,
- ],
- [
- 'name' => 'wp-seo-premium-ai-generator',
- 'path' => 'assets/js/dist/',
- 'filename' => 'ai-generator-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'lodash',
- 'regenerator-runtime',
- 'wp-api-fetch',
- 'wp-components',
- 'wp-data',
- 'wp-dom-ready',
- 'wp-element',
- 'wp-hooks',
- 'wp-i18n',
- 'yoast-seo-premium-commons',
- WPSEO_Admin_Asset_Manager::PREFIX . 'analysis',
- WPSEO_Admin_Asset_Manager::PREFIX . 'editor-modules',
- WPSEO_Admin_Asset_Manager::PREFIX . 'ui-library-package',
- WPSEO_Admin_Asset_Manager::PREFIX . 'react-helmet-package',
- ],
- ],
- [
- 'name' => 'wp-seo-premium-manage-ai-consent-button',
- 'path' => 'assets/js/dist/',
- 'filename' => 'manage-ai-consent-button-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'lodash',
- 'regenerator-runtime',
- 'wp-api-fetch',
- 'wp-components',
- 'wp-data',
- 'wp-dom-ready',
- 'wp-element',
- 'wp-hooks',
- 'wp-i18n',
- 'yoast-seo-premium-commons',
- WPSEO_Admin_Asset_Manager::PREFIX . 'ui-library-package',
- WPSEO_Admin_Asset_Manager::PREFIX . 'react-helmet-package',
- ],
- ],
- [
- 'name' => 'wp-seo-premium-introductions',
- 'path' => 'assets/js/dist/',
- 'filename' => 'introductions-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- 'dependencies' => [
- 'lodash',
- 'regenerator-runtime',
- 'wp-api-fetch',
- 'wp-components',
- 'wp-data',
- 'wp-dom-ready',
- 'wp-element',
- 'wp-hooks',
- 'wp-i18n',
- 'yoast-seo-premium-commons',
- WPSEO_Admin_Asset_Manager::PREFIX . 'introductions',
- WPSEO_Admin_Asset_Manager::PREFIX . 'ui-library-package',
- WPSEO_Admin_Asset_Manager::PREFIX . 'react-helmet-package',
- ],
- ],
- ];
- }
-
- /**
- * Retrieves an array of styles to register.
- *
- * @codeCoverageIgnore Returns a simple dataset.
- *
- * @param string $version Current version number.
- *
- * @return array The styles.
- */
- protected function get_styles( $version ) {
- $rtl_suffix = ( is_rtl() ) ? '-rtl' : '';
-
- return [
- [
- 'name' => WPSEO_Admin_Asset_Manager::PREFIX . 'premium-metabox',
- 'source' => 'assets/css/dist/premium-metabox-' . $version . '.css',
- 'dependencies' => [],
- ],
- [
- 'name' => WPSEO_Admin_Asset_Manager::PREFIX . 'premium-workouts',
- 'source' => 'assets/css/dist/premium-workouts-' . $version . '.css',
- 'dependencies' => [
- 'wp-components',
- ],
- ],
- [
- 'name' => 'elementor-premium',
- 'source' => 'assets/css/dist/premium-elementor-' . $version . '.css',
- 'dependencies' => [
- WPSEO_Admin_Asset_Manager::PREFIX . 'premium-metabox',
- ],
- ],
- [
- 'name' => WPSEO_Admin_Asset_Manager::PREFIX . 'premium-draft-js-plugins',
- 'source' => 'assets/css/dist/premium-draft-js-plugins-' . $version . '.css',
- 'dependencies' => [],
- ],
- [
- 'name' => WPSEO_Admin_Asset_Manager::PREFIX . 'premium-thank-you',
- 'source' => 'assets/css/dist/premium-thank-you-' . $version . '.css',
- 'dependencies' => [],
- ],
- [
- 'name' => WPSEO_Admin_Asset_Manager::PREFIX . 'premium-settings',
- 'source' => 'assets/css/dist/premium-settings-' . $version . '.css',
- 'dependencies' => [],
- ],
- [
- 'name' => WPSEO_Admin_Asset_Manager::PREFIX . 'premium-post-overview',
- 'source' => 'assets/css/dist/premium-post-overview-' . $version . '.css',
- 'dependencies' => [],
- ],
- [
- 'name' => WPSEO_Admin_Asset_Manager::PREFIX . 'premium-tailwind',
- 'source' => 'assets/css/dist/premium-tailwind-' . $version . $rtl_suffix . '.css',
- 'dependencies' => [],
- ],
- [
- 'name' => WPSEO_Admin_Asset_Manager::PREFIX . 'premium-ai-generator',
- 'source' => 'assets/css/dist/premium-ai-generator-' . $version . $rtl_suffix . '.css',
- 'dependencies' => [
- WPSEO_Admin_Asset_Manager::PREFIX . 'premium-tailwind',
- WPSEO_Admin_Asset_Manager::PREFIX . 'monorepo',
- ],
- ],
- ];
- }
-
- /**
- * Registers the given script to WordPress.
- *
- * @codeCoverageIgnore Method calls a WordPress function.
- *
- * @param array $script The script to register.
- *
- * @return void
- */
- protected function register_script( $script ) {
- $url = plugin_dir_url( WPSEO_PREMIUM_FILE ) . $script['path'] . $script['filename'];
-
- if ( defined( 'YOAST_SEO_PREMIUM_DEV_SERVER' ) && YOAST_SEO_PREMIUM_DEV_SERVER ) {
- $url = 'http://localhost:8081/' . $script['filename'];
- }
-
- $in_footer = ( $script['in_footer'] ?? false );
-
- wp_register_script(
- $script['name'],
- $url,
- $script['dependencies'],
- WPSEO_PREMIUM_VERSION,
- $in_footer
- );
- }
-
- /**
- * Registers the given style to WordPress.
- *
- * @codeCoverageIgnore Method calls a WordPress function.
- *
- * @param array $style The style to register.
- *
- * @return void
- */
- protected function register_style( $style ) {
- wp_register_style(
- $style['name'],
- plugin_dir_url( WPSEO_PREMIUM_FILE ) . $style['source'],
- $style['dependencies'],
- WPSEO_PREMIUM_VERSION
- );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-expose-shortlinks.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-expose-shortlinks.php
deleted file mode 100644
index 2f2a2f2d..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-expose-shortlinks.php
+++ /dev/null
@@ -1,36 +0,0 @@
- '',
- 'success' => false,
- 'status' => null,
- ];
- }
-
- $this->import = $import;
- $this->htaccess_import();
- $this->do_plugin_imports();
- $this->do_csv_imports();
-
- return $this->import;
- }
-
- /**
- * Outputs a tab header for the htaccess import block.
- *
- * @return void
- */
- public function redirects_import_header() {
- /* translators: %s: '.htaccess' file name */
- echo '' . esc_html__( 'Import redirects', 'wordpress-seo-premium' ) . ' ';
- }
-
- /**
- * Adding the import block for redirects.
- *
- * @return void
- */
- public function add_redirect_import_block() {
- $import = $this->import;
-
- // Display the forms.
- require WPSEO_PREMIUM_PATH . 'classes/views/import-redirects.php';
- }
-
- /**
- * Do .htaccess file import.
- *
- * @return void
- */
- protected function htaccess_import() {
- $htaccess = $this->get_posted_htaccess();
-
- if ( ! $htaccess || $htaccess === '' ) {
- return;
- }
-
- try {
- $loader = new WPSEO_Redirect_HTAccess_Loader( $htaccess );
- $result = $this->import_redirects_from_loader( $loader );
-
- $this->set_import_success( $result );
- }
- catch ( WPSEO_Redirect_Import_Exception $e ) {
- $this->set_import_message( $e->getMessage() );
- }
- }
-
- /**
- * Handles plugin imports.
- *
- * @return void
- */
- protected function do_plugin_imports() {
- $import_plugin = $this->get_posted_import_plugin();
-
- if ( ! $import_plugin ) {
- return;
- }
-
- try {
- $loader = $this->get_plugin_loader( $import_plugin );
- $result = $this->import_redirects_from_loader( $loader );
-
- $this->set_import_success( $result );
- }
- catch ( WPSEO_Redirect_Import_Exception $e ) {
- $this->set_import_message( $e->getMessage() );
- }
- }
-
- /**
- * Processes a CSV import.
- *
- * @return void
- */
- protected function do_csv_imports() {
- $redirects_csv_file = $this->get_posted_csv_file();
-
- if ( ! $redirects_csv_file ) {
- return;
- }
-
- try {
- $this->validate_uploaded_csv_file( $redirects_csv_file );
-
- // Load the redirects from the uploaded file.
- $loader = new WPSEO_Redirect_CSV_Loader( $redirects_csv_file['tmp_name'] );
- $result = $this->import_redirects_from_loader( $loader );
-
- $this->set_import_success( $result );
- }
- catch ( WPSEO_Redirect_Import_Exception $e ) {
- $this->set_import_message( $e->getMessage() );
- }
- }
-
- /**
- * Sets the import message.
- *
- * @param string $import_message The message.
- *
- * @return void
- */
- protected function set_import_message( $import_message ) {
- $this->import->msg .= $import_message;
- }
-
- /**
- * Sets the import success state to true.
- *
- * @param array $result The import result.
- *
- * @return void
- */
- protected function set_import_success( array $result ) {
- $this->import->success = true;
-
- $this->set_import_message(
- $this->get_success_message( $result['total_imported'], $result['total_redirects'] )
- );
- }
-
- /**
- * Retrieves the success message when import has been successful.
- *
- * @param int $total_imported The number of imported redirects.
- * @param int $total_redirects The total amount of redirects.
- *
- * @return string The generated message.
- */
- protected function get_success_message( $total_imported, $total_redirects ) {
- if ( $total_imported === $total_redirects ) {
- return sprintf(
- /* translators: 1: link to redirects overview, 2: closing link tag */
- __( 'All redirects have been imported successfully. Go to the %1$sredirects overview%2$s to see the imported redirects.', 'wordpress-seo-premium' ),
- '',
- ' '
- );
- }
-
- if ( $total_imported === 0 ) {
- return sprintf(
- /* translators: 1: link to redirects overview, 2: closing link tag */
- __( 'No redirects have been imported. Probably they already exist as a redirect. Go to the %1$sredirects overview%2$s to see the existing redirects.', 'wordpress-seo-premium' ),
- '',
- ' '
- );
- }
-
- return sprintf(
- /* translators: 1: amount of imported redirects, 2: total amount of redirects, 3: link to redirects overview, 4: closing link tag */
- _n(
- 'Imported %1$s/%2$s redirects successfully. Go to the %3$sredirects overview%4$s to see the imported redirect.',
- 'Imported %1$s/%2$s redirects successfully. Go to the %3$sredirects overview%4$s to see the imported redirects.',
- $total_imported,
- 'wordpress-seo-premium'
- ),
- $total_imported,
- $total_redirects,
- '',
- ' '
- );
- }
-
- /**
- * Returns a loader for the given plugin.
- *
- * @codeCoverageIgnore
- *
- * @param string $plugin_name The plugin we want to load redirects from.
- *
- * @return bool|WPSEO_Redirect_Abstract_Loader The redirect loader.
- *
- * @throws WPSEO_Redirect_Import_Exception When the plugin is not installed or activated.
- */
- protected function get_plugin_loader( $plugin_name ) {
- global $wpdb;
-
- switch ( $plugin_name ) {
- case 'redirection':
- // Only do import if Redirections is active.
- if ( ! defined( 'REDIRECTION_VERSION' ) ) {
- throw new WPSEO_Redirect_Import_Exception(
- __( 'Redirect import failed: the Redirection plugin is not installed or activated.', 'wordpress-seo-premium' )
- );
- }
- return new WPSEO_Redirect_Redirection_Loader( $wpdb );
- case 'safe_redirect_manager':
- return new WPSEO_Redirect_Safe_Redirect_Loader();
- case 'simple-301-redirects':
- return new WPSEO_Redirect_Simple_301_Redirect_Loader();
- default:
- throw new WPSEO_Redirect_Import_Exception(
- __( 'Redirect import failed: the selected redirect plugin is not installed or activated.', 'wordpress-seo-premium' )
- );
- }
- }
-
- /**
- * Validates an uploaded CSV file.
- *
- * @param array $csv_file The file to upload, from the $_FILES object.
- *
- * @return void
- *
- * @throws WPSEO_Redirect_Import_Exception When the given file is invalid.
- */
- protected function validate_uploaded_csv_file( $csv_file ) {
-
- // If no file is selected.
- if ( array_key_exists( 'name', $csv_file ) && $csv_file['name'] === '' ) {
- $error_message = __( 'CSV import failed: No file selected.', 'wordpress-seo-premium' );
- throw new WPSEO_Redirect_Import_Exception( $error_message );
- }
-
- // If the file upload failed for any other reason.
- if ( array_key_exists( 'error', $csv_file ) && $csv_file['error'] !== UPLOAD_ERR_OK ) {
- $error_message = __( 'CSV import failed: the provided file could not be parsed using a CSV parser.', 'wordpress-seo-premium' );
- throw new WPSEO_Redirect_Import_Exception( $error_message );
- }
-
- // If somehow the file is larger than it should be.
- if ( $csv_file['size'] > wp_max_upload_size() ) {
- $max_size_formatted = size_format( wp_max_upload_size() );
- /* translators: 1: The maximum file size */
- $error_message = sprintf( __( 'CSV import failed: the provided file is larger than %1$s.', 'wordpress-seo-premium' ), $max_size_formatted );
- throw new WPSEO_Redirect_Import_Exception( $error_message );
- }
-
- // If it's not a CSV file (send the csv mimetype along for multisite installations).
- $filetype = wp_check_filetype( $csv_file['name'], [ 'csv' => 'text/csv' ] );
- if ( strtolower( $filetype['ext'] ) !== 'csv' ) {
- $error_message = __( 'CSV import failed: the provided file is not a CSV file.', 'wordpress-seo-premium' );
- throw new WPSEO_Redirect_Import_Exception( $error_message );
- }
- }
-
- /**
- * Imports all redirects from the loader.
- *
- * @codeCoverageIgnore
- *
- * @param WPSEO_Redirect_Loader $loader The loader to import redirects from.
- *
- * @return array The result of the import.
- *
- * @throws WPSEO_Redirect_Import_Exception When there is no loader given or when there are no redirects.
- */
- protected function import_redirects_from_loader( WPSEO_Redirect_Loader $loader ) {
- if ( ! $loader ) {
- throw new WPSEO_Redirect_Import_Exception(
- __( 'Redirect import failed: we can\'t recognize this type of import.', 'wordpress-seo-premium' )
- );
- }
-
- $redirects = $loader->load();
-
- if ( count( $redirects ) === 0 ) {
- throw new WPSEO_Redirect_Import_Exception(
- __( 'Redirect import failed: no redirects found.', 'wordpress-seo-premium' )
- );
- }
-
- $importer = new WPSEO_Redirect_Importer();
- return $importer->import( $redirects );
- }
-
- /**
- * Retrieves the posted htaccess.
- *
- * @codeCoverageIgnore
- *
- * @return string The posted htaccess.
- */
- protected function get_posted_htaccess() {
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are validating a nonce here.
- if ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'wpseo-import' )
- && isset( $_POST['htaccess'] ) && is_string( $_POST['htaccess'] ) ) {
- return sanitize_text_field( wp_unslash( $_POST['htaccess'] ) );
- }
-
- return '';
- }
-
- /**
- * Retrieves the posted import plugin.
- *
- * @codeCoverageIgnore
- *
- * @return string|null The posted import plugin.
- */
- protected function get_posted_import_plugin() {
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are validating a nonce here.
- if ( isset( $_POST['_wpnonce'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'wpseo-import' )
- && isset( $_POST['wpseo'] ) && is_array( $_POST['wpseo'] )
- && isset( $_POST['wpseo']['import_plugin'] ) && is_string( $_POST['wpseo']['import_plugin'] ) ) {
- return sanitize_text_field( wp_unslash( $_POST['wpseo']['import_plugin'] ) );
- }
-
- return null;
- }
-
- /**
- * Retrieves the posted CSV file.
- *
- * @codeCoverageIgnore
- *
- * @return array|null The posted CSV file.
- */
- protected function get_posted_csv_file() {
- if ( ! isset( $_FILES['redirects_csv_file'] ) ) {
- return null;
- }
-
- return $_FILES['redirects_csv_file'];
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-javascript-strings.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-javascript-strings.php
deleted file mode 100644
index 62878a0c..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-javascript-strings.php
+++ /dev/null
@@ -1,80 +0,0 @@
- __( 'You can\'t redirect a URL to itself.', 'wordpress-seo-premium' ),
- 'error_old_url' => __( 'The old URL field can\'t be empty.', 'wordpress-seo-premium' ),
- 'error_regex' => __( 'The Regular Expression field can\'t be empty.', 'wordpress-seo-premium' ),
- 'error_new_url' => __( 'The new URL field can\'t be empty.', 'wordpress-seo-premium' ),
- 'error_saving_redirect' => __( 'Error while saving this redirect', 'wordpress-seo-premium' ),
- 'error_new_type' => __( 'New type can\'t be empty.', 'wordpress-seo-premium' ),
- 'unsaved_redirects' => __( 'You have unsaved redirects, are you sure you want to leave?', 'wordpress-seo-premium' ),
-
- /* translators: %s is replaced with the URL that will be deleted. */
- 'enter_new_url' => __( 'Please enter the new URL for %s', 'wordpress-seo-premium' ),
- /* translators: variables will be replaced with from and to URLs. */
- 'redirect_saved' => __( 'Redirect created from %1$s to %2$s!', 'wordpress-seo-premium' ),
- /* translators: %1$s will be replaced with the from URL. */
- 'redirect_saved_no_target' => __( '410 Redirect created from %1$s!', 'wordpress-seo-premium' ),
-
- 'redirect_added' => [
- 'title' => __( 'Redirect added.', 'wordpress-seo-premium' ),
- 'message' => __( 'The redirect was added successfully.', 'wordpress-seo-premium' ),
- ],
- 'redirect_updated' => [
- 'title' => __( 'Redirect updated.', 'wordpress-seo-premium' ),
- 'message' => __( 'The redirect was updated successfully.', 'wordpress-seo-premium' ),
- ],
- 'redirect_deleted' => [
- 'title' => __( 'Redirect deleted.', 'wordpress-seo-premium' ),
- 'message' => __( 'The redirect was deleted successfully.', 'wordpress-seo-premium' ),
- ],
-
- 'button_ok' => __( 'OK', 'wordpress-seo-premium' ),
- 'button_cancel' => __( 'Cancel', 'wordpress-seo-premium' ),
- 'button_save' => __( 'Save', 'wordpress-seo-premium' ),
- 'button_save_anyway' => __( 'Save anyway', 'wordpress-seo-premium' ),
-
- 'edit_redirect' => __( 'Edit redirect', 'wordpress-seo-premium' ),
- 'editing_redirect' => __( 'You are already editing a redirect, please finish this one first', 'wordpress-seo-premium' ),
-
- 'editAction' => __( 'Edit', 'wordpress-seo-premium' ),
- 'deleteAction' => __( 'Delete', 'wordpress-seo-premium' ),
- ];
- }
-
- /**
- * Returns an array with all the translated strings.
- *
- * @return string[]
- */
- public static function strings() {
- if ( self::$strings === null ) {
- self::fill();
- }
-
- return self::$strings;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-keyword-export-manager.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-keyword-export-manager.php
deleted file mode 100644
index e766f6b1..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-keyword-export-manager.php
+++ /dev/null
@@ -1,209 +0,0 @@
-'
- . esc_html__( 'Export keyphrases', 'wordpress-seo-premium' )
- . '';
- }
- }
-
- /**
- * Adds the export block for CSV. Makes it able to export redirects to CSV.
- *
- * @return void
- */
- public function add_keyword_export_tab_block() {
- // Display the forms.
- if ( current_user_can( 'export' ) ) {
- $yform = Yoast_Form::get_instance();
- require WPSEO_PREMIUM_PATH . 'classes/views/export-keywords.php';
- }
- }
-
- /**
- * Hooks into the request and returns a CSV file if we're on the right page with the right method and the right capabilities.
- *
- * @return void
- */
- public function keywords_csv_export() {
-
- if ( ! $this->is_valid_csv_export_request() || ! current_user_can( 'export' ) ) {
- return;
- }
-
- // Check if we have a valid nonce.
- check_admin_referer( 'wpseo-export' );
-
- // Clean any content that has been already outputted, for example by other plugins or faulty PHP files.
- if ( ob_get_contents() ) {
- ob_clean();
- }
-
- // Make sure we don't time out during the collection of items.
- set_time_limit( 0 );
-
- // Set CSV headers and content.
- $this->set_csv_headers();
-
- // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- This is controlled output.
- echo $this->get_csv_contents();
-
- // And exit so we don't start appending HTML to our CSV file.
- // NOTE: this makes this entire class untestable as it will exit all tests but WordPress seems to have no elegant way of handling this.
- exit;
- }
-
- /**
- * Returns whether this is a POST request for a CSV export of posts and keywords.
- *
- * @return bool True if this is a valid CSV export request.
- */
- protected function is_valid_csv_export_request() {
- // phpcs:disable WordPress.Security.NonceVerification -- Reason: Nonce is checked in export.
- // phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are strictly comparing only or ignoring the value.
- return ( isset( $_GET['page'] ) && is_string( $_GET['page'] ) && wp_unslash( $_GET['page'] ) === 'wpseo_tools' )
- && ( isset( $_GET['tool'] ) && is_string( $_GET['tool'] ) && wp_unslash( $_GET['tool'] ) === 'import-export' )
- && ( isset( $_POST['export-posts'] ) && ! empty( $_POST['export-posts'] ) );
- // phpcs:enable
- }
-
- /**
- * Sets the headers to trigger a CSV download in the browser.
- *
- * @return void
- */
- protected function set_csv_headers() {
- header( 'Content-type: text/csv' );
- header( 'Content-Disposition: attachment; filename=' . gmdate( 'Y-m-d' ) . '-yoast-seo-keywords.csv' );
- header( 'Pragma: no-cache' );
- header( 'Expires: 0' );
- }
-
- /**
- * Generates the CSV to be exported.
- *
- * @return void
- */
- protected function get_csv_contents() {
- $columns = [ 'keywords' ];
-
- $post_wpseo = filter_input( INPUT_POST, 'wpseo', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
-
- if ( is_array( $post_wpseo ) ) {
- $columns = array_merge( $columns, $this->get_export_columns( $post_wpseo ) );
- }
-
- $builder = new WPSEO_Export_Keywords_CSV( $columns );
- $builder->print_headers();
- $this->prepare_export( $builder, $columns );
- }
-
- /**
- * Returns an array of the requested columns.
- *
- * @param array $post_object An associative array with the post data.
- *
- * @return array List of export columns.
- */
- protected function get_export_columns( array $post_object ) {
- $exportable_columns = [
- 'export-keywords-score' => 'keywords_score',
- 'export-url' => 'url',
- 'export-title' => 'title',
- 'export-seo-title' => 'seo_title',
- 'export-meta-description' => 'meta_description',
- 'export-readability-score' => 'readability_score',
- ];
-
- // Need to call array_values to ensure that we get a numerical key back.
- return array_values( array_intersect_key( $exportable_columns, $post_object ) );
- }
-
- /**
- * Feeds post and term items to the CSV builder.
- *
- * @param WPSEO_Export_Keywords_CSV $builder The builder to use.
- * @param array $columns The columns that need to be exported.
- *
- * @return void
- */
- protected function prepare_export( WPSEO_Export_Keywords_CSV $builder, array $columns ) {
- $this->feed_to_builder(
- $builder,
- new WPSEO_Export_Keywords_Post_Query( $columns, 1000 ),
- new WPSEO_Export_Keywords_Post_Presenter( $columns )
- );
-
- $this->feed_to_builder(
- $builder,
- new WPSEO_Export_Keywords_Term_Query( $columns, 1000 ),
- new WPSEO_Export_Keywords_Term_Presenter( $columns )
- );
- }
-
- /**
- * Fetches the items and feeds them to the builder.
- *
- * @param WPSEO_Export_Keywords_CSV $builder Builder to feed the items to.
- * @param WPSEO_Export_Keywords_Query $export_query Query to use to get the items.
- * @param WPSEO_Export_Keywords_Presenter $presenter Presenter to present the items in the builder format.
- *
- * @return void
- */
- protected function feed_to_builder( WPSEO_Export_Keywords_CSV $builder, WPSEO_Export_Keywords_Query $export_query, WPSEO_Export_Keywords_Presenter $presenter ) {
- $page_size = $export_query->get_page_size();
-
- $page = 1;
- do {
- $results = $export_query->get_data( $page );
-
- if ( ! is_array( $results ) ) {
- break;
- }
-
- $result_count = count( $results );
-
- // Present the result.
- $presented = array_map( [ $presenter, 'present' ], $results );
-
- // Feed presented item to the builder.
- array_walk( $presented, [ $builder, 'print_row' ] );
-
- ++$page;
-
- // If we have the number of items per page, there will be more items ahead.
- } while ( $result_count === $page_size );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-metabox.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-metabox.php
deleted file mode 100644
index dbe2cbb7..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-metabox.php
+++ /dev/null
@@ -1,392 +0,0 @@
-prominent_words_helper = $prominent_words_helper;
- $this->current_page_helper = $current_page_helper;
- $this->link_suggestions = $link_suggestions;
- }
-
- /**
- * Registers relevant hooks to WordPress.
- *
- * @codeCoverageIgnore Method uses dependencies.
- *
- * @return void
- */
- public function register_hooks() {
- add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
- add_action( 'admin_init', [ $this, 'initialize' ] );
-
- $this->link_suggestions->register_hooks();
- }
-
- /**
- * Checks if the content endpoints are available.
- *
- * @return bool Returns true if the content endpoints are available
- */
- public static function are_content_endpoints_available() {
- if ( function_exists( 'rest_get_server' ) ) {
- $namespaces = rest_get_server()->get_namespaces();
-
- return in_array( 'wp/v2', $namespaces, true );
- }
-
- return false;
- }
-
- /**
- * Initializes the metabox by loading the register_hooks for the dependencies.
- *
- * @return void
- */
- public function initialize() {
- if ( ! $this->load_metabox( $this->get_current_page() ) ) {
- return;
- }
-
- foreach ( $this->get_metabox_integrations() as $integration ) {
- $integration->register_hooks();
- }
- }
-
- /**
- * Enqueues assets when relevant.
- *
- * @codeCoverageIgnore Method uses dependencies.
- *
- * @return void
- */
- public function enqueue_assets() {
- if ( ! $this->load_metabox( $this->get_current_page() ) ) {
- return;
- }
-
- wp_enqueue_script( WPSEO_Admin_Asset_Manager::PREFIX . 'premium-metabox' );
- wp_enqueue_style( WPSEO_Admin_Asset_Manager::PREFIX . 'premium-metabox' );
-
- $premium_localization = new WPSEO_Premium_Asset_JS_L10n();
- $premium_localization->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'premium-metabox' );
-
- $this->send_data_to_assets();
- }
-
- /**
- * Send data to assets by using wp_localize_script.
- * Also localizes the Table of Contents heading title to the wp-seo-premium-blocks asset.
- *
- * @return void
- */
- public function send_data_to_assets() {
- $analysis_seo = new WPSEO_Metabox_Analysis_SEO();
- $content_analysis = new WPSEO_Metabox_Analysis_Readability();
- $assets_manager = new WPSEO_Admin_Asset_Manager();
-
- /**
- * Filters the parameter to disable Table of Content block.
- *
- * Note: Used to prevent auto-generation of HTML anchors for headings when TOC block is registered.
- *
- * @since 21.5
- *
- * @param bool $disable_table_of_content The value of the `autoload` parameter. Default: false.
- *
- * @return bool The filtered value of the `disable_table_of_content` parameter.
- */
- $disable_table_of_content = apply_filters( 'Yoast\WP\SEO\disable_table_of_content_block', false );
-
- $data = [
- 'restApi' => $this->get_rest_api_config(),
- 'seoAnalysisEnabled' => $analysis_seo->is_enabled(),
- 'contentAnalysisEnabled' => $content_analysis->is_enabled(),
- 'licensedURL' => WPSEO_Utils::get_home_url(),
- 'settingsPageUrl' => admin_url( 'admin.php?page=wpseo_page_settings#/site-features#card-wpseo-enable_link_suggestions' ),
- 'integrationsTabURL' => admin_url( 'admin.php?page=wpseo_integrations' ),
- 'commonsScriptUrl' => plugins_url(
- 'assets/js/dist/commons-premium-' . $assets_manager->flatten_version( WPSEO_PREMIUM_VERSION ) . WPSEO_CSSJS_SUFFIX . '.js',
- WPSEO_PREMIUM_FILE
- ),
- 'premiumAssessmentsScriptUrl' => plugins_url(
- 'assets/js/dist/register-premium-assessments-' . $assets_manager->flatten_version( WPSEO_PREMIUM_VERSION ) . WPSEO_CSSJS_SUFFIX . '.js',
- WPSEO_PREMIUM_FILE
- ),
- 'pluginUrl' => plugins_url( '', WPSEO_PREMIUM_FILE ),
- ];
-
- if ( defined( 'YOAST_SEO_TEXT_FORMALITY' ) && YOAST_SEO_TEXT_FORMALITY === true ) {
- $data['textFormalityScriptUrl'] = plugins_url(
- 'assets/js/dist/register-text-formality-' . $assets_manager->flatten_version( WPSEO_PREMIUM_VERSION ) . WPSEO_CSSJS_SUFFIX . '.js',
- WPSEO_PREMIUM_FILE
- );
- }
-
- if ( WPSEO_Metabox::is_post_edit( $this->get_current_page() ) ) {
- $data = array_merge( $data, $this->get_post_metabox_config() );
- }
- elseif ( WPSEO_Taxonomy::is_term_edit( $this->get_current_page() ) ) {
- $data = array_merge( $data, $this->get_term_metabox_config() );
- }
-
- if ( current_user_can( 'edit_others_posts' ) ) {
- $data['workoutsUrl'] = admin_url( 'admin.php?page=wpseo_workouts' );
- }
-
- // Use an extra level in the array to preserve booleans. WordPress sanitizes scalar values in the first level of the array.
- wp_localize_script( 'yoast-seo-premium-metabox', 'wpseoPremiumMetaboxData', [ 'data' => $data ] );
-
- // Localize the title of the Table of Contents block: the translation needs to be based on the site language instead of the user language.
- wp_localize_script(
- 'wp-seo-premium-blocks',
- 'wpseoTOCData',
- [
- 'data' => [
- 'TOCTitle' => __( 'Table of contents', 'wordpress-seo-premium' ),
- 'disableTableOfContents' => $disable_table_of_content,
- ],
- ]
- );
- }
-
- /**
- * Retrieves the metabox config for a post.
- *
- * @return array The config.
- */
- protected function get_post_metabox_config() {
- $link_suggestions_enabled = WPSEO_Options::get( 'enable_link_suggestions', false );
-
- $post = $this->get_post();
-
- $prominent_words_support = new WPSEO_Premium_Prominent_Words_Support();
- $is_prominent_words_available = $prominent_words_support->is_post_type_supported( $post->post_type );
-
- $site_locale = get_locale();
- $language = WPSEO_Language_Utils::get_language( $site_locale );
-
- return [
- 'currentObjectId' => $this->get_post_ID(),
- 'currentObjectType' => 'post',
- 'linkSuggestionsEnabled' => ( $link_suggestions_enabled ) ? 'enabled' : 'disabled',
- 'linkSuggestionsAvailable' => $is_prominent_words_available,
- 'linkSuggestionsUnindexed' => ! $this->is_prominent_words_indexing_completed() && WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ),
- 'perIndexableLimit' => $this->per_indexable_limit( $language ),
- 'isProminentWordsAvailable' => $is_prominent_words_available,
- 'isTitleAssessmentAvailable' => true,
- ];
- }
-
- /**
- * Retrieves the metabox config for a term.
- *
- * @return array The config.
- */
- protected function get_term_metabox_config() {
- $term = null;
- if ( isset( $GLOBALS['tag_ID'], $GLOBALS['taxonomy'] ) ) {
- $term = get_term( $GLOBALS['tag_ID'], $GLOBALS['taxonomy'] );
- }
-
- if ( $term === null || is_wp_error( $term ) ) {
- return [
- 'insightsEnabled' => 'disabled',
- 'linkSuggestionsEnabled' => 'disabled',
- 'linkSuggestionsAvailable' => false,
- 'linkSuggestionsUnindexed' => false,
- ];
- }
-
- $link_suggestions_enabled = WPSEO_Options::get( 'enable_link_suggestions', false );
-
- $prominent_words_support = new WPSEO_Premium_Prominent_Words_Support();
- $is_prominent_words_available = $prominent_words_support->is_taxonomy_supported( $term->taxonomy );
-
- $site_locale = get_locale();
- $language = WPSEO_Language_Utils::get_language( $site_locale );
-
- return [
- 'currentObjectId' => $term->term_id,
- 'currentObjectType' => 'term',
- 'linkSuggestionsEnabled' => ( $link_suggestions_enabled ) ? 'enabled' : 'disabled',
- 'linkSuggestionsAvailable' => $is_prominent_words_available,
- 'linkSuggestionsUnindexed' => ! $this->is_prominent_words_indexing_completed() && WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ),
- 'perIndexableLimit' => $this->per_indexable_limit( $language ),
- 'isProminentWordsAvailable' => $is_prominent_words_available,
- 'isTitleAssessmentAvailable' => false,
- ];
- }
-
- /**
- * Retrieves the REST API configuration.
- *
- * @return array The configuration.
- */
- protected function get_rest_api_config() {
- return [
- 'available' => WPSEO_Utils::is_api_available(),
- 'contentEndpointsAvailable' => self::are_content_endpoints_available(),
- 'root' => esc_url_raw( rest_url() ),
- 'nonce' => wp_create_nonce( 'wp_rest' ),
- ];
- }
-
- /**
- * Returns the post for the current admin page.
- *
- * @codeCoverageIgnore
- *
- * @return WP_Post The post for the current admin page.
- */
- protected function get_post() {
- return get_post( $this->get_post_ID() );
- }
-
- /**
- * Retrieves the post ID from the globals.
- *
- * @codeCoverageIgnore
- *
- * @return int The post ID.
- */
- protected function get_post_ID() {
- if ( ! isset( $GLOBALS['post_ID'] ) ) {
- return 0;
- }
-
- return $GLOBALS['post_ID'];
- }
-
- /**
- * Retrieves the metabox specific integrations.
- *
- * @codeCoverageIgnore
- *
- * @return WPSEO_WordPress_Integration[] The metabox integrations.
- */
- protected function get_metabox_integrations() {
- return [
- 'social-previews' => new WPSEO_Social_Previews(),
-
- // Add custom fields plugin to post and page edit pages.
- 'premium-custom-fields' => new WPSEO_Custom_Fields_Plugin(),
- ];
- }
-
- /**
- * Checks whether or not the metabox related scripts should be loaded.
- *
- * @codeCoverageIgnore
- *
- * @param string $current_page The page we are on.
- *
- * @return bool True when it should be loaded.
- */
- protected function load_metabox( $current_page ) {
- // When the current page is a term related one.
- if ( WPSEO_Taxonomy::is_term_edit( $current_page ) || WPSEO_Taxonomy::is_term_overview( $current_page ) ) {
- return WPSEO_Options::get( 'display-metabox-tax-' . $this->current_page_helper->get_current_taxonomy() );
- }
-
- // When the current page isn't a post related one.
- if ( WPSEO_Metabox::is_post_edit( $current_page ) || WPSEO_Metabox::is_post_overview( $current_page ) ) {
- return WPSEO_Post_Type::has_metabox_enabled( $this->current_page_helper->get_current_post_type() );
- }
-
- // Make sure ajax integrations are loaded.
- return wp_doing_ajax();
- }
-
- /**
- * Retrieves the value of the pagenow variable.
- *
- * @codeCoverageIgnore
- *
- * @return string The value of pagenow.
- */
- private function get_current_page() {
- global $pagenow;
-
- return $pagenow;
- }
-
- /**
- * Returns whether or not we need to index more posts for correct link suggestion functionality.
- *
- * @return bool Whether or not we need to index more posts.
- */
- protected function is_prominent_words_indexing_completed() {
- $is_indexing_completed = $this->prominent_words_helper->is_indexing_completed();
- if ( $is_indexing_completed === null ) {
- $indexation_integration = YoastSEOPremium()->classes->get( Indexing_Integration::class );
- $is_indexing_completed = $indexation_integration->get_unindexed_count( 0 ) === 0;
-
- $this->prominent_words_helper->set_indexing_completed( $is_indexing_completed );
- }
-
- return $is_indexing_completed;
- }
-
- /**
- * Returns the number of prominent words to store for content written in the given language.
- *
- * @param string $language The current language.
- *
- * @return int The number of words to store.
- */
- protected function per_indexable_limit( $language ) {
- if ( YoastSEO()->helpers->language->has_function_word_support( $language ) ) {
- return Indexing_Integration::PER_INDEXABLE_LIMIT;
- }
-
- return Indexing_Integration::PER_INDEXABLE_LIMIT_NO_FUNCTION_WORD_SUPPORT;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-option.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-option.php
deleted file mode 100644
index 217e57a0..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-option.php
+++ /dev/null
@@ -1,102 +0,0 @@
-get_defaults();}}
- *
- * @var array
- */
- protected $defaults = [
- // Form fields.
- 'prominent_words_indexing_completed' => null,
- 'workouts' => [ 'cornerstone' => [ 'finishedSteps' => [] ] ],
- 'should_redirect_after_install' => false,
- 'activation_redirect_timestamp' => 0,
- 'dismiss_update_premium_notification' => '0',
- ];
-
- /**
- * Registers the option to the WPSEO Options framework.
- *
- * @return void
- */
- public static function register_option() {
- WPSEO_Options::register_option( static::get_instance() );
- }
-
- /**
- * Get the singleton instance of this class.
- *
- * @return static Returns instance of itself.
- */
- public static function get_instance() {
- if ( ! ( static::$instance instanceof static ) ) {
- static::$instance = new static();
- }
-
- return static::$instance;
- }
-
- /**
- * All concrete classes must contain a validate_option() method which validates all
- * values within the option.
- *
- * @param array $dirty New value for the option.
- * @param array $clean Clean value for the option, normally the defaults.
- * @param array $old Old value of the option.
- *
- * @return array The clean option value.
- */
- protected function validate_option( $dirty, $clean, $old ) {
- foreach ( $clean as $key => $value ) {
- switch ( $key ) {
- case 'prominent_words_indexing_completed':
- if ( isset( $dirty[ $key ] ) && $dirty[ $key ] !== null ) {
- $clean[ $key ] = WPSEO_Utils::validate_bool( $dirty[ $key ] );
- }
-
- break;
- case 'workouts':
- if ( isset( $dirty[ $key ] ) && is_array( $dirty[ $key ] ) ) {
- $clean[ $key ] = $dirty[ $key ];
- }
- break;
- case 'should_redirect_after_install':
- if ( isset( $dirty[ $key ] ) && is_bool( $dirty[ $key ] ) ) {
- $clean[ $key ] = $dirty[ $key ];
- }
- break;
- case 'activation_redirect_timestamp':
- if ( isset( $dirty[ $key ] ) && is_int( $dirty[ $key ] ) ) {
- $clean[ $key ] = $dirty[ $key ];
- }
- break;
- case 'dismiss_update_premium_notification':
- if ( isset( $dirty[ $key ] ) && is_string( $dirty[ $key ] ) ) {
- $clean[ $key ] = $dirty[ $key ];
- }
- break;
- }
- }
-
- return $clean;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-content-support.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-content-support.php
deleted file mode 100644
index 85e96a3a..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-content-support.php
+++ /dev/null
@@ -1,47 +0,0 @@
-get_supported_post_types(), true );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-content-utils.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-content-utils.php
deleted file mode 100644
index 804acaf2..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-content-utils.php
+++ /dev/null
@@ -1,44 +0,0 @@
-classes->get( Migration_Status::class )->is_version( 'free', WPSEO_VERSION ) ) {
- return false;
- }
-
- return WPSEO_Options::get( 'enable_text_link_counter', false );
- }
-
- /**
- * Checks if there are unprocessed objects.
- *
- * @return bool True when there are unprocessed objects.
- */
- public static function has_unprocessed_content() {
- static $has_unprocessed_posts;
-
- if ( $has_unprocessed_posts === null ) {
- $post_link_action = YoastSEO()->classes->get( Post_Link_Indexing_Action::class );
- $has_unprocessed_posts = $post_link_action->get_total_unindexed();
- }
-
- return $has_unprocessed_posts;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-post-filter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-post-filter.php
deleted file mode 100644
index 371727ae..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-post-filter.php
+++ /dev/null
@@ -1,196 +0,0 @@
-classes->get( Migration_Status::class )->is_version( 'free', WPSEO_VERSION ) ) {
- return;
- }
-
- if ( WPSEO_Premium_Orphaned_Content_Utils::is_feature_enabled() ) {
- parent::register_hooks();
- }
- }
-
- /**
- * Returns a text explaining this filter.
- *
- * @return string|null The explanation or null if the current post stype is unknown.
- */
- protected function get_explanation() {
- $post_type_object = get_post_type_object( $this->get_current_post_type() );
-
- if ( $post_type_object === null ) {
- return null;
- }
-
- $unprocessed = WPSEO_Premium_Orphaned_Content_Utils::has_unprocessed_content();
- $can_recalculate = WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' );
-
- $learn_more = sprintf(
- /* translators: %1$s expands to the link to an article to read more about orphaned content, %2$s expands to */
- __( '%1$sLearn more about orphaned content%2$s.', 'wordpress-seo-premium' ),
- '',
- ' '
- );
-
- if ( $unprocessed && ! $can_recalculate ) {
- return sprintf(
- /* translators: %1$s: plural form of the current post type, %2$s: a Learn more about link */
- __( 'Ask your SEO Manager or Site Administrator to count links in all texts, so we can identify orphaned %1$s. %2$s', 'wordpress-seo-premium' ),
- strtolower( $post_type_object->labels->name ),
- $learn_more
- );
- }
-
- if ( $unprocessed ) {
- return sprintf(
- /* translators: %1$s expands to link to the recalculation option, %2$s: anchor closing, %3$s: plural form of the current post type, %4$s: a Learn more about link */
- __( '%1$sClick here%2$s to index your links, so we can identify orphaned %3$s. %4$s', 'wordpress-seo-premium' ),
- '',
- ' ',
- strtolower( $post_type_object->labels->name ),
- $learn_more
- );
- }
-
- return sprintf(
- /* translators: %1$s: plural form of the current post type, %2$s: a Learn more about link */
- __( '\'Orphaned content\' refers to %1$s that have no inbound links, consider adding links towards these %1$s. %2$s', 'wordpress-seo-premium' ),
- strtolower( $post_type_object->labels->name ),
- $learn_more
- );
- }
-
- /**
- * Modifies the query based on the seo_filter variable in $_GET.
- *
- * @param string $where Query variables.
- *
- * @return string The modified query.
- */
- public function filter_posts( $where ) {
- if ( $this->is_filter_active() ) {
- $where .= $this->get_where_filter();
- $where .= $this->filter_published_posts();
- }
-
- return $where;
- }
-
- /**
- * Returns the where clause to use.
- *
- * @return string The where clause.
- */
- protected function get_where_filter() {
- global $wpdb;
-
- if ( WPSEO_Premium_Orphaned_Content_Utils::has_unprocessed_content() ) {
- // Hide all posts, because we cannot tell anything for certain.
- return 'AND 1 = 0';
- }
-
- $subquery = WPSEO_Premium_Orphaned_Post_Query::get_orphaned_content_query();
- return ' AND ' . $wpdb->posts . '.ID IN ( ' . $subquery . ' ) ';
- }
-
- /**
- * Adds a published posts filter so we don't show unpublished posts in the orphaned pages results.
- *
- * @return string A published posts filter.
- */
- protected function filter_published_posts() {
- global $wpdb;
-
- return " AND {$wpdb->posts}.post_status = 'publish' AND {$wpdb->posts}.post_password = ''";
- }
-
- /**
- * Returns the label for this filter.
- *
- * @return string The label for this filter.
- */
- protected function get_label() {
- static $label;
-
- if ( $label === null ) {
- $label = __( 'Orphaned content', 'wordpress-seo-premium' );
- }
-
- return $label;
- }
-
- /**
- * Returns the total amount of articles that are orphaned content.
- *
- * @return int
- */
- protected function get_post_total() {
- global $wpdb;
-
- static $count;
-
- if ( WPSEO_Premium_Orphaned_Content_Utils::has_unprocessed_content() ) {
- return '?';
- }
-
- if ( $count === null ) {
- $subquery = WPSEO_Premium_Orphaned_Post_Query::get_orphaned_content_query();
- $count = $wpdb->get_var(
- $wpdb->prepare(
- "SELECT COUNT(ID)
- FROM %i
- WHERE ID IN ( $subquery )
- AND %i = 'publish'
- AND %i = ''
- AND %i = %s",
- $wpdb->posts,
- 'post_status',
- 'post_password',
- 'post_type',
- $this->get_current_post_type()
- )
- );
-
- $count = (int) $count;
- }
-
- return $count;
- }
-
- /**
- * Returns the post types to which this filter should be added.
- *
- * @return array The post types to which this filter should be added.
- */
- protected function get_post_types() {
- $orphaned_content_support = new WPSEO_Premium_Orphaned_Content_Support();
-
- return $orphaned_content_support->get_supported_post_types();
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-post-query.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-post-query.php
deleted file mode 100644
index 3ef7397b..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-orphaned-post-query.php
+++ /dev/null
@@ -1,122 +0,0 @@
-classes->get( Indexable_Repository::class );
- $query = $repository->query()
- ->select( 'object_id' )
- ->where( 'object_type', 'post' )
- ->where_any_is(
- [
- [ 'incoming_link_count' => 0 ],
- [ 'incoming_link_count' => null ],
- ]
- );
-
- $frontpage_id = self::get_frontpage_id();
- if ( $frontpage_id ) {
- $query = $query->where_not_equal( 'object_id', $frontpage_id );
- }
-
- $query = sprintf( $query->get_sql(), '\'post\'', 0, $frontpage_id );
- }
-
- return $query;
- }
-
- /**
- * Returns all the object ids from the records with an incoming link count of 0.
- *
- * @return array Array with the object ids.
- */
- public static function get_orphaned_object_ids() {
- $repository = YoastSEO()->classes->get( Indexable_Repository::class );
- $results = $repository->query()
- ->select( 'object_id' )
- ->where( 'object_type', 'post' )
- ->where( 'incoming_link_count', 0 )
- ->find_array();
-
- $object_ids = wp_list_pluck( $results, 'object_id' );
- $object_ids = self::remove_frontpage_id( $object_ids );
-
- return $object_ids;
- }
-
- /**
- * Removes the frontpage id from orphaned id's when the frontpage is a static page.
- *
- * @param array $object_ids The orphaned object ids.
- *
- * @return array The orphaned object ids, without frontpage id.
- */
- protected static function remove_frontpage_id( $object_ids ) {
- // When the frontpage is a static page, remove it from the object ids.
- if ( get_option( 'show_on_front' ) !== 'page' ) {
- return $object_ids;
- }
-
- $frontpage_id = get_option( 'page_on_front' );
-
- // If the frontpage ID exists in the list, remove it.
- $object_id_key = array_search( $frontpage_id, $object_ids, true );
- if ( $object_id_key !== false ) {
- unset( $object_ids[ $object_id_key ] );
- }
-
- return $object_ids;
- }
-
- /**
- * Retrieves the frontpage id when set, otherwise null.
- *
- * @return int|null The frontpage id when set.
- */
- protected static function get_frontpage_id() {
- if ( get_option( 'show_on_front' ) !== 'page' ) {
- return null;
- }
-
- $page_on_front = get_option( 'page_on_front', null );
- if ( empty( $page_on_front ) ) {
- return null;
- }
-
- return (int) $page_on_front;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-prominent-words-support.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-prominent-words-support.php
deleted file mode 100644
index f41e3897..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-prominent-words-support.php
+++ /dev/null
@@ -1,113 +0,0 @@
- `post`
- * `page` => `page`
- * ]
- *
- * This can result in problems downstream when trying to array_merge this twice.
- * array_values prevents this issue by ensuring numeric keys.
- */
- $prominent_words_post_types = array_values( $prominent_words_post_types );
-
- return $prominent_words_post_types;
- }
-
- /**
- * Checks if the post type is supported.
- *
- * @param string $post_type The post type to look up.
- *
- * @return bool True when post type is supported.
- */
- public function is_post_type_supported( $post_type ) {
- return in_array( $post_type, $this->get_supported_post_types(), true );
- }
-
- /**
- * Retrieves a list of taxonomies that are public, viewable and have the metabox enabled.
- *
- * @return array The supported taxonomies.
- */
- public function get_supported_taxonomies() {
- $taxonomies = get_taxonomies( [ 'public' => true ] );
- $taxonomies = array_filter( $taxonomies, 'is_taxonomy_viewable' );
-
- /**
- * Filter: 'Yoast\WP\SEO\prominent_words_taxonomies' - Allows to filter from which taxonomies terms are eligible for generating prominent words.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 14.7.0
- *
- * @param array $taxonomies The accessible taxonomies.
- */
- $prominent_words_taxonomies = apply_filters(
- 'Yoast\WP\SEO\prominent_words_taxonomies',
- $taxonomies
- );
-
- if ( ! is_array( $prominent_words_taxonomies ) || empty( $prominent_words_taxonomies ) ) {
- return [];
- }
-
- $prominent_words_taxonomies = array_filter(
- $prominent_words_taxonomies,
- static function ( $taxonomy ) {
- return (bool) WPSEO_Options::get( 'display-metabox-tax-' . $taxonomy, true );
- }
- );
-
- return array_values( $prominent_words_taxonomies );
- }
-
- /**
- * Checks if the taxonomy is supported.
- *
- * @param string $taxonomy The taxonomy to look up.
- *
- * @return bool True when taxonomy is supported.
- */
- public function is_taxonomy_supported( $taxonomy ) {
- return in_array( $taxonomy, $this->get_supported_taxonomies(), true );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-prominent-words-unindexed-post-query.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-prominent-words-unindexed-post-query.php
deleted file mode 100644
index d2ef0d96..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-prominent-words-unindexed-post-query.php
+++ /dev/null
@@ -1,190 +0,0 @@
-get_unindexed_post_ids( $this->get_post_types(), ( $limit + 1 ) );
- return count( $unindexed_post_ids ) > $limit;
- }
-
- /**
- * Returns the total unindexed posts for given post type.
- *
- * @since 4.6.0
- *
- * @param string $post_type The posttype to fetch.
- *
- * @return int The total amount of unindexed posts.
- */
- public function get_total( $post_type ) {
- if ( ! array_key_exists( $post_type, $this->totals ) ) {
- $totals = $this->get_totals( $this->get_post_types() );
-
- foreach ( $totals as $total_post_type => $total ) {
- $this->totals[ $total_post_type ] = $total;
- }
- }
-
- if ( ! array_key_exists( $post_type, $this->totals ) ) {
- $this->totals[ $post_type ] = 0;
- }
-
- return $this->totals[ $post_type ];
- }
-
- /**
- * Returns the totals for each posttype by counting them.
- *
- * @since 4.6.0
- *
- * @param array $post_types The posttype to limit the resultset for.
- *
- * @return array Array with the totals for the requested posttypes.
- */
- public function get_totals( $post_types ) {
- global $wpdb;
-
- if ( $post_types === [] ) {
- return $post_types;
- }
-
- $replacements = [
- WPSEO_Premium_Prominent_Words_Versioning::POST_META_NAME,
- WPSEO_Premium_Prominent_Words_Versioning::get_version_number(),
- ];
- $replacements = array_merge( $replacements, $post_types );
-
- $results = $wpdb->get_results(
- $wpdb->prepare(
- '
- SELECT COUNT( ID ) as total, post_type
- FROM ' . $wpdb->posts . '
- WHERE ID NOT IN( SELECT post_id FROM ' . $wpdb->postmeta . ' WHERE meta_key = %s AND meta_value = %s )
- AND post_status IN( "future", "draft", "pending", "private", "publish" )
- AND post_type IN( ' . implode( ',', array_fill( 0, count( $post_types ), '%s' ) ) . ' )
- GROUP BY post_type
- ',
- $replacements
- )
- );
-
- $totals = [];
-
- foreach ( $results as $result ) {
- $totals[ $this->determine_rest_endpoint_for_post_type( $result->post_type ) ] = (int) $result->total;
- }
-
- return $totals;
- }
-
- /**
- * Determines the REST endpoint for the given post type.
- *
- * @param string $post_type The post type to determine the endpoint for.
- *
- * @return string The endpoint. Returns empty string if post type doesn't exist.
- */
- protected function determine_rest_endpoint_for_post_type( $post_type ) {
- $post_type_object = get_post_type_object( $post_type );
-
- if ( is_null( $post_type_object ) ) {
- return '';
- }
-
- if ( isset( $post_type_object->rest_base ) && ! empty( $post_type_object->rest_base ) ) {
- return $post_type_object->rest_base;
- }
-
- return $post_type_object->name;
- }
-
- /**
- * Returns the array with supported posttypes.
- *
- * @return array The supported posttypes.
- */
- protected function get_post_types() {
- $prominent_words_support = new WPSEO_Premium_Prominent_Words_Support();
-
- return array_filter( $prominent_words_support->get_supported_post_types(), [ 'WPSEO_Post_Type', 'is_rest_enabled' ] );
- }
-
- /**
- * Gets the Post IDs of un-indexed objects.
- *
- * @param array|string $post_types The post type(s) to fetch.
- * @param int $limit Limit the number of results.
- *
- * @return int[] Post IDs found which are un-indexed.
- */
- public function get_unindexed_post_ids( $post_types, $limit ) {
- global $wpdb;
-
- if ( is_string( $post_types ) ) {
- $post_types = (array) $post_types;
- }
-
- if ( $post_types === [] ) {
- return $post_types;
- }
-
- $replacements = [
- WPSEO_Premium_Prominent_Words_Versioning::POST_META_NAME,
- WPSEO_Premium_Prominent_Words_Versioning::get_version_number(),
- ];
- $replacements = array_merge( $replacements, $post_types );
- $replacements[] = $limit;
-
- $results = $wpdb->get_results(
- $wpdb->prepare(
- '
- SELECT ID
- FROM ' . $wpdb->posts . '
- WHERE ID NOT IN( SELECT post_id FROM ' . $wpdb->postmeta . ' WHERE meta_key = %s AND meta_value = %s )
- AND post_status IN( "future", "draft", "pending", "private", "publish" )
- AND post_type IN( ' . implode( ',', array_fill( 0, count( $post_types ), '%s' ) ) . ' )
- LIMIT %d',
- $replacements
- ),
- ARRAY_A
- );
-
- // Make sure we return a list of IDs.
- $results = wp_list_pluck( $results, 'ID' );
-
- return $results;
- }
-
- /**
- * Returns the array with supported post statuses.
- *
- * @return string[] The supported post statuses.
- */
- public function get_supported_post_statuses() {
- return [ 'future', 'draft', 'pending', 'private', 'publish' ];
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-prominent-words-versioning.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-prominent-words-versioning.php
deleted file mode 100644
index 00a0a59e..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-prominent-words-versioning.php
+++ /dev/null
@@ -1,67 +0,0 @@
-query(
- $wpdb->prepare(
- 'UPDATE ' . $wpdb->postmeta . ' SET meta_key = %s WHERE meta_key = "yst_prominent_words_version"',
- self::POST_META_NAME
- )
- );
- }
-
- /**
- * Removes the meta key for the prominent words version for the unsupported languages that might have this value
- * set.
- *
- * @return void
- */
- public static function upgrade_4_8() {
- $supported_languages = [ 'en', 'de', 'nl', 'es', 'fr', 'it', 'pt', 'ru', 'pl', 'sv', 'id' ];
-
- if ( in_array( WPSEO_Language_Utils::get_language( get_locale() ), $supported_languages, true ) ) {
- return;
- }
-
- global $wpdb;
-
- // The remove all post metas.
- $wpdb->query(
- $wpdb->prepare(
- 'DELETE FROM ' . $wpdb->postmeta . ' WHERE meta_key = %s',
- self::POST_META_NAME
- )
- );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-endpoint.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-endpoint.php
deleted file mode 100644
index 002f35b6..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-endpoint.php
+++ /dev/null
@@ -1,120 +0,0 @@
-service = $service;
- }
-
- /**
- * Registers all hooks to WordPress.
- *
- * @return void
- */
- public function register_hooks() {
- add_action( 'rest_api_init', [ $this, 'register' ] );
- }
-
- /**
- * Register the REST endpoint to WordPress.
- *
- * @return void
- */
- public function register() {
- $args = [
- 'origin' => [
- 'required' => true,
- 'type' => 'string',
- 'description' => 'The origin to redirect',
- ],
- 'target' => [
- 'required' => false,
- 'type' => 'string',
- 'description' => 'The redirect target',
- ],
- 'type' => [
- 'required' => true,
- 'type' => 'integer',
- 'description' => 'The redirect type',
- ],
- ];
-
- register_rest_route(
- self::REST_NAMESPACE,
- self::ENDPOINT_QUERY,
- [
- 'methods' => 'POST',
- 'args' => $args,
- 'callback' => [
- $this->service,
- 'save',
- ],
- 'permission_callback' => [
- $this,
- 'can_save_data',
- ],
- ]
- );
-
- register_rest_route(
- self::REST_NAMESPACE,
- self::ENDPOINT_UNDO,
- [
- 'methods' => 'POST',
- 'args' => array_merge(
- $args,
- [
- 'type' => [
- 'required' => false,
- 'type' => 'string',
- 'description' => 'The redirect format',
- ],
- ]
- ),
- 'callback' => [
- $this->service,
- 'delete',
- ],
- 'permission_callback' => [
- $this,
- 'can_save_data',
- ],
- ]
- );
- }
-
- /**
- * Determines if the current user is allowed to use this endpoint.
- *
- * @return bool True user is allowed to use this endpoint.
- */
- public function can_save_data() {
- return current_user_can( self::CAPABILITY_STORE );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-export-manager.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-export-manager.php
deleted file mode 100644
index ae6a0757..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-export-manager.php
+++ /dev/null
@@ -1,116 +0,0 @@
-'
- . esc_html__( 'Export redirects', 'wordpress-seo-premium' )
- . '';
- }
- }
-
- /**
- * Adding the export block for CSV. Makes it able to export redirects to CSV.
- *
- * @return void
- */
- public function add_redirect_export_block() {
- // Display the forms.
- if ( current_user_can( 'export' ) ) {
- require WPSEO_PREMIUM_PATH . 'classes/views/export-redirects.php';
- }
- }
-
- /**
- * Hijacks the request and returns a CSV file if we're on the right page with the right method and the right capabilities.
- *
- * @return void
- */
- public function redirects_csv_export() {
- if ( $this->is_valid_csv_export_request() && current_user_can( 'export' ) ) {
- // Check if we have a valid nonce.
- check_admin_referer( 'wpseo-export' );
-
- // Clean any content that has been already outputted, for example by other plugins or faulty PHP files.
- if ( ob_get_contents() ) {
- ob_clean();
- }
-
- // Set CSV headers and content.
- $this->set_csv_headers();
- echo $this->get_csv_contents();
-
- // And exit so we don't start appending HTML to our CSV file.
- // NOTE: this makes this entire class untestable as it will exit all tests but WordPress seems to have no elegant way of handling this.
- exit();
- }
- }
-
- /**
- * Are we on the wpseo_tools page in the import-export tool and have we received an export post request?
- *
- * @return bool
- */
- protected function is_valid_csv_export_request() {
- // phpcs:disable WordPress.Security.NonceVerification -- Reason: Nonce is checked in export.
- // phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We are strictly comparing only or ignoring the value.
- return ( isset( $_GET['page'] ) && is_string( $_GET['page'] ) && wp_unslash( $_GET['page'] ) === 'wpseo_tools' )
- && ( isset( $_GET['tool'] ) && is_string( $_GET['tool'] ) && wp_unslash( $_GET['tool'] ) === 'import-export' )
- && ( isset( $_POST['export'] ) && ! empty( $_POST['export'] ) );
- // phpcs:enable
- }
-
- /**
- * Sets the headers to trigger an CSV download in the browser.
- *
- * @return void
- */
- protected function set_csv_headers() {
- header( 'Content-type: text/csv' );
- header( 'Content-Disposition: attachment; filename=wordpress-seo-redirects.csv' );
- header( 'Pragma: no-cache' );
- header( 'Expires: 0' );
- }
-
- /**
- * Generates CSV from all redirects.
- *
- * @return string
- */
- protected function get_csv_contents() {
- // Grab all our redirects.
- $redirect_manager = new WPSEO_Redirect_Manager();
- $redirects = $redirect_manager->get_all_redirects();
-
- $csv_exporter = new WPSEO_Redirect_CSV_Exporter();
- return $csv_exporter->export( $redirects );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-option.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-option.php
deleted file mode 100644
index e7efff38..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-option.php
+++ /dev/null
@@ -1,80 +0,0 @@
-get_defaults();}}
- *
- * @var array
- */
- protected $defaults = [
- // Form fields.
- 'disable_php_redirect' => 'off',
- 'separate_file' => 'off',
- ];
-
- /**
- * Registers the option to the WPSEO Options framework.
- *
- * @return void
- */
- public static function register_option() {
- WPSEO_Options::register_option( static::get_instance() );
- }
-
- /**
- * Get the singleton instance of this class.
- *
- * @return static Returns instance of itself.
- */
- public static function get_instance() {
- if ( ! ( static::$instance instanceof static ) ) {
- static::$instance = new static();
- }
-
- return static::$instance;
- }
-
- /**
- * All concrete classes must contain a validate_option() method which validates all
- * values within the option.
- *
- * @param array $dirty New value for the option.
- * @param array $clean Clean value for the option, normally the defaults.
- * @param array $old Old value of the option.
- *
- * @return array The clean option with the saved value.
- */
- protected function validate_option( $dirty, $clean, $old ) {
-
- foreach ( $clean as $key => $value ) {
- switch ( $key ) {
- case 'disable_php_redirect':
- case 'separate_file':
- if ( isset( $dirty[ $key ] ) && in_array( $dirty[ $key ], [ 'on', 'off' ], true ) ) {
- $clean[ $key ] = $dirty[ $key ];
- }
- break;
- }
- }
-
- return $clean;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-service.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-service.php
deleted file mode 100644
index 1af790f0..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-redirect-service.php
+++ /dev/null
@@ -1,94 +0,0 @@
-map_request_to_redirect( $request );
-
- if ( $this->get_redirect_manager()->create_redirect( $redirect ) ) {
- return new WP_REST_Response( 'true' );
- }
-
- return new WP_REST_Response( 'false' );
- }
-
- /**
- * Deletes the redirect from the redirects.
- *
- * @param WP_REST_Request $request The request object.
- *
- * @return WP_REST_Response The response to send back.
- */
- public function delete( WP_REST_Request $request ) {
- $redirect = $this->map_request_to_redirect( $request );
- $redirects = [ $redirect ];
-
- $redirect_format = $request->get_param( 'format' );
- if ( ! $redirect_format ) {
- $redirect_format = WPSEO_Redirect_Formats::PLAIN;
- }
-
- if ( $this->get_redirect_manager( $redirect_format )->delete_redirects( $redirects ) ) {
- return new WP_REST_Response(
- [
- 'title' => __( 'Redirect deleted.', 'wordpress-seo-premium' ),
- 'message' => __( 'The redirect was deleted successfully.', 'wordpress-seo-premium' ),
- 'success' => true,
- ]
- );
- }
-
- return new WP_REST_Response(
- [
- 'title' => __( 'Redirect not deleted.', 'wordpress-seo-premium' ),
- 'message' => __( 'Something went wrong when deleting this redirect.', 'wordpress-seo-premium' ),
- 'success' => false,
- ],
- 400
- );
- }
-
- /**
- * Creates and returns an instance of the redirect manager.
- *
- * @param string $format The redirect format.
- *
- * @return WPSEO_Redirect_Manager The redirect maanger.
- */
- protected function get_redirect_manager( $format = WPSEO_Redirect_Formats::PLAIN ) {
- return new WPSEO_Redirect_Manager( $format );
- }
-
- /**
- * Maps the given request to an instance of the WPSEO_Redirect.
- *
- * @param WP_REST_Request $request The request object.
- *
- * @return WPSEO_Redirect Redirect instance.
- */
- protected function map_request_to_redirect( WP_REST_Request $request ) {
- $origin = $request->get_param( 'origin' );
- $target = $request->get_param( 'target' );
- $type = $request->get_param( 'type' );
- $format = $request->get_param( 'format' );
-
- return new WPSEO_Redirect( $origin, $target, $type, $format );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-register-capabilities.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-register-capabilities.php
deleted file mode 100644
index 8a901828..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-register-capabilities.php
+++ /dev/null
@@ -1,32 +0,0 @@
-register( 'wpseo_manage_redirects', [ 'administrator', 'editor', 'wpseo_editor', 'wpseo_manager' ] );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-stale-cornerstone-content-filter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-stale-cornerstone-content-filter.php
deleted file mode 100644
index 8194a5ee..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/premium-stale-cornerstone-content-filter.php
+++ /dev/null
@@ -1,121 +0,0 @@
-is_filter_active() ) {
- return $where;
- }
-
- global $wpdb;
-
- $where .= sprintf(
- ' AND ' . $wpdb->posts . '.ID IN( SELECT post_id FROM ' . $wpdb->postmeta . ' WHERE meta_key = "%s" AND meta_value = "1" ) AND ' . $wpdb->posts . '.post_modified < "%s" ',
- WPSEO_Meta::$meta_prefix . 'is_cornerstone',
- $this->date_threshold()
- );
-
- return $where;
- }
-
- /**
- * Returns the label for this filter.
- *
- * @return string The label for this filter.
- */
- protected function get_label() {
- return __( 'Stale cornerstone content', 'wordpress-seo-premium' );
- }
-
- /**
- * Returns a text explaining this filter.
- *
- * @return string|null The explanation for this filter.
- */
- protected function get_explanation() {
- $post_type_object = get_post_type_object( $this->get_current_post_type() );
-
- if ( $post_type_object === null ) {
- return null;
- }
-
- return sprintf(
- /* translators: %1$s expands to dynamic post type label, %2$s expands anchor to blog post about cornerstone content, %3$s expands to */
- __( 'Stale cornerstone content refers to cornerstone content that hasn’t been updated in the last 6 months. Make sure to keep these %1$s up-to-date. %2$sLearn more about cornerstone content%3$s.', 'wordpress-seo-premium' ),
- strtolower( $post_type_object->labels->name ),
- '',
- ' '
- );
- }
-
- /**
- * Returns the total amount of stale cornerstone content.
- *
- * @return int The total amount of stale cornerstone content.
- */
- protected function get_post_total() {
- global $wpdb;
-
- return (int) $wpdb->get_var(
- $wpdb->prepare(
- '
- SELECT COUNT( 1 )
- FROM ' . $wpdb->postmeta . '
- WHERE post_id IN( SELECT ID FROM ' . $wpdb->posts . ' WHERE post_type = %s && post_modified < %s ) &&
- meta_value = "1" AND meta_key = %s
- ',
- $this->get_current_post_type(),
- $this->date_threshold(),
- WPSEO_Meta::$meta_prefix . 'is_cornerstone'
- )
- );
- }
-
- /**
- * Returns the post types to which this filter should be added.
- *
- * @return array The post types to which this filter should be added.
- */
- protected function get_post_types() {
- // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Using YoastSEO hook.
- $post_types = apply_filters( 'wpseo_cornerstone_post_types', parent::get_post_types() );
- if ( ! is_array( $post_types ) ) {
- return [];
- }
-
- return $post_types;
- }
-
- /**
- * Returns the date 6 months ago.
- *
- * @return string The formatted date.
- */
- protected function date_threshold() {
- return gmdate( 'Y-m-d', strtotime( '-6months' ) );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/product-premium.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/product-premium.php
deleted file mode 100644
index 682f4262..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/product-premium.php
+++ /dev/null
@@ -1,60 +0,0 @@
-set_extension_url( 'https://my.yoast.com/licenses/' );
- }
- }
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect-undo-endpoint.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect-undo-endpoint.php
deleted file mode 100644
index 4c9a3cbd..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect-undo-endpoint.php
+++ /dev/null
@@ -1,176 +0,0 @@
-manager = $manager;
- }
-
- /**
- * Registers all hooks to WordPress.
- *
- * @return void
- */
- public function register_hooks() {
- add_action( 'rest_api_init', [ $this, 'register' ] );
- }
-
- /**
- * Register the REST endpoint to WordPress.
- *
- * @return void
- */
- public function register() {
- register_rest_route(
- self::REST_NAMESPACE,
- self::ENDPOINT_UNDO,
- [
- 'methods' => 'POST',
- 'args' => [
- 'obj_id' => [
- 'required' => true,
- 'type' => 'int',
- 'description' => 'The id of the post or term',
- ],
- 'obj_type' => [
- 'required' => true,
- 'type' => 'string',
- 'description' => 'The object type: post or term',
- ],
- ],
- 'callback' => [ $this, 'undo_redirect' ],
- 'permission_callback' => [ $this, 'can_save_data' ],
- ]
- );
- }
-
- /**
- * Deletes the latest redirect to the post or term referenced in the request.
- *
- * @param WP_REST_Request $request The request.
- *
- * @return WP_REST_Response The response.
- */
- public function undo_redirect( WP_REST_Request $request ) {
- $object_id = $request->get_param( 'obj_id' );
- $object_type = $request->get_param( 'obj_type' );
-
- $redirect_info = $this->retrieve_post_or_term_redirect_info( $object_type, $object_id );
- $redirect = $this->map_redirect_info_to_redirect( $redirect_info );
-
- if ( ! $redirect->get_origin() ) {
- return new WP_REST_Response(
- [
- 'title' => __( 'Redirect not deleted.', 'wordpress-seo-premium' ),
- 'message' => __( 'Something went wrong when deleting this redirect.', 'wordpress-seo-premium' ),
- 'success' => false,
- ],
- 400
- );
- }
-
- if ( $this->manager->delete_redirects( [ $redirect ] ) ) {
- return new WP_REST_Response(
- [
- 'title' => __( 'Redirect deleted.', 'wordpress-seo-premium' ),
- 'message' => __( 'The redirect was deleted successfully.', 'wordpress-seo-premium' ),
- 'success' => true,
- ]
- );
- }
-
- return new WP_REST_Response(
- [
- 'title' => __( 'Redirect not deleted.', 'wordpress-seo-premium' ),
- 'message' => __( 'Something went wrong when deleting this redirect.', 'wordpress-seo-premium' ),
- 'success' => false,
- ],
- 400
- );
- }
-
- /**
- * Maps the given redirect info to an instance of the WPSEO_Redirect.
- *
- * @param array $redirect_info The redirect info array.
- *
- * @return WPSEO_Redirect Redirect instance.
- */
- protected function map_redirect_info_to_redirect( $redirect_info ) {
- $origin = ( $redirect_info['origin'] ?? null );
- $target = ( $redirect_info['target'] ?? null );
- $type = ( $redirect_info['type'] ?? null );
- $format = ( $redirect_info['format'] ?? null );
-
- return new WPSEO_Redirect( $origin, $target, $type, $format );
- }
-
- /**
- * Retrieve the redirect info from the meta for the specified object and id.
- *
- * @param string $object_type The type of object: post or term.
- * @param int $object_id The post or term ID.
- *
- * @return array
- */
- private function retrieve_post_or_term_redirect_info( $object_type, $object_id ) {
- if ( $object_type === 'post' ) {
- $redirect_info = get_post_meta( $object_id, '_yoast_post_redirect_info', true );
- delete_post_meta( $object_id, '_yoast_post_redirect_info' );
- return $redirect_info;
- }
-
- if ( $object_type === 'term' ) {
- $redirect_info = get_term_meta( $object_id, '_yoast_term_redirect_info', true );
- delete_term_meta( $object_id, '_yoast_term_redirect_info' );
- return $redirect_info;
- }
-
- return [];
- }
-
- /**
- * Determines if the current user is allowed to use this endpoint.
- *
- * @param WP_REST_Request $request The request.
- *
- * @return bool True user is allowed to use this endpoint.
- */
- public function can_save_data( WP_REST_Request $request ) {
- $object_id = $request->get_param( 'obj_id' );
- $object_type = $request->get_param( 'obj_type' );
-
- if ( $object_type === 'post' ) {
- return current_user_can( 'edit_post', $object_id );
- }
-
- if ( $object_type === 'term' ) {
- return current_user_can( 'edit_term', $object_id );
- }
-
- return false;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/executable-redirect.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/executable-redirect.php
deleted file mode 100644
index 0afcccb6..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/executable-redirect.php
+++ /dev/null
@@ -1,104 +0,0 @@
-origin = $origin;
- $this->target = $target;
- $this->type = $type;
- $this->format = $format;
- }
-
- /**
- * Creates an instance based on the given data.
- *
- * @param array $data The redirect data.
- *
- * @return WPSEO_Executable_Redirect The created object.
- */
- public static function from_array( $data ) {
- return new self( $data['origin'], $data['target'], $data['type'], $data['format'] );
- }
-
- /**
- * Retrieves the origin.
- *
- * @return string The origin.
- */
- public function get_origin() {
- return $this->origin;
- }
-
- /**
- * Retrieves the target.
- *
- * @return string The target.
- */
- public function get_target() {
- return $this->target;
- }
-
- /**
- * Retrieves the type.
- *
- * @return int The redirect type.
- */
- public function get_type() {
- return $this->type;
- }
-
- /**
- * Retrieves the redirect format.
- *
- * @return string The redirect format.
- */
- public function get_format() {
- return $this->format;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-apache-exporter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-apache-exporter.php
deleted file mode 100644
index 382c71a1..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-apache-exporter.php
+++ /dev/null
@@ -1,138 +0,0 @@
-get_type() );
- if ( $redirect_type >= 400 && $redirect_type < 500 ) {
- return $this->format_non_target( $redirect );
- }
-
- $origin = $redirect->get_origin();
-
- if ( $redirect->get_format() === WPSEO_Redirect_Formats::PLAIN ) {
- $origin = $this->format_url( $redirect->get_origin() );
- }
-
- return sprintf(
- $this->get_format( $redirect->get_format() ),
- $origin,
- $this->format_url( $redirect->get_target() ),
- $redirect->get_type()
- );
- }
-
- /**
- * Format the URL before it is added to the redirects.
- *
- * @param string $url The URL.
- *
- * @return string Formatted URL.
- */
- protected function format_url( $url ) {
- return $this->add_url_slash( $url );
- }
-
- /**
- * Build the redirect output for non-target status codes (4xx)
- *
- * @param WPSEO_Redirect $redirect The redirect data.
- *
- * @return string
- */
- public function format_non_target( WPSEO_Redirect $redirect ) {
-
- $target = $redirect->get_origin();
- if ( $redirect->get_format() === WPSEO_Redirect_Formats::PLAIN ) {
- $target = $this->add_url_slash( $target );
- }
-
- return sprintf(
- $this->get_non_target_format( $redirect->get_format() ),
- $target,
- $redirect->get_type()
- );
- }
-
- /**
- * Get the format the redirect needs to output
- *
- * @param string $redirect_format The format of the redirect.
- *
- * @return string
- */
- public function get_non_target_format( $redirect_format ) {
- if ( $redirect_format === WPSEO_Redirect_Formats::PLAIN ) {
- return $this->url_non_target_format;
- }
-
- return $this->regex_non_target_format;
- }
-
- /**
- * Check if first character is a slash, adds a slash if it ain't so
- *
- * @param string $url The URL add the slashes to.
- *
- * @return string mixed
- */
- private function add_url_slash( $url ) {
- $scheme = wp_parse_url( $url, PHP_URL_SCHEME );
- if ( substr( $url, 0, 1 ) !== '/' && empty( $scheme ) ) {
- $url = '/' . $url;
- }
-
- return $url;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-csv-exporter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-csv-exporter.php
deleted file mode 100644
index 6c2299d4..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-csv-exporter.php
+++ /dev/null
@@ -1,93 +0,0 @@
-get_headers();
-
- if ( ! empty( $redirects ) ) {
- foreach ( $redirects as $redirect ) {
- if ( $redirect instanceof WPSEO_Redirect ) {
- $csv .= PHP_EOL . $this->format( $redirect );
- }
- }
- }
-
- return $csv;
- }
-
- /**
- * Formats a redirect for use in the export, returns a line of CSV.
- *
- * @param WPSEO_Redirect $redirect The redirect to format.
- *
- * @return string CSV line of the redirect for format.
- */
- public function format( WPSEO_Redirect $redirect ) {
- $target = $redirect->get_target();
- if ( WPSEO_Redirect_Util::is_relative_url( $target ) ) {
- $target = '/' . $target;
- }
- if ( WPSEO_Redirect_Util::requires_trailing_slash( $target ) ) {
- $target = trailingslashit( $target );
- }
-
- $origin = $redirect->get_origin();
- if ( $redirect->get_format() === WPSEO_Redirect_Formats::PLAIN && WPSEO_Redirect_Util::is_relative_url( $origin ) ) {
- $origin = '/' . $origin;
- }
-
- $redirect_details = [
- $this->format_csv_column( $origin ),
- $this->format_csv_column( $target ),
- $this->format_csv_column( $redirect->get_type() ),
- $this->format_csv_column( $redirect->get_format() ),
- ];
-
- return implode( ',', $redirect_details );
- }
-
- /**
- * Returns the headers to add to the first line of the generated CSV.
- *
- * @return string CSV line of the headers.
- */
- protected function get_headers() {
- $headers = [
- __( 'Origin', 'wordpress-seo-premium' ),
- __( 'Target', 'wordpress-seo-premium' ),
- __( 'Type', 'wordpress-seo-premium' ),
- __( 'Format', 'wordpress-seo-premium' ),
- ];
-
- return implode( ',', $headers );
- }
-
- /**
- * Surrounds a value with double quotes and escapes existing double quotes.
- *
- * @param string $value The value to sanitize.
- *
- * @return string The sanitized value.
- */
- protected function format_csv_column( $value ) {
- return '"' . str_replace( '"', '""', (string) $value ) . '"';
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-exporter-interface.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-exporter-interface.php
deleted file mode 100644
index 8c7e712b..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-exporter-interface.php
+++ /dev/null
@@ -1,28 +0,0 @@
-format( $redirect ) . PHP_EOL;
- }
- }
- // Check if the file content isset.
- return $this->save( $file_content );
- }
-
- /**
- * Formats a redirect for use in the export.
- *
- * @param WPSEO_Redirect $redirect The redirect to format.
- *
- * @return string
- */
- public function format( WPSEO_Redirect $redirect ) {
- return sprintf(
- $this->get_format( $redirect->get_format() ),
- $redirect->get_origin(),
- $redirect->get_target(),
- $redirect->get_type()
- );
- }
-
- /**
- * Returns the needed format for the redirect.
- *
- * @param string $redirect_format The format of the redirect.
- *
- * @return string
- */
- protected function get_format( $redirect_format ) {
- if ( $redirect_format === WPSEO_Redirect_Formats::PLAIN ) {
- return $this->url_format;
- }
-
- return $this->regex_format;
- }
-
- /**
- * Save the redirect file.
- *
- * @param string $file_content The file content that will be saved.
- *
- * @return bool
- */
- protected function save( $file_content ) {
- // Save the actual file.
- if ( is_writable( WPSEO_Redirect_File_Util::get_file_path() ) ) {
- WPSEO_Redirect_File_Util::write_file( WPSEO_Redirect_File_Util::get_file_path(), $file_content );
- }
-
- return true;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-htaccess-exporter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-htaccess-exporter.php
deleted file mode 100644
index 40ab6048..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-htaccess-exporter.php
+++ /dev/null
@@ -1,101 +0,0 @@
-get_htaccess_content( $file_path, $file_content );
- $return = (bool) WPSEO_Redirect_File_Util::write_file( $file_path, $htaccess );
-
- // Make sure defines are created.
- WP_Filesystem();
- chmod( $file_path, FS_CHMOD_FILE );
-
- return $return;
- }
-
- return false;
- }
-
- /**
- * Getting the content from current .htaccess
- *
- * @param string $file_path The location of the htaccess file.
- * @param string $file_content THe content to save in the htaccess file.
- *
- * @return string
- */
- private function get_htaccess_content( $file_path, $file_content ) {
- // Read current htaccess.
- $htaccess = '';
- if ( file_exists( $file_path ) ) {
- $htaccess = file_get_contents( $file_path );
- }
-
- $htaccess = preg_replace( '`# BEGIN YOAST REDIRECTS.*# END YOAST REDIRECTS' . PHP_EOL . '`is', '', $htaccess );
-
- // Only add redirect code when redirects are present.
- if ( ! empty( $file_content ) ) {
- $file_content = '# BEGIN YOAST REDIRECTS' . PHP_EOL . '' . PHP_EOL . 'RewriteEngine On' . PHP_EOL . $file_content . ' ' . PHP_EOL . '# END YOAST REDIRECTS' . PHP_EOL;
-
- // Prepend our redirects to htaccess file.
- $htaccess = $file_content . $htaccess;
- }
-
- return $htaccess;
- }
-
- /**
- * Escape special characters in the URL that will cause problems in .htaccess.
- *
- * Overrides WPSEO_Redirect_Apache_Exporter::format_url.
- *
- * @param string $url The URL.
- *
- * @return string The escaped URL.
- */
- protected function format_url( $url ) {
- $url = parent::format_url( $url );
-
- return $this->sanitize( $url );
- }
-
- /**
- * Escape special characters that will cause problems in .htaccess.
- *
- * @param string $unsanitized The unsanitized value.
- *
- * @return string The sanitized value.
- */
- private function sanitize( $unsanitized ) {
- return str_replace(
- [
- '\\',
- '"',
- ],
- [
- '/',
- '\"',
- ],
- $unsanitized
- );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-nginx-exporter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-nginx-exporter.php
deleted file mode 100644
index d303d529..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-nginx-exporter.php
+++ /dev/null
@@ -1,72 +0,0 @@
-get_format( $redirect->get_format() ),
- $redirect->get_origin(),
- $redirect->get_target(),
- $redirect->get_type(),
- $this->add_x_redirect_header()
- );
- }
-
- /**
- * Adds an X-Redirect-By header if allowed by the filter.
- *
- * @return string
- */
- private function add_x_redirect_header() {
- /**
- * Filter: 'Yoast\WP\SEO\add_x_redirect' - can be used to remove the X-Redirect-By header
- * Yoast SEO Premium creates (defaults to true, which is adding it)
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param bool $add_xredirect
- */
- if ( apply_filters( 'Yoast\WP\SEO\add_x_redirect', true ) === true ) {
- return 'add_header X-Redirect-By "Yoast SEO Premium";';
- }
-
- return '';
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-option-exporter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-option-exporter.php
deleted file mode 100644
index 4f8a89f9..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/exporters/redirect-option-exporter.php
+++ /dev/null
@@ -1,66 +0,0 @@
- [],
- WPSEO_Redirect_Formats::REGEX => [],
- ];
-
- foreach ( $redirects as $redirect ) {
- $formatted_redirects[ $redirect->get_format() ][ $redirect->get_origin() ] = $this->format( $redirect );
- }
-
- /**
- * Filters the parameter to save the redirect options as autoloaded.
- *
- * Note that the `autoload` value in the database will change only if the option value changes (i.e. a redirect is added, edited or deleted).
- * Otherwise you will need to change the `autoload` value directly in the DB.
- *
- * @since 20.13
- *
- * @param bool $autoload The value of the `autoload` parameter. Default: true.
- * @param string $type The type of redirects, either `plain` or `regex`.
- * @param array $formatted_redirects The redirects to be written in the options, already formatted.
- *
- * @return bool The filtered value of the `autoload` parameter.
- */
- $autoload_options_plain = apply_filters( 'Yoast\WP\SEO\redirects_options_autoload', true, 'plain', $formatted_redirects );
- $autoload_options_regex = apply_filters( 'Yoast\WP\SEO\redirects_options_autoload', true, 'regex', $formatted_redirects );
-
- update_option( WPSEO_Redirect_Option::OPTION_PLAIN, $formatted_redirects[ WPSEO_Redirect_Formats::PLAIN ], $autoload_options_plain );
- update_option( WPSEO_Redirect_Option::OPTION_REGEX, $formatted_redirects[ WPSEO_Redirect_Formats::REGEX ], $autoload_options_regex );
-
- return true;
- }
-
- /**
- * Formats a redirect for use in the export.
- *
- * @param WPSEO_Redirect $redirect The redirect to format.
- *
- * @return array
- */
- public function format( WPSEO_Redirect $redirect ) {
- return [
- 'url' => $redirect->get_target(),
- 'type' => $redirect->get_type(),
- ];
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-abstract-loader.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-abstract-loader.php
deleted file mode 100644
index 872b2b23..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-abstract-loader.php
+++ /dev/null
@@ -1,45 +0,0 @@
-has( $status_code );
- }
-
- /**
- * Validates if the given value is a redirect format.
- *
- * @param string $format The format to validate.
- *
- * @return bool Whether or not the format is valid.
- */
- protected function validate_format( $format ) {
- $redirect_formats = new WPSEO_Redirect_Formats();
-
- return $redirect_formats->has( $format );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-csv-loader.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-csv-loader.php
deleted file mode 100644
index f11b5aac..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-csv-loader.php
+++ /dev/null
@@ -1,78 +0,0 @@
-csv_file = $csv_file;
- }
-
- /**
- * Loads all redirects from the CSV file.
- *
- * @return WPSEO_Redirect[] The redirects loaded from the CSV file.
- */
- public function load() {
- $handle = fopen( $this->csv_file, 'r' );
-
- if ( ! $handle ) {
- return [];
- }
-
- $redirects = [];
- while ( $item = fgetcsv( $handle, 10000 ) ) {
- if ( ! $this->validate_item( $item ) ) {
- continue;
- }
-
- $redirects[] = new WPSEO_Redirect( $item[0], $item[1], $item[2], $item[3] );
- }
-
- return $redirects;
- }
-
- /**
- * Checks if a parsed CSV row is has a valid redirect format.
- * It should have exactly 4 values.
- * The third value should be a http status code.
- * The last value should be a redirect format.
- *
- * @param array $item The parsed CSV row.
- *
- * @return bool Whether or not the parsed CSV row is valid.
- */
- protected function validate_item( $item ) {
- if ( count( $item ) !== 4 ) {
- return false;
- }
-
- if ( ! $this->validate_status_code( $item[2] ) ) {
- return false;
- }
-
- if ( ! $this->validate_format( $item[3] ) ) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-htaccess-loader.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-htaccess-loader.php
deleted file mode 100644
index d945b126..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-htaccess-loader.php
+++ /dev/null
@@ -1,145 +0,0 @@
-htaccess = $htaccess;
- }
-
- /**
- * Loads redirects as WPSEO_Redirects from the .htaccess file given to the constructor.
- *
- * @return WPSEO_Redirect[] The loaded redirects.
- */
- public function load() {
- $redirects = [];
-
- // Loop through patterns.
- foreach ( self::regex_patterns() as $regex ) {
- $matches = $this->match_redirects( $regex['pattern'] );
-
- if ( is_array( $matches ) ) {
- $redirects = array_merge( $redirects, $this->convert_redirects_from_matches( $matches, $regex['type'] ) );
- }
- }
-
- return $redirects;
- }
-
- /**
- * Matches the string (containing redirects) for the given regex.
- *
- * @param string $pattern The regular expression to match redirects.
- *
- * @return array[]
- */
- protected function match_redirects( $pattern ) {
- preg_match_all( $pattern, $this->htaccess, $matches, PREG_SET_ORDER );
-
- return $matches;
- }
-
- /**
- * Converts matches to WPSEO_Redirect objects.
- *
- * @param array[] $matches The redirects to save.
- * @param string $format The format for the redirects.
- *
- * @return WPSEO_Redirect[] The redirects.
- */
- protected function convert_redirects_from_matches( $matches, $format ) {
- $redirects = [];
-
- foreach ( $matches as $match ) {
- $type = trim( $match[1] );
- $source = trim( $match[2] );
- $target = $this->parse_target( $type, $match );
-
- if ( $target === false || $source === '' || ! $this->validate_status_code( $type ) ) {
- continue;
- }
-
- $redirects[] = new WPSEO_Redirect( $source, $target, $type, $format );
- }
-
- return $redirects;
- }
-
- /**
- * Parses the target from a match.
- *
- * @param string $type The status code of the redirect.
- * @param string[] $matched The match.
- *
- * @return bool|string The status code, false if no status code could be parsed.
- */
- protected function parse_target( $type, $matched ) {
- // If it's a gone status code that doesn't need a target.
- if ( $type === '410' ) {
- return '';
- }
-
- $target = trim( $matched[3] );
-
- // There is no target, skip it.
- if ( $target === '' ) {
- return false;
- }
-
- return $target;
- }
-
- /**
- * Returns regex patterns to match redirects in .htaccess files.
- *
- * @return array[] The regex patterns to test against.
- */
- protected static function regex_patterns() {
- return [
- [
- 'type' => WPSEO_Redirect_Formats::PLAIN,
- 'pattern' => '`^Redirect ([0-9]{3}) ([^"\s]+) ([a-z0-9-_+/.:%&?=#\][]+)`im',
- ],
- [
- 'type' => WPSEO_Redirect_Formats::PLAIN,
- 'pattern' => '`^Redirect ([0-9]{3}) "([^"]+)" ([a-z0-9-_+/.:%&?=#\][]+)`im',
- ],
- [
- 'type' => WPSEO_Redirect_Formats::PLAIN,
- 'pattern' => '`^Redirect (410) ([^"\s]+)`im', // Matches a redirect without a target.
- ],
- [
- 'type' => WPSEO_Redirect_Formats::PLAIN,
- 'pattern' => '`^Redirect (410) "([^"]+)"`im', // Matches a redirect without a target.
- ],
- [
- 'type' => WPSEO_Redirect_Formats::REGEX,
- 'pattern' => '`^RedirectMatch ([0-9]{3}) ([^"\s]+) ([^\s]+)`im',
- ],
- [
- 'type' => WPSEO_Redirect_Formats::REGEX,
- 'pattern' => '`^RedirectMatch ([0-9]{3}) "([^"]+)" ([^\s]+)`im',
- ],
- ];
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-loader-interface.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-loader-interface.php
deleted file mode 100644
index de118c69..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-loader-interface.php
+++ /dev/null
@@ -1,19 +0,0 @@
-wpdb = $wpdb;
- }
-
- /**
- * Loads redirects as WPSEO_Redirects from the Redirection plugin.
- *
- * @return WPSEO_Redirect[] The loaded redirects.
- */
- public function load() {
- // Get redirects.
- // phpcs:disable WordPress.DB.PreparedSQLPlaceholders.UnsupportedPlaceholder,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,WordPress.DB.PreparedSQL.NotPrepared
- $items = $this->wpdb->get_results(
- $this->wpdb->prepare(
- "SELECT `url`, `action_data`, `regex`, `action_code`
- FROM %i
- WHERE %i = 'enabled' AND %i = 'url'",
- $this->wpdb->prefix . 'redirection_items',
- 'status',
- 'action_type'
- )
- );
- // phpcs:enable
-
- $redirects = [];
-
- foreach ( $items as $item ) {
- $format = WPSEO_Redirect_Formats::PLAIN;
- if ( (int) $item->regex === 1 ) {
- $format = WPSEO_Redirect_Formats::REGEX;
- }
-
- if ( ! $this->validate_status_code( $item->action_code ) ) {
- continue;
- }
-
- $redirects[] = new WPSEO_Redirect( $item->url, $item->action_data, $item->action_code, $format );
- }
-
- return $redirects;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-safe-redirect-loader.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-safe-redirect-loader.php
deleted file mode 100644
index 7b3060df..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-safe-redirect-loader.php
+++ /dev/null
@@ -1,83 +0,0 @@
-convert_wildcards( $item );
-
- $format = WPSEO_Redirect_Formats::PLAIN;
- if ( (int) $item['enable_regex'] === 1 ) {
- $format = WPSEO_Redirect_Formats::REGEX;
- }
-
- $status_code = $this->convert_status_code( $item['status_code'] );
-
- if ( ! $this->validate_status_code( $status_code ) ) {
- continue;
- }
-
- $redirects[] = new WPSEO_Redirect( $item['redirect_from'], $item['redirect_to'], $status_code, $format );
- }
-
- return $redirects;
- }
-
- /**
- * Converts unsupported 404 and 403 status codes to a 410 status code.
- * Also converts unsupported 303 status codes to a 302 status code.
- *
- * @param int $status_code The original status code.
- *
- * @return int A status code Yoast supports.
- */
- protected function convert_status_code( $status_code ) {
- switch ( $status_code ) {
- case 303:
- return 302;
- case 403:
- case 404:
- return 410;
- default:
- return (int) $status_code;
- }
- }
-
- /**
- * Converts unsupported wildcard format to supported regex format.
- *
- * @param array $item A Safe Redirect Manager redirect.
- *
- * @return array A converted redirect.
- */
- protected function convert_wildcards( $item ) {
- if ( substr( $item['redirect_from'], -1, 1 ) === '*' ) {
- $item['redirect_from'] = preg_replace( '/(\*)$/', '.*', $item['redirect_from'] );
- $item['enable_regex'] = 1;
- }
-
- return $item;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-simple-301-redirect-loader.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-simple-301-redirect-loader.php
deleted file mode 100644
index ab410087..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/loaders/redirect-simple-301-redirect-loader.php
+++ /dev/null
@@ -1,44 +0,0 @@
- $target ) {
- $format = WPSEO_Redirect_Formats::PLAIN;
-
- // If wildcard redirects had been used, and this is one, flip it.
- if ( $uses_wildcards && strpos( $origin, '*' ) !== false ) {
- $format = WPSEO_Redirect_Formats::REGEX;
- $origin = str_replace( '*', '(.*)', $origin );
- $target = str_replace( '*', '$1', $target );
- }
-
- $redirects[] = new WPSEO_Redirect( $origin, $target, 301, $format );
- }
-
- return $redirects;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-form-presenter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-form-presenter.php
deleted file mode 100644
index f8d00d5a..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-form-presenter.php
+++ /dev/null
@@ -1,57 +0,0 @@
-view_vars = $view_vars;
-
- $this->view_vars['redirect_types'] = $this->get_redirect_types();
- }
-
- /**
- * Display the form.
- *
- * @param array $display Additional display variables.
- *
- * @return void
- */
- public function display( array $display = [] ) {
- $display_vars = $this->view_vars;
- if ( ! empty( $display ) ) {
- $display_vars = array_merge_recursive( $display_vars, $display );
- }
-
- require WPSEO_PREMIUM_PATH . 'classes/redirect/views/redirects-form.php';
- }
-
- /**
- * Getting array with the available redirect types.
- *
- * @return array Array with the redirect types.
- */
- private function get_redirect_types() {
- $types = new WPSEO_Redirect_Types();
-
- return $types->get();
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-page-presenter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-page-presenter.php
deleted file mode 100644
index 856592ef..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-page-presenter.php
+++ /dev/null
@@ -1,89 +0,0 @@
-get_tab_presenter( $current_tab );
- $redirect_tabs = $this->navigation_tabs( $current_tab );
-
- include WPSEO_PREMIUM_PATH . 'classes/redirect/views/redirects.php';
- }
-
- /**
- * Returns a tab presenter.
- *
- * @param string $tab_to_display The tab that will be shown.
- *
- * @return WPSEO_Redirect_Tab_Presenter|null Tab presenter instance, or null if invalid tab given.
- */
- private function get_tab_presenter( $tab_to_display ) {
- $tab_presenter = null;
- switch ( $tab_to_display ) {
- case WPSEO_Redirect_Formats::PLAIN:
- case WPSEO_Redirect_Formats::REGEX:
- $tab_presenter = new WPSEO_Redirect_Table_Presenter( $tab_to_display );
- break;
- case 'settings':
- if ( current_user_can( 'wpseo_manage_options' ) ) {
- $tab_presenter = new WPSEO_Redirect_Settings_Presenter( $tab_to_display );
- }
- break;
- }
-
- return $tab_presenter;
- }
-
- /**
- * Returning the anchors html for the tabs
- *
- * @param string $current_tab The tab that will be active.
- *
- * @return array {
- * Associative array of navigation tabs data.
- *
- * @type array $tabs Array of $tab_slug => $tab_label pairs.
- * @type string $current_tab The currently active tab slug.
- * @type string $page_url Base URL of the current page, to append the tab slug to.
- * }
- */
- private function navigation_tabs( $current_tab ) {
- $tabs = $this->get_redirect_formats();
-
- if ( current_user_can( 'wpseo_manage_options' ) ) {
- $tabs['settings'] = __( 'Settings', 'wordpress-seo-premium' );
- }
-
- return [
- 'tabs' => $tabs,
- 'current_tab' => $current_tab,
- 'page_url' => admin_url( 'admin.php?page=wpseo_redirects&tab=' ),
- ];
- }
-
- /**
- * Gets the available redirect formats.
- *
- * @return array Redirect formats as $slug => $label pairs.
- */
- protected function get_redirect_formats() {
- $redirect_formats = new WPSEO_Redirect_Formats();
-
- return $redirect_formats->get();
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-presenter-interface.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-presenter-interface.php
deleted file mode 100644
index 6bb03324..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-presenter-interface.php
+++ /dev/null
@@ -1,21 +0,0 @@
- WPSEO_Redirect_File_Util::get_file_path(),
- 'redirect_file' => $this->writable_redirect_file(),
- ]
- );
- }
-
- /**
- * Check if it is possible to write to the files
- *
- * @return false|string
- */
- private function writable_redirect_file() {
- if ( WPSEO_Options::get( 'disable_php_redirect' ) !== 'on' ) {
- return false;
- }
-
- // Do file checks.
- $file_exists = file_exists( WPSEO_Redirect_File_Util::get_file_path() );
-
- if ( WPSEO_Utils::is_apache() ) {
- $separate_file = ( WPSEO_Options::get( 'separate_file' ) === 'on' );
-
- if ( $separate_file && $file_exists ) {
- return 'apache_include_file';
- }
-
- if ( ! $separate_file ) {
- // Everything is as expected.
- if ( is_writable( WPSEO_Redirect_Htaccess_Util::get_htaccess_file_path() ) ) {
- return false;
- }
- }
-
- return 'cannot_write_htaccess';
- }
-
- if ( WPSEO_Utils::is_nginx() ) {
- if ( $file_exists ) {
- return 'nginx_include_file';
- }
-
- return 'cannot_write_file';
- }
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-tab-presenter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-tab-presenter.php
deleted file mode 100644
index a7d489a6..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-tab-presenter.php
+++ /dev/null
@@ -1,51 +0,0 @@
-view = $view;
- }
-
- /**
- * Displaying the table URL or regex. Depends on the current active tab.
- *
- * @param array $display Contextual display data.
- *
- * @return void
- */
- public function display( array $display = [] ) {
- $view_vars = $this->get_view_vars( $display );
- include WPSEO_PREMIUM_PATH . 'classes/redirect/views/redirects-tab-' . $this->view . '.php';
- }
-
- /**
- * The method to get the variables for the view. This method should return an array, because this will be extracted.
- *
- * @param array $passed_vars Optional. View data manually passed. Default empty array.
- *
- * @return array Contextual variables to pass to the view.
- */
- abstract protected function get_view_vars( array $passed_vars = [] );
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-table-presenter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-table-presenter.php
deleted file mode 100644
index 79fd6700..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/presenters/redirect-table-presenter.php
+++ /dev/null
@@ -1,73 +0,0 @@
-view );
-
- return array_merge(
- $passed_vars,
- [
- 'redirect_table' => new WPSEO_Redirect_Table(
- $this->view,
- $this->get_first_column_value(),
- $redirect_manager->get_redirects()
- ),
- 'origin_from_url' => $this->get_old_url(),
- 'quick_edit_table' => new WPSEO_Redirect_Quick_Edit_Presenter(),
- 'form_presenter' => new WPSEO_Redirect_Form_Presenter(
- [
- 'origin_label_value' => $this->get_first_column_value(),
- ]
- ),
- ]
- );
- }
-
- /**
- * Get the old URL from the URL.
- *
- * @return string The old URL.
- */
- private function get_old_url() {
- if ( isset( $_GET['old_url'] ) && is_string( $_GET['old_url'] ) ) {
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We decode it before sanitization to keep encoded characters.
- $old_url = sanitize_text_field( rawurldecode( wp_unslash( $_GET['old_url'] ) ) );
- if ( ! empty( $old_url ) ) {
- check_admin_referer( 'wpseo_redirects-old-url', 'wpseo_premium_redirects_nonce' );
-
- return esc_attr( $old_url );
- }
- }
-
- return '';
- }
-
- /**
- * Return the value of the first column based on the table type.
- *
- * @return string The value of the first column.
- */
- private function get_first_column_value() {
- if ( $this->view === 'regex' ) {
- return __( 'Regular Expression', 'wordpress-seo-premium' );
- }
-
- return __( 'Old URL', 'wordpress-seo-premium' );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-ajax.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-ajax.php
deleted file mode 100644
index ff3d264f..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-ajax.php
+++ /dev/null
@@ -1,218 +0,0 @@
-redirect_manager = new WPSEO_Redirect_Manager( $redirect_format );
- $this->redirect_format = $redirect_format;
-
- $this->set_hooks( $redirect_format );
- }
-
- /**
- * Function that handles the AJAX 'wpseo_add_redirect' action.
- *
- * @return void
- */
- public function ajax_add_redirect() {
- $this->valid_ajax_check();
-
- // Save the redirect.
- $redirect = $this->get_redirect_from_post( 'redirect' );
- $this->validate( $redirect );
-
- // The method always returns the added redirect.
- if ( $this->redirect_manager->create_redirect( $redirect ) ) {
- $response = [
- 'origin' => $redirect->get_origin(),
- 'target' => $redirect->get_target(),
- 'type' => $redirect->get_type(),
- 'info' => [
- 'hasTrailingSlash' => WPSEO_Redirect_Util::requires_trailing_slash( $redirect->get_target() ),
- 'isTargetRelative' => WPSEO_Redirect_Util::is_relative_url( $redirect->get_target() ),
- ],
- ];
- }
- else {
- // Set the value error.
- $error = [
- 'type' => 'error',
- 'message' => __( 'Unknown error. Failed to create redirect.', 'wordpress-seo-premium' ),
- ];
-
- $response = [ 'error' => $error ];
- }
-
- // Response.
- // phpcs:ignore WordPress.Security.EscapeOutput -- WPCS bug/methods can't be whitelisted yet.
- wp_die( WPSEO_Utils::format_json_encode( $response ) );
- }
-
- /**
- * Function that handles the AJAX 'wpseo_update_redirect' action.
- *
- * @return void
- */
- public function ajax_update_redirect() {
-
- $this->valid_ajax_check();
-
- $current_redirect = $this->get_redirect_from_post( 'old_redirect' );
- $new_redirect = $this->get_redirect_from_post( 'new_redirect' );
- $this->validate( $new_redirect, $current_redirect );
-
- // The method always returns the added redirect.
- if ( $this->redirect_manager->update_redirect( $current_redirect, $new_redirect ) ) {
- $response = [
- 'origin' => $new_redirect->get_origin(),
- 'target' => $new_redirect->get_target(),
- 'type' => $new_redirect->get_type(),
- ];
- }
- else {
- // Set the value error.
- $error = [
- 'type' => 'error',
- 'message' => __( 'Unknown error. Failed to update redirect.', 'wordpress-seo-premium' ),
- ];
-
- $response = [ 'error' => $error ];
- }
-
- // Response.
- // phpcs:ignore WordPress.Security.EscapeOutput -- WPCS bug/methods can't be whitelisted yet.
- wp_die( WPSEO_Utils::format_json_encode( $response ) );
- }
-
- /**
- * Run the validation.
- *
- * @param WPSEO_Redirect $redirect The redirect to save.
- * @param WPSEO_Redirect|null $current_redirect The current redirect.
- *
- * @return void
- */
- private function validate( WPSEO_Redirect $redirect, ?WPSEO_Redirect $current_redirect = null ) {
- $validator = new WPSEO_Redirect_Validator();
-
- if ( $validator->validate( $redirect, $current_redirect ) === true ) {
- return;
- }
-
- $ignore_warning = filter_input( INPUT_POST, 'ignore_warning' );
-
- $error = $validator->get_error();
-
- if ( $error->get_type() === 'error' || ( $error->get_type() === 'warning' && $ignore_warning === 'false' ) ) {
- wp_die(
- // phpcs:ignore WordPress.Security.EscapeOutput -- WPCS bug/methods can't be whitelisted yet.
- WPSEO_Utils::format_json_encode( [ 'error' => $error->to_array() ] )
- );
- }
- }
-
- /**
- * Setting the AJAX hooks.
- *
- * @param string $hook_suffix The piece that will be stitched after the hooknames.
- *
- * @return void
- */
- private function set_hooks( $hook_suffix ) {
- // Add the new redirect.
- add_action( 'wp_ajax_wpseo_add_redirect_' . $hook_suffix, [ $this, 'ajax_add_redirect' ] );
-
- // Update an existing redirect.
- add_action( 'wp_ajax_wpseo_update_redirect_' . $hook_suffix, [ $this, 'ajax_update_redirect' ] );
-
- // Add URL response code check AJAX.
- if ( ! has_action( 'wp_ajax_wpseo_check_url' ) ) {
- add_action( 'wp_ajax_wpseo_check_url', [ $this, 'ajax_check_url' ] );
- }
- }
-
- /**
- * Check if the posted nonce is valid and if the user has the needed rights.
- *
- * @return void
- */
- private function valid_ajax_check() {
- // Check nonce.
- check_ajax_referer( 'wpseo-redirects-ajax-security', 'ajax_nonce' );
-
- $this->permission_check();
- }
-
- /**
- * Checks whether the current user is allowed to do what he's doing.
- *
- * @return void
- */
- private function permission_check() {
- if ( ! current_user_can( 'edit_posts' ) ) {
- wp_die( '0' );
- }
- }
-
- /**
- * Get the redirect from the post values.
- *
- * @param string $post_value The key where the post values are located in the $_POST.
- *
- * @return WPSEO_Redirect
- */
- private function get_redirect_from_post( $post_value ) {
- // phpcs:ignore WordPress.Security.NonceVerification -- Reason: nonce is verified in ajax_update_redirect and ajax_add_redirect.
- if ( isset( $_POST[ $post_value ] ) && is_array( $_POST[ $post_value ] ) ) {
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.NonceVerification -- Reason: we want to stick to sanitize_url function, while the nonce has been already checked.
- $post_values = wp_unslash( $_POST[ $post_value ] );
-
- return new WPSEO_Redirect(
- $this->sanitize_url( $post_values['origin'] ),
- $this->sanitize_url( $post_values['target'] ),
- urldecode( $post_values['type'] ),
- $this->redirect_format
- );
- }
-
- return new WPSEO_Redirect( '', '', '', '' );
- }
-
- /**
- * Sanitize the URL for displaying on the window.
- *
- * @param string $url The URL to sanitize.
- *
- * @return string
- */
- private function sanitize_url( $url ) {
- return trim( htmlspecialchars_decode( rawurldecode( $url ) ) );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-file-util.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-file-util.php
deleted file mode 100644
index 537a896d..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-file-util.php
+++ /dev/null
@@ -1,122 +0,0 @@
-add_notification(
- new Yoast_Notification(
- /* translators: %s expands to the file path that we tried to write to */
- sprintf( __( "We're unable to create the directory %s", 'wordpress-seo-premium' ), $basedir ),
- [ 'type' => 'error' ]
- )
- );
-
- return;
- }
-
- // Create the .htaccess file.
- if ( ! file_exists( $basedir . '/.htaccess' ) ) {
- self::write_file( $basedir . '/.htaccess', "Options -Indexes\ndeny from all" );
- }
-
- // Create an empty index.php file.
- if ( ! file_exists( $basedir . '/index.php' ) ) {
- self::write_file( $basedir . '/index.php', 'add_notification(
- new Yoast_Notification(
- /* translators: %s expands to the file path that we tried to write to */
- sprintf( __( "We're unable to write data to the file %s", 'wordpress-seo-premium' ), $file_path ),
- [ 'type' => 'error' ]
- )
- );
-
- return false;
- }
-
- return true;
- }
-
- /**
- * Getting the object which will save the redirects file
- *
- * @param string $separate_file Saving the redirects in an separate apache file.
- *
- * @return WPSEO_Redirect_File_Exporter|null
- */
- public static function get_file_exporter( $separate_file ) {
- // Create the correct file object.
- if ( WPSEO_Utils::is_apache() ) {
- if ( $separate_file === 'on' ) {
- return new WPSEO_Redirect_Apache_Exporter();
- }
-
- return new WPSEO_Redirect_Htaccess_Exporter();
- }
-
- if ( WPSEO_Utils::is_nginx() ) {
- return new WPSEO_Redirect_Nginx_Exporter();
- }
-
- return null;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-formats.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-formats.php
deleted file mode 100644
index 04f910ad..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-formats.php
+++ /dev/null
@@ -1,40 +0,0 @@
- __( 'Redirects', 'wordpress-seo-premium' ),
- self::REGEX => __( 'Regex Redirects', 'wordpress-seo-premium' ),
- ];
- }
-
- /**
- * Checks whether the given value is a valid redirect format.
- *
- * @param string $value Value to check.
- *
- * @return bool True if a redirect format, false otherwise.
- */
- public function has( $value ) {
- $formats = $this->get();
-
- return isset( $formats[ $value ] );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-formatter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-formatter.php
deleted file mode 100644
index 6b78d0f8..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-formatter.php
+++ /dev/null
@@ -1,28 +0,0 @@
-get_origin(),
- $redirect->get_target(),
- $redirect->get_type(),
- $redirect->get_format()
- );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-htaccess-util.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-htaccess-util.php
deleted file mode 100644
index e43201f9..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-htaccess-util.php
+++ /dev/null
@@ -1,46 +0,0 @@
-redirect_option = $redirect_option;
- }
-
- /**
- * Imports the redirects and retrieves the import statistics.
- *
- * @param WPSEO_Redirect[] $redirects The redirects to import.
- *
- * @return int[] The import statistics.
- */
- public function import( array $redirects ) {
- array_walk( $redirects, [ $this, 'add_redirect' ] );
-
- if ( $this->total_imported > 0 ) {
- $this->save_import();
- }
-
- return [
- 'total_redirects' => count( $redirects ),
- 'total_imported' => $this->total_imported,
- ];
- }
-
- /**
- * Saves the redirects to the database and exports them to the necessary configuration file.
- *
- * @codeCoverageIgnore Because it contains dependencies
- *
- * @return void
- */
- protected function save_import() {
- $this->redirect_option->save();
-
- // Export the redirects to .htaccess, Apache or NGinx configuration files depending on plugin settings.
- $redirect_manager = new WPSEO_Redirect_Manager();
- $redirect_manager->export_redirects();
- }
-
- /**
- * Adds a redirect to the option.
- *
- * @param WPSEO_Redirect $redirect The redirect to add.
- *
- * @return void
- */
- protected function add_redirect( $redirect ) {
- if ( ! $this->redirect_option->add( $redirect ) ) {
- return;
- }
-
- ++$this->total_imported;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-manager.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-manager.php
deleted file mode 100644
index 5c57d168..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-manager.php
+++ /dev/null
@@ -1,197 +0,0 @@
-redirect_option = $option;
- $this->redirect_format = $redirect_format;
- $this->exporters = $exporters;
- }
-
- /**
- * Get the redirects.
- *
- * @return WPSEO_Redirect[]
- */
- public function get_redirects() {
- // Filter the redirect for the current format.
- return array_filter( $this->redirect_option->get_all(), [ $this, 'filter_redirects_by_format' ] );
- }
-
- /**
- * Returns all redirects.
- *
- * @return WPSEO_Redirect[]
- */
- public function get_all_redirects() {
- return $this->redirect_option->get_all();
- }
-
- /**
- * Export the redirects to the specified sources.
- *
- * @return void
- */
- public function export_redirects() {
- $redirects = $this->redirect_option->get_all();
- $exporters = $this->exporters;
-
- if ( ! $exporters ) {
- $exporters = self::default_exporters();
- }
-
- foreach ( $exporters as $exporter ) {
- $exporter->export( $redirects );
- }
- }
-
- /**
- * Create a new redirect.
- *
- * @param WPSEO_Redirect $redirect The redirect object to add.
- *
- * @return bool
- */
- public function create_redirect( WPSEO_Redirect $redirect ) {
- if ( $this->redirect_option->add( $redirect ) ) {
- $this->save_redirects();
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Save the redirect.
- *
- * @param WPSEO_Redirect $current_redirect The old redirect, the value is a key in the redirects array.
- * @param WPSEO_Redirect $redirect New redirect object.
- *
- * @return bool
- */
- public function update_redirect( WPSEO_Redirect $current_redirect, WPSEO_Redirect $redirect ) {
- if ( $this->redirect_option->update( $current_redirect, $redirect ) ) {
- $this->save_redirects();
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Delete the redirects.
- *
- * @param WPSEO_Redirect[] $delete_redirects Array with the redirects to remove.
- *
- * @return bool
- */
- public function delete_redirects( $delete_redirects ) {
- $deleted = false;
- foreach ( $delete_redirects as $delete_redirect ) {
- if ( $this->redirect_option->delete( $delete_redirect ) ) {
- $deleted = true;
- }
- }
-
- if ( $deleted === true ) {
- $this->save_redirects();
- }
-
- return $deleted;
- }
-
- /**
- * Returns the redirect when it's found, otherwise it will return false.
- *
- * @param string $origin The origin to search for.
- *
- * @return bool|WPSEO_Redirect
- */
- public function get_redirect( $origin ) {
- return $this->redirect_option->get( $origin );
- }
-
- /**
- * This method will save the redirect option and if necessary the redirect file.
- *
- * @return void
- */
- public function save_redirects() {
- // Update the database option.
- $this->redirect_option->save();
-
- // Save the redirect file.
- $this->export_redirects();
- }
-
- /**
- * Filter the redirects that don't match the needed format.
- *
- * @param WPSEO_Redirect $redirect The redirect to filter.
- *
- * @return bool
- */
- private function filter_redirects_by_format( WPSEO_Redirect $redirect ) {
- return $redirect->get_format() === $this->redirect_format;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-option.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-option.php
deleted file mode 100644
index ffad7751..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-option.php
+++ /dev/null
@@ -1,278 +0,0 @@
-redirects = $this->get_all();
- }
- }
-
- /**
- * Getting the array with all the redirects.
- *
- * @return WPSEO_Redirect[]
- */
- public function get_all() {
- $redirects = $this->get_from_option();
-
- array_walk( $redirects, [ $this, 'map_option_to_object' ] );
-
- return $redirects;
- }
-
- /**
- * Check if the old redirect doesn't exist already, if not it will be added.
- *
- * @param WPSEO_Redirect $redirect The redirect object to save.
- *
- * @return bool
- */
- public function add( WPSEO_Redirect $redirect ) {
- if ( $this->search( $redirect->get_origin() ) === false ) {
- $this->run_redirects_modified_action( $redirect );
-
- $this->redirects[] = $redirect;
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Check if the $current_redirect exists and remove it if so.
- *
- * @param WPSEO_Redirect $current_redirect The current redirect value.
- * @param WPSEO_Redirect $redirect The redirect object to save.
- *
- * @return bool
- */
- public function update( WPSEO_Redirect $current_redirect, WPSEO_Redirect $redirect ) {
- $found = $this->search( $current_redirect->get_origin() );
- if ( $found !== false ) {
- $this->run_redirects_modified_action( $redirect );
-
- $this->redirects[ $found ] = $redirect;
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Deletes the given redirect from the array.
- *
- * @param WPSEO_Redirect $current_redirect The redirect that will be removed.
- *
- * @return bool
- */
- public function delete( WPSEO_Redirect $current_redirect ) {
- $found = $this->search( $current_redirect->get_origin() );
- if ( $found !== false ) {
- $this->run_redirects_modified_action( $current_redirect );
-
- unset( $this->redirects[ $found ] );
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Get a redirect from the array.
- *
- * @param string $origin The redirects origin to search for.
- *
- * @return WPSEO_Redirect|bool
- */
- public function get( $origin ) {
- $found = $this->search( $origin );
- if ( $found !== false ) {
- return $this->redirects[ $found ];
- }
-
- return false;
- }
-
- /**
- * Check if the $origin already exists as a key in the array.
- *
- * @param string $origin The redirect to search for.
- *
- * @return int|bool
- */
- public function search( $origin ) {
- foreach ( $this->redirects as $redirect_key => $redirect ) {
- if ( $redirect->origin_is( $origin ) ) {
- return $redirect_key;
- }
- }
-
- return false;
- }
-
- /**
- * Saving the redirects.
- *
- * @param bool $retry_upgrade Whether or not to retry the 3.1 upgrade. Used to prevent infinite recursion.
- *
- * @return void
- */
- public function save( $retry_upgrade = true ) {
- $redirects = $this->redirects;
-
- // Retry the 3.1 upgrade routine to make sure we're always dealing with valid redirects.
- $upgrade_manager = new WPSEO_Upgrade_Manager();
- if ( $retry_upgrade && $upgrade_manager->should_retry_upgrade_31() ) {
- $upgrade_manager->retry_upgrade_31( true );
- $redirects = array_merge( $redirects, $this->get_all() );
- }
-
- array_walk( $redirects, [ $this, 'map_object_to_option' ] );
-
- /**
- * Filter: 'Yoast\WP\SEO\save_redirects' - can be used to filter the redirects before saving.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param array $redirects
- */
- $redirects = apply_filters( 'Yoast\WP\SEO\save_redirects', $redirects );
-
- // Update the database option.
- update_option( self::OPTION, $redirects, false );
- }
-
- /**
- * Setting the redirects property.
- *
- * @param string $option_name The target option name.
- *
- * @return array
- */
- public function get_from_option( $option_name = self::OPTION ) {
- $redirects = get_option( $option_name );
-
- /**
- * Filter: 'Yoast\WP\SEO\get_redirects' - can be used to filter the redirects on option retrieval.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param array $redirects
- */
- $redirects = apply_filters( 'Yoast\WP\SEO\get_redirects', $redirects );
-
- if ( ! is_array( $redirects ) ) {
- $redirects = [];
- }
-
- return $redirects;
- }
-
- /**
- * Runs the redirects modified hook with the altered redirect as input.
- *
- * @param WPSEO_Redirect $redirect The redirect that has been altered.
- *
- * @return void
- */
- protected function run_redirects_modified_action( WPSEO_Redirect $redirect ) {
- /**
- * Filter: Yoast\WP\SEO\redirects_modified - Allow developers to run actions when the redirects are modified.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param string $origin The redirect origin.
- * @param string $target The redirect target.
- * @param int $type The redirect type (301, 404, 410, etc).
- */
- do_action( 'Yoast\WP\SEO\redirects_modified', $redirect->get_origin(), $redirect->get_target(), $redirect->get_type() );
- }
-
- /**
- * Maps the array values to a redirect object.
- *
- * @param array $redirect_values The data for the redirect option.
- *
- * @return void
- */
- private function map_option_to_object( array &$redirect_values ) {
- $redirect_values = new WPSEO_Redirect( $redirect_values['origin'], $redirect_values['url'], $redirect_values['type'], $redirect_values['format'] );
- }
-
- /**
- * Maps a redirect object to an array option.
- *
- * @param WPSEO_Redirect $redirect The redirect to map.
- *
- * @return void
- */
- private function map_object_to_option( WPSEO_Redirect &$redirect ) {
- $redirect = [
- 'origin' => $redirect->get_origin(),
- 'url' => $redirect->get_target(),
- 'type' => $redirect->get_type(),
- 'format' => $redirect->get_format(),
- ];
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-page.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-page.php
deleted file mode 100644
index d036a3cb..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-page.php
+++ /dev/null
@@ -1,355 +0,0 @@
-initialize_admin();
- }
-
- // Only initialize the ajax for all tabs except settings.
- if ( wp_doing_ajax() ) {
- $this->initialize_ajax();
- }
- }
-
- /**
- * Display the presenter.
- *
- * @return void
- */
- public function display() {
- $display_args = [ 'current_tab' => $this->get_current_tab() ];
-
- $redirect_presenter = new WPSEO_Redirect_Page_Presenter();
- $redirect_presenter->display( $display_args );
- }
-
- /**
- * Catches possible posted filter values and redirects it to a GET-request.
- *
- * It catches:
- * A search post.
- * A redirect-type filter.
- *
- * @return void
- */
- public function list_table_search() {
- if ( ! isset( $_SERVER['REQUEST_URI'] ) ) {
- return;
- }
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Variable is used in a strict comparison and sanitized by wp_safe_redirect anyway.
- $url = wp_unslash( $_SERVER['REQUEST_URI'] );
- $new_url = $this->extract_redirect_type_from_url( $url );
- $new_url = $this->extract_search_string_from_url( $new_url );
-
- if ( $url !== $new_url ) {
- // Do the redirect.
- wp_safe_redirect( $new_url );
- exit;
- }
- }
-
- /**
- * Extracts the redirect type from the passed URL.
- *
- * @param string $url The URL to try and extract the redirect type from.
- *
- * @return string The newly formatted URL. Returns original URL if filter is null.
- */
- protected function extract_redirect_type_from_url( $url ) {
- if ( ( ! isset( $_POST['redirect-type'] ) ) || ( ! is_string( $_POST['redirect-type'] ) )
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized in wp_verify_none.
- || ! isset( $_POST['wpseo_redirects_ajax_nonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['wpseo_redirects_ajax_nonce'] ), 'wpseo-redirects-ajax-security' ) ) {
- return $url;
- }
-
- $filter = sanitize_text_field( wp_unslash( $_POST['redirect-type'] ) );
-
- $new_url = remove_query_arg( 'redirect-type', $url );
-
- if ( $filter !== '0' ) {
- $new_url = add_query_arg( 'redirect-type', rawurlencode( $filter ), $new_url );
- }
-
- return $new_url;
- }
-
- /**
- * Extracts the search string from the passed URL.
- *
- * @param string $url The URL to try and extract the search string from.
- *
- * @return string The newly formatted URL. Returns original URL if search string is null.
- */
- protected function extract_search_string_from_url( $url ) {
- if ( ( ! isset( $_POST['s'] ) ) || ( ! is_string( $_POST['s'] ) )
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized in wp_verify_none.
- || ! isset( $_POST['wpseo_redirects_ajax_nonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['wpseo_redirects_ajax_nonce'] ), 'wpseo-redirects-ajax-security' ) ) {
- return $url;
- }
-
- $search_string = sanitize_text_field( wp_unslash( $_POST['s'] ) );
-
- $new_url = remove_query_arg( 's', $url );
-
- if ( $search_string !== '' ) {
- $new_url = add_query_arg( 's', rawurlencode( $search_string ), $new_url );
- }
-
- return $new_url;
- }
-
- /**
- * Load the admin redirects scripts.
- *
- * @return void
- */
- public function enqueue_assets() {
- $asset_manager = new WPSEO_Admin_Asset_Manager();
- $version = $asset_manager->flatten_version( WPSEO_PREMIUM_VERSION );
-
- $dependencies = [
- 'jquery',
- 'jquery-ui-dialog',
- 'wp-util',
- 'underscore',
- 'yoast-seo-premium-commons',
- 'wp-api',
- 'wp-api-fetch',
- ];
-
- wp_enqueue_script(
- 'wp-seo-premium-admin-redirects',
- plugin_dir_url( WPSEO_PREMIUM_FILE )
- . 'assets/js/dist/wp-seo-premium-admin-redirects-' . $version . WPSEO_CSSJS_SUFFIX . '.js',
- $dependencies,
- WPSEO_PREMIUM_VERSION,
- true
- );
- wp_localize_script( 'wp-seo-premium-admin-redirects', 'wpseoPremiumStrings', WPSEO_Premium_Javascript_Strings::strings() );
- wp_localize_script( 'wp-seo-premium-admin-redirects', 'wpseoUserLocale', [ 'code' => substr( get_user_locale(), 0, 2 ) ] );
- wp_localize_script( 'wp-seo-premium-admin-redirects', 'wpseoAdminRedirect', [ 'homeUrl' => home_url( '/' ) ] );
- wp_enqueue_style( 'wpseo-premium-redirects', plugin_dir_url( WPSEO_PREMIUM_FILE ) . 'assets/css/dist/premium-redirects-' . $version . '.css', [], WPSEO_PREMIUM_VERSION );
-
- wp_enqueue_style( 'wp-jquery-ui-dialog' );
-
- $screen_option_args = [
- 'label' => __( 'Redirects per page', 'wordpress-seo-premium' ),
- 'default' => 25,
- 'option' => 'redirects_per_page',
- ];
- add_screen_option( 'per_page', $screen_option_args );
- }
-
- /**
- * Catch redirects_per_page.
- *
- * @param string|false $status The value to save instead of the option value.
- * Default false (to skip saving the current option).
- * @param string $option The option name where the value is set for.
- * @param string $value The new value for the screen option.
- *
- * @return string|false
- */
- public function set_screen_option( $status, $option, $value ) {
- if ( $option === 'redirects_per_page' ) {
- return $value;
- }
-
- return $status;
- }
-
- /**
- * Hook that runs after the 'wpseo_redirect' option is updated.
- *
- * @param array $old_value Unused.
- * @param array $value The new saved values.
- *
- * @return void
- */
- public function save_redirect_files( $old_value, $value ) {
-
- $is_php = ( empty( $value['disable_php_redirect'] ) || $value['disable_php_redirect'] !== 'on' );
-
- $was_separate_file = ( ! empty( $old_value['separate_file'] ) && $old_value['separate_file'] === 'on' );
- $is_separate_file = ( ! empty( $value['separate_file'] ) && $value['separate_file'] === 'on' );
-
- // Check if the 'disable_php_redirect' option set to true/on.
- if ( ! $is_php ) {
- // The 'disable_php_redirect' option is set to true(on) so we need to generate a file.
- // The Redirect Manager will figure out what file needs to be created.
- $redirect_manager = new WPSEO_Redirect_Manager();
- $redirect_manager->export_redirects();
- }
-
- // Check if we need to remove the .htaccess redirect entries.
- if ( WPSEO_Utils::is_apache() ) {
- if ( $is_php || ( ! $was_separate_file && $is_separate_file ) ) {
- // Remove the apache redirect entries.
- WPSEO_Redirect_Htaccess_Util::clear_htaccess_entries();
- }
-
- if ( $is_php || ( $was_separate_file && ! $is_separate_file ) ) {
- // Remove the apache separate file redirect entries.
- WPSEO_Redirect_File_Util::write_file( WPSEO_Redirect_File_Util::get_file_path(), '' );
- }
- }
-
- if ( WPSEO_Utils::is_nginx() && $is_php ) {
- // Remove the nginx redirect entries.
- $this->clear_nginx_redirects();
- }
- }
-
- /**
- * The server should always be apache. And the php redirects have to be enabled or in case of a separate
- * file it should be disabled.
- *
- * @param bool $disable_php_redirect Are the php redirects disabled.
- * @param bool $separate_file Value of the separate file.
- *
- * @return bool
- */
- private function remove_htaccess_entries( $disable_php_redirect, $separate_file ) {
- return ( WPSEO_Utils::is_apache() && ( ! $disable_php_redirect || ( $disable_php_redirect && $separate_file ) ) );
- }
-
- /**
- * Clears the redirects from the nginx config.
- *
- * @return void
- */
- private function clear_nginx_redirects() {
- $redirect_file = WPSEO_Redirect_File_Util::get_file_path();
- if ( is_writable( $redirect_file ) ) {
- WPSEO_Redirect_File_Util::write_file( $redirect_file, '' );
- }
- }
-
- /**
- * Initialize admin hooks.
- *
- * @return void
- */
- private function initialize_admin() {
- $this->fetch_bulk_action();
-
- // Check if we need to save files after updating options.
- add_action( 'update_option_wpseo_redirect', [ $this, 'save_redirect_files' ], 10, 2 );
-
- // Convert post into get on search and loading the page scripts.
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.NonceVerification.Recommended -- We're not manipulating the value.
- if ( isset( $_GET['page'] ) && is_string( $_GET['page'] ) && wp_unslash( $_GET['page'] ) === 'wpseo_redirects' ) {
- $upgrade_manager = new WPSEO_Upgrade_Manager();
- $upgrade_manager->retry_upgrade_31();
-
- add_action( 'admin_init', [ $this, 'list_table_search' ] );
-
- add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
- add_filter( 'set-screen-option', [ $this, 'set_screen_option' ], 11, 3 );
- }
- }
-
- /**
- * Initialize the AJAX redirect files.
- *
- * @return void
- */
- private function initialize_ajax() {
- // Normal Redirect AJAX.
- new WPSEO_Redirect_Ajax( WPSEO_Redirect_Formats::PLAIN );
-
- // Regex Redirect AJAX.
- new WPSEO_Redirect_Ajax( WPSEO_Redirect_Formats::REGEX );
- }
-
- /**
- * Getting the current active tab.
- *
- * @return string
- */
- private function get_current_tab() {
- static $current_tab;
-
- if ( $current_tab === null ) {
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We're not manipulating the value.
- if ( isset( $_GET['tab'] ) && is_string( $_GET['tab'] )
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.NonceVerification.Recommended -- value sanitized in the if body, regex filters unwanted values.
- && in_array( wp_unslash( $_GET['tab'] ), [ WPSEO_Redirect_Formats::PLAIN, WPSEO_Redirect_Formats::REGEX, 'settings' ], true ) ) {
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- the regex takes care of filtering out unwanted values.
- $current_tab = sanitize_text_field( wp_unslash( $_GET['tab'] ) );
- }
- else {
- $current_tab = WPSEO_Redirect_Formats::PLAIN;
- }
- }
-
- return $current_tab;
- }
-
- /**
- * Setting redirect manager, based on the current active tab.
- *
- * @return WPSEO_Redirect_Manager
- */
- private function get_redirect_manager() {
- static $redirect_manager;
-
- if ( $redirect_manager === null ) {
- $redirects_format = WPSEO_Redirect_Formats::PLAIN;
- if ( $this->get_current_tab() === WPSEO_Redirect_Formats::REGEX ) {
- $redirects_format = WPSEO_Redirect_Formats::REGEX;
- }
-
- $redirect_manager = new WPSEO_Redirect_Manager( $redirects_format );
- }
-
- return $redirect_manager;
- }
-
- /**
- * Fetches the bulk action for removing redirects.
- *
- * @return void
- */
- private function fetch_bulk_action() {
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized in wp_verify_none.
- if ( ! isset( $_POST['wpseo_redirects_ajax_nonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['wpseo_redirects_ajax_nonce'] ), 'wpseo-redirects-ajax-security' ) ) {
- return;
- }
-
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- We're just strictly comparing the value.
- if ( ( ! isset( $_POST['action'] ) || ! is_string( $_POST['action'] ) || ! wp_unslash( $_POST['action'] ) === 'delete' )
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- We're just strictly comparing the value.
- && ( ! isset( $_POST['action2'] ) || ! is_string( $_POST['action2'] ) || ! wp_unslash( $_POST['action2'] ) === 'delete' ) ) {
- return;
- }
-
- if ( ! isset( $_POST['wpseo_redirects_bulk_delete'] ) || ! is_array( $_POST['wpseo_redirects_bulk_delete'] ) ) {
- return;
- }
-
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Array elements are sanitized one by one in the foreach loop.
- $bulk_delete = wp_unslash( $_POST['wpseo_redirects_bulk_delete'] );
- $redirects = [];
- foreach ( $bulk_delete as $origin ) {
- $redirect = $this->get_redirect_manager()->get_redirect( $origin );
- if ( $redirect !== false ) {
- $redirects[] = $redirect;
- }
- }
- $this->get_redirect_manager()->delete_redirects( $redirects );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-sitemap-filter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-sitemap-filter.php
deleted file mode 100644
index 58b974ce..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-sitemap-filter.php
+++ /dev/null
@@ -1,85 +0,0 @@
-home_url = $home_url;
- }
-
- /**
- * Registers the hooks.
- *
- * @return void
- */
- public function register_hooks() {
- add_filter( 'wpseo_sitemap_entry', [ $this, 'filter_sitemap_entry' ] );
- add_action( 'Yoast\WP\SEO\redirects_modified', [ $this, 'clear_sitemap_cache' ] );
- }
-
- /**
- * Prevents a redirected URL from being added to the sitemap.
- *
- * @param array $url The url data.
- *
- * @return bool|array False when entry will be redirected.
- */
- public function filter_sitemap_entry( $url ) {
- if ( empty( $url['loc'] ) ) {
- return $url;
- }
-
- $entry_location = str_replace( $this->home_url, '', $url['loc'] );
-
- if ( $this->is_redirect( $entry_location ) !== false ) {
- return false;
- }
-
- return $url;
- }
-
- /**
- * Clears the sitemap cache.
- *
- * @return void
- */
- public function clear_sitemap_cache() {
- WPSEO_Sitemaps_Cache::clear();
- }
-
- /**
- * Checks if the given entry location already exists as a redirect.
- *
- * @param string $entry_location The entry location.
- *
- * @return bool Whether the entry location exists as a redirect.
- */
- protected function is_redirect( $entry_location ) {
- static $redirects = null;
-
- if ( $redirects === null ) {
- $redirects = new WPSEO_Redirect_Option();
- }
-
- return $redirects->search( $entry_location ) !== false;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-table.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-table.php
deleted file mode 100644
index ccec4173..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-table.php
+++ /dev/null
@@ -1,492 +0,0 @@
- null,
- 'search_string' => null,
- ];
-
- /**
- * The name of the first column.
- *
- * @var string
- */
- private $current_column;
-
- /**
- * The primary column.
- *
- * @var string
- */
- private $primary_column = 'type';
-
- /**
- * Caches the WPSEO_Redirect_Types::get() result.
- *
- * @var string[]
- */
- private $redirect_types;
-
- /**
- * Holds the orderby.
- *
- * @var string
- */
- private $orderby = 'old';
-
- /**
- * Holds the order.
- *
- * @var string
- */
- private $order = 'asc';
-
- /**
- * WPSEO_Redirect_Table constructor.
- *
- * @param array|string $type Type of the redirects that is opened.
- * @param string $current_column The value of the first column.
- * @param WPSEO_Redirect[] $redirects The redirects.
- */
- public function __construct( $type, $current_column, $redirects ) {
- parent::__construct( [ 'plural' => $type ] );
-
- $this->current_column = $current_column;
-
- // Cache used in filter_items and extra_tablenav.
- $wpseo_redirect_types = new WPSEO_Redirect_Types();
- $this->redirect_types = $wpseo_redirect_types->get();
-
- $this->set_items( $redirects );
-
- add_filter( 'list_table_primary_column', [ $this, 'redirect_list_table_primary_column' ], 10, 2 );
- }
-
- /**
- * Renders the extra table navigation.
- *
- * @param string $which Which tablenav is called.
- *
- * @return void
- */
- public function extra_tablenav( $which ) {
- if ( $which !== 'top' ) {
- return;
- }
-
- $selected = $this->filter['redirect_type'];
- if ( $selected === null ) {
- $selected = 0;
- }
- ?>
-
-
-
-
-
- value="0">
- redirect_types as $http_code => $redirect_type ) {
- printf(
- "%s \n",
- selected( $selected, $http_code, false ),
- esc_attr( $http_code ),
- esc_html( $redirect_type )
- );
- }
- ?>
-
- 'post-query-submit' ] ); ?>
-
- ' ',
- 'type' => _x( 'Type', 'noun', 'wordpress-seo-premium' ),
- 'old' => $this->current_column,
- 'new' => __( 'New URL', 'wordpress-seo-premium' ),
- ];
- }
-
- /**
- * Counts the total columns for the table.
- *
- * @return int The total amount of columns.
- */
- public function count_columns() {
- return count( $this->get_columns() );
- }
-
- /**
- * Filter for setting the primary table column.
- *
- * @param string $column The current column.
- * @param string $screen The current opened window.
- *
- * @return string The primary table column.
- */
- public function redirect_list_table_primary_column( $column, $screen ) {
- if ( $screen === 'seo_page_wpseo_redirects' ) {
- $column = $this->primary_column;
- }
-
- return $column;
- }
-
- /**
- * Sets up the table variables, fetch the items from the database, search, sort and format the items.
- * Sets the items as the WPSEO_Redirect_Table items variable.
- *
- * @return void
- */
- public function prepare_items() {
- // Setup the columns.
- $this->_column_headers = [ $this->get_columns(), [], $this->get_sortable_columns() ];
-
- // Get variables needed for pagination.
- $per_page = $this->get_items_per_page( 'redirects_per_page', 25 );
- $total_items = count( $this->items );
- $pagination_args = [
- 'total_items' => $total_items,
- 'total_pages' => ceil( $total_items / $per_page ),
- 'per_page' => $per_page,
- ];
-
- // Set pagination.
- $this->set_pagination_args( $pagination_args );
-
- $current_page = $this->get_pagenum();
-
- // Setting the starting point. If starting point is below 1, overwrite it with value 0, otherwise it will be sliced of at the back.
- $slice_start = ( $current_page - 1 );
- if ( $slice_start < 0 ) {
- $slice_start = 0;
- }
-
- // Apply 'pagination'.
- $formatted_items = array_slice( $this->items, ( $slice_start * $per_page ), $per_page );
-
- // Set items.
- $this->items = $formatted_items;
- }
-
- /**
- * Returns the columns that are sortable.
- *
- * @return array[] An array containing the sortable columns.
- */
- public function get_sortable_columns() {
- return [
- 'old' => [ 'old', false ],
- 'new' => [ 'new', false ],
- 'type' => [ 'type', false ],
- ];
- }
-
- /**
- * Reorders the items based on user input.
- *
- * @param array $a The current sort direction.
- * @param array $b The new sort direction.
- *
- * @return int The order that should be used.
- */
- public function do_reorder( $a, $b ) {
- // Determine sort order.
- $result = strcmp( $a[ $this->orderby ], $b[ $this->orderby ] );
-
- // Send final sort direction to usort.
- return ( $this->order === 'asc' ) ? $result : ( -$result );
- }
-
- /**
- * Creates a column for a checkbox.
- *
- * @param array $item Array with the row data.
- *
- * @return string The column with a checkbox.
- */
- public function column_cb( $item ) {
- return sprintf(
- '%3$s ',
- esc_attr( $item['old'] ),
- $item['row_number'],
- /* translators: Hidden accessibility text. */
- esc_html( __( 'Select this redirect', 'wordpress-seo-premium' ) )
- );
- }
-
- /**
- * Displays a default column.
- *
- * @param array $item Array with the row data.
- * @param string $column_name The name of the needed column.
- *
- * @return string The default column.
- */
- public function column_default( $item, $column_name ) {
-
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
- $is_regex = isset( $_GET['tab'] ) && is_string( $_GET['tab'] ) && sanitize_text_field( wp_unslash( $_GET['tab'] ) ) === 'regex';
- $row_actions = $this->get_row_actions( $column_name );
-
- switch ( $column_name ) {
- case 'new':
- $classes = [ 'val' ];
- $new_url = $item['new'];
- $new_full_url = home_url( $new_url );
- if ( ! $is_regex && WPSEO_Redirect_Util::requires_trailing_slash( $new_url ) ) {
- $classes[] = 'has-trailing-slash';
- }
-
- if (
- $new_url === ''
- || $new_url === '/'
- || ! WPSEO_Redirect_Util::is_relative_url( $new_url )
- ) {
- $classes[] = 'remove-slashes';
- }
-
- if ( $new_url ) {
- return '' . esc_html( $new_url ) . ' ' . $row_actions;
- }
- return '
' . $row_actions;
-
- case 'old':
- $classes = '';
- $old_full_url = home_url( $item['old'] );
- if ( $is_regex === true ) {
- return '' . esc_html( $item['old'] ) . '
' . $row_actions;
- }
-
- return '' . esc_html( $item['old'] ) . ' ' . $row_actions;
-
- case 'type':
- return '' . esc_html( $item['type'] ) . '
' . $row_actions;
-
- default:
- return $item[ $column_name ];
- }
- }
-
- /**
- * Returns the available bulk actions.
- *
- * @return string[] Array containing the available bulk actions.
- */
- public function get_bulk_actions() {
- return [
- 'delete' => __( 'Delete', 'wordpress-seo-premium' ),
- ];
- }
-
- /**
- * Sets the items and orders them.
- *
- * @param array $items The data that will be showed.
- *
- * @return void
- */
- private function set_items( $items ) {
- // Getting the items.
- $this->items = $this->filter_items( $items );
-
- $this->format_items();
-
- // Sort the results.
- if ( count( $this->items ) > 0 ) {
- $this->orderby = $this->get_orderby();
- $this->order = $this->get_order();
- usort( $this->items, [ $this, 'do_reorder' ] );
- }
- }
-
- /**
- * Filters the given items.
- *
- * @param WPSEO_Redirect[] $items The items to filter.
- *
- * @return array The filtered items.
- */
- private function filter_items( array $items ) {
- $search_string = '';
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We come from our own redirect in a simple search form, let's not overcomplicate.
- if ( isset( $_GET['s'] ) && is_string( $_GET['s'] ) ) {
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: Same as above.
- $search_string = trim( sanitize_text_field( wp_unslash( $_GET['s'] ) ), '/' );
- }
- if ( $search_string !== '' ) {
- $this->filter['search_string'] = $search_string;
-
- $items = array_filter( $items, [ $this, 'filter_by_search_string' ] );
- }
-
- $redirect_type = 0;
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We come from our own redirect in a simple filter form, let's not overcomplicate.
- if ( isset( $_GET['redirect-type'] ) && is_string( $_GET['redirect-type'] ) ) {
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: Cast to an integer and strictly compared against known keys.
- $redirect_type = (int) wp_unslash( $_GET['redirect-type'] );
- $redirect_type = array_key_exists( $redirect_type, $this->redirect_types ) ? $redirect_type : 0;
- }
- if ( $redirect_type !== 0 ) {
- $this->filter['redirect_type'] = $redirect_type;
-
- $items = array_filter( $items, [ $this, 'filter_by_type' ] );
- }
-
- return $items;
- }
-
- /**
- * Formats the items.
- *
- * @return void
- */
- private function format_items() {
- // Format the data.
- $formatted_items = [];
-
- $counter = 1;
-
- foreach ( $this->items as $redirect ) {
- $formatted_items[] = [
- 'old' => $redirect->get_origin(),
- 'new' => $redirect->get_target(),
- 'type' => $redirect->get_type(),
- 'row_number' => $counter,
- ];
-
- ++$counter;
- }
-
- $this->items = $formatted_items;
- }
-
- /**
- * Filters the redirect by entered search string.
- *
- * @param WPSEO_Redirect $redirect The redirect to filter.
- *
- * @return bool True when the search strings match.
- */
- private function filter_by_search_string( WPSEO_Redirect $redirect ) {
- return ( stripos( $redirect->get_origin(), $this->filter['search_string'] ) !== false || stripos( $redirect->get_target(), $this->filter['search_string'] ) !== false );
- }
-
- /**
- * Filters the redirect by redirect type.
- *
- * @param WPSEO_Redirect $redirect The redirect to filter.
- *
- * @return bool True when type matches redirect type.
- */
- private function filter_by_type( WPSEO_Redirect $redirect ) {
- return $redirect->get_type() === $this->filter['redirect_type'];
- }
-
- /**
- * The old column actions.
- *
- * @param string $column The column name to verify.
- *
- * @return string
- */
- private function get_row_actions( $column ) {
- if ( $column === $this->primary_column ) {
- $actions = [
- 'edit' => '' . __( 'Edit', 'wordpress-seo-premium' ) . ' ',
- 'trash' => '' . __( 'Delete', 'wordpress-seo-premium' ) . ' ',
- ];
-
- return $this->row_actions( $actions );
- }
-
- return '';
- }
-
- /**
- * Generates and display row actions links for the list table.
- *
- * We override the parent class method to avoid doubled buttons to be printed out.
- *
- * @param object $item The item being acted upon.
- * @param string $column_name Current column name.
- * @param string $primary Primary column name.
- *
- * @return string Empty string.
- */
- protected function handle_row_actions( $item, $column_name, $primary ) {
- return '';
- }
-
- /**
- * Retrieves the orderby from the request.
- *
- * @return string The orderby value.
- */
- private function get_orderby() {
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: WP list table is not using a nonce.
- if ( isset( $_GET['orderby'] ) && is_string( $_GET['orderby'] ) ) {
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: same as above and we are strictly comparing the values.
- $orderby = wp_unslash( $_GET['orderby'] );
- if ( array_key_exists( $orderby, $this->get_sortable_columns() ) ) {
- return $orderby;
- }
- }
-
- return 'old';
- }
-
- /**
- * Retrieves the order from the request.
- *
- * @return string The order value.
- */
- private function get_order() {
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: WP list table is not using a nonce.
- if ( isset( $_GET['order'] ) && is_string( $_GET['order'] ) ) {
- // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: same as above and we are strictly comparing the values.
- $order = wp_unslash( $_GET['order'] );
- if ( in_array( $order, [ 'asc', 'desc' ], true ) ) {
- return $order;
- }
- }
-
- return 'asc';
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-types.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-types.php
deleted file mode 100644
index 840d8935..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-types.php
+++ /dev/null
@@ -1,57 +0,0 @@
- __( '301 Moved Permanently', 'wordpress-seo-premium' ),
- '302' => __( '302 Found', 'wordpress-seo-premium' ),
- '307' => __( '307 Temporary Redirect', 'wordpress-seo-premium' ),
- '410' => __( '410 Content Deleted', 'wordpress-seo-premium' ),
- '451' => __( '451 Unavailable For Legal Reasons', 'wordpress-seo-premium' ),
- ];
-
- /**
- * Filter: 'Yoast\WP\SEO\redirect_types' - can be used to filter the redirect types.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param array $redirect_types
- */
- return apply_filters( 'Yoast\WP\SEO\redirect_types', $redirect_types );
- }
-
- /**
- * Checks whether the given value is a valid redirect type.
- *
- * @param string $value Value to check.
- *
- * @return bool True if a redirect type, false otherwise.
- */
- public function has( $value ) {
- $types = $this->get();
-
- return isset( $types[ $value ] );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-upgrade.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-upgrade.php
deleted file mode 100644
index 14f37084..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-upgrade.php
+++ /dev/null
@@ -1,147 +0,0 @@
- WPSEO_Redirect_Formats::PLAIN,
- WPSEO_Redirect_Option::OLD_OPTION_REGEX => WPSEO_Redirect_Formats::REGEX,
- ];
-
- /**
- * Upgrade routine from Yoast SEO premium 1.2.0.
- *
- * @return void
- */
- public static function upgrade_1_2_0() {
- $redirect_option = self::get_redirect_option();
- $redirects = [];
-
- foreach ( self::$redirect_option_names as $redirect_option_name => $redirect_format ) {
- $old_redirects = $redirect_option->get_from_option( $redirect_option_name );
-
- foreach ( $old_redirects as $origin => $redirect ) {
- // Check if the redirect is not an array yet.
- if ( ! is_array( $redirect ) ) {
- $redirects[] = new WPSEO_Redirect( $origin, $redirect['url'], $redirect['type'], $redirect_format );
- }
- }
- }
-
- self::import_redirects( $redirects );
- }
-
- /**
- * Check if redirects should be imported from the free version.
- *
- * @since 2.3
- *
- * @return void
- */
- public static function import_redirects_2_3() {
- // phpcs:ignore WordPress.DB.SlowDBQuery -- Upgrade routine, so rarely used, therefore not an issue.
- $wp_query = new WP_Query( 'post_type=any&meta_key=_yoast_wpseo_redirect&order=ASC' );
-
- if ( ! empty( $wp_query->posts ) ) {
- $redirects = [];
-
- foreach ( $wp_query->posts as $post ) {
-
- $old_url = '/' . $post->post_name . '/';
- $new_url = get_post_meta( $post->ID, '_yoast_wpseo_redirect', true );
-
- // Create redirect.
- $redirects[] = new WPSEO_Redirect( $old_url, $new_url, 301, WPSEO_Redirect_Formats::PLAIN );
-
- // Remove post meta value.
- delete_post_meta( $post->ID, '_yoast_wpseo_redirect' );
- }
-
- self::import_redirects( $redirects );
- }
- }
-
- /**
- * Upgrade routine to merge plain and regex redirects in a single option.
- *
- * @return void
- */
- public static function upgrade_3_1() {
- $redirects = [];
-
- foreach ( self::$redirect_option_names as $redirect_option_name => $redirect_format ) {
- $old_redirects = get_option( $redirect_option_name, [] );
-
- foreach ( $old_redirects as $origin => $redirect ) {
- // Only when URL and type is set.
- if ( array_key_exists( 'url', $redirect ) && array_key_exists( 'type', $redirect ) ) {
- $redirects[] = new WPSEO_Redirect( $origin, $redirect['url'], $redirect['type'], $redirect_format );
- }
- }
- }
-
- // Saving the redirects to the option.
- self::import_redirects( $redirects, [ new WPSEO_Redirect_Option_Exporter() ] );
- }
-
- /**
- * Exports the redirects to htaccess or nginx file if needed.
- *
- * @return void
- */
- public static function upgrade_13_0() {
- $redirect_manager = new WPSEO_Redirect_Manager();
- $redirect_manager->export_redirects();
- }
-
- /**
- * Imports an array of redirect objects.
- *
- * @param WPSEO_Redirect[] $redirects The redirects.
- * @param WPSEO_Redirect_Exporter[]|null $exporters The exporters.
- *
- * @return void
- */
- private static function import_redirects( $redirects, $exporters = null ) {
- if ( empty( $redirects ) ) {
- return;
- }
-
- $redirect_option = self::get_redirect_option();
- $redirect_manager = new WPSEO_Redirect_Manager( null, $exporters, $redirect_option );
-
- foreach ( $redirects as $redirect ) {
- $redirect_option->add( $redirect );
- }
-
- $redirect_option->save( false );
- $redirect_manager->export_redirects();
- }
-
- /**
- * Gets and caches the redirect option.
- *
- * @return WPSEO_Redirect_Option
- */
- private static function get_redirect_option() {
- static $redirect_option;
-
- if ( empty( $redirect_option ) ) {
- $redirect_option = new WPSEO_Redirect_Option( false );
- }
-
- return $redirect_option;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-url-formatter.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-url-formatter.php
deleted file mode 100644
index b7f56538..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-url-formatter.php
+++ /dev/null
@@ -1,76 +0,0 @@
-url = $this->sanitize_url( $url );
- }
-
- /**
- * We want to strip the subdirectory from the redirect url.
- *
- * @param string $home_url The URL to use as the base.
- *
- * @return string
- */
- public function format_without_subdirectory( $home_url ) {
- $subdirectory = $this->get_subdirectory( $home_url );
-
- if ( ! empty( $subdirectory ) ) {
- $subdirectory = trailingslashit( $subdirectory );
- $path_position = strpos( $this->url, $subdirectory );
- if ( $path_position === 0 ) {
- return '/' . $this->sanitize_url( substr( $this->url, strlen( $subdirectory ) ) );
- }
- }
-
- return '/' . $this->url;
- }
-
- /**
- * Removes the slashes at the beginning of an url.
- *
- * @param string $url The URL to sanitize.
- *
- * @return string
- */
- protected function sanitize_url( $url ) {
- return ltrim( $url, '/' );
- }
-
- /**
- * Returns the subdirectory from the given URL.
- *
- * @param string $url The URL to get the subdirectory for.
- *
- * @return string
- */
- protected function get_subdirectory( $url ) {
- $path = wp_parse_url( $url, PHP_URL_PATH );
- if ( is_string( $path ) ) {
- return $this->sanitize_url( $path );
- }
-
- return '';
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-util.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-util.php
deleted file mode 100644
index 832ad3a8..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect-util.php
+++ /dev/null
@@ -1,131 +0,0 @@
- [
- 'validation_class' => 'WPSEO_Redirect_Relative_Origin_Validation',
- 'exclude_types' => [],
- 'exclude_format' => [ WPSEO_Redirect_Formats::REGEX ],
- ],
- 'self-redirect' => [
- 'validation_class' => 'WPSEO_Redirect_Self_Redirect_Validation',
- 'exclude_types' => [],
- 'exclude_format' => [ WPSEO_Redirect_Formats::REGEX ],
- ],
- 'uniqueness' => [
- 'validation_class' => 'WPSEO_Redirect_Uniqueness_Validation',
- 'exclude_types' => [],
- 'exclude_format' => [],
- ],
- 'presence' => [
- 'validation_class' => 'WPSEO_Redirect_Presence_Validation',
- 'exclude_types' => [],
- 'exclude_format' => [],
- ],
- 'subdirectory-presence' => [
- 'validation_class' => 'WPSEO_Redirect_Subdirectory_Validation',
- 'exclude_types' => [],
- 'exclude_format' => [],
- ],
- 'accessible' => [
- 'validation_class' => 'WPSEO_Redirect_Accessible_Validation',
- 'exclude_types' => [ WPSEO_Redirect_Types::DELETED, WPSEO_Redirect_Types::UNAVAILABLE ],
- 'exclude_format' => [ WPSEO_Redirect_Formats::REGEX ],
- ],
- 'endpoint' => [
- 'validation_class' => 'WPSEO_Redirect_Endpoint_Validation',
- 'exclude_types' => [ WPSEO_Redirect_Types::DELETED, WPSEO_Redirect_Types::UNAVAILABLE ],
- 'exclude_format' => [ WPSEO_Redirect_Formats::REGEX ],
- ],
- ];
-
- /**
- * A string holding a possible redirect validation error.
- *
- * @var bool|string The validation error.
- */
- protected $validation_error = false;
-
- /**
- * Validates the old and the new URL.
- *
- * @param WPSEO_Redirect $redirect The redirect that will be saved.
- * @param WPSEO_Redirect|null $current_redirect Redirect that will be used for comparison.
- *
- * @return bool|string
- */
- public function validate( WPSEO_Redirect $redirect, ?WPSEO_Redirect $current_redirect = null ) {
-
- $validators = $this->get_validations( $this->get_filtered_validation_rules( $this->validation_rules, $redirect ) );
- $redirects = $this->get_redirects( $redirect->get_format() );
-
- $this->validation_error = '';
- foreach ( $validators as $validator ) {
- if ( ! $validator->run( $redirect, $current_redirect, $redirects ) ) {
- $this->validation_error = $validator->get_error();
-
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Returns the validation error.
- *
- * @return WPSEO_Validation_Result
- */
- public function get_error() {
- return $this->validation_error;
- }
-
- /**
- * Removes a rule from the validations.
- *
- * @param array $validations Array with the validations.
- * @param string $rule_to_remove The rule that will be removed.
- *
- * @return void
- */
- protected function remove_rule( &$validations, $rule_to_remove ) {
- if ( array_key_exists( $rule_to_remove, $validations ) ) {
- unset( $validations[ $rule_to_remove ] );
- }
- }
-
- /**
- * Filters the validation rules.
- *
- * @param array $validations Array with validation rules.
- * @param WPSEO_Redirect $redirect The redirect that will be saved.
- *
- * @return array
- */
- protected function get_filtered_validation_rules( array $validations, WPSEO_Redirect $redirect ) {
- foreach ( $validations as $validation => $validation_rules ) {
- $exclude_format = in_array( $redirect->get_format(), $validation_rules['exclude_format'], true );
- $exclude_type = in_array( $redirect->get_type(), $validation_rules['exclude_types'], true );
-
- if ( $exclude_format || $exclude_type ) {
- $this->remove_rule( $validations, $validation );
- }
- }
-
- return $validations;
- }
-
- /**
- * Getting the validations based on the set validation rules.
- *
- * @param array $validation_rules The rules for the validations that will be run.
- *
- * @return WPSEO_Redirect_Validation[]
- */
- protected function get_validations( $validation_rules ) {
- $validations = [];
- foreach ( $validation_rules as $validation_rule ) {
- $validations[] = new $validation_rule['validation_class']();
- }
-
- return $validations;
- }
-
- /**
- * Fill the redirect property.
- *
- * @param string $format The format for the redirects.
- *
- * @return array
- */
- protected function get_redirects( $format ) {
- $redirect_manager = new WPSEO_Redirect_Manager( $format );
-
- // Format the redirects.
- $redirects = [];
- foreach ( $redirect_manager->get_all_redirects() as $redirect ) {
- $redirects[ $redirect->get_origin() ] = $redirect->get_target();
- }
-
- return $redirects;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect.php
deleted file mode 100644
index fd89423a..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/redirect.php
+++ /dev/null
@@ -1,349 +0,0 @@
-origin = ( $format === WPSEO_Redirect_Formats::PLAIN ) ? $this->sanitize_origin_url( $origin ) : $origin;
- $this->target = $this->sanitize_target_url( $target );
- $this->format = $format;
- $this->type = (int) $type;
- }
-
- /**
- * Returns the origin.
- *
- * @return string The set origin.
- */
- public function get_origin() {
- return $this->origin;
- }
-
- /**
- * Returns the target
- *
- * @return string The set target.
- */
- public function get_target() {
- return $this->target;
- }
-
- /**
- * Returns the type
- *
- * @return int The set type.
- */
- public function get_type() {
- return $this->type;
- }
-
- /**
- * Returns the format
- *
- * @return string The set format.
- */
- public function get_format() {
- return $this->format;
- }
-
- /**
- * Whether a offset exists.
- *
- * @link http://php.net/manual/en/arrayaccess.offsetexists.php
- *
- * @param string $offset An offset to check for.
- *
- * @return bool True on success or false on failure.
- * The return value will be cast to boolean if non-boolean was returned.
- */
- #[ReturnTypeWillChange]
- public function offsetExists( $offset ) {
- return in_array( $offset, [ 'url', 'type' ], true );
- }
-
- /**
- * Offset to retrieve.
- *
- * @link http://php.net/manual/en/arrayaccess.offsetget.php
- *
- * @param string $offset The offset to retrieve.
- *
- * @return mixed Can return all value types.
- */
- #[ReturnTypeWillChange]
- public function offsetGet( $offset ) {
- switch ( $offset ) {
- case 'old':
- return $this->origin;
-
- case 'url':
- return $this->target;
-
- case 'type':
- return $this->type;
- }
-
- return null;
- }
-
- /**
- * Offset to set.
- *
- * @link http://php.net/manual/en/arrayaccess.offsetset.php
- *
- * @param string $offset The offset to assign the value to.
- * @param string $value The value to set.
- *
- * @return void
- */
- #[ReturnTypeWillChange]
- public function offsetSet( $offset, $value ) {
- switch ( $offset ) {
- case 'url':
- $this->target = $value;
- break;
- case 'type':
- $this->type = $value;
- break;
- }
- }
-
- /**
- * Offset to unset.
- *
- * @link http://php.net/manual/en/arrayaccess.offsetunset.php
- *
- * @codeCoverageIgnore
- *
- * @param string $offset The offset to unset.
- *
- * @return void
- */
- #[ReturnTypeWillChange]
- public function offsetUnset( $offset ) {
- }
-
- /**
- * Compares an URL with the origin of the redirect.
- *
- * @param string $url The URL to compare.
- *
- * @return bool True when url matches the origin.
- */
- public function origin_is( $url ) {
- // Sanitize the slash in case of plain redirect.
- if ( $this->format === WPSEO_Redirect_Formats::PLAIN ) {
- $url = $this->sanitize_slash( $url, $this->parse_url( $url ) );
- }
-
- return (string) $this->origin === (string) $url;
- }
-
- /**
- * Strip the trailing slashes for relative URLs.
- *
- * @param string $url_to_sanitize The URL to sanitize.
- * @param array $url_pieces The url pieces.
- *
- * @return string The sanitized url.
- */
- private function sanitize_slash( $url_to_sanitize, array $url_pieces = [] ) {
- $url = $url_to_sanitize;
- if ( $url !== '/' && ! isset( $url_pieces['scheme'] ) ) {
- return trim( $url_to_sanitize, '/' );
- }
-
- return $url;
- }
-
- /**
- * Strip the protocol from the URL.
- *
- * @param string $scheme The scheme to strip.
- * @param string $url The URL to remove the scheme from.
- *
- * @return string The url without the scheme.
- */
- private function strip_scheme_from_url( $scheme, $url ) {
- return str_replace( $scheme . '://', '', $url );
- }
-
- /**
- * Remove the home URL from the redirect to ensure that relative URLs are created.
- *
- * @param string $url The URL to sanitize.
- *
- * @return string The sanitized url.
- */
- private function sanitize_origin_url( $url ) {
- $home_url = static::$home_url->get();
- $home_url_pieces = static::$home_url->get_parsed();
- $url_pieces = $this->parse_url( $url );
-
- if ( $this->match_home_url( $home_url_pieces, $url_pieces ) ) {
- $url = substr(
- $this->strip_scheme_from_url( $url_pieces['scheme'], $url ),
- strlen( $this->strip_scheme_from_url( $home_url_pieces['scheme'], $home_url ) )
- );
-
- $url_pieces['scheme'] = null;
- }
-
- return $this->sanitize_slash( $url, $url_pieces );
- }
-
- /**
- * Sanitizes the target url.
- *
- * @param string $url The url to sanitize.
- *
- * @return string The sanitized url.
- */
- private function sanitize_target_url( $url ) {
- $home_url_pieces = static::$home_url->get_parsed();
- $url_pieces = $this->parse_url( $url );
-
- if ( $this->match_home_url( $home_url_pieces, $url_pieces ) ) {
- $url = substr(
- $this->strip_scheme_from_url( $url_pieces['scheme'], $url ),
- strlen( $home_url_pieces['host'] )
- );
-
- $url_pieces['scheme'] = null;
- }
-
- return $this->sanitize_slash( $url, $url_pieces );
- }
-
- /**
- * Checks if the URL matches the home URL.
- *
- * @param array $home_url_pieces The pieces (wp_parse_url) from the home_url.
- * @param array $url_pieces The pieces (wp_parse_url) from the url to match.
- *
- * @return bool True when the URL matches the home URL.
- */
- private function match_home_url( $home_url_pieces, $url_pieces ) {
- if ( ! isset( $url_pieces['scheme'] ) ) {
- return false;
- }
-
- if ( ! isset( $url_pieces['host'] ) || ! $this->match_home_url_host( $home_url_pieces['host'], $url_pieces['host'] ) ) {
- return false;
- }
-
- if ( ! isset( $home_url_pieces['path'] ) ) {
- return true;
- }
-
- return isset( $url_pieces['path'] ) && $this->match_home_url_path( $home_url_pieces['path'], $url_pieces['path'] );
- }
-
- /**
- * Checks if the URL matches the home URL by comparing their host.
- *
- * @param string $home_url_host The home URL host.
- * @param string $url_host The URL host.
- *
- * @return bool True when both hosts are equal.
- */
- private function match_home_url_host( $home_url_host, $url_host ) {
- return $url_host === $home_url_host;
- }
-
- /**
- * Checks if the URL matches the home URL by comparing their path.
- *
- * @param string $home_url_path The home URL path.
- * @param string $url_path The URL path.
- *
- * @return bool True when the home URL path is empty or when the URL path begins with the home URL path.
- */
- private function match_home_url_path( $home_url_path, $url_path ) {
- $home_url_path = trim( $home_url_path, '/' );
- if ( empty( $home_url_path ) ) {
- return true;
- }
-
- return strpos( trim( $url_path, '/' ), $home_url_path ) === 0;
- }
-
- /**
- * Parses the URL into separate pieces.
- *
- * @param string $url The URL string.
- *
- * @return array Array of URL pieces.
- */
- private function parse_url( $url ) {
- $parsed_url = wp_parse_url( $url );
- if ( is_array( $parsed_url ) ) {
- return $parsed_url;
- }
-
- return [];
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-abstract-validation.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-abstract-validation.php
deleted file mode 100644
index 607e91fc..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-abstract-validation.php
+++ /dev/null
@@ -1,39 +0,0 @@
-error;
- }
-
- /**
- * Sets the validation error.
- *
- * @param WPSEO_Validation_Result $error Validation error or warning.
- *
- * @return void
- */
- protected function set_error( WPSEO_Validation_Result $error ) {
- $this->error = $error;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-accessible-validation.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-accessible-validation.php
deleted file mode 100644
index 77d8a4ad..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-accessible-validation.php
+++ /dev/null
@@ -1,138 +0,0 @@
-parse_target( $redirect->get_target() );
- $decoded_url = rawurldecode( $target );
- $response = $this->remote_head( $decoded_url, [ 'sslverify' => false ] );
-
- if ( is_wp_error( $response ) ) {
- $error = __( 'The URL you entered could not be resolved.', 'wordpress-seo-premium' );
- $this->set_error( new WPSEO_Validation_Warning( $error, 'target' ) );
-
- return false;
- }
-
- $response_code = $this->retrieve_response_code( $response );
-
- // Check if the target is a temporary location.
- if ( $this->is_temporary( $response_code ) ) {
- /* translators: %1$s expands to the returned http code */
- $error = __( 'The URL you are redirecting to seems to return a %1$s status. You might want to check if the target can be reached manually before saving.', 'wordpress-seo-premium' );
- $error = sprintf( $error, $response_code );
- $this->set_error( new WPSEO_Validation_Warning( $error, 'target' ) );
-
- return false;
- }
-
- // Check if the response code is 301.
- if ( $response_code === 301 ) {
- $error = __( 'You\'re redirecting to a target that returns a 301 HTTP code (permanently moved). Make sure the target you specify is directly reachable.', 'wordpress-seo-premium' );
- $this->set_error( new WPSEO_Validation_Warning( $error, 'target' ) );
-
- return false;
- }
-
- if ( $response_code !== 200 ) {
- /* translators: %1$s expands to the returned http code */
- $error = __( 'The URL you entered returned a HTTP code different than 200(OK). The received HTTP code is %1$s.', 'wordpress-seo-premium' );
- $error = sprintf( $error, $response_code );
- $this->set_error( new WPSEO_Validation_Warning( $error, 'target' ) );
-
- return false;
- }
-
- return true;
- }
-
- /**
- * Retrieves the response code from the response array.
- *
- * @param array $response The response.
- *
- * @return int The response code.
- */
- protected function retrieve_response_code( $response ) {
- return wp_remote_retrieve_response_code( $response );
- }
-
- /**
- * Sends a HEAD request to the passed remote URL.
- *
- * @param string $url The URL to send the request to.
- * @param array $options The options to send along with the request.
- *
- * @return array|WP_Error The response or WP_Error if something goes wrong.
- */
- protected function remote_head( $url, $options = [] ) {
- return wp_remote_head( $url, $options );
- }
-
- /**
- * Check if the given response code is a temporary one.
- *
- * @param int $response_code The response code to check.
- *
- * @return bool
- */
- protected function is_temporary( $response_code ) {
- return in_array( $response_code, [ 302, 307 ], true ) || in_array( substr( $response_code, 0, 2 ), [ '40', '50' ], true );
- }
-
- /**
- * Check if the target is relative, if so just parse a full URL.
- *
- * @param string $target The target to parse.
- *
- * @return string
- */
- protected function parse_target( $target ) {
- $scheme = wp_parse_url( $target, PHP_URL_SCHEME );
-
- // If we have an absolute url return it.
- if ( ! empty( $scheme ) ) {
- return $target;
- }
-
- // Removes the installation directory if present.
- $target = WPSEO_Redirect_Util::strip_base_url_path_from_url( $this->get_home_url(), $target );
-
- // If we have a relative url make it absolute.
- $absolute = get_home_url( null, $target );
-
- // If the path does not end with an extension then add a trailing slash.
- if ( WPSEO_Redirect_Util::requires_trailing_slash( $target ) ) {
- return trailingslashit( $absolute );
- }
-
- return $absolute;
- }
-
- /**
- * Returns the home url.
- *
- * @return string The home url.
- */
- protected function get_home_url() {
- return home_url();
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-endpoint-validation.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-endpoint-validation.php
deleted file mode 100644
index 4c03f5da..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-endpoint-validation.php
+++ /dev/null
@@ -1,99 +0,0 @@
-redirects = $redirects;
-
- $origin = $redirect->get_origin();
- $target = $redirect->get_target();
- $endpoint = $this->search_end_point( $target, $origin );
-
- // Check for a redirect loop.
- if ( is_string( $endpoint ) && in_array( $endpoint, [ $origin, $target ], true ) ) {
- $error = __( 'The redirect you are trying to save will create a redirect loop. This means there probably already exists a redirect that points to the origin of the redirect you are trying to save', 'wordpress-seo-premium' );
- $this->set_error( new WPSEO_Validation_Error( $error, [ 'origin', 'target' ] ) );
-
- return false;
- }
-
- if ( is_string( $endpoint ) && $target !== $endpoint ) {
- /* translators: %1$s: will be the target, %2$s: will be the found endpoint. */
- $error = __( '%1$s will be redirected to %2$s. Maybe it\'s worth considering to create a direct redirect to %2$s.', 'wordpress-seo-premium' );
- $error = sprintf( $error, $target, $endpoint );
- $this->set_error( new WPSEO_Validation_Warning( $error, 'target' ) );
-
- return false;
- }
-
- return true;
- }
-
- /**
- * Will check if the $new_url is redirected also and follows the trace of this redirect
- *
- * @param string $new_url The new URL to search for.
- * @param string $old_url The current URL that is redirected.
- *
- * @return bool|string
- */
- private function search_end_point( $new_url, $old_url ) {
- $new_target = $this->find_url( $new_url );
- if ( $new_target !== false ) {
- // Unset the redirects, because it was found already.
- unset( $this->redirects[ $new_url ] );
-
- if ( $new_url !== $old_url ) {
- $traced_target = $this->search_end_point( $new_target, $old_url );
- if ( $traced_target !== false ) {
- return $traced_target;
- }
- }
-
- return $new_target;
- }
-
- return false;
- }
-
- /**
- * Search for the given $url and returns it target
- *
- * @param string $url The URL to search for.
- *
- * @return bool
- */
- private function find_url( $url ) {
- if ( ! empty( $this->redirects[ $url ] ) ) {
- return $this->redirects[ $url ];
- }
-
- return false;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-presence-validation.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-presence-validation.php
deleted file mode 100644
index 9d40097b..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-presence-validation.php
+++ /dev/null
@@ -1,52 +0,0 @@
-allow_empty_target( $redirect->get_type() ) && $redirect->get_origin() !== '' ) {
- return true;
- }
-
- if ( ( $redirect->get_origin() !== '' && $redirect->get_target() !== '' && $redirect->get_type() !== '' ) ) {
- return true;
- }
-
- $error = __( 'Not all the required fields are filled.', 'wordpress-seo-premium' );
- $this->set_error( new WPSEO_Validation_Error( $error ) );
-
- return false;
- }
-
- /**
- * Allows an empty target when the given redirect type matches one of the values in the array.
- *
- * @param string $redirect_type The type to match.
- *
- * @return bool
- */
- private function allow_empty_target( $redirect_type ) {
- $allowed_redirect_types = [ WPSEO_Redirect_Types::DELETED, WPSEO_Redirect_Types::UNAVAILABLE ];
-
- return in_array( (int) $redirect_type, $allowed_redirect_types, true );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-relative-origin-validation.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-relative-origin-validation.php
deleted file mode 100644
index 359ca9e7..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-relative-origin-validation.php
+++ /dev/null
@@ -1,31 +0,0 @@
-get_origin() ) ) {
- return true;
- }
-
- $error = __( 'The old URL for your redirect is not relative. Only the new URL is allowed to be absolute. Make sure to provide a relative old URL.', 'wordpress-seo-premium' );
- $this->set_error( new WPSEO_Validation_Warning( $error, 'origin' ) );
- return false;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-self-redirect-validation.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-self-redirect-validation.php
deleted file mode 100644
index 491c29f7..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-self-redirect-validation.php
+++ /dev/null
@@ -1,33 +0,0 @@
-get_origin() === $redirect->get_target() ) {
- $error = __( 'You are attempting to redirect to the same URL as the origin. Please choose a different URL to redirect to.', 'wordpress-seo-premium' );
- $this->set_error( new WPSEO_Validation_Error( $error, 'origin' ) );
-
- return false;
- }
-
- return true;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-subdirectory-validation.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-subdirectory-validation.php
deleted file mode 100644
index 3cdf9c46..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-subdirectory-validation.php
+++ /dev/null
@@ -1,82 +0,0 @@
-get_subdirectory();
-
- // When there is no subdirectory, there is nothing to validate.
- if ( $subdirectory === '' ) {
- return true;
- }
-
- // When the origin starts with subdirectory, it is okay.
- if ( $this->origin_starts_with_subdirectory( $subdirectory, $redirect->get_origin() ) ) {
- return true;
- }
-
- /* translators: %1$s expands to the subdirectory WordPress is installed. */
- $error = __( 'Your redirect is missing the subdirectory where WordPress is installed in. This will result in a redirect that won\'t work. Make sure the redirect starts with %1$s', 'wordpress-seo-premium' );
- $error = sprintf( $error, '' . $subdirectory . '' );
- $this->set_error( new WPSEO_Validation_Warning( $error, 'origin' ) );
-
- return false;
- }
-
- /**
- * Returns the subdirectory if applicable.
- *
- * Calculates the difference between the home and site url. It strips of the site_url from the home_url and returns
- * the part that remains.
- *
- * @return string
- */
- protected function get_subdirectory() {
- $home_url = untrailingslashit( home_url() );
- $site_url = untrailingslashit( site_url() );
- if ( $home_url === $site_url ) {
- return '';
- }
-
- // Strips the site_url from the home_url. substr is used because we want it from the start.
- $encoding = get_bloginfo( 'charset' );
- return mb_substr( $home_url, mb_strlen( $site_url, $encoding ), null, $encoding );
- }
-
- /**
- * Checks if the origin starts with the given subdirectory. If so, the origin must start with the subdirectory.
- *
- * @param string $subdirectory The subdirectory that should be present.
- * @param string $origin The origin to check for.
- *
- * @return bool
- */
- protected function origin_starts_with_subdirectory( $subdirectory, $origin ) {
- // Strip slashes at the beginning because the origin doesn't start with a slash.
- $subdirectory = ltrim( $subdirectory, '/' );
-
- if ( strstr( $origin, $subdirectory ) ) {
- return substr( $origin, 0, strlen( $subdirectory ) ) === $subdirectory;
- }
-
- return false;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-uniqueness-validation.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-uniqueness-validation.php
deleted file mode 100644
index df4bb77e..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-uniqueness-validation.php
+++ /dev/null
@@ -1,42 +0,0 @@
-get_origin() === $old_redirect->get_origin() ) {
- return true;
- }
-
- if ( array_key_exists( $redirect->get_origin(), $redirects ) ) {
- $this->set_error(
- new WPSEO_Validation_Error(
- __( 'The old URL already exists as a redirect.', 'wordpress-seo-premium' ),
- 'origin'
- )
- );
-
- return false;
- }
-
- return true;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-validation-interface.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-validation-interface.php
deleted file mode 100644
index 76e44b47..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/validation/redirect-validation-interface.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
- '>
-
-
- ' class='select'>
- 0 ) {
- foreach ( $yoast_seo_redirect_types as $yoast_seo_redirect_type => $yoast_seo_redirect_desc ) {
- echo ''
- . esc_html( $yoast_seo_redirect_desc ) . ' ' . "\n";
- }
- }
- ?>
-
-
-
-
- ',
- ''
- );
- ?>
-
-
-
- '>
-
-
- ' value='' />
-
-
-
-
- '>
-
-
- ' value='' />
-
-
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-quick-edit.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-quick-edit.php
deleted file mode 100644
index a6dc5a79..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-quick-edit.php
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-tab-plain.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-tab-plain.php
deleted file mode 100644
index 0adc9137..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-tab-plain.php
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-' . esc_html__( 'Plain redirects', 'wordpress-seo-premium' ) . ''; ?>
-
-
-
-
- display(
- [
- 'form_presenter' => $yoast_seo_form_presenter,
- 'total_columns' => $yoast_seo_redirect_table->count_columns(),
- ]
- );
- ?>
-
-
-
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-tab-regex.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-tab-regex.php
deleted file mode 100644
index e3d03709..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-tab-regex.php
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-' . esc_html__( 'Regular Expression redirects', 'wordpress-seo-premium' ) . ''; ?>
-
- ',
- ''
- );
- ?>
-
-
-
-
-
-
- display(
- [
- 'form_presenter' => $yoast_seo_form_presenter,
- 'total_columns' => $yoast_seo_redirect_table->count_columns(),
- ]
- );
- ?>
-
-
-
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-tab-settings.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-tab-settings.php
deleted file mode 100644
index 4e382c0b..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects-tab-settings.php
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
-
-
- .htaccess'
- );
- ?>
-
-
-
-
-
-
-
-
-
-
-' . esc_html__( 'Redirects settings', 'wordpress-seo-premium' ) . ''; ?>
-
-'
- . esc_html__( 'Read more about why web server redirect methods have been disabled on a multisite.', 'wordpress-seo-premium' )
- . '';
- // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output escaped in Alert_Presenter.
- echo new Alert_Presenter( $yoast_seo_disable_htaccess_message, 'info' );
-}
-?>
-
-
-
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects.php
deleted file mode 100644
index 3696e7e0..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/redirect/views/redirects.php
+++ /dev/null
@@ -1,36 +0,0 @@
-admin_header( false, 'wpseo_redirects', false, 'yoast_wpseo_redirects_options' );
-?>
-
- $yoast_seo_tab_value ) {
- $yoast_seo_active = '';
- if ( $redirect_tabs['current_tab'] === $yoast_seo_tab_url ) {
- $yoast_seo_active = ' nav-tab-active';
- }
- echo '' . esc_html( $yoast_seo_tab_value ) . ' ';
- }
- ?>
-
-
- display(
- [
- 'nonce' => wp_create_nonce( 'wpseo-redirects-ajax-security' ),
- ]
- );
- }
- ?>
-
-
-admin_footer( false );
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/social-previews.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/social-previews.php
deleted file mode 100644
index 69f1fbd2..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/social-previews.php
+++ /dev/null
@@ -1,34 +0,0 @@
-term_redirect_can_be_made( $pagenow ) ) {
- return;
- }
-
- add_action( 'admin_enqueue_scripts', [ $this, 'page_scripts' ] );
-
- // Get all taxonomies.
- $taxonomies = get_taxonomies();
-
- // Loop through all taxonomies.
- if ( count( $taxonomies ) > 0 ) {
- foreach ( $taxonomies as $taxonomy ) {
- // Add old URL field to term edit screen.
- add_action( $taxonomy . '_edit_form_fields', [ $this, 'old_url_field' ], 10, 2 );
- }
- }
-
- add_action( 'wp_ajax_inline-save-tax', [ $this, 'set_old_url_quick_edit' ], 1 );
-
- // Detect the term slug change.
- add_action( 'edited_term', [ $this, 'detect_slug_change' ], 10, 3 );
-
- // Detect a term delete.
- add_action( 'delete_term_taxonomy', [ $this, 'detect_term_delete' ] );
- }
-
- /**
- * Registers the page scripts.
- *
- * @param string $current_page The page that is opened at the moment.
- *
- * @return void
- */
- public function page_scripts( $current_page ) {
- if ( ! $this->term_redirect_can_be_made( $current_page ) ) {
- return;
- }
-
- parent::page_scripts( $current_page );
-
- if ( $current_page === 'edit-tags.php' ) {
- wp_enqueue_script( 'wp-seo-premium-quickedit-notification' );
- }
- if ( $current_page === 'term.php' ) {
- wp_enqueue_script( 'wp-seo-premium-redirect-notifications' );
- }
- }
-
- /**
- * Add an extra field to term edit screen.
- *
- * @param string $tag The current tag name.
- * @param string $taxonomy The name of the current taxonomy.
- *
- * @return void
- */
- public function old_url_field( $tag, $taxonomy ) {
- $url = $this->get_target_url( $tag, $taxonomy );
-
- // phpcs:ignore WordPress.Security.EscapeOutput -- Correctly escaped in parse_url_field() method.
- echo $this->parse_url_field( $url, 'term' );
- }
-
- /**
- * Set old URL when the quick edit is used for taxonomies.
- *
- * @return void
- */
- public function set_old_url_quick_edit() {
- check_ajax_referer( 'taxinlineeditnonce', '_inline_edit' );
-
- $permalink = $this->get_taxonomy_permalink();
-
- if ( ! is_wp_error( $permalink ) ) {
- $this->old_url = str_replace( home_url(), '', $permalink );
- }
- }
-
- /**
- * Detect if the slug changed, hooked into 'post_updated'.
- *
- * @param int $term_id The term id.
- * @param int $tt_id The term taxonomy id.
- * @param stdClass $taxonomy Object with the values of the taxonomy.
- *
- * @return bool
- */
- public function detect_slug_change( $term_id, $tt_id, $taxonomy ) {
- /**
- * Filter: 'Yoast\WP\SEO\term_redirect_slug_change' - Check if a redirect should be created
- * on term slug change.
- *
- * Note: This is a Premium plugin-only hook.
- *
- * @since 12.9.0
- *
- * @param bool $create_redirect Whether a redirect should be created.
- */
- if ( apply_filters( 'Yoast\WP\SEO\term_redirect_slug_change', false ) === true ) {
- return true;
- }
-
- /**
- * Certain plugins use multisite context switching when saving terms. This can lead to incorrect redirects being
- * created.
- *
- * See https://github.com/Yoast/bugreports/issues/437.
- */
- if ( is_multisite() && ms_is_switched() ) {
- return false;
- }
-
- $old_url = $this->get_old_url();
-
- if ( ! $old_url ) {
- return false;
- }
-
- // Get the new URL.
- $new_url = $this->get_target_url( $term_id, $taxonomy );
-
- // Maybe we can undo the created redirect.
- $created_redirect = $this->notify_undo_slug_redirect( $old_url, $new_url, $term_id, 'term' );
-
- if ( $created_redirect ) {
- $redirect_info = [
- 'origin' => $created_redirect->get_origin(),
- 'target' => $created_redirect->get_target(),
- 'type' => $created_redirect->get_type(),
- 'format' => $created_redirect->get_format(),
- ];
- update_term_meta( $term_id, '_yoast_term_redirect_info', $redirect_info );
- }
- }
-
- /**
- * Offer to create a redirect from the term that is about to get deleted.
- *
- * @param int $term_taxonomy_id The term taxonomy id that will be deleted.
- *
- * @return void
- */
- public function detect_term_delete( $term_taxonomy_id ) {
- $term = get_term_by( 'term_taxonomy_id', (int) $term_taxonomy_id );
-
- if ( ! $term || is_wp_error( $term ) ) {
- return;
- }
-
- $url = $this->get_target_url( $term, $term->taxonomy );
- if ( $this->is_redirect_needed( $term, $url ) ) {
- $this->set_delete_notification( $url );
- }
- }
-
- /**
- * Checks if a redirect is needed for the term with the given ID.
- *
- * @param WP_Term $term The term to check.
- * @param string $url The target url.
- *
- * @return bool If a redirect is needed.
- */
- protected function is_redirect_needed( $term, $url ) {
- $redirect_manager = new WPSEO_Redirect_Manager( 'plain' );
- $redirect = $redirect_manager->get_redirect( $url );
- return ! $redirect || ( ! is_nav_menu( $term->term_id ) && is_taxonomy_viewable( $term->taxonomy ) );
- }
-
- /**
- * Parses the hidden field with the old URL to show in the form.
- *
- * @param string $url The old URL.
- * @param string $type The type of the URL.
- *
- * @return string The parsed hidden input field.
- */
- protected function parse_url_field( $url, $type ) {
-
- // Output the hidden field.
- return ' ';
- }
-
- /**
- * Gets the URL to the term and returns its path.
- *
- * @param string $tag The current tag name.
- * @param string $taxonomy The name of the current taxonomy.
- *
- * @return string
- */
- protected function get_target_url( $tag, $taxonomy ) {
- // Get the term link.
- $term_link = get_term_link( $tag, $taxonomy );
-
- // Return early if the term link is not a string, i.e. a WP_Error Object.
- if ( ! is_string( $term_link ) ) {
- return '';
- }
-
- // Use the correct URL path.
- $url = wp_parse_url( $term_link );
- if ( is_array( $url ) && isset( $url['path'] ) ) {
- return $url['path'];
- }
-
- return '';
- }
-
- /**
- * Get permalink for taxonomy.
- *
- * @return string|WP_Error
- */
- protected function get_taxonomy_permalink() {
- // phpcs:disable WordPress.Security.NonceVerification.Missing -- Reason: We verify the nonce before coming here.
- // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: We do sanitize by casting to int.
- $term_id = isset( $_POST['tax_ID'] ) ? (int) wp_unslash( $_POST['tax_ID'] ) : 0;
- $taxonomy = isset( $_POST['taxonomy'] ) ? sanitize_text_field( wp_unslash( $_POST['taxonomy'] ) ) : null;
- // phpcs:enable
-
- return get_term_link( get_term( $term_id, $taxonomy ), $taxonomy );
- }
-
- /**
- * Get the old URL.
- *
- * @return bool|string
- */
- protected function get_old_url() {
- // phpcs:disable WordPress.Security.NonceVerification.Missing -- Reason: This is used while hooked in an action thus we don't control the nonce creation.
- // phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: This data looks like it's being used only with WP functions later on.
- $wpseo_old_term_url = isset( $_POST['wpseo_old_term_url'] ) ? wp_unslash( $_POST['wpseo_old_term_url'] ) : null;
- // phpcs:enable
-
- if ( empty( $wpseo_old_term_url ) ) {
- if ( ! empty( $this->old_url ) ) {
- return $this->old_url;
- }
-
- return false;
- }
- return $wpseo_old_term_url;
- }
-
- /**
- * Returns the undo message for the term.
- *
- * @return string
- */
- protected function get_undo_slug_notification() {
- /* translators: %1$s: Yoast SEO Premium, %2$s and %3$s expand to a link to the admin page. */
- return __(
- '%1$s created a %2$sredirect%3$s from the old term URL to the new term URL.',
- 'wordpress-seo-premium'
- );
- }
-
- /**
- * Returns the delete message for the term.
- *
- * @return string
- */
- protected function get_delete_notification() {
- /* translators: %1$s: Yoast SEO Premium, %2$s: List with actions, %3$s: , %4$s: , %5%s: The removed url. */
- return __(
- '%1$s detected that you deleted a term (%5$s). You can either: %2$s Don\'t know what to do? %3$sRead this post %4$s.',
- 'wordpress-seo-premium'
- );
- }
-
- /**
- * Is the current page valid to make a redirect from.
- *
- * @param string $current_page The currently opened page.
- *
- * @return bool True when a redirect can be made on this page.
- */
- protected function term_redirect_can_be_made( $current_page ) {
- return $this->is_term_page( $current_page ) || $this->is_action_inline_save_tax() || $this->is_action_delete_tag();
- }
-
- /**
- * Is the current page related to a term (edit/overview).
- *
- * @param string $current_page The current opened page.
- *
- * @return bool True when page is a term edit/overview page.
- */
- protected function is_term_page( $current_page ) {
- return ( in_array( $current_page, [ 'edit-tags.php', 'term.php' ], true ) );
- }
-
- /**
- * Is the page in an AJAX-request and is the action "inline save".
- *
- * @return bool True when in an AJAX-request and the action is inline-save.
- */
- protected function is_action_inline_save_tax() {
- if ( ! wp_doing_ajax() ) {
- return false;
- }
-
- // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: We don't control the nonce creation.
- $action = isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : null;
- return $action === 'inline-save-tax';
- }
-
- /**
- * Is the page in an AJAX-request and is the action "delete-tag".
- *
- * @return bool True when in an AJAX-request and the action is delete-tag.
- */
- protected function is_action_delete_tag() {
- if ( ! wp_doing_ajax() ) {
- return false;
- }
-
- // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reason: We don't control the nonce creation.
- $action = isset( $_POST['action'] ) ? sanitize_text_field( wp_unslash( $_POST['action'] ) ) : null;
- return $action === 'delete-tag';
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/upgrade-manager.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/upgrade-manager.php
deleted file mode 100644
index 2fcbc4c1..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/upgrade-manager.php
+++ /dev/null
@@ -1,365 +0,0 @@
-check_update( $saved_version );
-
- update_option( self::VERSION_OPTION_KEY, $current_version );
-
- add_action( 'shutdown', 'flush_rewrite_rules' );
- }
- }
-
- /**
- * Runs the specific updates when it is necessary.
- *
- * @param string $version_number The version number that will be compared.
- *
- * @return void
- */
- public function check_update( $version_number ) {
- // Get current version.
- $current_version = get_site_option( WPSEO_Premium::OPTION_CURRENT_VERSION, 1 );
-
- // Check if update is required.
- if ( WPSEO_Premium::PLUGIN_VERSION_CODE > $current_version ) {
-
- // Do update.
- $this->do_update( $current_version );
-
- // Update version code.
- $this->update_current_version_code();
- }
-
- if ( version_compare( $version_number, '2.3', '<' ) ) {
- add_action( 'wp', [ 'WPSEO_Redirect_Upgrade', 'import_redirects_2_3' ], 11 );
- add_action( 'admin_head', [ 'WPSEO_Redirect_Upgrade', 'import_redirects_2_3' ], 11 );
- }
-
- if ( version_compare( $version_number, '3.1', '<' ) ) {
- add_action( 'wp', [ 'WPSEO_Redirect_Upgrade', 'upgrade_3_1' ], 12 );
- add_action( 'admin_head', [ 'WPSEO_Redirect_Upgrade', 'upgrade_3_1' ], 12 );
- }
-
- if ( version_compare( $version_number, '4.7', '<' ) ) {
- add_action( 'wp', [ 'WPSEO_Premium_Prominent_Words_Versioning', 'upgrade_4_7' ], 12 );
- add_action( 'admin_head', [ 'WPSEO_Premium_Prominent_Words_Versioning', 'upgrade_4_7' ], 12 );
- }
-
- if ( version_compare( $version_number, '4.8', '<' ) ) {
- add_action( 'wp', [ 'WPSEO_Premium_Prominent_Words_Versioning', 'upgrade_4_8' ], 12 );
- add_action( 'admin_head', [ 'WPSEO_Premium_Prominent_Words_Versioning', 'upgrade_4_8' ], 12 );
- }
-
- if ( version_compare( $version_number, '9.8-RC0', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_9_8' ], 12 );
- }
-
- if ( version_compare( $version_number, '10.3', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_11' ], 12 );
- }
-
- if ( version_compare( $version_number, '13.0-RC0', '<' ) ) {
- add_action( 'init', [ 'WPSEO_Redirect_Upgrade', 'upgrade_13_0' ], 12 );
- }
-
- if ( version_compare( $version_number, '15.3-RC0', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_15_3' ], 12 );
- }
-
- if ( version_compare( $version_number, '16.2-RC0', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_16_2' ], 12 );
- }
-
- if ( version_compare( $version_number, '16.3-beta2', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_16_3' ], 12 );
- }
-
- if ( version_compare( $version_number, '17.2-RC0', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_17_2' ], 12 );
- }
-
- if ( version_compare( $version_number, '17.3-RC4', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_17_3' ], 12 );
- }
-
- if ( version_compare( $version_number, '17.4-RC0', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_17_4' ], 12 );
- }
-
- if ( version_compare( $version_number, '17.7-RC0', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_17_7' ], 12 );
- }
-
- if ( version_compare( $version_number, '19.3-RC0', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_19_3' ], 12 );
- }
-
- if ( version_compare( $version_number, '21.6-RC0', '<' ) ) {
- add_action( 'init', [ $this, 'upgrade_21_6' ], 12 );
- }
- }
-
- /**
- * Enables the AI feature if it was not enabled before.
- *
- * @return void
- */
- public function upgrade_21_6() {
-
- if ( ! empty( WPSEO_Options::get( 'activation_redirect_timestamp' ) ) ) {
- $is_ai_enabled = WPSEO_Options::get( 'enable_ai_generator' );
-
- if ( $is_ai_enabled ) {
- WPSEO_Options::set( 'ai_enabled_pre_default', true );
-
- return;
- }
- WPSEO_Options::set( 'enable_ai_generator', true );
- }
- }
-
- /**
- * Removes the inclusive language feature notification from the Notification center.
- *
- * @return void
- */
- public function upgrade_19_3() {
- Yoast_Notification_Center::get()->remove_notification_by_id( 'wpseo-inclusive-language-notice' );
- }
-
- /**
- * Make sure our options autoload.
- *
- * @return void
- */
- public function upgrade_17_7() {
- global $wpdb;
-
- foreach ( [ WPSEO_Redirect_Option::OPTION_PLAIN, WPSEO_Redirect_Option::OPTION_REGEX ] as $option ) {
- // phpcs:ignore WordPress.DB.DirectDatabaseQuery -- Normal methods only work if the option value has changed.
- $wpdb->update( $wpdb->options, [ 'autoload' => 'yes' ], [ 'option_name' => $option ] );
- }
-
- // Make sure we don't autoload the non-exported option.
- $wpdb->update( $wpdb->options, [ 'autoload' => 'no' ], [ 'option_name' => WPSEO_Redirect_Option::OPTION ] );
- }
-
- /**
- * Schedules the cleanup integration if it's no already scheduled.
- *
- * @return void
- */
- public function upgrade_17_4() {
- $this->retrigger_cleanup();
- }
-
- /**
- * Clears the first step of the orphaned workout.
- *
- * @return void
- */
- public function upgrade_17_3() {
- $workouts_option = WPSEO_Options::get( 'workouts' );
-
- if ( isset( $workouts_option['orphaned'] )
- && isset( $workouts_option['orphaned']['indexablesByStep'] )
- && is_array( $workouts_option['orphaned']['indexablesByStep'] )
- ) {
- $workouts_option['orphaned']['indexablesByStep']['improveRemove'] = [];
- WPSEO_Options::set( 'workouts', $workouts_option );
- }
- }
-
- /**
- * Schedules the cleanup integration if it's no already scheduled.
- *
- * @return void
- */
- public function upgrade_17_2() {
- $this->retrigger_cleanup();
- }
-
- /**
- * Re-triggers the cleanup of old things from the database.
- *
- * @return void
- */
- protected function retrigger_cleanup() {
- // If Yoast SEO hasn't been upgraded to 17.2 the cleanup integration has not been implemented in the current way.
- if ( ! defined( '\Yoast\WP\SEO\Integrations\Cleanup_Integration::START_HOOK' ) ) {
- return;
- }
- // If Yoast SEO premium was upgraded after Yoast SEO, reschedule the task to clean out orphaned prominent words.
- if ( ! wp_next_scheduled( Cleanup_Integration::START_HOOK ) ) {
- wp_schedule_single_event( ( time() + ( MINUTE_IN_SECONDS * 5 ) ), Cleanup_Integration::START_HOOK );
- }
- }
-
- /**
- * Runs the language pack upgrader to migrate to TranslationsPress.
- *
- * @return void
- */
- public function upgrade_16_3() {
- require_once ABSPATH . 'wp-admin/includes/admin.php';
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
- $upgrader = new WP_Upgrader();
- $upgrader->skin = new Automatic_Upgrader_Skin();
- Language_Pack_Upgrader::async_upgrade( $upgrader );
- }
-
- /**
- * Makes sure the Premium capabilities exist.
- *
- * @return void
- */
- public function upgrade_16_2() {
- do_action( 'wpseo_register_capabilities_premium' );
- WPSEO_Capability_Manager_Factory::get( 'premium' )->add();
- }
-
- /**
- * Renames the `prominent_words_indexation_completed` option.
- *
- * @return void
- */
- public function upgrade_15_3() {
- $old_value = WPSEO_Options::get( 'prominent_words_indexation_completed' );
- WPSEO_Options::set( 'prominent_words_indexing_completed', $old_value );
- }
-
- /**
- * Removes the orphaned content notification.
- *
- * @return void
- */
- public function upgrade_11() {
- $orphaned_content_support = new WPSEO_Premium_Orphaned_Content_Support();
- $notification_manager = Yoast_Notification_Center::get();
-
- foreach ( $orphaned_content_support->get_supported_post_types() as $post_type ) {
- // We need to remove the dismissal first, to clean up better but also as otherwise the remove won't work.
- delete_metadata( 'user', false, 'wpseo-premium-orphaned-content-' . $post_type, '', true );
- $notification_manager->remove_notification_by_id( 'wpseo-premium-orphaned-content-' . $post_type, true );
- }
-
- // Remove the cronjob if present.
- wp_clear_scheduled_hook( 'wpseo-premium-orphaned-content' );
- }
-
- /**
- * Removes the stale cornerstone content beta notification.
- *
- * @return void
- */
- public function upgrade_9_8() {
- $notification_manager = Yoast_Notification_Center::get();
- $notification_manager->remove_notification_by_id( 'wpseo-stale-content-notification' );
-
- // Delete the user meta data that tracks whether the user has seen the notification.
- delete_metadata( 'user', false, 'wp_wpseo-stale-content-notification', '', true );
- }
-
- /**
- * Returns whether or not we should retry the 31 upgrade.
- *
- * @return bool
- */
- public function should_retry_upgrade_31() {
- $retry = false;
-
- $new_redirects = get_option( WPSEO_Redirect_Option::OPTION, null );
- if ( $new_redirects === null ) {
- $old_plain_redirects = get_option( WPSEO_Redirect_Option::OLD_OPTION_PLAIN, [] );
- $old_regex_redirects = get_option( WPSEO_Redirect_Option::OLD_OPTION_REGEX, [] );
-
- if ( ! empty( $old_plain_redirects ) || ! empty( $old_regex_redirects ) ) {
- $retry = true;
- }
- }
-
- return $retry;
- }
-
- /**
- * Validates if the 31 upgrade routine has correctly run and if not retries to run it
- *
- * @param bool $immediately Whether to do the upgrade immediately when this function is called.
- *
- * @return void
- */
- public function retry_upgrade_31( $immediately = false ) {
- /*
- * If we detect that the new redirect option doesn't exist but there are redirects in the old option we try the
- * upgrade routine again. This brings the redirects back for people if the upgrade routine failed the first
- * time.
- */
- if ( $this->should_retry_upgrade_31() ) {
- if ( $immediately ) {
- WPSEO_Redirect_Upgrade::upgrade_3_1();
-
- return;
- }
- add_action( 'wp', [ 'WPSEO_Redirect_Upgrade', 'upgrade_3_1' ], 12 );
- add_action( 'admin_head', [ 'WPSEO_Redirect_Upgrade', 'upgrade_3_1' ], 12 );
- }
- }
-
- /**
- * An update is required, do it
- *
- * @param string $current_version The current version number of the installation.
- *
- * @return void
- */
- private function do_update( $current_version ) {
- // Upgrade to version 1.2.0.
- if ( $current_version < 15 ) {
- /**
- * Upgrade redirects
- */
- add_action( 'wp', [ 'WPSEO_Redirect_Upgrade', 'upgrade_1_2_0' ], 10 );
- add_action( 'admin_head', [ 'WPSEO_Redirect_Upgrade', 'upgrade_1_2_0' ], 10 );
- }
- }
-
- /**
- * Update the current version code
- *
- * @return void
- */
- private function update_current_version_code() {
- update_site_option( WPSEO_Premium::OPTION_CURRENT_VERSION, WPSEO_Premium::PLUGIN_VERSION_CODE );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/validation-error.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/validation-error.php
deleted file mode 100644
index 70a2ddca..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/validation-error.php
+++ /dev/null
@@ -1,21 +0,0 @@
-message = $message;
- $this->set_fields( $fields );
- }
-
- /**
- * Gets the validation result message.
- *
- * @return string
- */
- public function get_message() {
- return $this->message;
- }
-
- /**
- * Returns an Array representation of the validation result.
- *
- * @return array
- */
- public function to_array() {
- return [
- 'type' => $this->get_type(),
- 'message' => $this->message,
- 'fields' => $this->fields,
- ];
- }
-
- /**
- * Setting the fields with errors.
- *
- * @param string $fields The fields with errors on it.
- *
- * @return void
- */
- protected function set_fields( $fields = '' ) {
- if ( ! is_array( $fields ) && is_string( $fields ) ) {
- $fields = [ $fields ];
- }
-
- $this->fields = $fields;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/validation-warning.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/validation-warning.php
deleted file mode 100644
index 3f5ba361..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/validation-warning.php
+++ /dev/null
@@ -1,21 +0,0 @@
-%s', esc_html( $yoast_seo_button_label ) )
-);
-
-?>
-
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/views/export-redirects.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/views/export-redirects.php
deleted file mode 100644
index 331b020f..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/views/export-redirects.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/views/import-redirects.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/views/import-redirects.php
deleted file mode 100644
index 1c4c1c6d..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/views/import-redirects.php
+++ /dev/null
@@ -1,82 +0,0 @@
-.htaccess'
-);
-
-$yoast_seo_i18n_import_redirects_explain = sprintf(
- /* translators: %1$s: '.htaccess' file name, %2$s: plugin name */
- __( 'You can copy the contents of any %1$s file in here, and it will import the redirects into %2$s.', 'wordpress-seo-premium' ),
- '.htaccess',
- 'Yoast SEO Premium'
-);
-
-// The plugins we have import functions for.
-$yoast_seo_plugins = [
- 'redirection' => __( 'Redirection', 'wordpress-seo-premium' ) . ' ',
- 'safe_redirect_manager' => __( 'Safe Redirect Manager', 'wordpress-seo-premium' ) . ' ',
- 'simple-301-redirects' => __( 'Simple 301 Redirects', 'wordpress-seo-premium' ) . ' ',
-];
-
-?>
-
-
-
-
-
-
-
-
-
-
-
[] ] ); ?>
-
- [] ] ); ?>
-
-
-
-
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/views/thank-you.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/views/thank-you.php
deleted file mode 100644
index 31e62342..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/views/thank-you.php
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- , %2$s: */
- esc_html__(
- '%1$sCornerstone content%2$s is the content on your site that’s most important. You want to rank highest in Google with these articles. Make sure your internal linking structure reflects what pages are most important. Want to know how?',
- 'wordpress-seo-premium'
- ),
- '',
- ' '
- );
- ?>
-
-
-
-
-
-
-
-
-
-
-
- , %2$s: */
- esc_html__(
- 'Different people search with different search terms. With our %1$spremium analysis%2$s, you are free to use variations and synonyms of your keywords in your content, which will make your writing style far more natural.',
- 'wordpress-seo-premium'
- ),
- '',
- ' '
- );
- ?>
-
-
-
-
-
-
-
-
-
-
-
- , %3$s: */
- esc_html__(
- 'The %1$s %2$sRedirect Manager%3$s automatically prevents visitors from reaching a dead end whenever you move or delete content. It also makes managing your existing redirects easy.',
- 'wordpress-seo-premium'
- ),
- 'Yoast SEO',
- '',
- ' '
- );
- ?>
-
-
-
-
-
-
-
-
-
-
-
- , %3$s: Yoast SEO, %4$s: */
- esc_html__(
- '%1$s grants you direct access to %2$sall premium %3$s academy courses%4$s. Learn all the ins and outs of holistic SEO from industry experts.',
- 'wordpress-seo-premium'
- ),
- 'Yoast SEO Premium',
- '',
- 'Yoast SEO',
- ' '
- );
- ?>
-
-
-
-
-
-
-
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/classes/watcher.php b/wp/wp-content/plugins/wordpress-seo-premium/classes/watcher.php
deleted file mode 100644
index 979aaf65..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/classes/watcher.php
+++ /dev/null
@@ -1,314 +0,0 @@
-watch_type . '_' . $notification_type,
- $show_notification
- );
-
- if ( $show_notification ) {
- // Add the message to the notifications center.
- $arguments = [ 'type' => 'updated' ];
- if ( ! empty( $id ) ) {
- $arguments['id'] = $id;
- }
-
- Yoast_Notification_Center::get()->add_notification( new Yoast_Notification( $message, $arguments ) );
- }
- }
-
- /**
- * Display the delete notification.
- *
- * @param string $url The redirect that will be deleted.
- *
- * @return void
- */
- protected function set_delete_notification( $url ) {
- $id = 'wpseo_delete_redirect_' . md5( $url );
-
- // Format the message.
- $message = sprintf(
- $this->get_delete_notification(),
- 'Yoast SEO Premium',
- $this->get_delete_action_list( $url, $id ),
- '',
- ' ',
- '' . esc_url( trim( $url ) ) . ''
- );
-
- $this->create_notification( $message, 'delete' );
- }
-
- /**
- * Returns the string to the javascript method from where the added redirect can be undone
- *
- * @param int $object_id The post or term ID.
- * @param string $object_type The object type: post or term.
- *
- * @return string
- */
- protected function javascript_undo_redirect( $object_id, $object_type ) {
- return sprintf(
- 'wpseoUndoRedirectByObjectId( "%1$s", "%2$s", this );return false;',
- esc_js( $object_id ),
- esc_js( $object_type )
- );
- }
-
- /**
- * Opens the redirect manager and create the redirect
- *
- * @param string $old_url The URL that will be redirected.
- * @param string $new_url The URL where the old_url redirects to.
- * @param int $header_code The redirect type.
- *
- * @return WPSEO_Redirect
- */
- protected function create_redirect( $old_url, $new_url, $header_code = 301 ) {
- // The URL redirect manager.
- $redirect = new WPSEO_Redirect( $old_url, $new_url, $header_code );
-
- // Create the redirect.
- $this->get_redirect_manager()->create_redirect( $redirect );
-
- return $redirect;
- }
-
- /**
- * Returns the string to the javascript method from where a new redirect can be added
- *
- * @param string $url The URL that can be redirected.
- * @param string $id ID of the notice that is displayed.
- * @param int $type The redirect type. Default is 301.
- *
- * @return string
- */
- protected function javascript_create_redirect( $url, $id, $type = WPSEO_Redirect_Types::PERMANENT ) {
- return sprintf(
- 'wpseoCreateRedirect( "%1$s", "%2$s", "%3$s", this );',
- esc_js( $url ),
- $type,
- wp_create_nonce( 'wpseo-redirects-ajax-security' )
- );
- }
-
- /**
- * Return the URL to the admin page where the just added redirect can be found
- *
- * @param string $old_url String that filters the wpseo_redirect table to the just added redirect.
- *
- * @return string
- */
- protected function admin_redirect_url( $old_url ) {
- return admin_url( 'admin.php?page=wpseo_redirects&s=' . urlencode( $old_url ) );
- }
-
- /**
- * There might be the possibility to undo the redirect, if it is so, we have to notify the user.
- *
- * @param string $old_url The origin URL.
- * @param string $new_url The target URL.
- * @param int $object_id The post or term ID.
- * @param string $object_type The object type: post or term.
- *
- * @return WPSEO_Redirect|null The created redirect.
- */
- protected function notify_undo_slug_redirect( $old_url, $new_url, $object_id, $object_type ) {
- // Check if we should create a redirect.
- if ( $this->should_create_redirect( $old_url, $new_url ) ) {
- $redirect = $this->create_redirect( $old_url, $new_url );
-
- $this->set_undo_slug_notification( $redirect, $object_id, $object_type );
-
- return $redirect;
- }
- }
-
- /**
- * Display the undo notification
- *
- * @param WPSEO_Redirect $redirect The old URL to the post.
- * @param int $object_id The post or term ID.
- * @param string $object_type The object type: post or term.
- *
- * @return void
- */
- protected function set_undo_slug_notification( WPSEO_Redirect $redirect, $object_id, $object_type ) {
- $old_url = $this->format_redirect_url( $redirect->get_origin() );
- $new_url = $this->format_redirect_url( $redirect->get_target() );
-
- // Format the message.
- $message = sprintf(
- $this->get_undo_slug_notification(),
- 'Yoast SEO Premium',
- '',
- ' '
- );
-
- $message .= ' ';
- $message .= esc_html__( 'Old URL:', 'wordpress-seo-premium' ) . ' ' . $this->create_hyperlink_from_url( $old_url );
- $message .= ' ';
- $message .= esc_html__( 'New URL:', 'wordpress-seo-premium' ) . ' ' . $this->create_hyperlink_from_url( $new_url );
- $message .= ' ';
-
- $message .= sprintf(
- '%s ',
- esc_html__( 'Ok', 'wordpress-seo-premium' )
- );
-
- $message .= sprintf(
- '%2$s ',
- $this->javascript_undo_redirect( $object_id, $object_type ),
- esc_html__( 'Undo', 'wordpress-seo-premium' )
- );
-
- // Only set notification when the slug change was not saved through quick edit.
- $this->create_notification( $message, 'slug_change' );
- }
-
- /**
- * Returns a list with the actions that the user can do on deleting a post/term
- *
- * @param string $url The URL that will be redirected.
- * @param string $id The ID of the element.
- *
- * @return string
- */
- protected function get_delete_action_list( $url, $id ) {
- return sprintf(
- '',
- 'javascript_create_redirect( $url, $id, WPSEO_Redirect_Types::PERMANENT ) . '\'>' . __( 'Redirect it to another URL', 'wordpress-seo-premium' ) . ' ',
- 'javascript_create_redirect( $url, $id, WPSEO_Redirect_Types::DELETED ) . '\'>' . __( 'Make it serve a 410 Content Deleted header', 'wordpress-seo-premium' ) . ' '
- );
- }
-
- /**
- * Returns the passed url in hyperlink form. Both the target and the text of the hyperlink is the passed url.
- *
- * @param string $url The url in string form to convert to a hyperlink.
- *
- * @return string
- */
- protected function create_hyperlink_from_url( $url ) {
- return '' . esc_html( $url ) . ' ';
- }
-
- /**
- * Formats the redirect url.
- *
- * @param string $url The url to format.
- *
- * @return string
- */
- protected function format_redirect_url( $url ) {
- $redirect_url_format = new WPSEO_Redirect_Url_Formatter( $url );
-
- return home_url( $redirect_url_format->format_without_subdirectory( get_home_url() ) );
- }
-
- /**
- * Retrieves an instance of the redirect manager.
- *
- * @return WPSEO_Redirect_Manager The redirect manager.
- */
- protected function get_redirect_manager() {
- static $redirect_manager;
-
- if ( $redirect_manager === null ) {
- $redirect_manager = new WPSEO_Redirect_Manager();
- }
-
- return $redirect_manager;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-premium-requirement.php b/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-premium-requirement.php
deleted file mode 100644
index 8a0ab3c1..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-premium-requirement.php
+++ /dev/null
@@ -1,29 +0,0 @@
-helpers->product->is_premium() ) {
- return;
- }
-
- // No premium commands allowed.
- WP_CLI::error(
- 'This command can only be run with an active Yoast SEO Premium license.'
- );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-base-command.php b/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-base-command.php
deleted file mode 100644
index da490e03..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-base-command.php
+++ /dev/null
@@ -1,152 +0,0 @@
-redirect_manager = new WPSEO_Redirect_Manager();
- }
-
- /**
- * Creates a new redirect.
- *
- * @param string $origin Origin of the redirect.
- * @param string $target Target of the redirect.
- * @param string $type Type of the redirect.
- * @param string $format Format of the redirect.
- *
- * @return bool Whether creation was successful.
- */
- protected function create_redirect( $origin, $target, $type, $format ) {
- $redirect = new WPSEO_Redirect( $origin, $target, $type, $format );
-
- return $this->redirect_manager->create_redirect( $redirect );
- }
-
- /**
- * Updates an existing redirect.
- *
- * @param string $old_origin Origin of the redirect.
- * @param string $new_origin Origin of the redirect.
- * @param string $target Target of the redirect.
- * @param string $type Type of the redirect.
- * @param string $format Format of the redirect.
- *
- * @return bool Whether updating was successful.
- */
- protected function update_redirect( $old_origin, $new_origin, $target, $type, $format ) {
- $old_redirect = new WPSEO_Redirect( $old_origin );
- $new_redirect = new WPSEO_Redirect( $new_origin, $target, $type, $format );
-
- return $this->redirect_manager->update_redirect( $old_redirect, $new_redirect );
- }
-
- /**
- * Deletes an existing redirect.
- *
- * @param string $origin Origin of the redirect.
- *
- * @return bool Whether deletion was successful.
- */
- protected function delete_redirect( $origin ) {
- $redirect = new WPSEO_Redirect( $origin );
-
- return $this->redirect_manager->delete_redirects( [ $redirect ] );
- }
-
- /**
- * Gets the redirect for a given origin.
- *
- * @param string $origin Origin to check for.
- *
- * @return WPSEO_Redirect|false Redirect value object, or false if not found.
- */
- protected function get_redirect( $origin ) {
- return $this->redirect_manager->get_redirect( $origin );
- }
-
- /**
- * Checks whether a redirect for a given origin already exists.
- *
- * @param string $origin Origin to check for.
- *
- * @return bool Whether a redirect for the given origin was found.
- */
- protected function has_redirect( $origin ) {
- return $this->get_redirect( $origin ) !== false;
- }
-
- /**
- * Checks whether a given redirect is valid.
- *
- * @param string $new_origin New origin of the redirect.
- * @param string $target Target of the redirect.
- * @param int $type Type of the redirect.
- * @param string $format Format of the redirect.
- * @param string|null $old_origin Optional. Old origin of the redirect to update.
- *
- * @return void
- */
- protected function validate( $new_origin, $target, $type, $format, $old_origin = null ) {
- $new_redirect = new WPSEO_Redirect( $new_origin, $target, $type, $format );
-
- $old_redirect = null;
-
- if ( $old_origin !== null ) {
- $old_redirect = $this->get_redirect( $old_origin );
- }
-
- $validator = new WPSEO_Redirect_Validator();
-
- if ( $validator->validate( $new_redirect, $old_redirect ) === true ) {
- return;
- }
-
- $error = $validator->get_error();
-
- $message = sprintf(
- 'Failed to validate redirect \'%s\' => \'%s\': %s',
- $new_redirect->get_origin(),
- $new_redirect->get_target(),
- $this->reformat_error( $error->get_message() )
- );
-
- if ( $error->get_type() === 'warning' ) {
- WP_CLI::warning( $message );
- }
-
- if ( $error->get_type() === 'error' ) {
- WP_CLI::error( $message );
- }
- }
-
- /**
- * Reformats error messages by removing excessive whitespace.
- *
- * @param string $message Error message to reformat.
- *
- * @return string Reformatted error message.
- */
- protected function reformat_error( $message ) {
- $message = preg_replace( '/\s+/', ' ', $message );
- return trim( $message );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-command-namespace.php b/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-command-namespace.php
deleted file mode 100644
index cbe5d455..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-command-namespace.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- * : Origin of the redirect.
- *
- *
- * : Target of the redirect.
- *
- * [--type=]
- * : Type of the redirect.
- * ---
- * default: 301
- * options:
- * - 301
- * - 302
- * - 307
- * - 410
- * - 451
- * ---
- *
- * [--format=]
- * : Format of the redirect.
- * ---
- * default: plain
- * options:
- * - plain
- * - regex
- * ---
- *
- * [--force]
- * : Force creation of the redirect, bypassing any validation.
- * ---
- * default: false
- * ---
- *
- * @param array $args Array of positional arguments.
- * @param array $assoc_args Associative array of associative arguments.
- *
- * @return void
- */
- public function __invoke( $args, $assoc_args ) {
- list( $origin, $target ) = $args;
-
- $type = (int) Utils\get_flag_value( $assoc_args, 'type', '301' );
- $format = Utils\get_flag_value( $assoc_args, 'format', 'plain' );
- $force = Utils\get_flag_value( $assoc_args, 'force', false );
-
- $exists = $this->has_redirect( $origin );
-
- if ( $exists && ! $force ) {
- WP_CLI::error( "Redirect already exists for '{$origin}'." );
- }
-
- if ( ! $force ) {
- $this->validate( $origin, $target, $type, $format );
- }
-
- if ( $exists ) {
- $success = $this->update_redirect( $origin, $origin, $target, $type, $format );
- }
-
- if ( ! $exists ) {
- $success = $this->create_redirect( $origin, $target, $type, $format );
- }
-
- if ( ! $success ) {
- WP_CLI::error( "Could not create redirect: '{$origin}' => '{$target}'." );
- }
-
- WP_CLI::success( "Redirect created: '{$origin}' => '{$target}'." );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-delete-command.php b/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-delete-command.php
deleted file mode 100644
index 561ea9e2..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-delete-command.php
+++ /dev/null
@@ -1,41 +0,0 @@
-
- * : Origin of the redirect.
- *
- * @param array $args Array of positional arguments.
- * @param array $assoc_args Associative array of associative arguments.
- *
- * @return void
- */
- public function __invoke( $args, $assoc_args ) {
- list( $origin ) = $args;
-
- if ( ! $this->has_redirect( $origin ) ) {
- WP_CLI::error( "Redirect does not exist for '{$origin}'." );
- }
-
- $success = $this->delete_redirect( $origin );
-
- if ( ! $success ) {
- WP_CLI::error( "Could not delete redirect: '{$origin}'." );
- }
-
- WP_CLI::success( "Redirect delete: '{$origin}'." );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-follow-command.php b/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-follow-command.php
deleted file mode 100644
index 722f0f9b..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-follow-command.php
+++ /dev/null
@@ -1,118 +0,0 @@
-
- * : Origin of the redirect.
- *
- * [--trace]
- * : Show a trace of all intermediary steps.
- *
- * [--limit=]
- * : Limit the number of jumps to follow the redirect chain. '0' means unlimited.
- * ---
- * default: 0
- * ---
- *
- * @param array $args Array of positional arguments.
- * @param array $assoc_args Associative array of associative arguments.
- *
- * @return void
- */
- public function __invoke( $args, $assoc_args ) {
- list( $origin ) = $args;
- $trace = (bool) Utils\get_flag_value( $assoc_args, 'trace', false );
- $limit = (int) Utils\get_flag_value( $assoc_args, 'limit', '0' );
-
- $redirect = $this->get_redirect( $origin );
-
- if ( $redirect === false ) {
- WP_CLI::error( "Redirect does not exist for '{$origin}'." );
- }
-
- $stack = $this->get_stack( $redirect, $limit );
-
- if ( ! $trace ) {
- $stack = (array) array_pop( $stack );
- }
-
- array_map( 'WP_CLI::line', $stack );
-
- if ( $this->detected_loop ) {
- WP_CLI::error( "Detected redirect loop for redirect: '{$origin}'." );
- }
- }
-
- /**
- * Gets the stack of redirect targets for a given starting redirect.
- *
- * @param WPSEO_Redirect $redirect Redirect to get the stack for.
- * @param int $limit Number of steps to limit the stack to.
- *
- * @return array Array of target URL steps.
- */
- private function get_stack( WPSEO_Redirect $redirect, $limit ) {
- $steps = 0;
-
- while ( ! $this->detected_loop && $redirect !== false ) {
- ++$steps;
- if ( $limit > 0 && $steps >= $limit ) {
- break;
- }
-
- $target = $redirect->get_target();
-
- $this->add_to_stack( $target );
-
- $redirect = $this->get_redirect( $target );
- }
-
- return array_keys( $this->stack );
- }
-
- /**
- * Adds a new target to the stack.
- *
- * @param string $target Target to add to the stack.
- *
- * @return void
- */
- private function add_to_stack( $target ) {
- if ( array_key_exists( $target, $this->stack ) ) {
- $this->detected_loop = true;
-
- return;
- }
-
- $this->stack[ $target ] = true;
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-has-command.php b/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-has-command.php
deleted file mode 100644
index 15a1131d..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-has-command.php
+++ /dev/null
@@ -1,31 +0,0 @@
-
- * : Origin of the redirect.
- *
- * @param array $args Array of positional arguments.
- * @param array $assoc_args Associative array of associative arguments.
- *
- * @return void
- */
- public function __invoke( $args, $assoc_args ) {
- list( $origin ) = $args;
-
- exit( $this->has_redirect( $origin ) ? 0 : 1 );
- }
-}
diff --git a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-list-command.php b/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-list-command.php
deleted file mode 100644
index 034bccae..00000000
--- a/wp/wp-content/plugins/wordpress-seo-premium/cli/cli-redirect-list-command.php
+++ /dev/null
@@ -1,185 +0,0 @@
-=]
- * : Filter the list to only show specific values for a given field.
- *
- * [--field=]
- * : Prints the value of a single field for each redirect.
- *
- * [--fields=]
- * : Limit the output to specific object fields.
- * ---
- * default: origin,target,type,format
- * ---
- *
- * [--output=